Converts an instance of the underlying type to an instance of the newtype.
Converts an instance of the underlying type to an instance of the newtype.
Attempts to convert an instance of the underlying type to an instance
of the newtype, returning a Validation
containing either a valid
instance of the newtype or a string message describing why the instance
was invalid.
Attempts to convert an instance of the underlying type to an instance
of the newtype, returning a Validation
containing either a valid
instance of the newtype or a string message describing why the instance
was invalid.
Attempts to convert a collection of instances of the underlying type to
a collection of instances of the newtype, returning a Validation
containing either a collection of valid instances of the newtype or an
accumulation of validation errors.
Attempts to convert a collection of instances of the underlying type to
a collection of instances of the newtype, returning a Validation
containing either a collection of valid instances of the newtype or an
accumulation of validation errors.
Allows pattern matching on newtype instances to convert them back to instances of the underlying type.
Allows pattern matching on newtype instances to convert them back to instances of the underlying type.
Converts an instance of the newtype back to an instance of the underlying type.
Converts an instance of the newtype back to an instance of the underlying type.
Converts an instance of a type parameterized on the newtype back to an instance of a type parameterized on the underlying type.
Converts an instance of a type parameterized on the newtype back to an instance of a type parameterized on the underlying type. For example, this could be used to convert a list of instances of the newtype back to a list of instances of the underlying type.
Converts an instance of the underlying type to an instance of the newtype.
Converts an instance of the underlying type to an instance of the newtype.
Converts an instance of a type parameterized on the underlying type to an instance of a type parameterized on the newtype.
Converts an instance of a type parameterized on the underlying type to an instance of a type parameterized on the newtype. For example, this could be used to convert a list of instances of the underlying type to a list of instances of the newtype.
The class of objects corresponding to subtypes with smart constructors where not all instances of the underlying type are valid instances of the subtype. Users should implement an object that extends this class to create their own subtypes, specifying
A
as the underlying type to wrap and an assertion that valid instances of the underlying type should satisfy.