dmgolubovsky / yhc

Automatically exported from code.google.com/p/yhc
0 stars 0 forks source link

Parameters in where bindings change results #148

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
This code doesn't work:

test :: Eq a => a -> Bool
test a = f a
 where
   (f) = \a -> (==) a a

-- during after type inference/checking
Error: Context for Prelude.Eq needed in left hand pattern at 8:5.

Removing the brackets makes it work. I suspect the problem is in the type
checker, but perhaps the parser should be removing the brackets from the
AST before this point.

Original issue reported on code.google.com by ndmitch...@gmail.com on 8 Aug 2007 at 11:26