Commit Graph

171 Commits

Author SHA1 Message Date
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
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
97c86a064b [Doc] Remove references to tuple_t from the benchmarks 2015-08-30 17:04:57 -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
a62ab5cb29 [at_c] Use a function instead of a variable template, and optimize
Using a function instead of a variable template allows us to provide an
optimized version for hana::tuple more easily. It also fixes some issues
on GCC.
2015-08-26 11:27:27 -04:00
Louis Dionne
54171139bc [Benchmarks, Doc] Update version of the Github.js lib and improve chart.html 2015-08-24 11:47:40 -04:00
Louis Dionne
55dfe66fe8 [cartesian_product] Benchmark on larger datasets 2015-08-23 13:49:17 -04:00
Louis Dionne
e42ce66d26 [Set,Map] Optimize several methods
Fixes #63
2015-08-23 12:00:59 -04:00
Louis Dionne
279e4bb4b8 [Benchmarks] Fix broken benchmarks for set theoretic operations 2015-08-23 09:33:27 -04:00
Louis Dionne
12c4deeece [Set] Add missing set theoretic operations
Closes #119
2015-08-23 08:36:21 -04:00
Louis Dionne
fd491ef9fb [Map] Fix broken benchmark of is_disjoint 2015-08-23 07:52:15 -04:00
Louis Dionne
e5e1f761f9 [Searchable] Add the is_disjoint algorithm
Partially addresses #119
2015-08-12 22:00:32 +02:00
Louis Dionne
fd63f651d0 Add basic_tuple, a minimal version of the tuple 2015-08-08 13:16:02 +02:00
Louis Dionne
0ccc0fb342 [Benchmarks] Depend on all the .cpp benchmark files instead of just the .erb.json
This way, the benchmarks will be re-generated when we modify one of the
.cpp files.
2015-08-08 13:16:02 +02:00
Louis Dionne
9d74084996 Remove take_until and some xxx_exactly variants
Of the xxx_exactly variants, only drop_front_exactly is kept for now,
because it actually allows an optimization. The other ones did not
really provide a compile-time improvement, so they are removed.
2015-07-26 12:42:20 +02:00
Louis Dionne
bbfd3b8a9e [Travis] Add a Travis job building with Clang + libstdc++
Also, add -ftemplate-depth=-1 in the benchmarks to avoid failures
due to hitting the recursive template instantiation limit.

Fixes #159
2015-06-30 23:53:46 +02:00
Louis Dionne
1e89c69049 [CMake] Remove LIBCXX_ROOT cruft and properly explain the situation in the README
Also:
- Remove the boost_hana_add_executable function, which is now useless
- Properly set the LD_LIBRARY_PATH to link against a custom libc++
- Adjust the Travis build

Fixes #135
2015-06-24 20:07:13 -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
daf8fdfa45 [Benchmarks] Only enable fold_right benchmarks for Fusion with Boost 1.57.0
reverse_fold on Boost.Fusion trunk is broken too
2015-06-06 11:19:02 -04:00
Louis Dionne
0b2f32e01b [Benchmarks] Disable fold_right benchmarks on Boost 1.58.0 due to Fusion bug 2015-06-06 10:38:12 -04:00
Louis Dionne
7b1de7fe43 [Travis] Speed up the travis build
- Make sure the check.benchmarks are serialized
- Run Doxygen with Clang 3.6 instead of Clang trunk
- Download prebuilt Doxygen instead of building from source
- Run unit tests on two cores
2015-06-05 19:38:27 -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
52b8083e53 [Benchmarks] Disable line markers by default 2015-06-05 17:27:17 -04:00
Louis Dionne
f3cff75480 [Benchmarks] Disable std::tuple benchmarks on Clang 3.5.0 due to ICE 2015-06-05 10:17:30 -04:00
Louis Dionne
077dc7b6c9 [Iterable] Normalize parameter order for at and drop
Partially addresses #83
2015-06-04 21:13:51 -04:00
Louis Dionne
35f25cbc35 [Doc] Implement improvements suggested by @tzlaine (part 1)
- Remove the preface entirely
- Move the current introduction to a "Description" section
- Move the "Quadrants of computation" to the "Introduction"
- Move the current "Motivation" section to the start of the "Introduction"
- Move the section on "Introspection" higher up in the docs
- Remove the "Concept" column in the Cheatsheet, and add links to each
  individual algorithm instead.
