infix type operators

Remi Turk rturk at science.uva.nl
Wed Mar 9 17:59:40 EST 2005


[warning: Very Vague message & possible bug-report follow]

Though I cannot claim any real-world experience with arrows, I'm
not sure I like this, and I hope they'll at least remain
experimental (may be removed next release kind of thing) for a
while.

- I doubt whether the difference between "Arrow a => a b c" and
  "Arrow (~>) => b ~> c" is all that great. Or even, whether the
  perhaps slightly improved readability of "b ~> c" makes up for
  the IMO slightly decreased readability of "Arrow (~>)".
- When one really needs to do it infix, one can always write
  "Arrow a => b `a` c".
- It's one thing more to learn. The difference between types and
  typevariables (upper/lowercase) is better visible than the
  difference between operator(variables) and infix-types ("Does
  it start with a colon?") Which, I have to admit, is more of a
  vague feeling than anything like a fact.
- We already have the special case of -> as a _type_, not
  a typevariable, and having -> as a type, :-> as a type and ->:
  as a typevariable doesn't sound too great. Of course, as -> is
  special in expression context too, that may not be convincing
  either :(

So I guess I'll have to end this mail with "there is at least one
person not feeling entirely comfortable about it" :)

Would it at least be possible to make it a seperate flag from
-fglasgow-exts? (I'm slightly worried about people needing one
extension and then using the rest too just because they're
already enabled, so actually this doesn't apply only to this
particular feature.)

Groetjes,
Remi


On Wed, Mar 09, 2005 at 05:06:03PM -0000, Simon Peyton-Jones wrote:
> OK, it's done for 6.4
> 
> SImon
> 
> | -----Original Message-----
> | From: glasgow-haskell-users-bounces at haskell.org
> [mailto:glasgow-haskell-users-
> | bounces at haskell.org] On Behalf Of Ross Paterson
> | Sent: 08 March 2005 16:29
> | To: glasgow-haskell-users at haskell.org
> | Subject: infix type operators
> | 
> | The User's Guide says:
> | 
> | 	The only thing that differs between operators in types and
> | 	operators in expressions is that ordinary non-constructor
> | 	operators, such as + and * are not allowed in types.  Reason:
> | 	the uniform thing to do would be to make them type variables,
> | 	but that's not very useful.  A less uniform but more useful
> thing
> | 	would be to allow them to be type constructors.  But that gives
> | 	trouble in export lists.  So for now we just exclude them.
> | 
> | Conal has pointed out that the uniform thing would be useful for
> | general arrow combinators:
> | 
> | 	liftA2 :: Arrow (~>) =>
> | 		(a -> b -> c) -> (e ~> a) -> (e ~> b) -> (e ~> c)

-- 
Nobody can be exactly like me. Even I have trouble doing it.


More information about the Glasgow-haskell-users mailing list