#2205: infix type constructors seem to ignore associativity
-------------------------+--------------------------------------------------
Reporter: gckeller | Owner:
Type: bug | Status: new
Priority: normal | Component: Compiler (Parser)
Version: 6.9 | Severity: normal
Keywords: | Testcase:
Architecture: Unknown | Os: Unknown
-------------------------+--------------------------------------------------
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)
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/2205>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs