Reason: Change `foo . foo` to `forall foo . foo`

Created on 5 May 2017  路  9Comments  路  Source: reasonml/reason

FEATURE REQUEST Parser

All 9 comments

can we find a way to avoid introducing a new keyword

Avoiding new keywords would be nice. No idea how in this situation though

Isn't the dot . in this case already stating that to the left are the generic type names anyway? What is the point in adding forall too?

@OvermindDL1 : The purpose was merely to improve readability. Most people new to Reason/OCaml have no idea what the . means.

@jordwalke Isn't the same true for forall? In either case it's more likely than not a new concept.

I'd be in favor of this. I think the dot isn't clear at all, even having used this feature. Adding a "forall" helps me remember what the heck this language feature is.

how about just using for, or for .. in

for 'a in 'a -> 'a 

@bobzhang I like the idea of replacing . with in. But 'a -> 'a already means for a single 'a, so I still prefer having forall a in a -> a. Though it is a poweruser feature to have (forall types vs for a single type).

let a in a -> a ? The cost of introducing a keyword is quite high, think about List.forall

Was this page helpful?
0 / 5 - 0 ratings

Related issues

kyldvs picture kyldvs  路  3Comments

chenglou picture chenglou  路  3Comments

shaneosullivan picture shaneosullivan  路  3Comments

bobzhang picture bobzhang  路  3Comments

chenglou picture chenglou  路  3Comments