Reason: suggestions: make rec type explicit

Created on 6 Mar 2017  路  3Comments  路  Source: reasonml/reason

non recursive types are simple ones, simple is better, also consistent with let rec

so that

type t = int list 
type rec t = Nil | Cons of t * t list 

Most helpful comment

@tekknolagi OCaml has rec by default for types and you have to specify nonrec to make it non-recursive. It's kind of confusing because it's different convention than value let bindings which have nonrec by default and make you specify rec to achieve recursive bindings.
I would rather them be consistent, and I don't care which (either both types and values recursive by default or not as long as they match).

All 3 comments

Why add this is OCaml does not require it?

@tekknolagi OCaml has rec by default for types and you have to specify nonrec to make it non-recursive. It's kind of confusing because it's different convention than value let bindings which have nonrec by default and make you specify rec to achieve recursive bindings.
I would rather them be consistent, and I don't care which (either both types and values recursive by default or not as long as they match).

Merging into #394. Let's do it!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

TheSpyder picture TheSpyder  路  3Comments

gustavopinto picture gustavopinto  路  3Comments

bluddy picture bluddy  路  3Comments

kyldvs picture kyldvs  路  3Comments

braibant picture braibant  路  4Comments