id,summary,reporter,owner,description,type,status,priority,milestone,component,version,resolution,keywords,cc,os,architecture,failure,difficulty,testcase,blockedby,blocking,related
5267,Missing type checks for arrow command combinators,peteg,ross,"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))|))
}}}
",bug,new,low,7.6.2,Compiler (Type checker),7.0.3,,,ross@… peteg,Unknown/Multiple,Unknown/Multiple,GHC accepts invalid program,,,,,
