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
* 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,
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
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
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
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