Variadic Functions in Shell DSL - ku-fpg/hermit-shell GitHub Wiki
Should we have variadic function in the Shell DSL? Or, equivalently, do we support default arguments?
Part of the decision here is do we want to have monomorphic primitives, and overloaded combinators, or overloaded primitives, and monomorphic combinators.
Variadic
Non-Variadic
Have a convention; for example:
extend :: Name -> Rewrite ...
extend' :: Rewrite ...
Here, '
means use default/sensible arguments.
Pros:
- Better DSL error messages.
- Works with OverloadingStrings
Cons:
- Need two functions for one functionality