Typed variadic arguments #42
Replies: 1 comment
-
Considering allowing syntax for non-curried arguments in order to facilitate this feature. Proposed syntax could be add: Int, Int -> Int For a variadic version one could do: add: Int, Int* -> Int Here we're using regex syntax that should be familiar to most to indicate 0 or more. A curried version could then be: add: (Int ->)* Int -> Int This means applying add: Int* -> Int -> Int Which would be much simpler to understand. fn: Int -> (Int ->)* Int This could be interpreted that no matter how many args you apply to |
Beta Was this translation helpful? Give feedback.
-
Add a variadic param type, inspired by Typescript's rest params
Possible syntax:
Edge cases:
Beta Was this translation helpful? Give feedback.
All reactions