Re: [GHC] #7479: ArrowChoice unit law in haddock seems to be wrong
#7479: ArrowChoice unit law in haddock seems to be wrong +--- Reporter: pminten| Owner: Type: bug| Status: closed Priority: normal | Milestone: Component: libraries/base |Version: 7.7 Resolution: fixed | Keywords: Os: Unknown/Multiple | Architecture: Unknown/Multiple Failure: Documentation bug | Difficulty: Unknown Testcase: | Blockedby: Blocking: |Related: +--- Changes (by igloo): * status: merge = closed * difficulty: = Unknown * resolution: = fixed Comment: Merged as 56c8295c638a03676a9be8d34195e6be945ddc2c. -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7479#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler ___ Glasgow-haskell-bugs mailing list Glasgow-haskell-bugs@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
[GHC] #7479: ArrowChoice unit law in haddock seems to be wrong
#7479: ArrowChoice unit law in haddock seems to be wrong --+- Reporter: pminten| Owner: Type: bug| Status: new Priority: normal | Component: libraries/base Version: 7.7| Keywords: Os: Unknown/Multiple | Architecture: Unknown/Multiple Failure: Documentation bug | Blockedby: Blocking: |Related: --+- In the haddock documentation of !ArrowChoice there is an (unnamed) law: {{{left f arr Left = arr Left f}}}. In Ross Paterson's [http://www.soi.city.ac.uk/~ross/papers/fop.html Arrows and Computations] paper there is a similar law named the unit law for !ArrowChoice that goes {{{pure Left left f = f pure Left}}} (pure in that paper is arr in the base library). Reordering the unit law from the paper and replacing pure with arr the unit law from the paper is {{{f arr Left = arr Left left f}}} where the law from haddock is {{{left f arr Left = arr Left f}}}. The laws are similar but left is used in different places. The law from haddock appears to be invalid, there does not appear to be a way to create an arrow f in such a way that it works with both sides of the equation. This can be verified by typing the following lines in GHCi: {{{ import Control.Arrow let foo f = left f arr Left let bar f = arr Left f let same :: a b c - a b c - (); same _ _ = () \f - same (foo f) (bar f) }}} The last line gives a type error. -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7479 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler ___ Glasgow-haskell-bugs mailing list Glasgow-haskell-bugs@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
Re: [GHC] #7479: ArrowChoice unit law in haddock seems to be wrong
#7479: ArrowChoice unit law in haddock seems to be wrong --+- Reporter: pminten| Owner: Type: bug| Status: merge Priority: normal | Component: libraries/base Version: 7.7| Keywords: Os: Unknown/Multiple | Architecture: Unknown/Multiple Failure: Documentation bug | Blockedby: Blocking: |Related: --+- Changes (by ross): * status: new = merge Comment: Thanks for spotting this. Fixed with {{{ commit 96889ddccdcfc1fb852eeb3fdce7d4124f52376d Author: Ross Paterson r...@soi.city.ac.uk Date: Tue Dec 4 19:32:40 2012 + fix #7479: ArrowChoice unit law in doc comment }}} -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7479#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler ___ Glasgow-haskell-bugs mailing list Glasgow-haskell-bugs@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs