Module Stringlike.MakeSource

Create a standard set of functions from a base pair of to/from string converters

Parameters

Signature

type t = S.t

An interface for types that are convertible from/to strings.

Sourceval of_string : string -> t

of_string should only be used on strings that are known to represent a valid t.

val to_string : t -> string
Sourceval parse_string_exn : (Stdune.Loc.t * string) -> t
Sourceval to_dyn : t -> Stdune.Dyn.t
val of_string_opt : string -> t option
Sourceval of_string_user_error : (Stdune.Loc.t * string) -> (t, Stdune.User_message.t) Stdune.result
Sourceval conv : (string -> (t, [> `Msg of string ]) Stdune.result) * (Format.formatter -> t -> unit)

From&to string conversions, for use with Cmdliner.Arg.conv

include Dune_lang.Conv.S with type t := t