
20 Jan
2012
20 Jan
'12
12:10 a.m.
On Thu, Jan 19, 2012 at 10:55 PM, Kazu Yamamoto
Hello,
I met strange behavior of let in ghci 7.0.4. The following works well.
You're running into the monomorphism restriction: http://www.haskell.org/haskellwiki/Monomorphism_restriction
let chooseMax = maximumBy compFst
If you re-define this to be:
let chooseMax x = maximumBy compFst x
you'll get around it in the easiest way. You can also turn off the restriction at the command-line with the argument '-XNoMonomorphismRestriction', I think. Antoine