aboutsummaryrefslogtreecommitdiff
path: root/src/list/list.h
AgeCommit message (Collapse)Author
2015-02-22Improved `simulate` function of the Turing machine exampleAdrian Kummerlaender
* introduced `state::state_accessor` helper function and moved position logic into `updatePosition` * added `IsEqual` comparator and expressed other basic comparators in terms of itself
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-16Renamed `detail::Sort` to `detail::quick_sort`Adrian Kummerlaender
* opens up the possibility of implementing different sort algorithms in this library * removed now unnecessary namespace prefixes
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-09Added `void` concatenation `List` template specializationAdrian Kummerlaender
* otherwise a type conflict occurs when trying to instantiate a list of `void` ** this hinders construction of higher level functionality on top of `List`
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-01-29Added `ListOfType` list constructor aliasAdrian Kummerlaender
* enables construction of `Cons` structures using the same value type across all their elements
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-22Implemented Scheme like `Concatenate` in terms of `Fold` and `Append`Adrian Kummerlaender
* added appropriate test case
2015-01-22Renamed `Concatenate` to `Append` to match Scheme function namingAdrian Kummerlaender
2015-01-17Extracted list operations into separate _operation_ headersAdrian Kummerlaender
2015-01-17Implemented `Length` functionAdrian Kummerlaender
* as its name implies this function returns the length of a given _Cons_ structure * result type is `Size<Length>` which wraps `std::size_t` to match the `sizeof` operator
2015-01-16Implemented recursive `Concatenate` _Cons_ constructorAdrian Kummerlaender
* concatenates two given _Cons_ based lists into a single one
2015-01-16Implemented basic `Cons` value type and `List` constructorAdrian Kummerlaender
* `Cons` is a straigth forward type _pair_ containing `car` and `cdr` typedefs ** they may be accessed using `Car` and `Cdr` helper template aliases ** there is no enforcement of _Cons_ structure and type equality whatsoever *** i.e. similar to Scheme and different from how it is implemented in _ConstList_ * `List` is a recursive variadic helper template for constructing `Cons` value types ** simplifies _Cons_ construction and may be expanded to offer type deduction and built upon to enforce type equality * added appropriate test cases