Attributes
- Companion
- object
- Graph
-
- Supertypes
Members list
Type members
Types
Value members
Concrete methods
Attempts to create a new instance of the Subtype for the given input by calling the validate
method.
Attempts to create a new instance of the Subtype for the given input by calling the validate
method.
If the validation fails, it will return a Left
with an error message. If the validation succeeds, it will return a Right
with the new instance.
Attributes
WARNING! Creates a new instance of the newtype without performing any validation. ONLY USE THIS IF YOU KNOW WHAT YOU'RE DOING.
WARNING! Creates a new instance of the newtype without performing any validation. ONLY USE THIS IF YOU KNOW WHAT YOU'RE DOING.
This method should be used with caution, as it bypasses any validation defined in the validate
method. It is recommended to use the apply
method instead, which performs compile-time validation of the input.
Attributes
WARNING! This casts an F[A]
to an F[Type]
without performing any validation. ONLY USE THIS IF YOU KNOW WHAT YOU'RE DOING.
WARNING! This casts an F[A]
to an F[Type]
without performing any validation. ONLY USE THIS IF YOU KNOW WHAT YOU'RE DOING.
If, for instance, you have a List[A]
and you want to convert it to a List[Type]
, you can use this method to do so.
Attributes
Inherited methods
Creates a new instance of the newtype.
Creates a new instance of the newtype.
If the validate
method is not defined for this, it will simply wrap the input in the neotype.
If validate
is defined, it will be called at compile-time to check if the input is valid. If it fails, it will raise a compile-time error. input should be a literal or a constant expression, a compile-time known value—otherwise, you should use the make
method instead.
Attributes
- Inherited from:
- TypeWrapper
Creates a list of newtype instances.
Creates a list of newtype instances.
This will essentially call apply
for each value in the list, performing the same compile-time validation for each element.
If any of the elements fail validation, it will raise a compile-time error. Otherwise, it will return a list of newtype instances.
Attributes
- Inherited from:
- TypeWrapper
Validates the input and returns a boolean or an error message.
Validates the input and returns a boolean or an error message.
Attributes
- Inherited from:
- TypeWrapper