Il Fri, Sep 01, 2006 at 10:43:14AM +0400, Bulat Ziganshin ebbe a scrivere:
> > The tutorial will have this outline: first we build a monad adding
> > output, exception, and state. Then we use monad transformer to take
> > out state and output and add debug, doing lifting, put(ing) and
> > get(ing) by hand, to understand the central role of type
> > matching/construction.
>> imho, your tutorial makes the error that is a very typical: when you
> write your tutorial you already know what are monads and what the
> program you will construct at the end. but your reader don't know all these!
Neither did I, actually.
> for such fresh reader this looks as you made some strange steps, write
> some ugly code and he don't have chances to understand that this ugly
> code is written just to show that this can be simplified using monads.
> i've tried to read it imaging myself as fresh reader and was stopped
> at some middle because code was too complicated to understand and
> it was completely imobvious (for fresh reader) that we just wrote
> "innards" of monad and then will reduce all this ugly code just to
> ">>=" calls
I do not entirely understand your point. I wrote just the first part
of the tutorial, till the "Errare Monadicum Est" chapter. From then
on, before writing the tutorial, I needed to understand what I was
headed to and so I wrote the code. Now the task is to explain each
step of that code.
Indeed I'm a fresh reader that did not find anything that she could
find useful to understand monads, and wrote her own.
That is to say, this is the way I came to understand monads. I do not
pretend to teach what monads are, but I hope that, by following the
same path I followed, someone else can get to the point where I am
now.
Where now I am is just another kind of problem. Probably nowhere.
That's it.
Anyway, thanks a lot for your suggestions. I'll try to understand them
and put them in practice.
As far as I can.
Best regards,
Andrea