[Haskell] arrows
Sebastian Boldt
Sebastian.Boldt at arcor.de
Wed Sep 15 09:38:43 EDT 2004
Hello,
I am a bit confused about command stacks. I tried to run the following
code in ghc:
mshowA :: (Arrow a, Show b) => a (b, String) String
mshowA = proc (x,s) -> returnA -< s ++ show x ++ s
f :: Arrow a => a Int String
f = proc x -> do a <- (mshowA -< x) "***"
returnA -< a
To my understanding (this doesn't mean anything :-) this is correct
because (mshowA -< x) "***" should be equivalent to (mshowA -< (x,"***")),
but somehow ghc is rejecting the code with the error message "Non-empty
command stack at command: mshowA -< x".
The arrow pre-processor from Ross Paterson compiles the code with no
problems to ordinary haskell and the resulting code runs as expected in ghc,
so, my question is, what's wrong? Me, ghc, arrowp...
Thanks in advance for every answer or hint you can give me
...Sebastian
More information about the Haskell
mailing list