infix type constructors seem to ignore associativity
In the following program, fst3 and fst3' should be equivalent, but fst3' but fst3' leads to type error:
module Main where
infixr 0 :->
data a :-> b = P a b
fst3:: (a :-> (b :-> c)) -> a
fst3 (P a (P b c)) = a
fst3':: (a :-> b :-> c) -> a
fst3' (P a (P b c)) = a
main = putStrLn $ show $ fst3 (P True (P False True))
the type error is:
TypeConstr.hs:11:0:
Occurs check: cannot construct the infinite type: a = a :-> b
When generalising the type(s) for `fst3''
pulled last changes on 7/4/2008 (used to work correctly before)
Trac metadata
Trac field | Value |
---|---|
Version | 6.9 |
Type | Bug |
TypeOfFailure | OtherFailure |
Priority | normal |
Resolution | Unresolved |
Component | Compiler (Parser) |
Test case | |
Differential revisions | |
BlockedBy | |
Related | |
Blocking | |
CC | |
Operating system | Unknown |
Architecture | Unknown |