Commit Graph

1208 Commits

Author SHA1 Message Date
Louis Dionne
9a412f9c39 [MPL] Add a conversion from Foldables to MPL vectors
Also, properly split the unit tests for mpl::vector
2015-04-26 14:20:15 -04:00
Louis Dionne
6f9441fa7a [Tutorial] Fix formatting of header in the FAQ and a precision about charts 2015-04-26 14:19:43 -04:00
Louis Dionne
b452dc4de3 Remove most usages of detail::std::forward 2015-04-26 09:22:04 -04:00
Louis Dionne
ef7dcf6800 [Tuple] Fix bug in the new optimized find_if 2015-04-25 17:57:09 -04:00
Louis Dionne
ca37fdfa4c [Doc] Add a section on performance in the tutorial
Also:
- Introduce the .js charts we have in the reference
- Remove the ugly "Generated by Doxygen" footer
- Refactor the benchmarks
2015-04-25 16:31:56 -04:00
Louis Dionne
1ee3b93a08 [Tuple] Implement a more efficient drop_while and find_if 2015-04-25 16:31:50 -04:00
Louis Dionne
5419065dfa [Sequence] Minor refactoring; NFC 2015-04-22 17:52:12 -04:00
Louis Dionne
c102989fc4 [Product] Reformulate the laws, and ask for move-independance of first and second 2015-04-22 17:38:06 -04:00
Louis Dionne
589425a6dd [Core] Make has_operator an IntegralConstant
Fixes #51
2015-04-22 07:35:11 -04:00
Louis Dionne
8e427f2c83 [Searchable] Provide an operator[] equivalent to find 2015-04-21 21:56:47 -04:00
Louis Dionne
a3ce836049 [Searchable] Document structure-preserving functions and allow cross-type dispatching in subset 2015-04-21 20:23:24 -04:00
Louis Dionne
f87919b94b [Record] Rename to Struct and refactor
- Define the notion of move-independence, thus relaxing the requirements on accessors.
- Rename `members` to `accessors` and use `members` to get the members only
- Document the different ways of providing a model
- Make the model of Foldable more consistent

Fixes #53
2015-04-21 16:32:33 -04:00
Louis Dionne
fb518d859a [Monad] Renaming and refactoring.
- Rename bind to chain
- Rename mcompose to monadic_compose
- Rewrite a large part of the documentation
- Document the limit on the arity of functions used with monadic_compose

Fixes 48
Fixes 9
2015-04-19 13:13:23 -04:00
Louis Dionne
056b072648 [Sequence] Add an example of using the Monad model for non-determinism 2015-04-15 10:06:27 -04:00
lolisa
21952b9f54 comment out unused variable.
[ldionne: rebase and remove the -Wno-unused-parameter flag from CMake]

Closes #43
2015-04-14 16:23:51 -04:00
Louis Dionne
0612624939 [Detail] Add basic unit tests for the constexpr algorithms. 2015-04-14 13:32:45 -04:00
Louis Dionne
686656a3f2 [Iterable] Add the drop.at_most and drop.exactly variants to drop 2015-04-12 11:29:02 -04:00
Louis Dionne
1171b83fe3 [Sequence] Add the subsequence method
Fixes #37
2015-04-12 10:47:12 -04:00
Louis Dionne
6abd0f9d8e [Set] Improve the documentation and fix inconsistency in the behavior of to<Set> 2015-04-11 12:49:45 -04:00
Louis Dionne
9edc0c854f [Foldable] Move the Foldable -> Sequence conversion to foldable.hpp 2015-04-11 12:09:01 -04:00
Louis Dionne
daaba5dfd8 [Map] Provide model of Foldable, improve docs and add insert method.
Fixes #41
2015-04-11 12:09:01 -04:00
Louis Dionne
8bd84a5d4b [Metafunction] Generalize trait to arbitrary Metafunctions and improve docs 2015-04-11 09:29:06 -04:00
Louis Dionne
e77b55b1b4 [Iterable] Precise the laws 2015-04-10 18:00:49 -04:00
Louis Dionne
08e55a7bb6 Rework the relations between Foldable, Iterable and Searchable. 2015-04-10 17:46:14 -04:00
Louis Dionne
c434f134ba [Applicative] Implement automatic law checking 2015-04-10 13:17:51 -04:00
Louis Dionne
06ed355b0d [Traversable] Document the laws 2015-04-10 12:21:52 -04:00
Louis Dionne
b21fdc32de [Detail] Remove obsolete detail::wrap utility 2015-04-10 09:38:32 -04:00
Louis Dionne
e8412cfc6a [Detail] Regroup the STL concepts into detail/concepts.hpp 2015-04-10 09:34:17 -04:00
Louis Dionne
a12315c1a6 [Detail] Add constexpr algorithms and use them in the implementation 2015-04-10 08:33:18 -04:00
Louis Dionne
17169d99d3 [Constant] Document conversions, embeddings and related material. Fix TODOS 2015-04-09 11:18:03 -04:00
Louis Dionne
8026bd1e48 [Sequence] Require the natural isomorphism to be bijective in the laws 2015-04-09 09:38:10 -04:00
Louis Dionne
55e4a1d083 [Sequence] Try to formulate laws that make sense and improve the documentation 2015-04-09 09:27:09 -04:00
Louis Dionne
818148de6e [Core] Document undefined behavior with operators 2015-04-08 18:28:15 -04:00
Louis Dionne
b436ff0ee6 [Sequence] Settle on the semantics of the slice function
Fixes #36
2015-04-08 17:56:28 -04:00
Louis Dionne
bccfabdef7 Add interface-level assertions in bi-dispatched methods too. 2015-04-08 17:29:57 -04:00
Louis Dionne
d85b0f7b5b [String] Fix placement of BOOST_HANA_STRING in the documentation 2015-04-08 12:54:20 -04:00
Louis Dionne
f1cfe4ad78 [IntegralConstant] Optimize if_ and eval_if 2015-04-08 12:28:07 -04:00
Louis Dionne
3053736ddd [Tuple] Optimize the equal method 2015-04-08 11:30:00 -04:00
Louis Dionne
22b82faacc [Detail] Optimize the left and right variadic folds 2015-04-08 11:20:00 -04:00
Louis Dionne
bdfeb46d88 Remove outdated TODOS 2015-04-07 21:41:54 -04:00
Louis Dionne
546d0dea7b [Tutorial] Remove redundant explanation of BOOST_HANA_CONSTANT_CHECK 2015-04-07 20:20:17 -04:00
Louis Dionne
80e0adf4e8 [Core] Move wrong to the detail namespace 2015-04-07 19:37:28 -04:00
Louis Dionne
5c1a752a9f [Pair] Remove the pair constructor in favor of make_pair 2015-04-07 19:26:59 -04:00
Louis Dionne
dbdd7e61e9 [Functor] Document natural transformations 2015-04-07 19:09:38 -04:00
Louis Dionne
bcefabf759 [Functional] Rewrite the documentation for demux 2015-04-07 18:42:43 -04:00
Louis Dionne
0246c59c6c [Sandbox] Remove the hana/sandbox folder and put everything in test/sandbox 2015-04-07 16:52:20 -04:00
Louis Dionne
40216cde23 [MonadPlus] Add the remove and remove_if functions to MonadPlus 2015-04-07 16:27:39 -04:00
Louis Dionne
0a46420c02 [Type] Major refactoring and improvements
- Make decltype_ the identity on Types
- Add the alignof_ function
- Allow sizeof_ to work with non-Types
- Remove the trait_ helper
- Allow Metafunctions to be called with non-Types
- Add make<Type>, which is equivalent to decltype_
2015-04-07 12:12:52 -04:00
Louis Dionne
84bc1a6a06 [Functional] Group the examples into a single file 2015-04-06 14:58:04 -04:00
Louis Dionne
3c2aa421b5 [Tuple] Provide efficient folds for tuple_t
Fixes #32
2015-04-06 14:28:09 -04:00
Louis Dionne
125fd45bfd [Functional] Add the overload_linearly utility 2015-04-06 14:11:42 -04:00
Louis Dionne
13392c7ed2 [Foldable] Use overloads for {maximum,minimum}_by 2015-04-01 19:28:42 -04:00
Louis Dionne
eb4f07a61c [Sequence] Use overloads for sort/sort_by and group/group_by 2015-04-01 19:28:42 -04:00
Louis Dionne
aaaab0e11d [Foldable] Allow specifying the Monoid/Ring for sum/product
Fixes #33
2015-04-01 16:19:37 -04:00
Louis Dionne
ccb2e05343 [Tuple] Move some issues to GitHub 2015-04-01 10:56:15 -04:00
Louis Dionne
38e02e9f53 [Sequence] Rename scan{l,r,l1,r1} similarly to folds 2015-03-31 17:55:27 -04:00
Louis Dionne
fe36fcd778 [Foldable] Workaround Clang 3.5/3.6 ICE in the monadic folds 2015-03-30 21:17:17 -04:00
Louis Dionne
a215f0a1b1 [Monad] Add tests for the bind method for Sequences 2015-03-30 18:30:59 -04:00
Louis Dionne
59d7e36726 [Sequence] Rename unfolds and flip their parameters 2015-03-30 18:17:42 -04:00
Louis Dionne
2c86ba2390 [Foldable] Rename the different fold variants
- Rename fold{l,r,l1,r1} to fold.{right,left} with overloads.
- Rename foldlM/foldrM to monadic_fold.{left,right}
- Add no-state variants of the monadic folds
- Improve the fold's documentation
- Deprecate the previous folds; they'll be removed soon

