Commit Graph

93 Commits

Author SHA1 Message Date
Louis Dionne
26f59c645f [example] Avoid ambiguity with ::sqrt 2019-07-29 10:23:55 -04:00
Louis Dionne
c334974abe [type] Make metafunction & friends SFINAE friendly
Also add a section to the tutorial showing how to use this functionality.
2018-06-19 21:07:14 -07:00
Louis Dionne
d9da8776aa Work around nasty GCC 7 regression
This allows making the GCC 7 Travis job non-optional. When/if the bug
gets fixed and patched in GCC 7, the work around can be undone.

Bug report: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81525
2017-07-23 10:07:13 -07:00
Louis Dionne
9895803ede Bump copyright year to 2017 2017-01-07 14:14:18 -08:00
Louis Dionne
9fe9d2f0d7 Make sure concepts inherit from an integral_constant
Fixes #269
2016-11-17 08:41:27 +01:00
Louis Dionne
edbbffeea4 [type] Add hana::typeid_ and deprecate hana::decltype_
Closes #290
2016-07-17 17:28:57 -07:00
Louis Dionne
b1696fe0cc [Metafunction] Do not automatically call decltype_ on metafunction arguments 2016-02-15 10:07:08 -05:00
Louis Dionne
23c3edc93b [NFC] Un-Doxygenize comments in non-header files 2016-02-04 11:07:41 -05:00
Louis Dionne
e3f2ad9cef [doc] Add a section on compile-time branching in the tutorial
Closes #147
2016-01-22 10:03:39 -05:00
Louis Dionne
f7a2ac5f45 [examples] Use to_tuple instead of to<tuple_tag> 2016-01-18 17:31:59 -05:00
Louis Dionne
c41a5cb6be Update copyright notices for 2016 2016-01-01 14:54:06 -05:00
Louis Dionne
129c80b0ce [Tutorial] Document when-based tag-dispatching
Closes #173
2015-11-29 11:20:01 -05:00
Louis Dionne
a41f63693b [Tutorial] Complete the section on external adapters 2015-11-15 15:16:31 -05:00
Louis Dionne
3707877225 [Iterable] Remove the tail function
Closes #158
2015-11-11 14:08:36 -05:00
Louis Dionne
8a643a9c14 [optional] Make the interface closer to that of std::optional
Also remove `only_when`, which is frankly not very useful.
2015-10-12 11:29:37 -04: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
4f1cbf58e9 [tutorial] Improve the section on container types and creation 2015-09-13 16:09:03 -04:00
Louis Dionne
272e583ce5 [tuple] Optimize find_if and do minor refactoring 2015-09-12 15:07:52 -04:00
Louis Dionne
da0a8281d1 Replace decltype(xxx_c) patterns by their actual types 2015-09-09 15:26:19 -04:00
Louis Dionne
cf56c3ab83 [Doc] Document new-style concepts and remove core/models.hpp 2015-09-05 19:27:38 -04:00
Louis Dionne
fd5e3ca715 [Concepts] Define concepts as template structs instead of using models<>
The `models<>` machinery added unnecessary complexity for little benefit.
Also, this makes Hana's concepts syntactically closer to concepts lite,
which should contribute to making them easier to grasp at first sight.
2015-09-05 19:25:01 -04:00
Louis Dionne
ac4e3bc56e [Tutorial] Use vector_tag instead of Vector in tutorial example 2015-09-03 13:29:17 -04:00
Louis Dionne
79db7e90df [range] Rename Range to range_tag 2015-09-02 21:59:05 -04:00
Louis Dionne
5cec8b3e2e [tuple] Rename Tuple to tuple_tag 2015-09-02 21:59:04 -04:00
Louis Dionne
9168cc4ce8 [map] Rename Map to map_tag 2015-09-02 21:59:04 -04:00
Louis Dionne
4e3d17bd3b [Core] Do not use a nested ::hana struct to hold the tag.
This was annoying because

(1) We couldn't use the name hana:: from within the struct
(2) It requires one more instantiation unless you use the
    `using hana = self` trick. But that trick makes something
    that should be trivial to do slightly harder, and that is stupid.
2015-09-02 21:59:03 -04:00
Louis Dionne
f3d9df96d0 [Core] Rename datatype<> to tag_of<>
Also, rename the nested hana::datatype alias to hana::tag.
2015-09-02 21:59:03 -04:00
Louis Dionne
08f66d47c1 [IntegralConstant] Suffix variable templates with _c, and clean up type names
Along with PR #166, this closes #122 because names have now been
cleaned up and are now consistent basically everywhere.
2015-09-01 16:34:04 -04:00
Louis Dionne
0e8913fa3c [Doc] Use implementation-defined instead of unspecified-type
Also, update the tutorial to reflect the fact that container types
are now sometimes specified.
2015-08-31 13:42:15 -04:00
Louis Dionne
d8b08aa43c [Doc] Promote Metafunction from data type to concept, and document as such 2015-08-31 12:59:22 -04:00
Louis Dionne
c2ed70ddf9 [Doc] Document hana::type instead of hana::Type
Precisely,
1. Rename hana::_type to hana::basic_type, and document it
2. Rename hana::type<> to hana::type_c<>
3. Create and document the hana::type<> type
2015-08-30 17:08:06 -04:00
Louis Dionne
d0492da082 [Doc] Document hana::integral_constant instead of hana::IntegralConstant 2015-08-30 17:07:19 -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
08b3db1708 [Examples] Modularize and use qualified names
This patch modularizes the examples, makes them self-contained and
also uses qualified hana:: names.

Fixes #139
Fixes #126
2015-08-15 17:50:40 +02:00
Louis Dionne
78f056a25c [example.switchAny] Update the tutorial to use hana::pair and default_t instead of _default 2015-07-28 20:23:21 +02:00
Louis Dionne
70cd321751 [example.SwitchAny] Use Hana's pair instead of broken std::pair
libc++'s std::pair always has a default constructor, and it is ill-formed
when the members are not default constructible. We need it to be SFINAE
friendly. See https://llvm.org/bugs/show_bug.cgi?id=21917.
2015-07-26 12:42:20 +02:00
Louis Dionne
8a0ddb0fa7 [Closure] Reimplement the closure to be almost standards-conforming
Also, use that closure to implement basically all containers.
The new closure compresses empty types.

Fixes #123
Fixes #93
Fixes #89
2015-07-26 12:42:20 +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
dcfdb09ff9 [Struct] BOOST_HANA_ADAPT_STRUCT does not require the types of the members
Fixes #152
2015-06-28 21:01:09 +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
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
c4ac6d67be [Doc] Make the quickstart examples self-contained
Fixes #137
2015-06-18 21:39:27 -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
78fa94047e [Example] Remove unused include_set.cpp file 2015-06-12 15:23:07 -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
7a4919e69d [MonadPlus] Swap the arguments of prepend and prefix 2015-06-08 18:13:04 -04:00
Louis Dionne
406cb49cc2 [Doc] Daily documentation improvements
- Improve the brief description of make<XXX>
- Rewrite the rationale for unspecified container types
- Update comments on some runtime benchmarks
- Rename std::decay_t(...) to std::decay_t<...> in Tuple reference
- Document data types as being Tags, not types themselves
2015-06-07 14:35:08 -04:00
Louis Dionne
898e9aa07f [Doc] Improve the documentation as suggested by @tzlaine (Part 2)
- Extend the Quick Start with more small examples, and then the large
  switchAny example.
- Add clarifying remarks right in front of the CheatSheet for skimmers.
  Damn skimmers.
- Benchmark the compile-time of creating std::array
2015-06-05 18:47:41 -04:00
Louis Dionne
077dc7b6c9 [Iterable] Normalize parameter order for at and drop
Partially addresses #83
2015-06-04 21:13:51 -04:00