GHC issueshttps://gitlab.haskell.org/ghc/ghc/-/issues2019-07-07T18:56:08Zhttps://gitlab.haskell.org/ghc/ghc/-/issues/5267Missing type checks for arrow command combinators2019-07-07T18:56:08ZpetegMissing type checks for arrow command combinatorsIs 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...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))|))
```
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | -------------------- |
| Version | 7.0.3 |
| Type | Bug |
| TypeOfFailure | ValidProgramRejected |
| Priority | normal |
| Resolution | Unresolved |
| Component | Compiler |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"Arrow command combinators","status":"New","operating_system":"","component":"Compiler","related":[],"milestone":"","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"7.0.3","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"Is this expected to work?\r\n\r\n{{{\r\n{-# LANGUAGE Arrows #-}\r\nmodule T where\r\n\r\nimport Prelude\r\nimport Control.Arrow\r\n\r\nt = proc () ->\r\n do rec x <- arr id <<< (| (arr id) (returnA -< x) |)\r\n returnA -< x\r\n\r\nt' = proc x ->\r\n do x <- arr id <<< (| (arr id) (returnA -< x) |)\r\n returnA -< x\r\n\r\nt'' = proc x ->\r\n do x <- arr id <<< (| (arr id) (returnA -< 3) |)\r\n returnA -< x\r\n\r\nt''' = proc x -> arr id <<< (| (arr id) (returnA -< 3) |)\r\n}}}\r\n\r\nI get:\r\n\r\n{{{\r\n/tmp/T.hs:8:18:\r\n The type of the first argument of a command form has the wrong shape\r\n Argument type: t_tX\r\n In the command: (arr id) <<< ((|(arr id) ((returnA -< x))|))\r\n In a stmt of a 'do' expression:\r\n x <- (arr id) <<< ((|(arr id) ((returnA -< x))|))\r\n In a stmt of a 'do' expression:\r\n rec {x <- (arr id) <<< ((|(arr id) ((returnA -< x))|))}\r\n\r\n/tmp/T.hs:12:14:\r\n The type of the first argument of a command form has the wrong shape\r\n Argument type: t_tG\r\n In the command: (arr id) <<< ((|(arr id) ((returnA -< x))|))\r\n In a stmt of a 'do' expression:\r\n x <- (arr id) <<< ((|(arr id) ((returnA -< x))|))\r\n In the expression:\r\n proc x -> do { x <- (arr id) <<< ((|(arr id) ((returnA -< x))|));\r\n returnA -< x }\r\n\r\n/tmp/T.hs:16:14:\r\n The type of the first argument of a command form has the wrong shape\r\n Argument type: t_tq\r\n In the command: (arr id) <<< ((|(arr id) ((returnA -< 3))|))\r\n In a stmt of a 'do' expression:\r\n x <- (arr id) <<< ((|(arr id) ((returnA -< 3))|))\r\n In the expression:\r\n proc x -> do { x <- (arr id) <<< ((|(arr id) ((returnA -< 3))|));\r\n returnA -< x }\r\n\r\n/tmp/T.hs:19:18:\r\n The type of the first argument of a command form has the wrong shape\r\n Argument type: t_k\r\n In the command: (arr id) <<< ((|(arr id) ((returnA -< 3))|))\r\n In the expression:\r\n proc x -> (arr id) <<< ((|(arr id) ((returnA -< 3))|))\r\n In an equation for `t'''':\r\n t''' = proc x -> (arr id) <<< ((|(arr id) ((returnA -< 3))|))\r\n}}}\r\n","type_of_failure":"ValidProgramRejected","blocking":[]} -->8.0.1Ross Patersonr.paterson@city.ac.ukRoss Patersonr.paterson@city.ac.ukhttps://gitlab.haskell.org/ghc/ghc/-/issues/344arrow notation: incorrect scope of existential dictionaries2021-03-12T11:26:40Znobodyarrow notation: incorrect scope of existential dictionaries```
ghc-6.4: panic! (the `impossible' happened, GHC version
6.4):
cgPanic
deref{v a1yz}
static binds for:
local binds for:
SRT labelghc-6.4: panic! (the `impossible'
happened, GHC version 6.4):
initC: srt
...```
ghc-6.4: panic! (the `impossible' happened, GHC version
6.4):
cgPanic
deref{v a1yz}
static binds for:
local binds for:
SRT labelghc-6.4: panic! (the `impossible'
happened, GHC version 6.4):
initC: srt
Please report it as a compiler bug to
glasgow-haskell-bugs@haskell.org,
or http://sourceforge.net/projects/ghc/.
I've attached a test driver that can reproduce the problem.
-- Esa Pulkkinen <esa.pulkkinen@kotiposti.net>
```8.0.1Ross Patersonr.paterson@city.ac.ukRoss Patersonr.paterson@city.ac.uk