Commit Graph

202 Commits

Author SHA1 Message Date
Jason Rice
6d086796a3 [index_if] New index_if function
- Adds index_if
    - Rewrites detail::index_if to use recursive alias stuff
      optimized for tuple and basic_tuple
    - find_if now uses index_if for Iterables
    - at_key now uses index_if for Sequence
    - Removes duplicate code and unnecessary special case implementations
        - detail::advance_until
        - at_key::advance_until
        - tuple_tag implementation of find_if
    - Uses Foldable instead of Sequence for cases where length is known.
      (find_if had a specialization when Iterable and not Sequence)
    - Adds test.*.auto.index_if for Sequences
    - Adds test support/counter for testing infinite iterables
2017-04-07 16:19:52 -07:00
Louis Dionne
9895803ede Bump copyright year to 2017 2017-01-07 14:14:18 -08:00
Louis Dionne
81ddcfafaf Rename take to take_front
This improves consistency:
drop_front/drop_back
take_front/take_back
2016-01-12 10:10:03 -05:00
Louis Dionne
131c56c32a Add the take_back algorithm 2016-01-12 10:00:11 -05:00
Louis Dionne
ed308613a8 [doc] Fix issue with undocumented boost::hana namespace 2016-01-09 14:16:55 -08:00
Louis Dionne
c41a5cb6be Update copyright notices for 2016 2016-01-01 14:54:06 -05:00
Louis Dionne
850dbf7ad7 Provide an experimental print function
Closes #200
Closes #219
2015-12-09 14:47:13 -05:00
Louis Dionne
56d4c499ad Use a macro to open and close Hana's namespace
Note, however, that we're not using inline namespaces yet.
Using a macro to open/close the namespace would however make
such a change trivial.
2015-11-17 09:33:21 -05:00
Louis Dionne
a41f63693b [Tutorial] Complete the section on external adapters 2015-11-15 15:16:31 -05:00
Louis Dionne
b5e82061d8 Provide macros to detect the version of the library
Closes #189
2015-11-13 14:25:33 -05:00
Louis Dionne
3707877225 [Iterable] Remove the tail function
Closes #158
2015-11-11 14:08:36 -05:00
Louis Dionne
42934900b8 [Struct] Add the BOOST_HANA_ADAPT_ADT macro
Also
- Reorganize adaptation macro unit tests
- Add BOOST_HANA_PP_DROP_FRONT and BOOST_HANA_PP_FRONT macros
2015-09-22 13:37:49 -07:00
Louis Dionne
cf063a4fe3 Return hana::integral_constants from type_traits adapters
Also, remove the ext/std/{type_traits,utility} headers in favour of the
<boost/hana/traits.hpp> header.
2015-09-21 07:45:04 -07:00
Louis Dionne
41c64b39a9 [IntegralDomain] Rename quot/rem to div/mod
Fixes #180
2015-09-14 14:18:29 -04:00
Louis Dionne
1d7b720c95 [Enumerable] Remove that concept entirely.
Enumerable was not being used inside the library, and its usefulness
was questionable due to the lack of upper/lower bounds.

Closes #23
2015-09-12 17:59:58 -04:00
Louis Dionne
136ba9be56 [IntegralConstant] Add the repeat algorithm
Fixes #100
2015-09-09 15:37:31 -04:00
Louis Dionne
a7f25d124e [slice] Accept an arbitrary Foldable of indices, and remove subsequence
Fixes #84
2015-09-08 17:29:54 -04:00
Louis Dionne
5d02750150 Improve diagnostics for supported compilers and standard libraries
Closes #172
Closes #168
2015-09-08 08:25:07 -04:00
Louis Dionne
423bc7220a [MonadPlus] Rename repeat to replicate 2015-09-07 22:43:35 -04:00
Louis Dionne
f4530d3058 Add a master header for the boost/hana/concept subdirectory 2015-08-31 17:27:40 -04:00
Louis Dionne
307f0d8c50 Add the lexicographical_compare algorithm 2015-08-26 13:40:11 -04:00
Louis Dionne
f373b421f9 [Headers] Minimize the #includes in headers
- Allow specializing models_impl with a forward declaration only
- Modularize remaining concept headers
- Include <boost/hana.hpp> in unit tests to ease the transition
- Add the core/dispatch.hpp header to reduce the number of boilerplate includes
2015-08-26 11:27:28 -04:00
Louis Dionne
32627e2463 [Doc] Properly document the boost::hana::literals namespace 2015-08-25 17:51:39 -04:00
Louis Dionne
529f1cd459 [Either] Remove entirely
I had been unsatisfied with Either for a while now, thinking it might
be useless. I am now convinced that it is useless, and I hence remove
it from the library altogether.
2015-08-24 13:21:25 -04:00
Louis Dionne
9771a2f0ed [Doc] Re-document the Functional module. 2015-08-09 09:00:31 +02:00
Louis Dionne
fd63f651d0 Add basic_tuple, a minimal version of the tuple 2015-08-08 13:16:02 +02:00
Louis Dionne
d3b7cb2c85 Modularize the headers
This (large) commit introduces the following changes:
- Each algorithm lives in its own header
- The concepts are defined in the concept/ subdirectory. They define the
  `models` metafunction, some explicit default implementations (like
  Applicative::transform_impl), and they include all the algorithms
  related to that concept.
