aboutsummaryrefslogtreecommitdiff
path: root/src/list/operation/higher
AgeCommit message (Collapse)Author
2015-02-10Moved `Sort` list index deletion into `DeleteNth` functionAdrian Kummerlaender
* as it is commonly required functionality and as such should be provided by this library
2015-02-09Updated `Sort` to make use of `Partition` for splitting at pivotAdrian Kummerlaender
* added further test cases for `Sort` as well as `Nth` aliae
2015-02-09Added `First`, `Second` and `Third` aliae for `Nth`Adrian Kummerlaender
* increases expressiveness in some contexts * renamed `Partition` list template parameter to avoid confusion
2015-02-08Implemented higher order `Sort` list operationAdrian Kummerlaender
* _Quicksort_ is the algorithm of choice ** it lends itself quite well to the _TypeAsValue_ approach because of its recursive nature ** this required implementation of a `Drop` counterpart to `Take` * the middle item of a given list is selected as the _pivot_ element * the `List` list contructor had to be expanded to allow `void` arguments inside its variadic parameter pack * added appropriate test cases
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-02-05Defer `If` template resolution analogously to other functionsAdrian Kummerlaender
* all other functions sans `Cons` are resolved when the respective member `*::type` is instantiated * this was changed soely to increase coherence
2015-02-01Added `DropWhile` analogously to `TakeWhile`Adrian Kummerlaender
2015-02-01Added `TakeWhile` higher order list operationAdrian Kummerlaender
* as its name implies this function returns the longest initial prefix of a list that satisfies a given _Predicate_ * added appropriate test case
2015-01-31Implemented higher order `Find` list search operationAdrian Kummerlaender
* added appropriate test case * other queries in `query.h` may be redefined in terms of `Find`
2015-01-30Implemented `Remove` and `Partition` higher order list functionsAdrian Kummerlaender
* `Remove` is a basic `Filter` alias that negates its predicate * `Partition` builds on both `Remove` and `Filter` to return both the elements satisfying a predicate and those which don't
2015-01-30Separated `Map` and `Filter`Adrian Kummerlaender
* there is no reason to keep them in the same header
2015-01-25Implemented `Count` in terms of `Fold` and `Map`Adrian Kummerlaender
* as its name implies this function counts the amount of elements satisfying a given _function_ * added appropriate test case
2015-01-21Implemented `Contains` in terms of `Any`Adrian Kummerlaender
* as its name implies this _function_ simplifies checking if a specific value is contained within a given list * updated `Map` to actually resolve the provided _function_
2015-01-21Moved `Reverse` into separate headerAdrian Kummerlaender
* it is not in itself a higher order function but only based on one
2015-01-20Added higher order list query `None`Adrian Kummerlaender
2015-01-20Implemented higher order list queries `All` and `Any`Adrian Kummerlaender
* in terms of `Fold` and `Map`, not the most efficient but reasonably concise * added appropriate test cases
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 `Reverse` function in terms of `Fold`Adrian Kummerlaender
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-18Implemented higher order function `fold`Adrian Kummerlaender
* applies a given _function_ to each _Cons_ starting with a initial value * added appropriate test case