You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Original bug ID: 1926 Reporter: administrator Status: closed (set by @mshinwell on 2016-12-06T21:10:41Z) Resolution: won't fix Priority: normal Severity: feature Category: ~DO NOT USE (was: OCaml general)
I'm very puzzled why after over 10 years, Caml did not acquire something like
this ("Modern" languages seem to usually have it: Haskell has "read" and
"show", e.g.)
(* =========== module IO ================== *)
module type AnyType = sig type t end
type style = Binary | Caml | S_expr | XML
exception Parse_error
exception Type_error
module type S =
sig
type t
val from_channel: ?style:style -> in_channel -> t
val from_string : ?style:style -> string -> t
val from_buffer : ?style:style -> string -> int -> t
val to_channel: ?style:style -> ?detect_sharing:bool -> out_channel -> t
-> unit
val to_string: ?style:style -> ?detect_sharing:bool -> t -> string
val to_buffer: ?style:style -> ?detect_sharing:bool -> t -> string ->
int-> int
end
module Make (Any : AnyType) : S with type t = Any.t
(* ======================================== *)
No explanation is necessary, I hope. IO module should to be type-safe and
subsume Marshal and IOXML.
This would, of course, require compiler support, since users can not do type
introspection, even with Camlp4.
The text was updated successfully, but these errors were encountered:
Original bug ID: 1926
Reporter: administrator
Status: closed (set by @mshinwell on 2016-12-06T21:10:41Z)
Resolution: won't fix
Priority: normal
Severity: feature
Category: ~DO NOT USE (was: OCaml general)
Bug description
Full_Name: Oleg Trott
Version: N/A
OS: N/A
Submission from: tw304h3.cpmc.columbia.edu (156.111.84.180)
I'm very puzzled why after over 10 years, Caml did not acquire something like
this ("Modern" languages seem to usually have it: Haskell has "read" and
"show", e.g.)
(* =========== module IO ================== *)
module type AnyType = sig type t end
type style = Binary | Caml | S_expr | XML
exception Parse_error
exception Type_error
module type S =
sig
type t
val from_channel: ?style:style -> in_channel -> t
val from_string : ?style:style -> string -> t
val from_buffer : ?style:style -> string -> int -> t
-> unit
val to_string: ?style:style -> ?detect_sharing:bool -> t -> string
val to_buffer: ?style:style -> ?detect_sharing:bool -> t -> string ->
int-> int
end
module Make (Any : AnyType) : S with type t = Any.t
(* ======================================== *)
No explanation is necessary, I hope. IO module should to be type-safe and
subsume Marshal and IOXML.
This would, of course, require compiler support, since users can not do type
introspection, even with Camlp4.
The text was updated successfully, but these errors were encountered: