[Haskell] question about a failure to generalize

Norman Ramsey nr at eecs.harvard.edu
Mon Sep 17 13:19:20 EDT 2007

 > If so, try working around the monomorphism restriction by changing  
 > from a pattern binding to a function binding.
 >      fold f = foldRegsUsed f

Brilliant.  I hadn't known about the monomorphism restriction.
Now I know it's a 'necessary evil'.  Thanks!


More information about the Haskell mailing list