[Haskell-cafe] Functional progr., images, laziness and all the rest

Jerzy Karczmarczuk jerzy.karczmarczuk at info.unicaen.fr
Thu Jun 22 07:24:32 EDT 2006


minh thu wrote:

/about the stream algorithms, lazy style/

> can you know a mean to express such computation but with elements
> depending of time (in about the same way as languages as esterel)
> (i.e. depending of IO)?
> Paul Hudak uses a Channel in his book Haskell SOE .. but is there 
> another way ?

Frankly, I don't see it well. The co-recursive, lazy constructions are
based on the fact that it is the consumer who unrolls the list and
forces the reduction. So, the unevaluated closures should contain
somehow the latent data, or rather refer to them. Synchronous processing
is another story, here the producer is really active.

Esterel until the version 4 demanded that all 'circuits' which handled
the data flows be *acyclic*; now it is more flexible, so you can do a lot
of "own-tail-eating snakes" with it, but differently.

I believe that ways of producing intricate streams by such languages or
Lustre are somehow based on continuation mechanisms. The paper on Esterel,
etc. :   ftp://ftp-sop.inria.fr/esterel/pub/papers/foundations.pdf

gives you an example in Lustre
X[n+1] = U[n+1]*sin(X[n] + S[n+1]-S[n])
S[n+1] = cos(S[n]+U[n+1]

in a form remarkably analogous as I did:

node Control(U:float) returns X:float
   var S:float
   let
     X = 0.0 -> (U*sin(pre(X)+S-pre(S));
     S = 1.0 -> cos(pre(S)+U);
   tel

So, I would say that this is obviously a live domain. The language Signal
can oversample, and produce output "faster" than the input, but I have
never followed the details.

Perhaps some YamPa-ladins who read this list could shed some light on the
reactive stream processing?
They use Arrows, a generalization (and twist, not compatible) of Monads, so
there is obviously *some* relation to continuations here... But I am a
Perfect Non-Specialist.


Jerzy Karczmarczuk




More information about the Haskell-Cafe mailing list