|
|
@ -2,18 +2,14 @@ |
|
|
|
#include "combinations/tuple.hpp"
|
|
|
|
|
|
|
|
namespace cl{ |
|
|
|
struct sigil_t{ |
|
|
|
constexpr sigil_t(){} |
|
|
|
}; |
|
|
|
sigil_t sigil; |
|
|
|
|
|
|
|
template<typename a, typename ...c> |
|
|
|
class compose{ |
|
|
|
class compose_t{ |
|
|
|
// f . next
|
|
|
|
a f; |
|
|
|
compose<c...> next; |
|
|
|
compose_t<c...> next; |
|
|
|
public: |
|
|
|
compose(a fn1, c ...oth) |
|
|
|
compose_t(a fn1, c ...oth) |
|
|
|
: f{fn1} |
|
|
|
, next{oth...} |
|
|
|
{} |
|
|
@ -25,11 +21,11 @@ namespace cl{ |
|
|
|
}; |
|
|
|
|
|
|
|
template<typename a> |
|
|
|
class compose<a>{ |
|
|
|
class compose_t<a>{ |
|
|
|
// f . g
|
|
|
|
a f; |
|
|
|
public: |
|
|
|
compose(a fn1) |
|
|
|
compose_t(a fn1) |
|
|
|
: f{fn1} |
|
|
|
{} |
|
|
|
template<typename ...t> |
|
|
@ -39,6 +35,12 @@ namespace cl{ |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
template<typename a, typename ...c> |
|
|
|
auto compose(a fn1, c ...oth) |
|
|
|
{ |
|
|
|
return function(compose_t(fn1,oth...)); |
|
|
|
} |
|
|
|
|
|
|
|
template<typename a, typename b> |
|
|
|
auto operator*(a fn1, b fn2) |
|
|
|
{ |
|
|
|