- Removed the `until` method from Logical
- Removed the `drop_until` method from Iterable
- [minor] Added the detail::nested_to utility

Closes #160
2015-07-25 16:20:47 +02:00
Louis Dionne
83c3b4781e [Doc] Move the tutorial out of hana.hpp
Fixes #161
2015-07-07 21:26:11 +02:00
Louis Dionne
508d59cab9 [Doc] Add a cheatsheet for the data types.
Fixes #124
2015-07-02 00:22:53 +02:00
Louis Dionne
52b150951d [Doc] Move prerequisites and installation to the tutorial
Fixes #128
2015-06-30 21:58:35 +02:00
Louis Dionne
af7db4c80e [Doc] Fix typo "names" => "named"
Thanks @Manu343726
2015-06-29 19:28:39 +02:00
Louis Dionne
c6045da6ee [Sequence] Use underscores instead of dots to name zip variants
Also, remove unzip since it is easily implemented with unpack and zip.

Addresses #114
2015-06-28 11:43:29 +02:00
Louis Dionne
b851f5a1cb [Doc] Rename 'head' to 'front' in the tutorial 2015-06-28 10:45:09 +02:00
Louis Dionne
09955bf1b7 Use drop_front/drop_back front/back instead of asymmetrical names
- Replace init by drop_back and drop_back_exactly
- Rename head to front
- Rename last to back, and also rewrite the default implementation
  in terms of at instead of using (inefficient) recursion.
- Rename drop[_exactly] to drop_front[_exactly]
- Remove drop_c

Note that tail is kept for the moment because it is part of Iterable's
MCD. Removing tail will be the subject of a different issue.

Fixes #66
2015-06-28 10:44:28 +02:00
Louis Dionne
f82efebe76 [Docs] Add a note about the precision of benchmarks
Fixes #154
2015-06-26 15:58:01 -04:00
Louis Dionne
1b45d87a42 [Iterable] Rename drop.at_most to drop and drop.exactly to drop_exactly
Partially addresses #114
2015-06-21 12:08:23 -04:00
Louis Dionne
46207eed20 [Sequence] Rename take.at_most to take, and take.exactly to take_exactly
Partially addresses #114
2015-06-21 11:50:02 -04:00
Louis Dionne
1959c49f4b [Doc] Precise the rationale about tag dispatching
Explain that it forces the user to check semantic requirements.

Addresses #144
2015-06-21 10:00:52 -04:00
Louis Dionne
93a3cc8f75 [Doc] Add a rationale for using tag-dispatching
Also, precise how the branches of the if_ are affected by the semantics
of the capture.

Fixes #144
2015-06-20 17:48:01 -04:00
Louis Dionne
c4ac6d67be [Doc] Make the quickstart examples self-contained
Fixes #137
2015-06-18 21:39:27 -04:00
Louis Dionne
61103afeeb [Doc] Add rationale for name choices and parameter order in the general case 2015-06-15 16:23:16 -04:00
Louis Dionne
7150695767 [Foldable] Use underscore syntax for monadic folds
Also,
- Fix broken reference to fold_right/fold_left in the cheatsheet

Partially addresses #114
2015-06-14 16:56:24 -04:00
Louis Dionne
b5a9a2e2c9 [Foldable] Rename fold.{left,right} to fold_{left,right}
Fixes #106
2015-06-14 10:07:04 -04:00
Louis Dionne
7fb312a225 [Doc] Superclass -> Refined concept
Fixes #102
2015-06-13 15:26:26 -04:00
Louis Dionne
4958b6d5ac [Doc] Various documentation improvements
- Rename "tag-dispatching" -> "tag dispatching"
- Split conclusion
- Add section on Tags
- Remove usages of "generalized types"
- Document the syntax of function signatures

Closes #94
2015-06-13 13:32:39 -04:00
Louis Dionne
93067e0176 [Doc] Add rationale for using our own Tuple type
Addresses #88
2015-06-13 09:58:05 -04:00
Louis Dionne
35cdf3b83a [Struct] Implement macros using ERB templates instead of Boost.Preprocessor
This is done because the resulting macros are much more straightforward
to debug when a user makes a mistake. Also, it avoids pulling yet another
dependency.

Also added some general purpose macros in detail/preprocessor.hpp.
2015-06-10 15:50:35 -04:00
Louis Dionne
4deb7c8bf1 [Doc] Add note about the meaning of Hana in Japanese and Korean 2015-06-10 10:17:18 -04:00
Louis Dionne
9928dea216 [Traversable] Remove that concept entirely
That concept was added more for completeness than for actual usefulness,
since I have not used it a single time since its creation. Given the
complexity of the library, I think it is better to remove it and shrink
the library to a more useful core than giving too many features that
contribute to bloat.

Also, the laws were difficult to check and it hence Traversable models
were not very well tested anyway.

I can always roll this back if someone shows me how Traversable is
actually useful for metaprogramming.
2015-06-10 10:07:55 -04:00
Louis Dionne
e32cafbf29 [Doc] Add a note about some data structures not being optimized. 2015-06-08 23:09:05 -04:00