Open tel opened 9 years ago
Also probably some tie-in with lwt.
Also some tie-in with fstreams
.
What's the universal fold? It would need to be lazy and look something like
type ('i, 'j, 'a) istore = ('i -> 'a) * 'j
val step : ('i, 'j) Moore.t -> ('i, 'j, ('i, 'j) Moore.t) istore
But this is a little weird because ('i, 'j, 'a) istore -> 'a
doesn't capture the notion of feeding subsequent values in to the machine.
There's also something like val cycle : ('a, 'a) Moore.t -> unit
and val cycle : 'a -> ('a, 'a) Mealy.t -> unit
which just feed output to input. Maybe this should be called iterate?
Probably something like
(unit -> a) -> (b -> unit) -> ('a, 'b) t -> unit
is one way. This is even nicer with the terminating machines.