sig
type 'a or_error = [ `Error of string | `Ok of 'a ]
type 'a sequence = ('a -> unit) -> unit
type 'a gen = unit -> 'a option
type t = [ `Atom of string | `List of CCSexpM.t list ]
type sexp = CCSexpM.t
val to_buf : Buffer.t -> CCSexpM.t -> unit
val to_string : CCSexpM.t -> string
val to_file : string -> CCSexpM.t -> unit
val to_file_seq : string -> CCSexpM.t CCSexpM.sequence -> unit
val to_chan : Pervasives.out_channel -> CCSexpM.t -> unit
val print : Format.formatter -> CCSexpM.t -> unit
val print_noindent : Format.formatter -> CCSexpM.t -> unit
module type MONAD =
sig
type 'a t
val return : 'a -> 'a CCSexpM.MONAD.t
val ( >>= ) :
'a CCSexpM.MONAD.t ->
('a -> 'b CCSexpM.MONAD.t) -> 'b CCSexpM.MONAD.t
end
type 'a parse_result = [ `End | `Error of string | `Ok of 'a ]
module MakeDecode :
functor (M : MONAD) ->
sig
type t
val make :
?bufsize:int ->
(Bytes.t -> int -> int -> int M.t) -> CCSexpM.MakeDecode.t
val next :
CCSexpM.MakeDecode.t -> CCSexpM.sexp CCSexpM.parse_result M.t
end
module ID_MONAD :
sig
type 'a t = 'a
val return : 'a -> 'a t
val ( >>= ) : 'a t -> ('a -> 'b t) -> 'b t
end
module D :
sig
type t = MakeDecode(ID_MONAD).t
val make :
?bufsize:int -> (Bytes.t -> int -> int -> int ID_MONAD.t) -> t
val next : t -> sexp parse_result ID_MONAD.t
end
val parse_string : string -> CCSexpM.t CCSexpM.or_error
val parse_chan :
?bufsize:int -> Pervasives.in_channel -> CCSexpM.t CCSexpM.or_error
val parse_chan_gen :
?bufsize:int ->
Pervasives.in_channel -> CCSexpM.t CCSexpM.or_error CCSexpM.gen
val parse_chan_list :
?bufsize:int -> Pervasives.in_channel -> CCSexpM.t list CCSexpM.or_error
val parse_file : string -> CCSexpM.t CCSexpM.or_error
val parse_file_list : string -> CCSexpM.t list CCSexpM.or_error
end