From 8e4e3466694e5bef43f1308296a76086a7db453d Mon Sep 17 00:00:00 2001 From: Adrian Kummerlaender Date: Tue, 17 Feb 2015 18:55:08 +0100 Subject: 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 --- src/list/operation/length.h | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 src/list/operation/length.h (limited to 'src/list/operation/length.h') diff --git a/src/list/operation/length.h b/src/list/operation/length.h new file mode 100644 index 0000000..1f609d4 --- /dev/null +++ b/src/list/operation/length.h @@ -0,0 +1,21 @@ +#ifndef TYPEASVALUE_SRC_LIST_OPERATION_LENGTH_H_ +#define TYPEASVALUE_SRC_LIST_OPERATION_LENGTH_H_ + +#include "higher/fold.h" +#include "operation/math.h" + +namespace tav { + +namespace detail { + +template +using length_accumulate = Add, Accumulated>; + +} + +template +using Length = Fold, List>; + +} + +#endif // TYPEASVALUE_SRC_LIST_OPERATION_LENGTH_H_ -- cgit v1.2.3