package cmdlang

  1. Overview
  2. Docs

Module type Command.Validated_stringSource

An interface for types that can be parsed from strings, with the possibility of parsing failures.

This is useful for types that require validation during conversion from string representations. The names v and to_string were chosen to match the conventions used by some existing libraries, such as Fpath.

type t
val of_string : string -> (t, [ `Msg of string ]) Result.t

Parses a string into the type t, potentially returning an error if the string is invalid.

val to_string : t -> string