From: Yamagata Y. <yor...@mb...> - 2004-01-24 23:01:15
|
From: "Nicolas Cannasse" <war...@fr...> Subject: Re: [Ocaml-lib-devel] Re: Abstract IO Date: Sat, 24 Jan 2004 09:55:54 +0100 > > 2) There would be pros and cons, but maybe objects (not abstract > > types) are more fitted to channels. It makes extension easier, for > > example. > > I don't see how it makes extension easier. Subtyping makes it possible that a channel has its own interface, and still behaves as a basic channel type. Of course, there is a cost of more complex typing. cryptokit(http://pauillac.inria.fr/~xleroy/software.html) and ocamlnet(http://ocamlnet.sourceforge.net/) make use of OO-channels. > > 3) I'd like to see filter type. > > Can you explain more ? I'm thinking of an interface like val apply_in : ('a, 'b) input -> ('a, 'b, 'c, 'd) filter -> ('c, 'd) input val apply_out : ('a, 'b, 'c, 'd) filter -> ('c, 'd, 'x) output -> ('a, 'b, 'x) output > I thing that it would be nice to add something like a pipe : > > IO.pipe : () -> ('a,'b) input * ('a,'b,unit) output Unless it launchs new threads each time, (or we implement continuation in ocaml) this has not much use. We have to track which inputs connect which outputs, oterwise the execution is blocked by the lack of incoming data. |