Skip to content

Arrows example error

In the section 7.15.2. Conditional commands of the User's Guide (http://www.haskell.org/ghc/docs/7.6.3/html/users_guide/arrow-notation.html#idp49515792) it is stated that:

proc (x,y) ->
        if f x y
        then g -< x+1
        else h -< y+2

is translated to:

arr (\ (x,y) -> if f x y then Left x else Right y) >>>
        (arr (\x -> x+1) >>> f) ||| (arr (\y -> y+2) >>> g)

But this translation doesn't seem correct, because the arrows g and h are not being used as in the original code (h doesn't appear at all in the translation).

Trac metadata
Trac field Value
Version 7.6.3
Type Bug
TypeOfFailure OtherFailure
Priority low
Resolution Unresolved
Component Documentation
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information