Commit Graph

51 Commits

Author SHA1 Message Date
Samuel Debionne
4a5ee58b29 Add a is_valid test for non static member functions 2019-05-10 12:13:37 -06: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
9895803ede Bump copyright year to 2017 2017-01-07 14:14:18 -08:00
Louis Dionne
28f5a6bf74 [tests] Clean up some tests using ::Tracked 2016-09-18 12:12:55 -07:00
Louis Dionne
edbbffeea4 [type] Add hana::typeid_ and deprecate hana::decltype_
Closes #290
2016-07-17 17:28:57 -07:00
Louis Dionne
7c0d6bd23e [test/is_valid] Remove invalid usage of member template in local class 2016-03-04 12:38:27 -05:00
Louis Dionne
3a2ad0b2b5 [Hashable] Improve documentation and tests 2016-02-16 15:24:23 -05: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
e1d001cf06 [tests] Modularize tests for hana::metafunction & al 2016-01-10 18:00:05 -05:00
Louis Dionne
a4ec52dac0 [type] Modularize the unit tests 2016-01-04 11:18:45 -05:00
Louis Dionne
647ad436b0 Reorganize the unit tests and increase the overall coverage. 2014-11-04 08:54:58 -05: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
1104f76d48 Add perfect forwarding in some places in Tuple 2014-10-04 20:13:14 -04:00
Louis Dionne
2d10fb461a Use minimal includes in unit tests. 2014-09-01 18:14:55 -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
356ee03483 Refactor the unit tests and remove some minimal instances 2014-08-09 17:49:16 -04:00
Louis Dionne
d132db0ebf Use finer grained assertions acknowledging Constants 2014-08-05 10:37:54 -04:00
Louis Dionne
9ca69bca71 Type: revert commit making metafunction & al SFINAE friendly 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
7d5243a312 Type: fix bug in construction and force explicit use of intializer_list 2014-07-24 08:48:38 -04:00
Louis Dionne
61576fc1ae Functor: improve laws and check them widely 2014-07-19 15:08:58 -04:00
Louis Dionne
2eb9867ec5 Comparable: Check laws widely 2014-07-16 17:12:19 -04:00
Louis Dionne
83bd276b3e Modularize Functor 2014-07-16 16:26:22 -04:00
Louis Dionne
48bb45394f Type: add a not-too-dirty way to optimize metafunction classes. 2014-07-07 21:33:06 -04:00
Louis Dionne
573c863c49 Type: make metafunction, metafunction_class and template_ valid metafunction classes. 2014-07-07 20:05:11 -04:00
Louis Dionne
5efa23003f Rename join to flatten. 2014-07-01 22:04:56 -04:00
Louis Dionne
70a6c913b7 Type: refactor the interface 2014-07-01 17:32:32 -04:00
Louis Dionne
159dbaecf6 Type: improve support for different metafunctions and rename lift 2014-06-22 10:31:10 -04:00
Louis Dionne
fa98685327 Move unit from Monad to Applicative and remove pure. 2014-06-21 19:29:28 -04:00
Louis Dionne
dfed9d39e7 Type: add lift and remove trait.hpp header 2014-06-21 14:09:08 -04:00
Louis Dionne
b185b652d7 Type: minor refactoring 2014-06-18 10:24:20 -04:00
Louis Dionne
ee9681f7aa Minor ungrouped improvements and bug fixes. 2014-06-16 08:17:08 -04:00
Louis Dionne
77c925d239 Add examples in Foldable and add the sizeof_ method 2014-06-13 22:16:12 -04:00
Louis Dionne
809101956b Type: add construction capabilities 2014-06-09 18:22:33 -04:00
Louis Dionne
ee6c805ca8 Type: decouple library from its internal representation 2014-06-09 10:39:05 -04:00
Louis Dionne
2567066828 Type: documentation and decoupling 2014-06-08 16:41:52 -04:00
Louis Dionne
b694f5e465 Integral: Strip cv-qualifiers of the integral type. 2014-06-05 21:17:06 -04:00
Louis Dionne
5b4d569962 Type: Add decltype_ and remove coupling. 2014-06-04 21:24:19 -04:00
Louis Dionne
91689fe4f0 Make the header comment and license uniform. 2014-06-03 11:46:24 -04:00
Louis Dionne
6215e82a01 Improve type traits and partially document Integral. 2014-06-02 21:49:36 -04:00
Louis Dionne
418b8941ad Test Functor laws and modify Type's fmap. 2014-05-31 10:40:21 -04:00
Louis Dionne
5f616bb4f5 Add the Monad typeclass and make Type a Monad. 2014-05-27 11:01:20 -04:00
Louis Dionne
05593b652c Redefine lift as an equivalence of categories.
This allows us to mechanically translate most type traits, which is
a good hint that we've found a way to merge type computation with
value computation. The problematic type traits will be tackled later.
2014-05-24 19:06:41 -04:00
Louis Dionne
bea47fa4d2 Add examples. 2014-05-24 13:28:48 -04:00
Louis Dionne
d1133c917b Split type and traits into two headers. 2014-05-24 12:39:12 -04:00
Louis Dionne
fe1e29bfa9 Fix incorrect use of static_assert. 2014-05-20 17:26:02 -04:00
Louis Dionne
abc623cc09 Use nastier types in mpl_equivalent test. 2014-05-20 14:36:20 -04:00
Louis Dionne
b66c0e8c14 Add list_t. 2014-05-20 13:50:44 -04:00