Monads compared to InputRanges?

Timon Gehr timon.gehr at gmx.ch
Tue Dec 3 15:45:32 PST 2013


On 12/04/2013 12:02 AM, Shammah Chancellor wrote:
>
> I get the gist of that, but it seems like the range concept with UFCS
> provides the same thing? E.G.  range.map().flatten().map()?
>

Well, informally speaking, this is roughly an instance of a Monad.

> Does it really not accomplish the same thing -- am I missing some key
> point of monads?

The quick answer is that they are more general and would also capture 
eg. rooted trees with map and flatten operations, not just linear sequences.


More information about the Digitalmars-d-learn mailing list