[Haskell-beginners] User defined operators : setting precedence

Antoine Latter aslatter at gmail.com
Mon Nov 21 16:47:45 CET 2011


On Mon, Nov 21, 2011 at 9:34 AM, Hugo Ferreira <hmf at inescporto.pt> wrote:
> Hello,
>
> Can anyone point me to some documentation that describes
> how one may set precedence in a user defined operators?
> I have composition operators so that I can write:
>
>  let ruleSuffixCapsFreq = ruleT |> suffixT .> capitalizeT .> freqT
>
> but I seem to be forced to write:
>
>  let ruleSuffixCapsFreq = ruleT |> (suffixT .> capitalizeT .> freqT)
>
> and I would like to avoid this.
>

Hello,

Here's a brief introduction to Haskell fixity declarations:

http://www.haskell.org/tutorial/functions.html#sect3.2.2

Here's the relevant part of the language definition, which includes a
precedence table for  the operators that ship with the language:

http://www.haskell.org/onlinereport/haskell2010/haskellch4.html#x10-820004.4.2

Antoine

> TIA,
> Hugo F.
>
>
> _______________________________________________
> Beginners mailing list
> Beginners at haskell.org
> http://www.haskell.org/mailman/listinfo/beginners
>



More information about the Beginners mailing list