Arrow command combinators and infixr cause the desugarer to fail
The following code exhibits the bug:
{-# LANGUAGE Arrows, NoMonomorphismRestriction #-}
module T where
import Prelude hiding ( id, (.) )
import Control.Arrow
cc1 :: Arrow a => a e b -> a e b -> a e b
cc1 = undefined
-- 'g' fails to compile.
-- g = proc (x, y, z) ->
-- ((returnA -< x) &&& (returnA -< y) &&& (returnA -< z))
-- 'f' compiles:
-- - without an infix declaration
-- - with the infixl declaration
-- and fails with the infixr declaration
infixr 6 `cc1`
-- infixl 6 `cc1`
f = proc (x, y, z) ->
((returnA -< x) `cc1` (returnA -< y) `cc1` (returnA -< z))
GHC says:
ghc: panic! (the 'impossible' happened)
(GHC version 7.0.3 for i386-apple-darwin):
dsSyntaxTable Not found: base:GHC.Desugar.>>>{v 01W}
Trac metadata
Trac field | Value |
---|---|
Version | 7.0.3 |
Type | Bug |
TypeOfFailure | OtherFailure |
Priority | normal |
Resolution | Unresolved |
Component | Compiler (Parser) |
Test case | |
Differential revisions | |
BlockedBy | |
Related | |
Blocking | |
CC | peteg42@gmail.com |
Operating system | |
Architecture |