sig
type ('input, 'output) t
exception Feeding_stopped_transform of string
val make :
?name:string ->
feed:('input -> unit) ->
next:(bool -> [ `end_of_stream | `not_ready | `output of 'output ]) ->
unit -> ('input, 'output) Biocaml_transform.t
val feed : ('input, 'output) Biocaml_transform.t -> 'input -> unit
val next :
('input, 'output) Biocaml_transform.t ->
[ `end_of_stream | `not_ready | `output of 'output ]
val stop : ('input, 'output) Biocaml_transform.t -> unit
val name : ('input, 'output) Biocaml_transform.t -> string option
val identity : ?name:string -> unit -> ('a, 'a) Biocaml_transform.t
val of_function :
?name:string -> ('a -> 'b) -> ('a, 'b) Biocaml_transform.t
val to_stream_fun :
('input, 'output) Biocaml_transform.t ->
'input Stream.t -> 'output Stream.t
val in_channel_strings_to_stream :
?buffer_size:int ->
Pervasives.in_channel ->
(string, 'output) Biocaml_transform.t -> 'output Stream.t
val stream_to_out_channel :
'input Stream.t ->
('input, string) Biocaml_transform.t -> Pervasives.out_channel -> unit
val on_input :
('b, 'c) Biocaml_transform.t ->
f:('a -> 'b) -> ('a, 'c) Biocaml_transform.t
val on_output :
('a, 'b) Biocaml_transform.t ->
f:('b -> 'c) -> ('a, 'c) Biocaml_transform.t
val compose :
('a, 'b) Biocaml_transform.t ->
('b, 'c) Biocaml_transform.t -> ('a, 'c) Biocaml_transform.t
val mix :
('a1, 'b1) Biocaml_transform.t ->
('a2, 'b2) Biocaml_transform.t ->
('a1 * 'a2, [ `both of 'b1 * 'b2 | `left of 'b1 | `right of 'b2 ])
Biocaml_transform.t
val filter_compose :
('il, 'ol) Biocaml_transform.t ->
('ir, 'our) Biocaml_transform.t ->
destruct:('ol -> [ `bypass of 'filtered | `transform of 'ir ]) ->
reconstruct:([ `bypassed of 'filtered | `transformed of 'our ] -> 'result) ->
('il, 'result) Biocaml_transform.t
val split_and_merge :
('il, 'ol) Biocaml_transform.t ->
('ir, 'our) Biocaml_transform.t ->
split:('input -> [ `left of 'il | `right of 'ir ]) ->
merge:([ `left of 'ol | `right of 'our ] -> 'output) ->
('input, 'output) Biocaml_transform.t
val make_result :
?name:string ->
feed:('input -> unit) ->
next:(bool ->
[ `end_of_stream
| `not_ready
| `output of ('a, 'b) Core.Std.Result.t ]) ->
unit -> ('input, ('a, 'b) Core.Std.Result.t) Biocaml_transform.t
val on_ok :
('input, ('ok, 'error) Core.Std.Result.t) Biocaml_transform.t ->
f:('ok -> 'still_ok) ->
('input, ('still_ok, 'error) Core.Std.Result.t) Biocaml_transform.t
val on_error :
('input, ('ok, 'error) Core.Std.Result.t) Biocaml_transform.t ->
f:('error -> 'another_errror) ->
('input, ('ok, 'another_errror) Core.Std.Result.t) Biocaml_transform.t
val compose_results :
on_error:([ `left of 'error_left | `right of 'error_right ] -> 'error) ->
('input_left, ('middle, 'error_left) Core.Std.Result.t)
Biocaml_transform.t ->
('middle, ('output_right, 'error_right) Core.Std.Result.t)
Biocaml_transform.t ->
('input_left, ('output_right, 'error) Core.Std.Result.t)
Biocaml_transform.t
val compose_results_merge_error :
('a, ('b, 'el) Core.Std.Result.t) Biocaml_transform.t ->
('b, ('d, 'er) Core.Std.Result.t) Biocaml_transform.t ->
('a, ('d, [ `left of 'el | `right of 'er ]) Core.Std.Result.t)
Biocaml_transform.t
val compose_result_left :
('input_left, ('middle, 'error) Core.Std.Result.t) Biocaml_transform.t ->
('middle, 'output_right) Biocaml_transform.t ->
('input_left, ('output_right, 'error) Core.Std.Result.t)
Biocaml_transform.t
class type ['input, 'output] object_t =
object
method feed : 'input -> unit
method next : [ `end_of_stream | `not_ready | `output of 'output ]
method stop : unit
end
val to_object :
('a, 'b) Biocaml_transform.t -> ('a, 'b) Biocaml_transform.object_t
val of_object :
('a, 'b) Biocaml_transform.object_t -> ('a, 'b) Biocaml_transform.t
val make_general :
?name:string ->
next:(unit -> [ `end_of_stream | `not_ready | `output of 'output ]) ->
feed:('input -> unit) ->
stop:(unit -> unit) -> unit -> ('input, 'output) Biocaml_transform.t
end