Refined provides support for common ways of creating refined types in Elm. A refined type is a basic type like Int or String, that has a constructor which ensures that it can only take on certain values. The basic type is wrapped in a custom type which is made opaque - so that only instances of it with the allowable values can ever be created.
Creates a refined type from the input guard function, decoder on the underlying basic type, encoder on the underlying basic type, the error to string function, and the unboxing function that extracts the underlying basic type.
Prints the error messages resulting from failing to create an instance of a refined type.
Creates a dict with a single entry with a Refined key.
Creates a decoder for dictionaries with refined values as keys.
Creates an encoder for dictionaries with refined values as keys.
Turns a Dict with refined keys, into a normal Dict with the refined keys unboxed to their underlying type.
Describes the possible errors that can occur when creating a refined integer.
Translates integer errors to descriptive strings.
Guard function for creating an integer that must be greater than a given value.
Guard function for creating an integer that must be greater than or equal to a given value.
Guard function for creating an integer that must be less than a given value.
Guard function for creating an integer that must be less than or equal to a given value.
Describes the possible errors that can occur when creating a refined string.
Translates string errors to descriptive strings.
Guard function for creating a string that must have a given minimum length.
Guard function for creating a string that must have a given maximum length.
Guard function for creating a string that must match a given regular expression.
Refined types.
iis the underlying basic type.ais the refined custom type that will be created from it.eis the type or errors that the constructor can return when invalid inputs are given.