putting left equation sides in parantheses causes GHC.Prim.Any specialization
|Reported by:||jeltsch||Owned by:|
|Operating System:||Linux||Architecture:||x86_64 (amd64)|
|Type of failure:||None/Unknown||Test Case:||typecheck/should_compile/T5032|
|Related Tickets:||Differential Rev(s):|
I put this code into a file:
identity : a -> a (identity) = id
I get this error message:
Inferred type is less polymorphic than expected Quantified type variable `a' escapes In the expression: id In a pattern binding: (identity) = id
This may be correct, I don’t know.
However, I can also do this:
(identity) = id
GHCi accepts this. If I enter :type identity into GHCi, I get this:
identity :: GHC.Prim.Any -> GHC.Prim.Any
This seems weird, in my opinion.
This is also accepted by GHCi:
(identity) = id hello = identity "hello"
Evaluating hello yields "hello", and :type identity yields this:
identity :: [Char] -> [Char]
Change History (7)
comment:1 follow-up: ↓ 2 Changed 5 years ago by igloo
- Resolution set to wontfix
- Status changed from new to closed