infix MPTC?

Donald Bruce Stewart dons at cse.unsw.edu.au
Wed Dec 6 20:39:35 EST 2006


droundy:
> I was just thinking today.  Is there any reason we couldn't have infix
> multiparameter typeclasses? For typeclasses standing as witnesses of
> relationships it'd be much clearer, for example to have something like
> (a :<: b) rather than the always-vague (LT a b) which either reads the
> same as the infix version or backwards.
> 
> This isn't so much a proposal as a query regarding reasonableness.  I
> certainly wouldn't like to have precedence rules for type classes, but
> perhaps if you simply always required parentheses it'd be more readable
> than always requiring prefix notation, and yet still not too insane to
> parse?

I think they are valid now!

Here's an example:

    class a :=: b where

from:
    http://www.haskell.org/ghc/docs/latest/html/users_guide/type-extensions.html#infix-tycons

Perhaps underappreciated, along with:

    f :: (a :=: b) => a -> b

-- Don


More information about the Haskell-prime mailing list