Operator precedence help

David Feuer david.feuer at gmail.com
Sat Aug 15 21:52:32 UTC 2020


Data.Sequence uses the same precedence for both, which strikes me as a bit sad.
Surprisingly, I am not seeing other packages on Hackage that define similar
operators.

On Thu, Aug 13, 2020 at 2:50 PM Andreas Abel <andreas.abel at ifi.lmu.de> wrote:
>
> My hunch would be too look at what the others do to form an opinion.
>
> On 2020-08-13 19:26, David Feuer wrote:
> > I'm trying to work out appropriate precedences for operators and pattern
> > synonyms in my brand-new compact-sequences package. I currently have
> > stacks and queues, but I will soon have deques, so let's pretend. For
> > consistency, operators will match pattern synonyms.
> >
> > (<|), pattern (:<) :: a -> Deque a -> Deque a
> > (|>), pattern (:>) :: Deque a -> a -> Deque a
> >
> > :< and :> need to have different precedence to allow things like
> >
> >    a :< b :< xs :> c :> d
> >
> > to work nicely, but what numbers should I pick?
> >
> > I also have cons and snoc functions. Should I give their backticked
> > spellings fixity declarations? If so, with what precedences?
> >
> > _______________________________________________
> > Libraries mailing list
> > Libraries at haskell.org
> > http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
> >
> _______________________________________________
> Libraries mailing list
> Libraries at haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries


More information about the Libraries mailing list