>
> [...]
>
> > * Documentation
>
> I think writing "using namespace boost::hana" for the documentation is
> confusion. I know it might be nit-picking, but I think the example is
> easier to understand when you read
>
> [...]
>
> Because if you read diagonally (and let's be realistic, we all read
> diagonally documentation) you might miss what is going on. At least
> some namespace alias would be helpful. I personally think redundancy
> is good in documentations.
Good suggestion. I think a `namespace hana = boost::hana` alias would be
better than fully qualifying all the names. Added this issue [1].
>
> [...]
>
>
> > * What was the experience? Any problems?
>
> The only problem I have with Hana is that it doesn't work with Visual
> Studio. The lack of VS is the only reason why we didn't adopt Hana on
> our product. Nevertheless, I don't think it a showstopper. Hana is an
> advanced MPL and the problem will solve by itself with time. It works,
> in my opinion, on a sufficient number on platforms at the moment to be
> accepted into Boost.
I think acceptance into boost and more wide usage of the library might also
push compiler vendors to (properly) support C++14 faster. That's sort of a
chicken-and-egg problem; if no one uses advanced features, vendors don't
have incentives to implement them and they also can't fix their bugs. On
the other hand, once all these features are available and bugfree, users
will use them.
> > - How much effort did you put into your evaluation of the review?
>
> I ran by the examples again as I would if I were trying the library for
> the first time. I have been following Boost.Hana since Louis' presentation
> at last year cppcon in Bellevue, Wa.
Thanks a lot for your review, Edouard!
Regards,
Louis
[1]: https://github.com/ldionne/hana/issues/126
>
> Le 24/06/15 18:39, Louis Dionne a écrit :
> > John Bytheway <jbytheway+boost <at> gmail.com> writes:
> >
> >> [...]
> >>
> >> Mostly very good, but of course there is always room for improvement.
> >> One particular thing I wanted to raise here is that I struggled to find
> >> enough information about Hana-convertibility (i.e. using the 'to'
> >> function). For example, I wondered if I could create a Tuple from a
> >> Range, and it seems I can. Then I wondered whether I could create a
> >> std::Array from a homogeneous Tuple, but it seems I cannot.
> > A Tuple is a Sequence, and a Sequence can be created from any Foldable.
> > Since a Range is Foldable, it works. However, a std::array is _not_ a
> > Sequence.
>
> Couldn't std::array<T,0> be considered the empty Array and so Array
> could be considered a homogeneous sequence?
The problem is that a homogeneous sequence (in Hana's mathematical universe)
is a sequence whose tags are homogeneous. Hence, a tuple containing
IntegralConstant<int> objects only is a homogeneous sequence for Hana's
concepts. Hence, a std::array is not powerful enough to hold Hana-homogeneous
data. Indeed, the following is Hana-homogeneous but not homogeneous in the
usual C++ sense:
auto xs = make_tuple(int_<1>, int_<2>, int_<3>);
It is Hana-homogeneous because all the int_s have the IntegralConstant<int>
tag, but it is not C++-homogeneous because they all have different C++ types.
Again, the concern here is being correct mathematically, but there's no other
technical reason why this can't be done. Ideally, I'd like to be mathematically
correct while also providing this functionality, or similar.
> > [...]
> >
> > See how we make an arbitrary choice to use the type of the first element
> > of the sequence for `T`? This, and the fact that it will only work when
> > the Sequence happens to contain elements of a single type, are what
> > breaks naturality.
> Why not request that the sequence is homogeneous?
My answer to your other question above should also answer this one. If not,
let me know and I'll gladly clarify.
Regards,
Louis