new keyword: infixlr?

Bas van Dijk v.dijk.bas at gmail.com
Tue Sep 14 07:27:47 EDT 2010


On Mon, Sep 13, 2010 at 4:23 PM, Nick Bowler <nbowler at elliptictech.com> wrote:
> ... not all Num instances have an associative (+).

Indeed:

$ cabal install repr    # [1]
...
$ ghci
Prelude> :m Text.Repr
Prelude Text.Repr> show (1 + 2 :: Repr Int) == show (2 + 1 :: Repr Int)
False

because:
show (1 + 2 :: Repr Int) == "1 + 2"
show (2 + 1 :: Repr Int) == "2 + 1"

but note:
Prelude Text.Repr> (1 + 2 :: Repr Int) == (2 + 1 :: Repr Int)
True

Bas

[1] http://hackage.haskell.org/package/repr


More information about the Haskell-prime mailing list