[Haskell-cafe] Inferred type not most general?

Malcolm Wallace Malcolm.Wallace at cs.york.ac.uk
Sat Jun 10 06:06:35 EDT 2006

Greg Buchholz <haskell at sleepingsquirrel.org> writes:

>     tmap :: (b -> a, b -> a) -> Twist b b -> Twist a a 
> ...I'm wondering why they couldn't infer the more general...
>     tmap :: (a -> b, c -> d) -> Twist a c -> Twist b d

Because the latter type involves polymorphic recursion.  Standard H-M
cannot infer a poly recursive type, but Haskell is willing to check it
if you give it a signature.


More information about the Haskell-Cafe mailing list