[Haskell-cafe] referential transparency? (for fixity of local operators)

2012-10-05 Thread Johannes Waldmann
I was really surprised at the following: *Main> 1 + 2 * 3 7 *Main> ( \ (+) (*) -> 1 + 2 * 3 ) (+) (*) 9 because I was somehow assuming that either a) the Prelude fixities of the operators are kept b) or they are undefined, so the parser rejects. but the Haskell standard says "Any operator lack

Re: [Haskell-cafe] referential transparency? (for fixity of local operators)

2012-10-05 Thread Roman Cheplyaka
* Johannes Waldmann [2012-10-05 11:11:48+] > I was really surprised at the following: > > *Main> 1 + 2 * 3 > 7 > > *Main> ( \ (+) (*) -> 1 + 2 * 3 ) (+) (*) > 9 > > because I was somehow assuming that either > > a) the Prelude fixities of the operators are kept > b) or they are undefined,

Re: [Haskell-cafe] referential transparency? (for fixity of local operators)

2012-10-05 Thread Clark Gaebel
Compile with -Wall and the flaw becomes obvious: :2:5: Warning: This binding for `+' shadows the existing binding imported from `Prelude' (and originally defined in `GHC.Num') :2:9: Warning: This binding for `*' shadows the existing binding imported from `Pre

Re: [Haskell-cafe] referential transparency? (for fixity of local operators)

2012-10-05 Thread wren ng thornton
On 10/5/12 7:11 AM, Johannes Waldmann wrote: I was really surprised at the following: *Main> 1 + 2 * 3 7 *Main> ( \ (+) (*) -> 1 + 2 * 3 ) (+) (*) 9 because I was somehow assuming that either a) the Prelude fixities of the operators are kept After dealing with how Coq handles infix operator

Re: [Haskell-cafe] referential transparency? (for fixity of local operators)

2012-10-06 Thread Johannes Waldmann
wren ng thornton freegeek.org> writes: > As for whether the default should be "infix 9" instead of "infixl 9" ... that was exactly the point of my message. - J. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/l

Re: [Haskell-cafe] referential transparency? (for fixity of local operators)

2012-10-06 Thread Albert Y. C. Lai
On 12-10-06 05:18 AM, Johannes Waldmann wrote: wren ng thornton freegeek.org> writes: As for whether the default should be "infix 9" instead of "infixl 9" ... that was exactly the point of my message. - J. Perhaps, half of the people want infixl, another half of the people want infixr, an