patch v0.3.0 Patch.Function View Source

Meck wants functions as mocks, this module assists in creating functions of any arity.

mix format wants this to be several thousand lines long, so it's getting put over here to keep the main Patch module small and easy to read.

TODO: Find a better way to do this.

Link to this section Summary

Functions

Generate an anonymous function of the arity provided that calls the provided factory function with the arguments as a list.

Link to this section Functions

Link to this function

for_arity(int, factory)

View Source
for_arity(arity :: arity(), factory :: ([term()] -> term())) :: (... -> term())

Generate an anonymous function of the arity provided that calls the provided factory function with the arguments as a list.

BEAM only supports functions of arity /0 though /254.