aboutsummaryrefslogtreecommitdiff
path: root/src/list/operation/higher/fold.h
diff options
context:
space:
mode:
authorAdrian Kummerlaender2015-02-17 18:55:08 +0100
committerAdrian Kummerlaender2015-02-17 18:55:08 +0100
commit8e4e3466694e5bef43f1308296a76086a7db453d (patch)
tree84049e2604341a0326e99d31cbed898fe5448d2d /src/list/operation/higher/fold.h
parentf81cd736e00c28cf24412a4099bae08ff2e6c493 (diff)
downloadTypeAsValue-8e4e3466694e5bef43f1308296a76086a7db453d.tar
TypeAsValue-8e4e3466694e5bef43f1308296a76086a7db453d.tar.gz
TypeAsValue-8e4e3466694e5bef43f1308296a76086a7db453d.tar.bz2
TypeAsValue-8e4e3466694e5bef43f1308296a76086a7db453d.tar.lz
TypeAsValue-8e4e3466694e5bef43f1308296a76086a7db453d.tar.xz
TypeAsValue-8e4e3466694e5bef43f1308296a76086a7db453d.tar.zst
TypeAsValue-8e4e3466694e5bef43f1308296a76086a7db453d.zip
Expressed `Take` and `Drop` in terms of new `Section` operation
* unifies the common functionality between `Take` and `Drop` * renamed `basic.h` to `length.h` as it only contains the `Length` implementation
Diffstat (limited to 'src/list/operation/higher/fold.h')
-rw-r--r--src/list/operation/higher/fold.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/list/operation/higher/fold.h b/src/list/operation/higher/fold.h
index 3f39b40..38c3554 100644
--- a/src/list/operation/higher/fold.h
+++ b/src/list/operation/higher/fold.h
@@ -8,12 +8,12 @@ namespace detail {
template <
template<typename, typename> class Function,
typename Initial,
- typename Current
+ typename Pair
>
struct fold_pair {
typedef Function<
- Head<Current>,
- Eval<fold_pair<Function, Initial, Tail<Current>>>
+ Car<Pair>,
+ Eval<fold_pair<Function, Initial, Cdr<Pair>>>
> type;
};
@@ -30,9 +30,9 @@ struct fold_pair<Function, Initial, void> {
template <
template<typename, typename> class Function,
typename Initial,
- typename Current
+ typename List
>
-using Fold = Eval<detail::fold_pair<Function, Initial, Current>>;
+using Fold = Eval<detail::fold_pair<Function, Initial, List>>;
}