Why effect inference fails?

Probably because you got signature wrong, your f takes a single argument, not two.

2 Likes