puffnfresh / roy

Small functional language that compiles to JavaScript.
http://roy.brianmckenna.org/
MIT License
834 stars 74 forks source link

Data constructors can't take arrays or tuples #162

Open brow opened 11 years ago

brow commented 11 years ago

I noticed that the following type declarations don't parse:

data Tree a = Tree a [Tree a]
data Point = Point (Number, Number)

Is there a way, then, to define data constructors that take arrays or tuples? It seems like the former can be hacked in just by defining a syntactically sugar-free synonym for [a]. Then we can write:

data Tree a = Tree a (List (Tree a))

However, I can't find any such synonym in the docs or examples.