mirror of
https://github.com/c-cube/ocaml-containers.git
synced 2025-12-06 11:15:31 -05:00
expose blocking decoder in CCSexpM
This commit is contained in:
parent
5e6ade9f68
commit
1f463c1e9c
2 changed files with 12 additions and 2 deletions
|
|
@ -309,11 +309,13 @@ module MakeDecode(M : MONAD) = struct
|
||||||
expr_or_end (fun _ x -> M.return (`Ok x)) t
|
expr_or_end (fun _ x -> M.return (`Ok x)) t
|
||||||
end
|
end
|
||||||
|
|
||||||
module D = MakeDecode(struct
|
module ID_MONAD = struct
|
||||||
type 'a t = 'a
|
type 'a t = 'a
|
||||||
let return x = x
|
let return x = x
|
||||||
let (>>=) x f = f x
|
let (>>=) x f = f x
|
||||||
end)
|
end
|
||||||
|
|
||||||
|
module D = MakeDecode(ID_MONAD)
|
||||||
|
|
||||||
let parse_string s : t or_error =
|
let parse_string s : t or_error =
|
||||||
let n = String.length s in
|
let n = String.length s in
|
||||||
|
|
|
||||||
|
|
@ -86,6 +86,14 @@ module MakeDecode(M : MONAD) : sig
|
||||||
long enough or isn't a proper S-expression *)
|
long enough or isn't a proper S-expression *)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
module ID_MONAD : MONAD
|
||||||
|
(** The monad that just uses blocking calls as bind
|
||||||
|
@since NEXT_RELEASE *)
|
||||||
|
|
||||||
|
module D : module type of MakeDecode(ID_MONAD)
|
||||||
|
(** Decoder that just blocks when input is not available
|
||||||
|
@since NEXT_RELEASE *)
|
||||||
|
|
||||||
val parse_string : string -> t or_error
|
val parse_string : string -> t or_error
|
||||||
(** Parse a string *)
|
(** Parse a string *)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue