[Haskell-cafe] Strange Type Error

Brandon Allbery allbery.b at gmail.com
Thu May 26 12:12:40 CEST 2011

On Thu, May 26, 2011 at 06:01, jean-christophe mincke
<jeanchristophe.mincke at gmail.com> wrote:
> f1 x =  convertToInt x
> f2 = \x -> convertToInt x

Absent useful things like error messages, I'll assume that you tripped
over the monomorphism restriction.  That is, when you have a name that
doesn't take a direct parameter, there are additional constraints on
that name's type.  (The inner lambda is not considered for this
purpose, so while in theory f1 and f2 should be identical, in practice
they are not unless you use {-# LANGUAGE NoMonomorphismRestriction

More information about the Haskell-Cafe mailing list