Skip to content

Variadic Functions in Shell DSL

Andy Gill edited this page Jun 11, 2015 · 2 revisions

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