Implement curry<N>(f) where N is f's arity.

Signed-off-by: Scott Prager <splinterofchaos@gmail.com>
Implement make_curried_n<N,F>.

...where F is a function of arity N.

Change ftl::fmap to use this over curried_binf to test it.

Signed-off-by: Scott Prager <splinterofchaos@gmail.com>
Make make_curried_n public and document.

Signed-off-by: Scott Prager <splinterofchaos@gmail.com>
Add make_curried_n test to prelude_tests.cpp.

Simplify make_curried_n slightly.

Signed-off-by: Scott Prager <splinterofchaos@gmail.com>
Document curry<N>(f).

Signed-off-by: Scott Prager <splinterofchaos@gmail.com>
Remove monomorphic requirement on curry<N>(f).

It may be used by std::functions or function pointer (albeit unnecessary
given the other overloads of curry), so do not restrict it.

Signed-off-by: Scott Prager <splinterofchaos@gmail.com>
Reimplement make_curried_n in terms of curry.

Simplify make_curried_n<N,F> by calling curry<N>(f) and applying the
arguments to that rather than explicitly constructing a
curried_fn_n<N,F> with _dtl::part(f,x...).

Signed-off-by: Scott Prager <splinterofchaos@gmail.com>
Merge branch 'curry'.

Includes new curry(f) overload, curry<N>(f) for currying N-ary
functions, and the type make_curried_n<N,F> for making automatically
curried function objects.
curried_fn_n: Fix overload ambiguity with clang.

clang could not tell whether curried_fn_n should use the currying or
calling version of its operator(). Add a requirement for the number of
arguments to equal F's arity in order to enable calling.

Signed-off-by: Scott Prager <splinterofchaos@gmail.com>
Improve calling conventions for `curry<N>(f)`.

Overload `curried_fn_n<F,N>::operator()` and
`partial_application<F,Arg>::operator()` for `const &` and `&&`
versions to remove warning when building with clang, and for consistency
with the rest of the library.

Signed-off-by: Scott Prager <splinterofchaos@gmail.com>
Merge branch 'curry'. (Fix clang compilation.)
Use std::integral_constant in _dtl::curried_fn_n.

Gcc seems unable to process the constexpr version of
curried_fn_n::left_over, unlike clang, so use std::integral_constant
which works for both.

Signed-off-by: Scott Prager <splinterofchaos@gmail.com>
Merge branch 'curry' (fix gcc compilation).
Merge pull request #8 from splinterofchaos/master

General curried function base class.