Pure functions in D

renoX renosky at free.fr
Wed Oct 8 15:25:39 PDT 2008


bearophile a écrit :
> renoX:
>> Sure, D should have monads as soon as Haskell programmers are able
>> to explain this concept to 'normal' programmers (and no cheating
>> such as the classical handwaving, this is a way to wrap side
>> effects..) So probably never then.
> 
> You can try reading this: 
> http://en.wikipedia.org/wiki/Monad_(functional_programming)

Sorry, but this is still above my level of understanding, and I've been 
programming for quite a long time (and have been curious of many things 
in programming)..

> If D wants to add some functional-style features to itself, then I
> think D programmers have to learn some functional-style idioms and
> style, otherwise those changes/additions D become useless. Do you
> agree?

In general yes, in this case no: AFAIK, monads are only useful for 
"pure" functional language which D isn't and won't ever be.

IMHO, functional programming has some good stuff which are easy to use 
and understand that D should steal such as "pure functions" but monads 
aren't such thing: they're very hard to understand, so their correct 
usage isn't obvious and in an impure language I fail to see their interest..

Regards,
Renaud.


> On the other hand I presume many D programmers know some
> functional programming, from Haskell, Scheme, or even Python...
> 
> Bye, bearophile



More information about the Digitalmars-d mailing list