[GHC] #5267: Arrow command combinators

GHC cvs-ghc at haskell.org
Wed Jun 22 10:44:03 CEST 2011


#5267: Arrow command combinators
---------------------------------+------------------------------------------
    Reporter:  peteg             |       Owner:                           
        Type:  bug               |      Status:  new                      
    Priority:  normal            |   Component:  Compiler                 
     Version:  7.0.3             |    Keywords:                           
    Testcase:                    |   Blockedby:                           
          Os:  Unknown/Multiple  |    Blocking:                           
Architecture:  Unknown/Multiple  |     Failure:  GHC rejects valid program
---------------------------------+------------------------------------------
 Is this expected to work?

 {{{
 {-# LANGUAGE Arrows #-}
 module T where

 import Prelude
 import Control.Arrow

 t = proc () ->
      do rec x <- arr id <<< (| (arr id) (returnA -< x) |)
         returnA -< x

 t' = proc x ->
      do x <- arr id <<< (| (arr id) (returnA -< x) |)
         returnA -< x

 t'' = proc x ->
      do x <- arr id <<< (| (arr id) (returnA -< 3) |)
         returnA -< x

 t''' = proc x -> arr id <<< (| (arr id) (returnA -< 3) |)
 }}}

 I get:

 {{{
 /tmp/T.hs:8:18:
     The type of the first argument of a command form has the wrong shape
       Argument type: t_tX
     In the command: (arr id) <<< ((|(arr id) ((returnA -< x))|))
     In a stmt of a 'do' expression:
         x <- (arr id) <<< ((|(arr id) ((returnA -< x))|))
     In a stmt of a 'do' expression:
         rec {x <- (arr id) <<< ((|(arr id) ((returnA -< x))|))}

 /tmp/T.hs:12:14:
     The type of the first argument of a command form has the wrong shape
       Argument type: t_tG
     In the command: (arr id) <<< ((|(arr id) ((returnA -< x))|))
     In a stmt of a 'do' expression:
         x <- (arr id) <<< ((|(arr id) ((returnA -< x))|))
     In the expression:
       proc x -> do { x <- (arr id) <<< ((|(arr id) ((returnA -< x))|));
                      returnA -< x }

 /tmp/T.hs:16:14:
     The type of the first argument of a command form has the wrong shape
       Argument type: t_tq
     In the command: (arr id) <<< ((|(arr id) ((returnA -< 3))|))
     In a stmt of a 'do' expression:
         x <- (arr id) <<< ((|(arr id) ((returnA -< 3))|))
     In the expression:
       proc x -> do { x <- (arr id) <<< ((|(arr id) ((returnA -< 3))|));
                      returnA -< x }

 /tmp/T.hs:19:18:
     The type of the first argument of a command form has the wrong shape
       Argument type: t_k
     In the command: (arr id) <<< ((|(arr id) ((returnA -< 3))|))
     In the expression:
       proc x -> (arr id) <<< ((|(arr id) ((returnA -< 3))|))
     In an equation for `t'''':
         t''' = proc x -> (arr id) <<< ((|(arr id) ((returnA -< 3))|))
 }}}

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/5267>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler



More information about the Glasgow-haskell-bugs mailing list