- Add a rationale for unpack's name and parameter order
- Add `fold` and `reverse_fold` to the cheatsheet
- Mention the list of all headers in the tutorial
- Add an alphabetical index with everything in the library
- Precise that smaller is better in chart subtitles
- Add benchmarks for std::make_tuple and std::get
2015-06-04 21:13:45 -04:00
Louis Dionne
686c5c4e11 [Benchmarks] Fix missing <%# in ERB template, which caused invalid JSON output 2015-06-03 12:11:03 -04:00
Louis Dionne
a04696007d [Benchmarks] Fix legend for fusion::vector's find_if 2015-05-30 19:55:10 -04:00
Louis Dionne
2a7447e990 [Benchmarks] Fix unused variable warnings 2015-05-29 11:26:32 -04:00
Louis Dionne
32d4c973e9 [Doc] Write new tutorial sections and reorder other sections
- Write sections on containers, algorithms, and runtime performance
- Make sure examples consistently use 2 space tabs
- Disable -Wunused-parameter for examples
- Resolves #70
  The requirement of pure functions is now documented.
- Resolves #14
  It turns out that the benefits of specifying the type of containers
  seems to be essentially limited to pattern matching. This is not
  enough to justify all the bad things it brings, especially
  considering the fact that recursion (currently the only use
  case for pattern matching) forces the creation of a new tuple
  at each step, which is disastrous. The unspecified-ness of the
  container's type is now documented.
2015-05-28 17:03:46 -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
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
e6f4220295 [Tuple] Implement a more efficient partition 2015-05-06 16:00:25 -04:00
Louis Dionne
98a3c6658c [Benchmarks] Improve support for MPL11 and remove most homogeneous benchmarks 2015-05-05 18:46:00 -04:00
Louis Dionne
5181793455 [Tuple] More efficient implementation of filter, still not incredible
Also add benchmarks for filter
2015-05-05 14:05:55 -04:00
Louis Dionne
deea418ad4 [Benchmarks] Add missing include_directories for Boost headers 2015-04-28 12:57:06 -04:00
Louis Dionne
7a4db87d3c [CMake] Set the proper xxx_FOUND variables in the CMake find modules. 2015-04-28 12:50:19 -04:00
Louis Dionne
e6d0fa9487 [CMake] Use Find modules to find optional external libraries 2015-04-28 10:46:44 -04:00
Louis Dionne
62804fe7e3 [Benchmarks] Add support for Meta in the benchmarks 2015-04-28 09:51:12 -04:00
Louis Dionne
4803e54b9d [Benchmarks] Make sure Fusion benchmarks use preprocessed headers 2015-04-28 09:51:03 -04:00
Louis Dionne
f0ca4df2da [Benchmarks] Fix benchmarks broken by ca37fdf
Also check the benchmarks when we're on develop, to make sure they're
not broken.
2015-04-25 19:52:06 -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
52c10011dc [Benchmarks] Refactoring
- Modularize the directory structure
- Add code bloat benchmarks
- Benchmark larger MPL vectors
- Improve the chart display

