Boost logo

Boost :

Subject: Re: [boost] Hana Typeclass
From: Robert Ramey (ramey_at_[hidden])
Date: 2014-08-03 18:30:59


Louis Dionne wrote
> Robert Ramey
> <ramey <at>
> rrsd.com> writes:
>
> Looking at all the discussions about concepts and comments about type
> classes
> that Hana has brought up, I really think I messed up when I tried to
> answer
> the "what are type classes" question in the documentation. The docs
> marketed
> them as something they were not (an implementation of concepts) and poorly
> reflected my own view. I'm working on fixing this (and other aspects of
> the
> documentation).

Your library needs concepts - just as fusion does. I don't see how your
"type class" is different. In fact, looking at my haskell book, I don't see
how haskell type classes are different either. (maybe a little - but not
much).

> For now, I'd rather have people think of type classes as a Boost.Fusion
> tag
> dispatching system on steroids.

what's tag dispatching? - OK - just kidding (only partially). But to me
it's
really an implementation technique and making it a center piece of the
documentation doesn't uses understand this. To me, the documentation
should be:

parameterized types
algorithms
  compile time
  runtime

One thing that the documentation needs is a good motivating example(s).
The user should be able to look at this and in 1/2 hour know how this is
going to make his life easier. Here's an example

the 8 queens problem:

a) class C++ solution using mutable objects, containers, etc.
b) solution using HANA
  1) why it's more verifiably correct
  2) why it's shorter
  3) why it's faster
  4) why it's faster than the same algorithm rendered in Haskell
c) scale to N queens

See http://cppnow.org/schedule-2014/

Regards,
Louis

_______________________________________________
Unsubscribe & other changes:
http://lists.boost.org/mailman/listinfo.cgi/boost

--
View this message in context: http://boost.2283326.n4.nabble.com/Hana-Typeclass-tp4665978p4665989.html
Sent from the Boost - Dev mailing list archive at Nabble.com.

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk