On Wed, 2005-08-10 at 08:32 +0100, Axel Simon wrote:
> sorry to answer so late. And I have to admit I didn't get around to
> really look at it. I think I need to read up on Arrows before I delve
> into your code.
> On Fri, 2005-08-05 at 10:08 +0200, Michal Palka wrote:
> > All,
> > I discovered that I can use onEditableChanged for being notified of the
> > changes of entryText attribute, so I made a mockup which will help you
> > to understand how Signal arrow works.
> > I created MyAttr datatype which extends Attr with information how to
> > register an action which has to be triggered by an attribute change.
> > If you don't understand something in the code, then just ask. btw. Have
> > you managed to run my previous examples?
> I tried with:
> ghc -fglasgow-exts FlowA.hs
> FlowA.hs:61: The last statement in a 'do' construct must be an
You need -farrows switch for GHC to parse the arrow notation. And you
don't need -fglasgow-exts for this source.
> So there's something not defined (it's the return statement with this
> funny -< operator. (Sorry about my ignorance.)
You can think of it this way:
result <- arrow -< input
You feed 'input' to 'arrow' which yields 'result'. Later you can feed
'result', or a function of it, to another arrow. In the end you want to
specify what is the output of the whole arrow you define. You do this in
the last statement. That's why it lacks the 'x <-' part. And returnA is
just an identity arrow.
This is a great tutorial on arrows:
> Thanks for your effort. The code does look quite clean, so it could be a
> good way forwards.