Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
Functional design for a basic simulation pipe.
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: skaller <skaller@u...>
Subject: Re: [Caml-list] Functional design for a basic simulation pipe.
On Wed, 2007-10-10 at 11:08 +0100, Hugo Ferreira wrote:
> Hello,

> Apologies for being so obtuse but I cannot to see how this solves my
> problem. 

> let exp = a |> b |> c
> a: requires the input of a state and outputs an event
> b: requires input of a state and the event generated at that state and
> outputs processed data
> c: consumes n number elements of processed data and stops when it
> requires no more such data

> Note that "c" will "pull in" for example 10 states and check for
> termination, "b" will therefore need "pull in" 10 events. 

Functions cannot do that. You have to control invert.

A function is a slave, it is *called* with its argument.
you cant *read* the arguments.

John Skaller <skaller at users dot sf dot net>
Felix, successor to C++: