
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? -- David Roundy Department of Physics Oregon State University

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... Perhaps underappreciated, along with: f :: (a :=: b) => a -> b -- Don

On Thu, Dec 07, 2006 at 12:39:35PM +1100, Donald Bruce Stewart wrote:
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. [...]
I think they are valid now!
Silly me! I didn't even think to try! Nice. And thanks! -- David Roundy Department of Physics Oregon State University
participants (2)
-
David Roundy
-
dons@cse.unsw.edu.au