Fixes #45
2015-04-23 13:07:39 -04:00
Louis Dionne
1538677829 [Travis] Run the benchmarks in Debug and Release configurations
Fixes #49
2015-04-22 22:58:29 -04:00
Louis Dionne
ac2f5222cd [Travis] Run the unit tests under valgrind 2015-04-18 22:36:40 -04:00
Louis Dionne
95b356038d [Benchmarks] Allow measuring the code bloat 2015-04-18 20:59:45 -04:00
Louis Dionne
f3030c926b [Benchmarks] Add benchmarks with the MPL11 and other experiments when supported 2015-04-18 19:55:20 -04:00
Louis Dionne
76d94cdcb2 [Benchmarks] Add a basic setup to visualize benchmarks 2015-04-18 19:55:20 -04:00
Louis Dionne
9a0e356421 [Travis] Run the benchmarks on each compiler and other minor enhancements 2015-04-18 12:51:26 -04:00
Louis Dionne
36a3e22429 [CMake] Add targets to update the benchmarks on the 'datasets' branch 2015-04-18 12:51:26 -04:00
Louis Dionne
fd14741747 [Benchmarks] Simplify the benchmark framework and generate JSON instead of CSV 2015-04-18 12:51:25 -04:00
Louis Dionne
6cf3364bb0 [Benchmarks] Update the benchmarks for fold.left 2015-04-13 19:44:57 -04:00
Louis Dionne
3c2aa421b5 [Tuple] Provide efficient folds for tuple_t
Fixes #32
2015-04-06 14:28:09 -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
38e02e9f53 [Sequence] Rename scan{l,r,l1,r1} similarly to folds 2015-03-31 17:55:27 -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
ed78fcb22b [Benchmarks] Start writing more customized benchmarks 2015-03-25 10:30:58 -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
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
f15b54d3b8 [Benchmarks] Fix the closure/get/multiple benchmark 2015-02-23 21:22:21 -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
3e78af4bcb [Tuple] Use make<Tuple>(...) instead of tuple(...) 2015-02-22 16:50:01 -05:00
Louis Dionne
9604c9a9f6 Replace List by Sequence 2015-02-20 11:05:43 -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
a90385271e Remove old benchmark code. 2014-11-26 20:27:38 -05:00
Louis Dionne
e0e2501931 List: add the remove_at method 2014-11-08 12:32:51 -05:00
Louis Dionne
302c33c8fa Fix broken benchmarks in techniques/closure/ 2014-11-08 10:43:13 -05:00
Louis Dionne
09619ad0c5 Refactor List benchmarks and ext::std::Tuple 2014-11-08 10:43:13 -05:00
Louis Dionne
a6310a046d Simplify the closure type 2014-10-28 14:22:58 -04:00
Louis Dionne
c2541c3713 Add detail::closure based on multiple-inheritance 2014-10-25 14:34:31 -04:00
Louis Dionne
905cdf7674 Benchmark different closure implementations. 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
2e94c2cd84 Fix a couple of bugs in the build system:
- Don't add benchmarks when the Benchmarks module is not available
- Properly handle tests and examples depending on Boost
2014-10-21 20:11:45 -04:00
Louis Dionne
b8a9cb1a3e Register benchmark for the subset method. 2014-10-19 17:46:11 -04:00
Louis Dionne
f0d9e9b9bb Add the intersperse method to List. 2014-10-16 16:56:39 -04:00
Louis Dionne
d74eb9e08f Add runtime and memory usage benchmarks. 2014-10-14 10:11:50 -04:00
Louis Dionne
6369313b32 Benchmark compile-time implications of using std::forward all around 2014-10-05 15:14:22 -04:00
Louis Dionne
bfda3810ee Guard the Boost-dependent benchmark 2014-09-30 09:33:03 -04:00
Louis Dionne
662592faff Allow passing additional compiler flags to data sets 2014-09-30 08:48:39 -04:00
Louis Dionne
fd473470c3 Add two runtime benchmarks for foldl 2014-09-30 08:21:36 -04:00
Louis Dionne
8e98fb808c Improve the accuracy of runtime benchmarks. 2014-09-29 11:18:48 -04:00
Louis Dionne
6b81bf4d36 Add runtime and memory usage benchmarks to Functor 2014-09-26 16:01:38 -04:00
Louis Dionne
a44e9b8d17 Benchmark a different way of reversing a parameter pack. 2014-09-22 11:13:28 -04:00
Louis Dionne
6ebcb5e701 Refactor the benchmarks 2014-09-22 10:26:29 -04:00
Louis Dionne
943c59c0a1 Refactor benchmarks. 2014-09-02 13:21:51 -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
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
41d6b75bc2 Add the product Type class and make Pair a simple data type 2014-07-28 18:35:57 -04:00
Louis Dionne
36610d3a22 Benchmarks: hide file from progressbar format 2014-07-23 20:30:32 -04:00
Louis Dionne
89a9a110e7 CMake: Handle dependencies on Boost properly 2014-07-23 07:22:49 -04:00