paldepind / union-type

A small JavaScript library for defining and using union types.
MIT License
477 stars 28 forks source link

Record constructor verbosity #38

Closed jgoux closed 8 years ago

jgoux commented 8 years ago

Hello :smile_cat:

is there a reason why the constructors for a Record type are named <name>Of ?

I find it quite verbose, would it be possible to use simply of ? Like Person.of({ name: "Hagrid" })

It would be closer to fantasyland notation too.

Thanks for this awesome lib ! :sparkles:

jgoux commented 8 years ago

After some thoughts, using simply of is impossible because Type creates tagged type by default!

Sorry. :sweat_smile: