[Haskell-beginners] Question about precedence
Darren Grant
dedgrant at gmail.com
Mon Jul 1 18:34:01 CEST 2013
I think that since infix notation always takes two parameters, the compiler
handles parameter swapping to match the unfilled argument for convenience.
Not sure where this would be described in a spec though.
Cheers,
Darren
On Mon, Jul 1, 2013 at 9:14 AM, Marc Gorenstein
<marc.gorenstein at gmail.com>wrote:
> What sort of beast is ( / 8) in Haskell? It looks like it is a function
> that divides a number by 8.
>
> *Main> ( / 8 ) 4
> 0.5
>
> *Main> let a = ( / 8 )
> *Main> a 4
> 0.5
>
> -- Yup that works.
>
> Does ( / 8 ) turn into a function that takes an argument, so that the
> "left" input to the /, becomes a right input to the function?
> What precedence rule is being followed here?
>
> Thanks,
>
> Marc
>
>
>
> _______________________________________________
> Beginners mailing list
> Beginners at haskell.org
> http://www.haskell.org/mailman/listinfo/beginners
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/beginners/attachments/20130701/f38e66e7/attachment.htm>
More information about the Beginners
mailing list