Fixes #18.
2015-03-30 17:29:37 -04:00
Louis Dionne
540f665e51 Use static_cast<T&&> instead of forward<T> to reduce compile-times
It might seem overkill to do this, but I measured:
static_cast:
    make compile.test.tuple  92.58s user 4.85s system 99% cpu 1:37.93 total
    make compile.test.tuple  91.89s user 4.78s system 99% cpu 1:37.07 total
    make compile.test.tuple  92.51s user 4.77s system 99% cpu 1:37.73 total
    make compile.test.tuple  95.91s user 5.16s system 99% cpu 1:41.60 total
    avg: 98.1125s

forward:
    make compile.test.tuple  108.16s user 5.50s system 99% cpu 1:54.36 total
    make compile.test.tuple  110.00s user 5.55s system 99% cpu 1:56.17 total
    make compile.test.tuple  108.41s user 5.47s system 99% cpu 1:54.46 total
    make compile.test.tuple  107.31s user 5.54s system 99% cpu 1:53.46 total
    avg: 113.985s

This shows an improvement of the average by 15.8725s, which
represents about 13.9%.
2015-03-29 11:14:24 -04:00
Louis Dionne
a98d32cae1 [Maybe] *just(x) is now equivalent to from_just 2015-03-29 10:39:04 -04:00
Louis Dionne
b62460d22f [std::tuple] Workaround libc++ bug 22806 2015-03-29 10:07:13 -04:00
Louis Dionne
1f9fcb7aca [boost::tuple] Fix dangling reference bug 2015-03-29 01:31:31 -04:00
Louis Dionne
7402a010ec [Tests] Track test::integer and use hana::capture instead of lambda capture to workaround Clang bug 2015-03-29 01:31:31 -04:00
Louis Dionne
637c5270ab [Functional] Add hana::capture 2015-03-28 22:22:13 -04:00
Louis Dionne
961fd14632 [Assert] Workaround Clang bug caused by closure in BOOST_HANA_CHECK 2015-03-28 22:22:12 -04:00
Louis Dionne
4390aa98df [Maybe] Fix bug in sfinae with non-pod arguments 2015-03-28 20:44:22 -04:00
Louis Dionne
d49db6d698 Fix dangling reference bugs in several adapters 2015-03-26 09:38:29 -04:00
Louis Dionne
beb72c224f Remove some more usage of lambdas 2015-03-26 02:08:44 -04:00
Louis Dionne
450c71c3b6 [Logical] Use perfect forwarding in eval_if. Fixes #20. 2015-03-26 00:46:59 -04:00
Louis Dionne
2ecedc140c [Functional] Add the iterate combinator 2015-03-25 12:26:04 -04:00
Louis Dionne
6e0a4bd70a [Sequence] Remove usages of lambdas to workaround Clang bugs 2015-03-24 16:20:06 -04:00
Louis Dionne
63b862518b [Fusion] Optimize concat by using fusion::join in Fusion adapters 2015-03-24 15:02:47 -04:00
Louis Dionne
85e96017f2 [Tutorial] Add a pseudo-code glossary with proper formatting 2015-03-22 17:37:46 -04:00
Louis Dionne
afa9171eec [Foldable] Add fold and reverse_fold aliases 2015-03-22 17:18:26 -04:00
Louis Dionne
46b4def732 [Iterable] Rewrite any_of for Iterable to improve performance and work around Clang ICE
Partially addresses #24
2015-03-22 15:54:07 -04:00
Louis Dionne
740da060f4 Transfer some issues to GitHub so everyone can chime in 2015-03-22 13:51:49 -04:00
Louis Dionne
2bd2b1239c Fix bugs with copy constructors in almost all the containers 2015-03-22 12:15:32 -04:00
Louis Dionne
5211da5a5d [Logical/Lazy] Tie eval_if and eval together, and update the docs
- Improve the documentation and tests of Lazy
- Add missing `operator!` to Logical's documentation
- In `eval_if`, evaluate branches with `eval` for more flexibility
- Use `lazy` instead of ugly workarounds in Sequence and Iterable
2015-03-22 10:58:21 -04:00
Louis Dionne
2d71e3f368 [Functor] Add missing include 2015-03-21 11:51:35 -04:00
Louis Dionne
483969e68c [Tests] Localize iteration whenever possible to reduce compile-times 2015-03-21 00:32:31 -04:00
Louis Dionne
466bb3c1ad Add the Comonad concept and refactor Lazy 2015-03-20 11:55:32 -04:00
Louis Dionne
2679c7f0a4 [Iterable] Use only_when to implement find_if_impl 2015-03-16 11:35:11 -04:00
Louis Dionne
a8586ec181 [Lazy] Fix move from destroyed object bug 2015-03-15 00:18:32 -04:00
Louis Dionne
744ac273b4 [ext/std/vector] Monomorphic => can't be a Functor 2015-03-15 00:18:31 -04:00
Louis Dionne
1b8b5a5e2f [ext/std/array] Can't be made a Sequence because it's homogeneous 2015-03-15 00:18:31 -04:00
Louis Dionne
bc0212c712 [Example] Move the mini-MPL to example/misc 2015-03-15 00:18:31 -04:00
Louis Dionne
463040d318 [Searchable] Rename find to find_if and lookup to find 2015-03-15 00:18:31 -04:00
Louis Dionne
b69f29ac7a [Functor] Rename replace to replace_if, and add replace 2015-03-15 00:18:30 -04:00
Louis Dionne
bcf573ccc6 [Functor] Rename adjust to adjust_if and add adjust 2015-03-15 00:18:30 -04:00
Louis Dionne
cde54c9ec0 [Foldable] Rename count to count_if and add count 2015-03-15 00:18:30 -04:00
Louis Dionne
112e34e8a1 [Foldable] Add a size alias to length 2015-03-13 19:54:28 -04:00
Louis Dionne
7a309d08c6 [Type] Remove some places where we read from non-constexpr variables 2015-03-13 19:54:28 -04:00
Louis Dionne
ee329961b2 [Tutorial] Add a section on assertions 2015-03-13 12:14:35 -04:00
Louis Dionne
e0ea535bd9 [Config] Document BOOST_HANA_CONFIG_DISABLE_DATA_TYPE_CHECKS 2015-03-13 12:14:34 -04:00
Louis Dionne
1889dfcd65 [MplVector] Remove unused includes and return mpl::integral_c from equal 2015-03-13 12:14:34 -04:00
Louis Dionne
af4ff59bfb [Core] Add is_a and make sure models<> returns an IntegralConstant 2015-03-13 12:14:32 -04:00
Louis Dionne
51c43a9c56 Include fwd/core/xxx instead of core/xxx in concept forward decl headers 2015-03-12 18:13:43 -04:00
Louis Dionne
9cc9ca4b0e [Travis] Add support for Travis CI 2015-03-12 14:42:50 -04:00
Louis Dionne
4671796d28 [Pair] Add make_pair and improve tests 2015-03-12 11:52:51 -04:00
Louis Dionne
42573fc696 [Doc] Lift a mailing list message into documentation for eval_if 2015-03-12 11:27:11 -04:00
Louis Dionne
5433debbf8 [Map] Split unit tests and remove usage of lambda 2015-03-10 09:30:07 -04:00
Louis Dionne
53b50c835b [Tuple] Fix ambiguous overload of transform 2015-03-10 09:30:07 -04:00
Louis Dionne
39079fa95a [Foldable] Add monadic folds 2015-03-10 09:30:07 -04:00
Louis Dionne
656b57e80b [ext/utility] Add traits::declval 2015-03-10 09:30:07 -04:00
Louis Dionne
aecb7dcdef Make sure Metafunctions are as SFINAE-friendly as possible 2015-03-10 09:30:06 -04:00
Louis Dionne
ea601ddf60 [Maybe] Add the sfinae utility 2015-03-10 09:30:06 -04:00
Louis Dionne
32be2c9ef7 [Doc] Minor rewording of Maybe's doc 2015-03-08 12:38:19 -04:00
Louis Dionne
6c076555a5 [ext/] Fix std::integer_sequence and mpl::vector failing tests 2015-03-08 11:56:27 -04:00
Louis Dionne
8a73a3208e [Map] Add make<Map> and remove map(...) 2015-03-07 21:28:07 -05:00
Louis Dionne
bd4daea264 Use models<Concept, T> instead of models<Concept(T)>, and check data types at the top level 2015-03-07 21:27:46 -05:00
Louis Dionne
d525c20397 [Detail] Add an helper to compute tuple cartesian products 2015-03-07 12:09:02 -05:00
Louis Dionne
4b44e867e1 [ext/] Add an experimental adapter for std::vector 2015-03-05 20:00:21 -05:00
Louis Dionne
0eb9c04b7e [ext/] Remove forward declarations. 2015-03-05 19:59:10 -05:00
Louis Dionne
471a9e3239 [Documentation] Minor fixes 2015-03-05 19:44:52 -05:00
Louis Dionne
00d1cac8d2 [Tutorial] Fix typo in cheatsheet 2015-03-05 14:04:06 -05:00
Louis Dionne
bb640c350e [Detail] Split detail::array into its own header 2015-03-05 13:18:40 -05:00
Louis Dionne
cc76ebbba2 [IntegralDomain] Use rem instead of mod, and change laws so it's consistent with % 2015-03-05 12:25:50 -05:00
Louis Dionne
e4e552401d [std::tuple] Workaround bug in std::tuple_cat: http://llvm.org/bugs/show_bug.cgi?id=22806 2015-03-05 11:46:16 -05:00
Louis Dionne
1cca71792e [ext/type_traits] Include ext/integer_sequence and ext/integral_constant 2015-03-05 10:31:44 -05:00
Louis Dionne
9388fe52eb [CMake + Config] Successfully compile on Clang 3.5 and improve diagnostics
Also disable fusion's adapters tests, which are currently broken
2015-03-05 09:35:06 -05:00
Louis Dionne
e92a7d3a84 [functional/overload] Fix a bug with clang 3.5 2015-03-04 18:18:53 -05:00
Louis Dionne
c239b5c035 Fix bugs where we read from non-constexpr variables 2015-03-04 16:57:38 -05:00
Louis Dionne
5c1e724748 [Documentation] Remove old references to type classes 2015-03-04 16:38:02 -05:00
Louis Dionne
c93a250d87 [Constant] Make value a nullary method depending only on the type 2015-03-04 16:36:40 -05:00
Louis Dionne
cee0c9b3ce [Clang 3.5] Workaround some bugs 2015-03-04 16:35:17 -05:00
Louis Dionne
8e9db82e28 [Tutorial] Move the cheatsheet after the quickstart, again 2015-03-04 14:38:48 -05:00
Louis Dionne
fb7cbdf13a [Sequence] Add missing examples 2015-03-04 14:30:41 -05:00
Louis Dionne
559c74e2dd [Tutorial] Wording tweaks 2015-03-04 13:10:17 -05:00
Louis Dionne
55e64b9579 [Iterable] Remove some usage of lambdas and add the at operator 2015-03-04 13:10:17 -05:00
Louis Dionne
065b910128 Update copyright year. 2015-03-03 14:16:50 -05:00
Louis Dionne
f017c4493a [Searchable] Swap {all,any,none} and their _of variant for consistency with the STL 2015-03-03 13:51:37 -05:00
Louis Dionne
fc12cee6e5 [Tutorial] Add sections on amphibian algorithms and semantics 2015-03-03 13:19:06 -05:00
Louis Dionne
da5c1a1ef1 [Ext] Re-add the old type_traits integration 2015-03-02 16:13:55 -05:00
Louis Dionne
87145a4a7f [IntegralConstant] Use nested hana::datatype so we can inherit them 2015-03-02 09:16:59 -05:00
Louis Dionne
dd86906e2d [Tuple] Make sure _tuple is default constructible when its elements are 2015-02-28 11:35:33 -05:00
Louis Dionne
37ab3ff31e [Tutorial] Rewrite the introduction 2015-02-27 14:04:36 -05:00
Louis Dionne
7e2bcdfee0 [ext/mpl] MPL vectors are not Sequences anymore 2015-02-27 11:34:21 -05:00
Louis Dionne
d7f58620ff [Example] Add a minimal implementation of the MPL 2015-02-26 12:35:06 -05:00
Louis Dionne
06037d2683 [Core] Introduce when_valid in when. 2015-02-25 12:39:06 -05:00
Louis Dionne
53b06ef572 [Range] Undeprecate range(...) for now, too many warnings in the tests 2015-02-25 12:39:05 -05:00
Louis Dionne
689ab952f8 [Orderable, Comparable] Add signatures and partially appliable methods 2015-02-25 12:39:05 -05:00
Louis Dionne
aa6eac6c3d [Config] Move BOOST_HANA_CONSTEXPR_LAMBDA to config.hpp 2015-02-25 10:20:12 -05:00
Louis Dionne
8c00e35387 [Applicative] Add signatures and refactor laws 2015-02-25 09:19:59 -05:00
Louis Dionne
c13f660ecc [MonadPlus] Add signatures and rename nil to empty 2015-02-25 09:19:58 -05:00
Louis Dionne
6824f2bc47 Rename has_common_embedding to has_nontrivial_common_embedding, which is more correct. 2015-02-24 20:42:03 -05:00
Louis Dionne
0f197ea93a [Core] Properly document models and add examples 2015-02-24 19:54:22 -05:00
Louis Dionne
771a5e39d7 [Range] Implement efficient lookup and elem methods 2015-02-24 19:54:21 -05:00
Louis Dionne
a46cd6a90c [Tuto + Functor] Document parameterized gtypes and pimp Functor's docs 2015-02-24 19:54:21 -05:00
Louis Dionne
da687d7cc6 [Range] Implement and document make<Range>. Deprecate range(...) 2015-02-24 19:54:21 -05:00
Louis Dionne
ad171f9cea [Make] Add a forward declaration header 2015-02-24 19:54:21 -05:00
Louis Dionne
edd086423e [Tuple] Replace tuple(...) by make<Tuple>(...) in the docs 2015-02-24 18:15:24 -05:00
Louis Dionne
9de4d0af11 [Type] Remove Doxygen warning 2015-02-24 14:09:30 -05:00
Louis Dionne
83644e851b [Searchable] Improve the any implementation for builtin arrays 2015-02-24 14:04:58 -05:00
Louis Dionne
bf61b312b9 [Range] Simplify and improve the implementation 2015-02-23 21:46:44 -05:00
Louis Dionne
ffd4cba716 Two-step definition for _tuple_t and _type 2015-02-23 21:46:43 -05:00
Louis Dionne
e7e9391147 [Iterable] Remove operator[] overload for const&& 2015-02-23 21:46:43 -05:00
Louis Dionne
1df1b62a8a [Assert/String] Use models instead of is_a 2015-02-23 21:46:43 -05:00
Louis Dionne
4345e85be2 [Map] Use models instead of is_a 2015-02-23 19:34:48 -05:00
Louis Dionne
2a8b52cf17 [Type] decltype(type<T>) should inherit from _type<T> 2015-02-23 19:34:48 -05:00
Louis Dionne
df97a4dfc1 [Set] Add a model of Foldable 2015-02-23 15:04:45 -05:00
Louis Dionne
cc5764bc7d [Cheatsheet] Arguments for elem were flipped 2015-02-23 14:54:33 -05:00
Louis Dionne
4e387cc2ff [Functional] Change the implementation of arg<n> so it can perfect forward. 2015-02-23 08:09:04 -05:00
Louis Dionne
d7bf35c7e8 [Iterable] Make foldl_impl constexpr-friendly 2015-02-22 16:50:01 -05:00
Louis Dionne
3e78af4bcb [Tuple] Use make<Tuple>(...) instead of tuple(...) 2015-02-22 16:50:01 -05:00
Louis Dionne
7dad374f1f [Tuple] Fix a nasty double-move in flatten 2015-02-22 16:50:00 -05:00
Louis Dionne
a25e84cf3b [Doc] Refactor the tutorial 2015-02-22 16:50:00 -05:00
Louis Dionne
8c6bdb3a3f [Tuple] Fix a bug in transform with tuple_t 2015-02-22 14:55:36 -05:00
Louis Dionne
f772374179 [Searchable] Add a model for builtin arrays. 2015-02-22 14:55:36 -05:00
Louis Dionne
d120513366 Rename cons to prepend and snoc to append 2015-02-22 14:55:35 -05:00
Louis Dionne
62ede37419 Rename fmap to transform 2015-02-22 14:55:35 -05:00
Louis Dionne
9e67213857 Rename zip_with to zip.with 2015-02-22 14:55:35 -05:00
Louis Dionne
734f89190c [Core] Refactor the operator system 2015-02-20 11:05:44 -05:00
Louis Dionne
f0c66b31f8 Remove outdated core/ tests and reorganize tests 2015-02-20 11:05:44 -05:00
Louis Dionne
5464f58131 [Sandbox] Remove outdated experiments 2015-02-20 11:05:44 -05:00
Louis Dionne
4d06bf69fe [Core] Refactor documentation and bring back stuff from split_methods branch 2015-02-20 11:05:44 -05:00
Louis Dionne
f31bb617d5 [Tuple] Implement an efficient sort for tuple_cs 2015-02-20 11:05:44 -05:00
Louis Dionne
45387e8294 [Set] Use models instead of is_a and fix missing include 2015-02-20 11:05:43 -05:00
Louis Dionne
9604c9a9f6 Replace List by Sequence 2015-02-20 11:05:43 -05:00
Louis Dionne
8b656656b4 [IntegerList] Forgot to remove the fwd declaration header 2015-02-18 17:14:19 -05:00
Louis Dionne
eda87ce328 [Monad] Add Monad::ap_impl to simplify modelling Applicative 2015-02-17 15:11:23 -05:00
Louis Dionne
272ffa7900 Add the MonadPlus concept 2015-02-17 15:11:07 -05:00
Louis Dionne
9706eef852 [ext/fusion] Reduce code duplication 2015-02-17 02:04:24 -05:00
Louis Dionne
0cb805b4f4 [Iterable] Add TODO for drop variants 2015-02-17 00:56:11 -05:00
Louis Dionne
964851bb76 [Foldable] Split tests and remove now useless foreign tests 2015-02-17 00:56:11 -05:00
Louis Dionne
92a526003b [Tuple] Tentatively implement Sequence and MonadPlus operations 2015-02-17 00:56:11 -05:00
Louis Dionne
02c9c47510 Remove TypeList and IntegerList 2015-02-15 12:38:04 -05:00
Louis Dionne
efd5aa9624 [Documentation] Rename group-typeclasses to group-concepts 2015-02-15 11:42:42 -05:00
Louis Dionne
15a5a03953 [Bool] Make bool_<...> an alias to integral_constant<bool, ...>. 2015-02-15 11:27:20 -05:00
Louis Dionne
737f20a5bb [models] Implement models for each concept; no need to explicitly specialize it 2015-02-15 10:31:12 -05:00
Louis Dionne
bec87eec87 [Functor] Properly annotate default implementations 2015-02-15 09:08:02 -05:00
Louis Dionne
337167bbb3 [Traversable] Refactor documentation and split methods 2015-02-15 09:08:02 -05:00
Louis Dionne
681116f0db [Iterable] Refactor documentation and split methods 2015-02-15 09:08:02 -05:00
Louis Dionne
8e744413be [Record] Refactor documentation and split methods 2015-02-13 12:00:14 -05:00
Louis Dionne
72334a8bcc [README] Improve the examples 2015-02-12 12:37:32 -05:00
Louis Dionne
e4d75ef25a [Foldable] Refactor documentation and split methods 2015-02-12 11:58:39 -05:00
Louis Dionne
bf34ec04e4 [Lazy] Document that operators are provided for Monad 2015-02-12 10:14:22 -05:00
Louis Dionne
c5f20a51d2 [Searchable] Split methods and refactor documentation 2015-02-12 10:10:38 -05:00
Louis Dionne
f99a35fba6 [Monad] Refactor documentation and split methods 2015-02-11 11:15:16 -05:00
Louis Dionne
3a6508f61b [Doxygen] Remove warnings 2015-02-11 10:43:26 -05:00
Louis Dionne
dbf7445a3c [Applicative] Refactor the documentation and split methods 2015-02-11 10:37:01 -05:00
Louis Dionne
8a3e5f794d [Functor] Refactor documentation and split methods 2015-02-10 20:34:41 -05:00
Louis Dionne
9c32ebe263 [Detail] Remove detail::n_times, which is replaced by int_<i>.times 2015-02-10 20:03:49 -05:00
Louis Dionne
17d2ce584c [Integral] Rename to IntegralConstant and improve the API 2015-02-10 20:03:49 -05:00
Louis Dionne
5dd70cbf3a [String] Remove the Constant model and document why 2015-02-10 19:18:40 -05:00
Louis Dionne
88549c004c [IntegralConstant] Remove the concept 2015-02-10 19:18:40 -05:00
Louis Dionne
dab93cc263 [Comparable] Update docs, split methods and more
- Use == for cross-type EqualityComparable data types
- Remove the not_equal mcd
2015-02-10 19:18:40 -05:00
Louis Dionne
9ddad3dc22 [Orderable] Split completely 2015-02-10 18:04:30 -05:00
Louis Dionne
c2b51f3780 [Logical] Split completely 2015-02-10 18:04:30 -05:00
Louis Dionne
1d3aaa93c4 [Monoid up to IntDomain] Refactor the documentation and split the methods 2015-02-10 18:03:42 -05:00
Louis Dionne
a06100c268 [Enumerable] Refactor the documentation and split the methods 2015-02-10 18:03:19 -05:00
Louis Dionne
04985812f8 [Range] Specify what happens when from and to have different underlying types 2015-02-10 18:03:19 -05:00
Louis Dionne
0ac6753f27 [Constant] Update the Constant concept and its models
- Provide a conversion to the underlying data type
- Provide a common data type when it makes sense
- Remove Constant::instance and Constant::mcd
- Split the methods of all the models
- Make sure all models provide a nested value_type
- Make sure all models provide conversions whenever possible
2015-02-10 18:03:19 -05:00
Louis Dionne
74fe83c517 [Detail] Add detail::std::is_non_boolean_arithmetic 2015-02-10 18:03:18 -05:00
Louis Dionne
2604c9eb53 [Detail] Add the CanonicalConstant helper 2015-02-10 18:03:18 -05:00
Louis Dionne
1683999b4e [Detail] Add std::conditional 2015-02-10 18:03:18 -05:00
Louis Dionne
551cb2f0b6 [Detail] Add detail::has_common_embedding 2015-02-10 18:03:18 -05:00
Louis Dionne
61d59eff57 [Core] Refactor the conversion system, hana::common and add hana::default 2015-02-10 18:02:32 -05:00
Louis Dionne
aefbc90a10 [Lazy] Fix a broken link to an example in the docs 2015-02-08 15:01:55 -05:00
Louis Dionne
50dc7506ff [Functional] Make the placeholder-based operators SFINAE-friendly 2015-02-08 10:51:00 -05:00
Louis Dionne
72169c81c1 [Detail] Make std::common_type SFINAE friendly 2015-02-08 10:50:14 -05:00
Louis Dionne
d6ef326e94 [Product] Split methods, refactor doc and add Orderable instance 2015-02-08 10:43:12 -05:00
Louis Dionne
738041d159 [Core] Add the wrong utility to make static asserts dependent. 2015-02-08 10:29:09 -05:00
Louis Dionne
d479e0f711 [Set] Split methods and refactor the documentation 2015-02-08 09:49:19 -05:00
Louis Dionne
b2b4a09f10 [Map] Split methods and refactor documentation. 2015-02-08 09:49:19 -05:00
Louis Dionne
733e9967ac [Core] Use proper tag-dispatching with make 2015-02-08 09:49:18 -05:00
Louis Dionne
ca31fe399c [Range] Split methods and refactor documentation 2015-02-08 09:22:39 -05:00
Louis Dionne
7f52833db6 [Lazy] Split methods and refactor documentation 2015-02-08 09:22:39 -05:00
Louis Dionne
d5076888fb [Type] Split methods and refactor the documentation 2015-02-08 09:22:39 -05:00
Louis Dionne
4892c4ad42 [Tuple] Add tuple_t and tuple_c to ease the transition to split methods 2015-02-08 09:22:39 -05:00
Louis Dionne
507aaa033d [String] Split methods and refactor 2015-02-08 09:22:39 -05:00
Louis Dionne
3947f264c1 [Maybe] Split methods and refactor documentation. 2015-02-08 09:22:39 -05:00
Louis Dionne
245819eb71 [Either] Split methods and refactor documentation 2015-02-08 09:22:39 -05:00
Louis Dionne
9941656298 [Core] Add models to ease transition to split methods 2015-02-08 09:22:39 -05:00
Louis Dionne
74647cb3ce Add independent methods to gradually split the type classes. 2015-02-08 09:22:38 -05:00
Louis Dionne
ee648c2bda [Core] Fix issue with when_valid 2015-02-04 23:02:04 -05:00
Louis Dionne
17100e774a [Tuple] Add a more efficient concat implementation 2015-01-13 16:19:45 -05:00
Louis Dionne
6f267bd37b Add detail::generate_integer_sequence. 2015-01-13 15:49:30 -05:00
Louis Dionne
4654c6786a Split instances for foreign types 2014-12-06 16:30:16 -05:00
Louis Dionne
0371952337 Make while_ part of Logical 2014-12-06 16:30:14 -05:00
Louis Dionne
99ff71dbef Doxygen: remove warnings 2014-12-01 11:53:56 -05:00
Louis Dionne
f5c4de477f Use true_type/false_type in std type traits. 2014-11-30 23:55:57 -05:00
Louis Dionne
8d4b34f6c2 Do not use variable templates for one, zero & al.
This is because using variable templates limits the objects to being
constexpr, or to not being constexpr (but then initializing the object
becomes an issue).

