Hello all,
this was previously posted on Haskell Beginners, but only partially answered.
In Sound.ALSA.Sequencer, there are a number of functions which together set up
a midi environement (client, port, queue). They all have a type, where the
last argument has a type like:
(something.T -> IO a
On Sun, Mar 3, 2013 at 10:28 AM, Martin Drautzburg wrote:
> Hello all,
>
> this was previously posted on Haskell Beginners, but only partially
> answered.
>
> In Sound.ALSA.Sequencer, there are a number of functions which together
> set up
> a midi environement (client, port, queue). They all hav
Hi Martin,
These are called "continuations" or "callbacks". In this case, the term
"callback" seems to fit better, since the result of continuation is an
IO action.
The common use case for callbacks is when you want to release some
resources after the IO action completes. Let's look at the defini
On Sunday, 3. March 2013 21:11:21 Roman Cheplyaka wrote:
> Admittedly, programming with callbacks is not very pleasant. So we have
> an excellent alternative — the continuation monad transformer!
>
> This nested code
>
> something1 $ \x -> do
> something2 $ \y -> do
>
* Martin Drautzburg [2013-03-04 21:21:30+0100]
> On Sunday, 3. March 2013 21:11:21 Roman Cheplyaka wrote:
>
> > Admittedly, programming with callbacks is not very pleasant. So we have
> > an excellent alternative — the continuation monad transformer!
> >
> > This nested code
> >
> > something