[Haskell-beginners] User defined operators : setting precedence

Hugo Ferreira hmf at inescporto.pt
Mon Nov 21 17:21:53 CET 2011


Antoine,

On 11/21/2011 03:47 PM, Antoine Latter wrote:
> 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
>

Exactly what I was looking for.

Thank you,
Hugo F.


> 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