module type SHTREAM = AnyShtream.ANYSHTREAM
The input signature of the functor Fitting.Make
.
This matches AnyShtream.ANYSHTREAM
, the output signature of
AnyShtream.Make
.
include Shtream.COMMON
AnyShtream.Make
contains all the type-indifferent
shtream operations from Shtream
.module Elem:AnyShtream.ELEM
type'a
elem ='a Elem.elem
typeinitial =
Elem.initial
AnyShtream.ELEM.elem
AnyShtream.ELEM.initial
val elem_reader : Reader.t ->
Pervasives.in_channel ->
initial elem
initial elem
reader from a record reader.
Functions such as AnyShtream.ANYSHTREAM.of_channel
and AnyShtream.ANYSHTREAM.of_program
take a function
of the type returned here.val output : ?channel:Pervasives.out_channel ->
?init:('a elem -> string) ->
?term:('a elem -> string) ->
?show:('a elem -> string) ->
'a elem t -> unit
x
of the shtream, it prints init x
, then
show x
, and then term x
on the channel, and then flushes the
channel.
channel
: default = stdout
init
: default = fun _ -> ""
term
: default = fun _ -> "\n"
show
: default = Elem.string_of ()
val channel_of : ?procref:Channel.procref ->
?before:(unit -> unit) ->
?after:(unit -> unit) ->
?init:('a elem -> string) ->
?term:('a elem -> string) ->
?show:('a elem -> string) ->
'a elem t -> Pervasives.in_channel
in_channel
from the data in a
shtream. If forking a child is necessary (see
Shtream.channel_of
), then the optional
parameter ?before
(resp. ?after
) is called in the child
before (resp. after) printing the shtream; anything printed on
stdout
by ?before
(?after
) appears in the resultant
in_channel
before (after) the shtream data.
The remaining arguments are as for AnyShtream.ANYSHTREAM.output
.
val string_list_of : ?show:('a elem -> string) ->
'a elem t -> string list
?show
.val string_stream_of : ?show:('a elem -> string) ->
'a elem t -> string Stream.t
Stream.t
of
strings, using ?show
.val of_channel : ?reader:(Pervasives.in_channel ->
initial elem) ->
Pervasives.in_channel ->
initial elem t
?reader
.val of_file : ?reader:(Pervasives.in_channel ->
initial elem) ->
string -> initial elem t
?reader
.val of_command : ?procref:Channel.procref ->
?dups:Channel.dup_spec ->
?reader:(Pervasives.in_channel ->
initial elem) ->
string -> initial elem t
?reader
.
If ?procref
is given, stash the Proc.t
; if ?dups
is given, perform the dups in the child process.val of_program : ?procref:Channel.procref ->
?dups:Channel.dup_spec ->
?reader:(Pervasives.in_channel ->
initial elem) ->
?path:bool ->
string ->
?argv0:string ->
string list -> initial elem t
?reader
.
If ?procref
is given, stash the Proc.t
; if ?dups
is given, perform the dups in the child process.val of_thunk : ?procref:Channel.procref ->
?dups:Channel.dup_spec ->
?reader:(Pervasives.in_channel ->
initial elem) ->
(unit -> unit) -> initial elem t
?reader
.
If ?procref
is given, stash the Proc.t
; if ?dups
is given, perform the dups in the child process.val of_string_list : ?parse:(string -> initial elem) ->
string list -> initial elem t
?parse
.val of_string_stream : ?parse:(string -> initial elem) ->
string Stream.t -> initial elem t
Stream.t
of strings, using ?parse
.