
7 Nov
2004
7 Nov
'04
2:02 p.m.
The following code should compile (If the constructor is valid, so is the function): data Test = Test (forall a . a) test a = Test a However this fails to compile with the following error: Test.hs:9:9: Inferred type is less polymorphic than expected Quantified type variable `a' escapes It is mentioned in the environment: test :: a -> Test (bound at Test.hs:9:0) a :: a (bound at Test.hs:9:5) In the first argument of `Test', namely `a' In the definition of `test': test a = Test a I think this should only generate an error once the value of 'a' is known not to be undefined. Keean.