Grafting Functional Support on Top of an Imperative Language
Bill Baxter
dnewsgroup at billbaxter.com
Fri Apr 4 17:03:29 PDT 2008
Simen Kjaeraas wrote:
> On Sat, 05 Apr 2008 01:09:14 +0200, Jason House
> <jason.james.house at gmail.com> wrote:
>
>> bearophile wrote:
>>> P. 31: >writeln(i);<
>>>
>>> Can you put (temporary) debugging writeln/putr inside a pure function?
>>
>> That's always bothered me about this stuff. I don't want to lose
>> debugging/logging ability!
>
>
> Just use multiple return types, and have the caller do the printing.
>
> --Simen
Monads!
Or at least I think that's what I read somewhere. I can't understand
the buggers for the life of me. I think maybe it's just a fancy word
for "loophole". If someone here has a good explanation for what a monad
is and how it allows mutable state in FP without making thing non-FP,
I'd love to hear it. Because I just don't get it.
--bb
More information about the Digitalmars-d
mailing list