aslilac / succulent

Powerful and easy runtime type checking
MIT License
32 stars 1 forks source link

Support shorthand Array syntax #3

Open aslilac opened 2 years ago

aslilac commented 2 years ago

i.e.

is([1,2,3,4,5], [$number])

[$number] here should be interpreted as $array($number)

Implementation attempts so far have shown that this is...tricky to get right. Also slightly concerned about confusion/conflict with single element tuples. Tuples with only one item are kind of pointless, and very uncommon, but I think we'd want to avoid ever adding a shorthand syntax for tuples in general, as [$number] meaning "Array of any length" along side something like [$number, $number] meaning "Array of exactly 2 length" would be confusing