aboutsummaryrefslogtreecommitdiff
path: root/src/list/operation/basic.h
AgeCommit message (Collapse)Author
2015-02-17Expressed `Take` and `Drop` in terms of new `Section` operationAdrian Kummerlaender
* unifies the common functionality between `Take` and `Drop` * renamed `basic.h` to `length.h` as it only contains the `Length` implementation
2015-02-16Simplified `List`, `Length` and `Reverse` implementationsAdrian Kummerlaender
* continuation of 8e49cc6 * list constructor was generalized to a _variadic fold_
2015-02-15Moved class-based implementations into `detail` namespaceAdrian Kummerlaender
* while class templates enable e.g. hiding implementation details they also require evaluation via `Eval` ** this clutters up the actual logic and is now hidden behind aliae that perform the evaluation
2015-02-14Introduced `Eval` function evaluation helperAdrian Kummerlaender
* replaces `typename *::type` constructs with `Eval` applications * aims to further unify function evaluation
2015-02-12Revamped partial function applicationAdrian Kummerlaender
* moved internals into separate header i.e. the `detail` namespace relating to `Apply` * implemented automatic alias selection by implementing aliae of the basic variadic `type` template alias in different base classes ** variadic partial application is implemented in `detail::apply_variadic` *** `detail::apply_single` and `detail::apply_pair` define aliae to `detail::apply_variadic`'s `type` template alias *** both restricted aliae derive from `detail::apply_variadic` ** `Apply` derives from any of the aliae defining base classes depending on the count of placeholders as determined by `detail::count_placeholders` *** `Apply` is guaranteed to always be derived from `detail::apply_variadic` one way or the other * changed functions, test cases and examples depending on `Apply` accordingly ** `Length` had to be reimplemented without `Apply` as it doesn't allow usage of aliae expecting a different count of arguments anymore *** this is a advantage in the sense that core functionality of _TypeAsValue_ now doesn't depend on this complex partial application implementation anymore *** such functionality may be reimplemented separately from `Apply` * removed unnecessary `tav` namespace prefixes
2015-02-06Revamped to use `Cons` as a function and `Pair` as its resultAdrian Kummerlaender
* this is analogous to _Scheme_ where a pair (dot-expression) is returned from a call to `cons` * `Head` and `Tail` are kept as direct references to the `CAR` and `CDR` values of a pair to match e.g. the math operators
2015-01-26Redefined `Length` in terms of `Apply` and `Fold`Adrian Kummerlaender
* this function illustrates the use case `Apply` is currently intended for * moved `Take` and `Nth` into separate files to resolve header resolution conflicts
2015-01-19Implemented `Filter` in terms of `Fold`Adrian Kummerlaender
* as its name implies this _function_ only returns elements which evaluate to _true_ when passed to a given _function_ ** this marks the moment where _TypeAsValue_ supports something _ConstList_ does not, i.e. primary goal is achieved *** namely returning different types depending on the actual _values_ of a _Cons_ structure * added appropriate test case
2015-01-18Implemented `Map` in terms of `Fold`Adrian Kummerlaender
* as its name implies this _function_ applies a given _function_ to each element of a _Cons_ structure * added appropriate test case
2015-01-18Reimplemented `Length` function in terms of `Fold`Adrian Kummerlaender
* this removes the need for maintaining a partial overload of `Length` * the recursive traversion of the _Cons_ structure is now implemented by `Fold` instead of needlessly duplicating it
2015-01-17Replaced `If` based `Nth` implementation with partial specializationsAdrian Kummerlaender
* partial specializations offer control over lazy type instantiation ** `If` is currently only a `std::conditional` wrapper and requires further refinement to be really useful for this kind of use case
2015-01-17Implemented `Take` functionAdrian Kummerlaender
* as its name implies this function _takes_ a maximum of _Count_ elements of a list * added appropriate test case
2015-01-17Implemented `Nth` functionAdrian Kummerlaender
* as its name implies this function returns the _nth_ value of a given _Cons_ structure * added appropriate test case
2015-01-17Extracted list operations into separate _operation_ headersAdrian Kummerlaender