This is also a step towards being compilable by GCC 4.9, but that only
would not justify the change.
2014-11-30 20:42:29 -05:00
Louis Dionne
51912d8661 Add detail::while_ and detail::until. 2014-11-29 12:17:25 -05:00
Louis Dionne
eed60b3ca8 Doc: add missing section header in Functor 2014-11-26 10:49:48 -05:00
Louis Dionne
7fbd438f31 Use perfect forwarding in Pair. 2014-11-26 09:32:11 -05:00
Louis Dionne
e043d1c046 Fix bug when returning a dangling reference from always.
Fixes #15.
2014-11-23 10:04:50 -05:00
Louis Dionne
8845b2a0c1 Use common to provide inter data type instances. 2014-11-17 10:05:58 -05:00
Louis Dionne
4009555990 Refactor and improve IntegralConstant
- Add mandatory lossless conversions between instances
- implement `common` properly
2014-11-17 09:13:48 -05:00
Louis Dionne
f4e9062d89 Core: add the common utility 2014-11-17 09:13:48 -05:00
Louis Dionne
12bb5b1fa4 Core: refactor convert 2014-11-17 09:13:36 -05:00
Louis Dionne
d042abda97 Automatically test including individual headers. 2014-11-12 11:22:53 -05:00
Louis Dionne
515ade7cf6 Split Fusion adapters. 2014-11-12 11:22:52 -05:00
Louis Dionne
8756e81977 Add boost/hana/config.hpp and BOOST_HANA_*_CHECK macros. 2014-11-10 17:52:33 -05:00
Louis Dionne
39006d288d Experiment with fold expressions. 2014-11-08 13:18:25 -05:00
Louis Dionne
e0e2501931 List: add the remove_at method 2014-11-08 12:32:51 -05:00
Louis Dionne
09619ad0c5 Refactor List benchmarks and ext::std::Tuple 2014-11-08 10:43:13 -05:00
Louis Dionne
584c16a746 Work around Clang bugs to make the String compile. 2014-11-07 21:33:23 -05:00
Louis Dionne
596eaf389d Fix Doxygen warnings 2014-11-07 20:31:27 -05:00
Louis Dionne
0ef90fbf39 Type: add a unary operator+ turning lvalues into rvalues.
Fixes #11
2014-11-07 20:31:26 -05:00
Louis Dionne
7b7bda5998 Experiment with adding operators to Types. 2014-11-07 20:31:26 -05:00
Louis Dionne
29995f62ee Work around bugs in Clang 3.5. 2014-11-07 20:31:26 -05:00
Louis Dionne
b9472015d1 Add the overload utility to Functional 2014-11-07 20:31:26 -05:00
Louis Dionne
da8fb2b486 Add laws to Enumerable. 2014-11-07 19:46:25 -05:00
Louis Dionne
0f0c2c4430 Replace when<is_valid<...>> by when_valid<...> 2014-11-07 15:41:10 -05:00
Louis Dionne
6e86e1f319 Searchable: add some laws 2014-11-05 13:32:45 -05:00
Louis Dionne
a0bde438f5 Iterable: Workaround a bug in example/core/to.cpp 2014-11-05 10:58:34 -05:00
Louis Dionne
049046478e Move ASSERT macros out of the details 2014-11-04 09:43:44 -05:00
Louis Dionne
1e8726f394 Make the tuple implementation constexpr-friendly.
- Move the lambda-based tuple to the sandbox
- Use the multiple inheritance based tuple instead
2014-11-04 09:02:31 -05:00
Louis Dionne
550bbeb065 Simplify the implementation of default conversions. 2014-11-04 08:54:59 -05:00
Louis Dionne
788b4df735 List: zip_with and zip must receive lists of the same data type 2014-11-04 08:54:59 -05:00
Louis Dionne
5fbf0f4da5 Add some easy perfect forwarding in List 2014-11-04 08:54:59 -05:00
Louis Dionne
57087cd249 Functional: make lockstep's syntax like demux's 2014-11-04 08:54:59 -05:00
Louis Dionne
647ad436b0 Reorganize the unit tests and increase the overall coverage. 2014-11-04 08:54:58 -05:00
Louis Dionne
217e1d2b46 Add BOOST_HANA_ASSERT. 2014-11-03 10:22:19 -05:00
Louis Dionne
f33c23b67e Add an alternative tuple implementation using multiple inheritance. 2014-11-03 10:22:19 -05:00
Louis Dionne
bfd7d3882d Make several data types constexpr friendly. 2014-11-03 10:22:19 -05:00
Louis Dionne
f955050dbd Make type class methods constexpr friendly.
Instead of using lambdas to implement type class dispatched methods,
constexpr function objects are now used instead.
2014-11-01 13:47:57 -04:00
Louis Dionne
d188e19938 Make functional utilities constexpr friendly 2014-10-28 14:38:49 -04:00
Louis Dionne
8590ce9376 Add detail::reverse_partial 2014-10-28 14:38:49 -04:00
Louis Dionne
c37916cdd4 Make variadic folds function objects. 2014-10-28 14:22:59 -04:00
Louis Dionne
a6310a046d Simplify the closure type 2014-10-28 14:22:58 -04:00
Louis Dionne
629b487d4c Add the detail::create utility. 2014-10-28 13:51:05 -04:00
Louis Dionne
40aef4d918 Add std::{decay,is_array,is_function} 2014-10-28 13:50:53 -04:00
Louis Dionne
e66473a0a9 Fix broken link to example in the doc. 2014-10-28 08:12:17 -04:00
Louis Dionne
ca821c9455 Move Searchable::list_mcd to Searchable::iterable_mcd. 2014-10-27 17:27:54 -04:00
Louis Dionne
40a7456bb1 Remove outdated TODOS. 2014-10-27 17:15:59 -04:00
Louis Dionne
503d372459 Lower the requirements on the arguments to drop and at. 2014-10-27 17:08:00 -04:00
Louis Dionne
fcca565695 Remove outdated TODO 2014-10-27 16:58:13 -04:00
Louis Dionne
80ab04ede0 Simplify datatype and enabled_operators implementations. 2014-10-27 16:43:49 -04:00
Louis Dionne
eddece8d00 Use the nested hana struct to define enabled operators. 2014-10-27 16:31:03 -04:00
Louis Dionne
cc8455dd65 Use the nested hana struct to instantiate unary type classes. 2014-10-27 16:14:02 -04:00
Louis Dionne
220d92ed82 Use a nested hana struct to customize stuff inside user defined objects. 2014-10-27 15:24:14 -04:00
Louis Dionne
a9743f3dde Add the Ring::power method. 2014-10-27 14:59:20 -04:00
Louis Dionne
847c53c6d3 Fix dangling reference in Foreign::{succ,pred}_impl. 2014-10-25 21:13:28 -04:00
Louis Dionne
fe1f1c65a7 Use functional utilities instead of handwritten lambdas when easy to do so. 2014-10-25 20:45:21 -04:00
Louis Dionne
1873a828c5 Simplify id's implementation. 2014-10-25 19:59:53 -04:00
Louis Dionne
133775bf20 Perform eta reduction in Tuple at_impl. 2014-10-25 14:34:32 -04:00
Louis Dionne
c2541c3713 Add detail::closure based on multiple-inheritance 2014-10-25 14:34:31 -04:00
Louis Dionne
187f396711 Add std::declval and std::add_rvalue_reference to detail:: 2014-10-25 12:56:30 -04:00
Louis Dionne
8adb3353f6 Use functional utilities instead of hand rolled equivalents in some places. 2014-10-25 09:47:06 -04:00
Louis Dionne
b26406d649 Simplify the header hierarchy: too modular isn't good.
This essentially undo parts of 307d3d0. While it seemed a like good
idea to over-modularize type classes to reduce header dependencies, I
think it was a mistake. What 307d3d0 did was basically split each of
the components of a type class into a single header (typeclass/operators.hpp,
typeclass/mcd_1.hpp, typeclass/mcd_2.hpp, ...).

