[GHC] #8505: Arrows example error

GHC ghc-devs at haskell.org
Tue Nov 5 21:34:05 UTC 2013


#8505: Arrows example error
------------------------------------+--------------------------------------
       Reporter:  pdfrod            |             Owner:
           Type:  bug               |            Status:  new
       Priority:  low               |         Milestone:
      Component:  Documentation     |           Version:  7.6.3
       Keywords:                    |  Operating System:  Unknown/Multiple
   Architecture:  Unknown/Multiple  |   Type of failure:  Documentation bug
     Difficulty:  Unknown           |         Test Case:
     Blocked By:                    |          Blocking:
Related Tickets:                    |
------------------------------------+--------------------------------------
 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).

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


More information about the ghc-tickets mailing list