Module RParsec::FunctorMixin
In: rparsec/functors.rb

This module provides instance methods that manipulate closures in a functional style. It is typically included in Proc and Method.

Methods

*   **   <<   >>   compose   curry   flip   power   repeat   reverse_curry   reverse_uncurry   uncurry  

Public Instance methods

*(n)

Alias for repeat

**(n)

Alias for power

<<(other)

Alias for compose

a >> b is equivalent to b << a

Create a Proc, when called, the parameter is first passed into other, self is called in turn with the return value from other.

Create a Proc that‘s curriable. When curried, parameters are passed in from left to right. i.e. closure.curry.call(a).call(b) is quivalent to closure.call(a,b) . self is encapsulated under the hood to perform the actual job when currying is done. ary explicitly specifies the number of parameters to curry.

Create a Proc, which expects the two parameters in the reverse order of self.

Create a Proc, when called, repeatedly call self for n times. At each iteration, return value from the previous iteration is used as parameter.

Create a Proc, when called, repeatedly call self for n times. The same arguments are passed to each invocation.

Create a Proc that‘s curriable. When curried, parameters are passed in from right to left. i.e. closure.reverse_curry.call(a).call(b) is quivalent to closure.call(b,a) . self is encapsulated under the hood to perform the actual job when currying is done. ary explicitly specifies the number of parameters to curry.

Uncurry a reverse curried closure.

Uncurry a curried closure.

[Validate]