Commit Graph

557 Commits

Author SHA1 Message Date
Louis Dionne
68dfc99b11 [Doc] Improve the section on tag-dispatching 2015-05-26 11:51:53 -04:00
Louis Dionne
6159007c15 [IntegralConstant] Write proper unit tests for .times and .times.with_index 2015-05-26 11:20:03 -04:00
Louis Dionne
f81f732390 Convert some RUNTIME_ASSERTs into RUNTIME_CHECKs 2015-05-26 10:52:38 -04:00
Louis Dionne
7f98ff0edd [Doc] Write a section about the different kinds of C++ computations 2015-05-25 16:27:16 -04:00
Louis Dionne
6718adbf5e [Doc] Rewrite the 'quick start' section of the tutorial 2015-05-25 10:16:48 -04:00
Louis Dionne
6ee5137604 [GCC] Workaround GCC ICEs and bugs 2015-05-24 21:00:27 -04:00
Louis Dionne
dc909f8900 [GCC] Remove unused parameter warnings and disambiguate use of size_t 2015-05-24 21:00:26 -04:00
Louis Dionne
aa2edb08ce [CMake] Reduce the number of targets and modularize the code 2015-05-22 16:23:54 -04:00
Louis Dionne
0660af6a8f [GCC] Initial port to GCC
- Fix ambiguous specialization in core/datatype
- [Config] Turn #errors into #warnings
- Qualify recursive calls to `apply` to make sure the right function is selected
- Remove usages of when_valid to workaround ambiguous specializations
- Use multiline comments to remove some GCC warnings with LaTeX's double backslash
- Specialize operators::of in the boost::hana::operators namespace
- Manually perform more conversions in constexpr-context
- Workaround the lack of support for constexpr-but-non-const member functions
- Disambiguate unqualified uses of size_t with hana::size_t and ::size_t
2015-05-20 16:56:34 -04:00
Louis Dionne
90ddffe54d [Sequence] Add the cartesian_product method
Also, replace the old tuple_cartesian_product by a newer, slightly
more efficient but much simpler version.
2015-05-19 11:55:50 -04:00
Louis Dionne
daea3549d5 [Struct] Add the keys method to Structs 2015-05-14 16:42:56 -06:00
Louis Dionne
71dc2a8f40 [Example] Fix typo and modernize slightly 2015-05-09 15:38:59 -04:00
Louis Dionne
3e0838b1e2 [Functional] Move reverse_partial from detail to functional 2015-05-04 14:01:45 -04:00
Louis Dionne
6ca6501278 [Searchable] Refactor the interface
- Rename elem to contains
- Rename subset to is_subset, and make is_subset applicable in infix notation
- Add the at_key method
- operator[] is now bound to at_key instead of find
2015-05-04 12:33:51 -04:00
Louis Dionne
334cbeb188 [Tuple] Allow brace-initializing tuple members
Fixes #57
2015-05-03 13:34:51 -04:00
Louis Dionne
dc56f6cebc [String] Add conversion to char const* and minor refactoring
Also
- remove useless value_type alias in String since it's not a Constant
- document why the interface is so minimal
2015-05-02 15:24:25 -04:00
Louis Dionne
b2145a2640 [IntegralConstant] Fix a bug with the .times function
Passing a normal function to .times would fail
2015-05-01 19:41:22 -04:00
Louis Dionne
fba9abc845 [README] Make sure the overview fits in the frame 2015-05-01 15:58:09 -04:00
Louis Dionne
3568186dac [Type] Add the is_valid utility.
Also refactor the overview in the README.
2015-05-01 15:54:22 -04:00
Louis Dionne
e6d0fa9487 [CMake] Use Find modules to find optional external libraries 2015-04-28 10:46:44 -04:00
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
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
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
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
ac2f5222cd [Travis] Run the unit tests under valgrind 2015-04-18 22:36:40 -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
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
e60827d02d [Example] Add a funny use case for user defined literals 2015-04-11 14:11:24 -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
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
08e55a7bb6 Rework the relations between Foldable, Iterable and Searchable. 2015-04-10 17:46:14 -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
3053736ddd [Tuple] Optimize the equal method 2015-04-08 11:30:00 -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
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
0819846fba [Example] Add a sequence based implementation of overload_linearly 2015-04-06 15:10:27 -04:00
Louis Dionne
84bc1a6a06 [Functional] Group the examples into a single file 2015-04-06 14:58:04 -04:00
Louis Dionne
125fd45bfd [Functional] Add the overload_linearly utility 2015-04-06 14:11:42 -04:00
Louis Dionne
1d7f28f941 [CMake] Improve the build system
- Simplify the compiler flag logic
- Use WARNING instead of STATUS to report caveats
- Allow specifying a custom libc++ root directory
2015-04-02 00:50:58 -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
3986e3c870 [Sequence] Fix compilation error in Sequence example 2015-03-31 19:57:09 -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
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
a98d32cae1 [Maybe] *just(x) is now equivalent to from_just 2015-03-29 10:39:04 -04:00
Louis Dionne
637c5270ab [Functional] Add hana::capture 2015-03-28 22:22:13 -04:00
Louis Dionne
2ecedc140c [Functional] Add the iterate combinator 2015-03-25 12:26:04 -04:00
Louis Dionne
afa9171eec [Foldable] Add fold and reverse_fold aliases 2015-03-22 17:18:26 -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
519b4cfb82 [Examples] Make the indexed_sort more generic 2015-03-22 10:58:21 -04:00
Louis Dionne
317724ac8c [Example] Add an example of sorting types but keeping the initial indices 2015-03-20 14:30:17 -04:00
Louis Dionne
466bb3c1ad Add the Comonad concept and refactor Lazy 2015-03-20 11:55:32 -04:00
Louis Dionne
2d1edb14ff [CMake] Disable some failing Fusion unit tests 2015-03-20 00:44:23 -04:00
Louis Dionne
dbde9d84c4 [Mini-MPL] Make find/find_if SFINAE-friendly 2015-03-15 12:54:35 -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
ee329961b2 [Tutorial] Add a section on assertions 2015-03-13 12:14:35 -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
ceba2336c3 [Examples] Add an example of compile-time printf formatting 2015-03-12 15:00:15 -04:00
Louis Dionne
56484a3ac9 [CMake] Improve the build system and the targets
- Split targets to compile and run tests
- Add run.* targets to run each target
2015-03-12 14:44:14 -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
39079fa95a [Foldable] Add monadic folds 2015-03-10 09:30:07 -04:00
Louis Dionne
ea601ddf60 [Maybe] Add the sfinae utility 2015-03-10 09:30:06 -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
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
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
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
fb7cbdf13a [Sequence] Add missing examples 2015-03-04 14:30:41 -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
244c7a6688 [README] Use make_tuple instead of make<Tuple> in the overview. 2015-03-03 13:23:56 -05:00
Louis Dionne
fc12cee6e5 [Tutorial] Add sections on amphibian algorithms and semantics 2015-03-03 13:19:06 -05:00
Louis Dionne
462383e35d [Example] Add more intrinsics to the mini-MPL 2015-03-02 09:16:58 -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
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
c13f660ecc [MonadPlus] Add signatures and rename nil to empty 2015-02-25 09:19:58 -05:00
Louis Dionne
0f197ea93a [Core] Properly document models and add examples 2015-02-24 19:54:22 -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
6b8532c38c [Example] Fix missing includes in type_computations.cpp 2015-02-23 21:55:17 -05:00
Louis Dionne
1df1b62a8a [Assert/String] Use models instead of is_a 2015-02-23 21:46:43 -05:00
Louis Dionne
df97a4dfc1 [Set] Add a model of Foldable 2015-02-23 15:04:45 -05:00
Louis Dionne
3e78af4bcb [Tuple] Use make<Tuple>(...) instead of tuple(...) 2015-02-22 16:50:01 -05:00
Louis Dionne
a25e84cf3b [Doc] Refactor the tutorial 2015-02-22 16:50:00 -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
7ceadaae67 [Tuple] Add examples and slightly improve tests 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
ec7336796b [README] Add example of tuple indexing with [] in the README 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
4d06bf69fe [Core] Refactor documentation and bring back stuff from split_methods branch 2015-02-20 11:05:44 -05:00
Louis Dionne
9604c9a9f6 Replace List by Sequence 2015-02-20 11:05:43 -05:00
Louis Dionne
d5dafc8e35 [Either] Add missing include to examples 2015-02-18 17:14:19 -05:00
Louis Dionne
272ffa7900 Add the MonadPlus concept 2015-02-17 15:11:07 -05:00
Louis Dionne
02c9c47510 Remove TypeList and IntegerList 2015-02-15 12:38:04 -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
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
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
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
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
61d59eff57 [Core] Refactor the conversion system, hana::common and add hana::default 2015-02-10 18:02:32 -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
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
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
ee648c2bda [Core] Fix issue with when_valid 2015-02-04 23:02:04 -05:00
Louis Dionne
4654c6786a Split instances for foreign types 2014-12-06 16:30:16 -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
ec8e7446a0 CppCon Matrix: Implement the one method 2014-11-30 11:38:48 -05:00
Louis Dionne
f0919d1761 Use List::repeat instead of handwritten one in the Matrix example. 2014-11-30 11:38:48 -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
d042abda97 Automatically test including individual headers. 2014-11-12 11:22:53 -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
e0e2501931 List: add the remove_at method 2014-11-08 12:32:51 -05:00
Louis Dionne
b9472015d1 Add the overload utility to Functional 2014-11-07 20:31:26 -05:00
Louis Dionne
0f0c2c4430 Replace when<is_valid<...>> by when_valid<...> 2014-11-07 15:41:10 -05:00
Louis Dionne
98a39c1204 Remove superfluous #define BOOST_PP_VARIADICS 1. 2014-11-07 10:57:48 -05:00
Louis Dionne
049046478e Move ASSERT macros out of the details 2014-11-04 09:43:44 -05:00
Louis Dionne
bc58bef03e Update the overview in the readme to use constexpr when possible. 2014-11-04 09:09:54 -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
57087cd249 Functional: make lockstep's syntax like demux's 2014-11-04 08:54:59 -05:00
Louis Dionne
e66473a0a9 Fix broken link to example in the doc. 2014-10-28 08:12:17 -04:00
Louis Dionne
eddece8d00 Use the nested hana struct to define enabled operators. 2014-10-27 16:31:03 -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
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
806b941603 Instantiate Searchable and Iterable with String. 2014-10-21 23:53:28 -04:00
Louis Dionne
ac528b81ba Add the insert function to Set. 2014-10-17 18:29:50 -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
f0d9e9b9bb Add the intersperse method to List. 2014-10-16 16:56:39 -04:00
Louis Dionne
88579de954 Allow folding move-only rvalue Records by constraining accessors. 2014-10-11 14:26:39 -04:00
Louis Dionne
ec93fc5dd4 Use BOOST_HANA_RUNTIME_ASSERT instead of assert in the tutorial 2014-10-04 23:12:46 -04:00
Louis Dionne
1104f76d48 Add perfect forwarding in some places in Tuple 2014-10-04 20:13:14 -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
a7525b71e3 Fixes #8 2014-09-16 19:41:06 -04:00
Louis Dionne
ac9bd151fb Fixes issue #7 2014-09-16 11:27:51 -04:00
Louis Dionne
18fef19050 List: add the repeat method 2014-09-11 08:22:12 -07:00
Louis Dionne
19b7ca2c7d Minor fixes with newest clang 2014-09-09 17:38:06 -07:00
Louis Dionne
9fbf074c55 Record: refactor macros to make them more user-friendly 2014-09-09 13:01:11 -07:00
Louis Dionne
1b021fcd89 Record: Allow instantiating with macros. 2014-09-09 10:32:04 -07:00
Louis Dionne
7a3dd8ae8a Example: Add the homogeneous Matrix example for CppCon. 2014-09-04 09:30:12 -04:00
Louis Dionne
444ffa8d48 Improve the documentation for IntegralConstant 2014-09-03 11:06:46 -04:00
Louis Dionne
028e672822 Refactor examples and fix broken links 2014-08-30 17:18:26 -04:00
Louis Dionne
8f593765a8 Set: improve Comparable example 2014-08-30 14:38:21 -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
919bc2f465 Move for_each to Foldable and optimize it with unpack 2014-08-28 12:53:33 -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
7cc729bd05 List: add the slice method 2014-08-25 12:33:48 -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
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
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
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
fecf7309d1 Add the Group type class 2014-08-07 17:01:22 -04:00
Louis Dionne
b46db0bdc0 Add the Monoid type class 2014-08-07 16:51:49 -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
ae9a849e2f README: make the overview narrower so we can see it all 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
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
f992faa91e Remove std::list adaptor; Iterable requires a Constant is_empty. 2014-08-05 12:14:40 -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
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
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
36edeacbc8 Maybe: refactor the documentation and add only_when 2014-07-29 10:09:06 -04:00
Louis Dionne
fda839dfb4 Show permutations in the overview. 2014-07-28 19:53:22 -04:00
Louis Dionne
412c52d9fc README: Use a more representative Hello World 2014-07-28 19:44:30 -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
aafd11ed82 Remove redundant examples introduced when refactoring the docs. 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
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
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