At first, it resolved many weird header dependency glitches. However, it
also made everything more complex; creating even easy type classes was
sometimes much longer than it should have been, and using type classes
was tricky because you had to know exactly what to include. It also went
against the idea of implicit type class instances being provided whenever
that's possible, which I think is a nice feature of the library. Being
dissatisfied with this, I opted for a simpler header organization with
a fwd/ directory that contains forward declaration headers, and everything
else in the same directory.

A possible objection to this change would be that you are now forced
to include sometimes more than what you strictly need when e.g. defining
an instance or using only some instance(s) of a data type. My answer to
this is that Hana is a really small library and the parsing is not
going to have a huge impact on overall compilation time. My bet is that
the time that will be saved by programmers with a simple header hierarchy
outweights the parsing time by far.
2014-10-25 09:47:05 -04:00
Louis Dionne
a74bb80490 Type: clean up and remove misplaced functionality
The ability to construct objects of a type T by calling the type<T>
object was removed; make<T> should be used instead.
2014-10-22 12:27:33 -04:00
Louis Dionne
e6c16a1394 Add more laws to Functor. 2014-10-22 10:43:16 -04:00
Louis Dionne
806b941603 Instantiate Searchable and Iterable with String. 2014-10-21 23:53:28 -04:00
Louis Dionne
e70e06c831 Add support for std::ratio. 2014-10-20 11:50:43 -04:00
Louis Dionne
93c0d4a8eb Fix broken links to benchmark plots in the documentation. 2014-10-19 17:23:30 -04:00
Louis Dionne
7b18a4598c Add perfect forwarding in Map. 2014-10-17 18:54:23 -04:00
Louis Dionne
ac528b81ba Add the insert function to Set. 2014-10-17 18:29:50 -04:00
Louis Dionne
b09096c11f Split ext/ integral constants into different files. 2014-10-17 16:31:16 -04:00
Louis Dionne
653d083eb0 Instantiate Foldable and Orderable with String. 2014-10-17 10:23:31 -04:00
Louis Dionne
716ff897cc Add the Enumerable type class. 2014-10-16 20:52:29 -04:00
Louis Dionne
d496ec6bbc Change the syntax of demux. 2014-10-16 19:32:09 -04:00
Louis Dionne
367ba66227 Undo 8076305 (constexpr-initialized lambdas).
This turned out to be pretty much useless because the call operator
still couldn't be made constexpr. Since that added a bit of complexity
without any gain, this is removed.
2014-10-16 17:13:09 -04:00
Louis Dionne
f0d9e9b9bb Add the intersperse method to List. 2014-10-16 16:56:39 -04:00
Louis Dionne
1280806839 Provide an instance of Foldable for Products. 2014-10-16 08:43:08 -04:00
Louis Dionne
7b57e7b474 Low hanging optimizations in Tuple. 2014-10-16 08:18:25 -04:00
Louis Dionne
30a4b02a68 Make sure the non-template operators for placeholders are inlined 2014-10-14 20:16:48 -04:00
Louis Dionne
177a7f11f3 Add an overload utility to the sandbox. 2014-10-14 17:38:56 -04:00
Louis Dionne
4335c4915c Move list/free/convert.hpp to list/convert.hpp 2014-10-11 16:04:12 -04:00
Louis Dionne
002320cdf6 Add variadic take and variadic split_at. 2014-10-11 15:58:04 -04:00
Louis Dionne
88579de954 Allow folding move-only rvalue Records by constraining accessors. 2014-10-11 14:26:39 -04:00
Louis Dionne
9bc46dd205 Add more perfect forwarding. 2014-10-11 13:20:30 -04:00
Louis Dionne
5c0755b496 Fix bugs where we default initialized lambdas. 2014-10-08 20:46:10 -04:00
Louis Dionne
4ff5485bd3 Remove workarounds for now-fixed libc++ #19616 2014-10-08 19:31:28 -04:00
Louis Dionne
d08c5c2f36 Fix broken include guard in set/convert.hpp 2014-10-07 20:20:19 -04:00
Louis Dionne
c6e79c1075 Add missing decltype(auto) to some foreign methods. 2014-10-07 19:37:57 -04:00
Louis Dionne
96ecd6b228 Make BOOST_HANA_RUNTIME_ASSERT print to stderr instead of stdout 2014-10-05 15:14:23 -04:00
Louis Dionne
241671ef0e Add perfect forwarding in some functional utilities 2014-10-05 15:14:22 -04:00
Louis Dionne
18e03832c4 Add perfect forwarding in Maybe 2014-10-05 15:14:22 -04:00
Louis Dionne
7338838d46 Allow template types with multiple arguments in BOOST_HANA_DEFINE_RECORD. 2014-10-05 01:30:37 -04:00
Louis Dionne
ae636b98c3 Make BOOST_HANA_RUNTIME_ASSERT enabled even in Release mode 2014-10-05 00:15:46 -04:00
Louis Dionne
2c8d51b7a7 Add detail::std::{true_type,false_type} 2014-10-04 22:58:40 -04:00
Louis Dionne
0c1dd29224 Improve some conversion operators.
- Add perfect forwarding
- Allow Maps and Sets to be created from Foldables instead of Lists
2014-10-04 22:58:39 -04:00
Louis Dionne
1104f76d48 Add perfect forwarding in some places in Tuple 2014-10-04 20:13:14 -04:00
Louis Dionne
3a9bf53490 Add perfect forwarding in the Foldable mcds. 2014-10-04 18:48:42 -04:00
Louis Dionne
a7b28bddd8 Add more perfect forwarding and do some refactoring. 2014-10-02 21:05:01 -04:00
Louis Dionne
f0a6d7150d Add some perfect forwarding. 2014-10-02 17:06:52 -04:00
Louis Dionne
e7b48ee23c Use compile-time strings as keys in records 2014-09-30 10:42:55 -04:00
Louis Dionne
c184a742fb Add compile-time strings 2014-09-30 10:23:45 -04:00
Louis Dionne
d06cd559ba Add the times method to Integrals 2014-09-29 16:31:59 -04:00
Louis Dionne
539ed83248 Fix a dangling reference bug in functional/id. 2014-09-29 11:15:00 -04:00
Louis Dionne
6b81bf4d36 Add runtime and memory usage benchmarks to Functor 2014-09-26 16:01:38 -04:00
Louis Dionne
a434f561d4 Add perfect forwarding in variadic folds and for_each. 2014-09-26 15:29:36 -04:00
Louis Dionne
a44e9b8d17 Benchmark a different way of reversing a parameter pack. 2014-09-22 11:13:28 -04:00
Louis Dionne
18fef19050 List: add the repeat method 2014-09-11 08:22:12 -07:00
Louis Dionne
9fbf074c55 Record: refactor macros to make them more user-friendly 2014-09-09 13:01:11 -07:00
Louis Dionne
a6d4511684 Record: Allow the intrusive macro to be used inside a function. 2014-09-09 10:43:25 -07:00
Louis Dionne
1b021fcd89 Record: Allow instantiating with macros. 2014-09-09 10:32:04 -07:00
Louis Dionne
3bb1bb9c6b Allow instantiating unary type classes from a data type. 2014-09-08 22:39:10 -07:00
Louis Dionne
80763053b3 Initialize methods with constexpr whenever possible. 2014-09-07 10:01:57 -07:00
Louis Dionne
0065ced91d Add operator[] for Tuple and Range. 2014-09-05 17:02:50 -04:00
Louis Dionne
444ffa8d48 Improve the documentation for IntegralConstant 2014-09-03 11:06:46 -04:00
Louis Dionne
3da09cc73e Core: is_a also allows checking for data types 2014-09-03 09:21:59 -04:00
Louis Dionne
943c59c0a1 Refactor benchmarks. 2014-09-02 13:21:51 -04:00
Louis Dionne
2d10fb461a Use minimal includes in unit tests. 2014-09-01 18:14:55 -04:00
Louis Dionne
d323c940d3 List: fix the MCD, which used Searchable 2014-09-01 10:02:45 -04:00
Louis Dionne
5d3ae825e5 StdTuple: Fix missing includes 2014-09-01 10:02:45 -04:00
Louis Dionne
980cda48ef Detail: add variadic::drop_into 2014-09-01 10:02:45 -04:00
Louis Dionne
118ca61066 Range: optimize the Foldable instance and fix includes 2014-08-31 20:27:23 -04:00
Louis Dionne
faef709431 Minor improvements:
- Test that detail::variadic::at can handle const objects
- Add perfect forwarding in functional/id
- Sandbox: experiment with a std compatible tuple
2014-08-31 10:16:03 -04:00
Louis Dionne
028e672822 Refactor examples and fix broken links 2014-08-30 17:18:26 -04:00
Louis Dionne
af0e2444ed Set: fix the Comparable instance so it works with runtime keys 2014-08-30 14:25:56 -04:00
Louis Dionne
fadb7a2af0 Core: document how operators work. 2014-08-29 11:18:26 -04:00
Louis Dionne
26af39f3d9 Flip the arguments of several methods.
Flipped:
- traverse
- fmap, adjust, fill, replace
- drop_while, drop_until
- take_while, take_until
2014-08-29 10:24:19 -04:00
Louis Dionne
aceed6a29a Tuple: specialize make so it is more optimized 2014-08-28 12:53:33 -04:00
Louis Dionne
919bc2f465 Move for_each to Foldable and optimize it with unpack 2014-08-28 12:53:33 -04:00
Louis Dionne
d6b765f794 Add variadic::reverse_apply 2014-08-28 10:47:35 -04:00
Louis Dionne
00642be684 Add the Either data type. 2014-08-26 15:09:51 -04:00
Louis Dionne
1e6d390626 Add slice_c, take_c, drop_c and at_c shorthands. 2014-08-25 17:45:10 -04:00
Louis Dionne
81a242c1f1 Replace into by make in the List type class. 2014-08-25 16:48:02 -04:00
Louis Dionne
cbeb6ae983 Core: add the make function 2014-08-25 12:33:49 -04:00
Louis Dionne
3147d9b5d5 Refactor and fix broken examples. 2014-08-25 12:33:49 -04:00
Louis Dionne
04c3fffbd8 Foreign: instantiate Foldable for builtin arrays 2014-08-25 12:33:48 -04:00
Louis Dionne
7cc729bd05 List: add the slice method 2014-08-25 12:33:48 -04:00
Louis Dionne
1463014414 Core: Using when-able metafunctions with too many arguments is an error. 2014-08-25 12:33:48 -04:00
Louis Dionne
ae8442482d Do not bring operators in the hana namespace automatically.
This caused an issue with types defined in the hana namespace and
type class instances for foreign types. For example, doing
`Integral{} == Integral{}` would hit the recursion depth limit
because `Integral` was defined in `boost::hana`, so ADL found
`boost::hana::operators::operator==` and we recursed in the foreign
instance for `Comparable`.
2014-08-25 12:33:48 -04:00
Louis Dionne
c4e4313c8e Remove the Foreign data type.
The Foreign data type made stuff like `to<int>` become
`to<Foreign<int>>`, which is not as clean.
2014-08-25 12:33:48 -04:00
Louis Dionne
be808cca69 Re-add unit tests for Fusion adaptors 2014-08-25 12:33:48 -04:00
Louis Dionne
24d8f1f591 Workaround bugs in libc++ when adapting std::tuple. 2014-08-25 12:33:47 -04:00
Louis Dionne
084fe9582d Re-add MPL vector. 2014-08-18 19:26:29 -04:00
Louis Dionne
3692a7bb81 Add the IntegralConstant type class 2014-08-18 19:26:29 -04:00
Louis Dionne
307d3d0ec8 Huge reorganization and refactoring.
- Split type class instances into separate files
- Instances provided automatically by a type class are actually MCDs
- Test each instance in a single file, not one file per method
- Refactor the operator system to fix the ADL-related bug.
2014-08-18 19:26:29 -04:00
Louis Dionne
7894be3e2f Searchable: add the subset method 2014-08-16 14:25:58 -04:00
Louis Dionne
04ba0bc426 Core: use when instead of enable_if in convert 2014-08-16 14:25:58 -04:00
Louis Dionne
f2de95a841 Use detail::injection instead of a std::tuple in the tests 2014-08-16 14:25:57 -04:00
Louis Dionne
ba5a74b81f Record: workaround weird ICE in LLVM codegen after adding perfect forwarding 2014-08-16 14:25:52 -04:00
Louis Dionne
828fffdaa4 Split the type traits emulation. 2014-08-10 21:08:43 -04:00
Louis Dionne
9823128862 Add support for perfect forwarding in type class methods 2014-08-10 20:54:55 -04:00
Louis Dionne
a67c592a1f Fusion: instantiate Searchable 2014-08-10 16:46:09 -04:00
Louis Dionne
1d986e4c04 Refactor the unit tests and examples
In particular, merge some unit tests and examples to reduce compilation
times.
2014-08-10 15:42:03 -04:00
Louis Dionne
4c13c21f91 Add the IntegralDomain type class 2014-08-10 12:57:37 -04:00
Louis Dionne
f61ec22e11 Remove the Identity functor, which is now detail::Identity 2014-08-09 17:52:39 -04:00
Louis Dionne
356ee03483 Refactor the unit tests and remove some minimal instances 2014-08-09 17:49:16 -04:00
Louis Dionne
cb9be38cf1 Add the Ring type class. 2014-08-09 09:45:33 -04:00
Louis Dionne
2b76377f91 Core: replace when_valid by when + is_valid 2014-08-07 22:38:54 -04:00
Louis Dionne
4df8c27cbb Finer grained use of operators 2014-08-07 21:05:38 -04:00
Louis Dionne
3d5acb2080 Remove old scattered operations on variadics 2014-08-07 17:56:30 -04:00
Louis Dionne
fecf7309d1 Add the Group type class 2014-08-07 17:01:22 -04:00
Louis Dionne
6c10ce440c Add the Identity functor. 2014-08-07 16:51:50 -04:00
Louis Dionne
474543ca14 Remove documentation for the laws.hpp headers of type classes.
This will be kept for internal use only.
2014-08-07 16:51:50 -04:00
Louis Dionne
b46db0bdc0 Add the Monoid type class 2014-08-07 16:51:49 -04:00
Louis Dionne
4a3f458f71 TypeList: use Foldable::unpack_mcd 2014-08-06 22:27:53 -04:00
Louis Dionne
af36f99f5d Foldable: add unpack_mcd 2014-08-06 18:17:47 -04:00
Louis Dionne
c7af842ea5 Detail: refactor variadic folds and at 2014-08-06 17:59:24 -04:00
Louis Dionne
d56bb224d3 Integral: consider specifying its type 2014-08-06 11:10:47 -04:00
Louis Dionne
82bc4a38da List: add span, group and group_by 2014-08-06 11:08:10 -04:00
Louis Dionne
2f16a364af Comparable: add the comparing helper function 2014-08-06 11:08:10 -04:00
Louis Dionne
64e160f9ab Searchable: add the in utility function 2014-08-06 08:38:45 -04:00
Louis Dionne
1d031b4556 Functional: add infix and use it to implement on 2014-08-05 22:49:18 -04:00
Louis Dionne
b6cef58ca1 Core: add are to make it prettier when there are many data types. 2014-08-05 19:52:44 -04:00
Louis Dionne
da8135ccec Foldable: flip the arguments of some methods 2014-08-05 19:52:44 -04:00
Louis Dionne
2900faec86 List: flip the order of arguments of some methods 2014-08-05 19:52:44 -04:00
Louis Dionne
b4cfc58e72 Searchable: flip the order of the arguments of the methods 2014-08-05 16:46:56 -04:00
Louis Dionne
7bd5afd95f Ext: show all the includes in the examples, because some includes are tricky 2014-08-05 15:06:56 -04:00
Louis Dionne
875a13a02f Fix wrong include guard 2014-08-05 14:50:12 -04:00
Louis Dionne
393cf06fb5 Tutorial: add a section on side effects 2014-08-05 14:44:02 -04:00
Louis Dionne
a7b38d3fff Range: add the range_c constructor 2014-08-05 14:44:02 -04:00
Louis Dionne
f5bc67709e Add master headers for ext/ components 2014-08-05 14:01:46 -04:00
Louis Dionne
f992faa91e Remove std::list adaptor; Iterable requires a Constant is_empty. 2014-08-05 12:14:40 -04:00
Louis Dionne
7a00af4755 Fix typo in documentation 2014-08-05 11:47:47 -04:00
Louis Dionne
d132db0ebf Use finer grained assertions acknowledging Constants 2014-08-05 10:37:54 -04:00
Louis Dionne
d4fde4f77a Documentation: refactoring and improvements in the tutorial 2014-08-04 18:44:38 -04:00
Louis Dionne
b46460842b Constant: consider renaming to UniversalConstant 2014-08-04 18:44:38 -04:00
Louis Dionne
b2e8017de8 Integral: make equivalent to a corresponding std::integral_constant 2014-08-04 18:44:38 -04:00
Louis Dionne
d6571e7681 Documentation: add indexes to the doxygen output 2014-07-31 18:15:27 -04:00
Louis Dionne
c382d9fca1 Tutorial: improve the section on data types 2014-07-31 16:31:56 -04:00
Louis Dionne
c85db2c4d2 Tutorial: make examples compilable 2014-07-31 15:09:34 -04:00
Louis Dionne
e9dfdeb57b Core: merge instantiates into is_a for the same functionality 2014-07-31 13:00:57 -04:00
Louis Dionne
b61dfc00a6 Core: document header structure and use when<> in datatype<> 2014-07-31 11:41:42 -04:00
Louis Dionne
8c683c6e08 Adapt MPL IntegralConstants with Constant. 2014-07-30 19:00:06 -04:00
Louis Dionne
c6f0420145 Functional: pimp the documentation 2014-07-30 15:21:39 -04:00
Louis Dionne
3488fe71cb Rename groups to avoid clashes when doing references 2014-07-30 11:23:38 -04:00
Louis Dionne
8a8ff797ab Split Core into subdirectories to reduce dependencies. 2014-07-30 11:15:26 -04:00
Louis Dionne
6c852e957e Make Constant a type class 2014-07-30 08:55:07 -04:00
Louis Dionne
f66871ec2c MPLVector: Document and instantiate List. 2014-07-29 15:44:45 -04:00
Louis Dionne
cf9c6ab821 Reformulation in the "getting concrete" section of the tutorial
Fixes #3.
2014-07-29 11:24:01 -04:00
Louis Dionne
8e0f4e10ed Fix broken link in the tutorial. 2014-07-29 10:19:50 -04:00
Louis Dionne
aaf8897cb8 Searchable: rename find_mcd to mcd 2014-07-29 10:14:01 -04:00
Louis Dionne
36edeacbc8 Maybe: refactor the documentation and add only_when 2014-07-29 10:09:06 -04:00
Louis Dionne
9199f53ae2 Reintroduce foldl optimizations for TypeList. 2014-07-29 01:26:18 -04:00
Louis Dionne
4fd8b27635 Detail: Add missing constexpr in variadic_unrolled left fold 2014-07-28 22:35:27 -04:00
Louis Dionne
41d6b75bc2 Add the product Type class and make Pair a simple data type 2014-07-28 18:35:57 -04:00
Louis Dionne
74654d6159 Tutorial: Polishing and explain the reference 2014-07-28 12:52:27 -04:00
Louis Dionne
aafd11ed82 Remove redundant examples introduced when refactoring the docs. 2014-07-27 16:57:38 -04:00
Louis Dionne
5f7e784899 Miscellaneous and minor documentation tweaks 2014-07-27 16:57:38 -04:00
Louis Dionne
4dfdbba0c6 List: refactor documentation 2014-07-27 16:57:38 -04:00
Louis Dionne
fdc5f75d5e Pair: refactor documentation 2014-07-27 16:57:38 -04:00
Louis Dionne
527fe09dda Traversable: refactor documentation 2014-07-27 16:57:38 -04:00
Louis Dionne
9ca69bca71 Type: revert commit making metafunction & al SFINAE friendly 2014-07-27 16:57:37 -04:00
Louis Dionne
02dfa4d012 Detail: First argument to dependent_on is now a boolean 2014-07-27 16:57:37 -04:00
Louis Dionne
98189f9d4b Fix definition of BOOST_HANA_STATIC_ASSERT when generating documentation 2014-07-27 16:57:37 -04:00
Louis Dionne
308368291f Searchable: refactor the documentation 2014-07-27 16:57:37 -04:00
Louis Dionne
47797a7f0d Monad: refactor documentation 2014-07-27 16:57:37 -04:00
Louis Dionne
d9c1d44992 Type: make metafunction and friends SFINAE friendly 2014-07-27 16:57:37 -04:00
Louis Dionne
8e91303552 Logical: refactor documentation 2014-07-27 16:57:37 -04:00
Louis Dionne
14f890b4b2 Iterable: refactor docs and make FoldableInstance a detail of implementation 2014-07-27 16:57:36 -04:00
Louis Dionne
c37347943e Functor: refactor documentation 2014-07-27 16:57:36 -04:00
Louis Dionne
184bf94382 Foldable: refactor the documentation 2014-07-27 16:57:36 -04:00
Louis Dionne
dab794edb1 Orderable: Refactor docs and add the ordering utility 2014-07-27 16:57:36 -04:00
Louis Dionne
eab9434945 Comparable: refactor documentation 2014-07-27 16:11:59 -04:00
Louis Dionne
05d80cb123 Applicative: refactor documentation 2014-07-27 16:11:59 -04:00
Louis Dionne
08f8e5f1f4 Tutorial: Write section on data types 2014-07-25 22:42:07 -04:00
Louis Dionne
e5be3a481a List: add some benchmark plots to the documentation 2014-07-25 09:49:02 -04:00
Louis Dionne
c67ce48847 Tutorial: Add section on type classes 2014-07-24 22:53:38 -04:00
Louis Dionne
1b4cfc9191 List: add the unzip method 2014-07-24 14:16:09 -04:00
Louis Dionne
0fb8990a13 List: add the unfoldr and unfoldl methods 2014-07-24 13:24:45 -04:00
Louis Dionne
3e75ad9159 Integral: Allow comparison and ordering with any arithmetic type 2014-07-24 11:34:10 -04:00
Louis Dionne
c42aeba92c Monad: add the tap method 2014-07-24 10:15:06 -04:00
Louis Dionne
a0133f546e Monad: replace >> by | 2014-07-24 09:43:16 -04:00
Louis Dionne
a0acbacc84 Monad: add the then method to sequence monadic actions 2014-07-24 09:26:20 -04:00
Louis Dionne
7d5243a312 Type: fix bug in construction and force explicit use of intializer_list 2014-07-24 08:48:38 -04:00
Louis Dionne
c42daba4a2 Searchable: document keys and values 2014-07-23 20:46:51 -04:00
Louis Dionne
95d227cd57 Lazy: allow calls of the form lazy(f)(). 2014-07-23 20:43:34 -04:00
Louis Dionne
310b44666d Comparable: make objects of different data types compare uneual by default 2014-07-23 20:11:00 -04:00
Louis Dionne
a2f90528cc Typeclasses: fix dependency on mcds for builtin instances 2014-07-23 19:00:46 -04:00
Louis Dionne
83dca441bb Typeclasses: move provided instances for non-builtin types out of the forward decls. 2014-07-23 16:13:40 -04:00
Louis Dionne
786816b391 Tutorial: Add organization section 2014-07-23 11:39:12 -04:00
Louis Dionne
b69029e9bf Map: document issue with mixed Type/Integral keys 2014-07-22 17:19:42 -04:00
Louis Dionne
aacfbfebde Tutorial: write the preface, introduction and quick start 2014-07-22 13:49:15 -04:00
Louis Dionne
c816fbe112 Remove almost all dependencies on the standard library. 2014-07-21 21:07:14 -04:00
Louis Dionne
cc6ee9370b Remove empty laws; I'll add them if I actually have laws to check 2014-07-21 15:47:20 -04:00
Louis Dionne
aba2bae382 Record: Fix ordering issues by using a list of pairs instead of a map 2014-07-21 15:47:12 -04:00
Louis Dionne
689b6c7118 List: add error message to static_assert in concat 2014-07-21 15:09:15 -04:00
Louis Dionne
d0a83b8d30 Functional: Allow 2 arguments or more in compose 2014-07-21 14:57:19 -04:00
Louis Dionne
3ead270cc0 Add the Record type class to adapt user defined types. 2014-07-21 13:53:27 -04:00
Louis Dionne
6c9823e176 Add the Constant data type. 2014-07-21 11:58:23 -04:00
Louis Dionne
d24b8e21ae List: add todo 2014-07-21 11:15:04 -04:00
Louis Dionne
653504ebe5 Remove more dependencies on <cstddef> 2014-07-21 11:08:26 -04:00
Louis Dionne
22a26fb9b7 Integral: remove dependency on <cstddef> and move integral struct out of operators namespace 2014-07-21 11:04:57 -04:00
Louis Dionne
15af56943a Core: Workaround Clang bug in is_a and is_an 2014-07-21 10:45:21 -04:00
Louis Dionne
6d150cf5ee List: add scanr, scanl, scanr1 and scanl1 2014-07-20 14:25:10 -04:00
Louis Dionne
3ccf6f4d62 Searchable: rename find_key to lookup 2014-07-19 18:58:14 -04:00
Louis Dionne
5a00d66ad6 Add the Set data type. 2014-07-19 18:24:39 -04:00
Louis Dionne
d1cc466342 Map: add missing include 2014-07-19 17:55:34 -04:00
Louis Dionne
97386dfb59 Add the Map data type. 2014-07-19 17:17:14 -04:00
Louis Dionne
61576fc1ae Functor: improve laws and check them widely 2014-07-19 15:08:58 -04:00
Louis Dionne
120410868e Searchable: add the find_key method 2014-07-19 13:42:46 -04:00
Louis Dionne
888e84f4e5 Foldable: Remove lazy_foldr and lazy_foldl 2014-07-19 13:29:41 -04:00