dry-types v0.7.0 Release Notes
Release Date: 2016-03-30 // about 8 years ago-
๐ Major focus of this release is to make complex type composition possible and improving constraint errors to be more meaningful.
โ Added
Type#try
interface that tries to process the input and return a result object which can be either a success or failure (solnic)#meta
interface for setting arbitrary meta data on types (solnic)ConstraintError
has a message which includes information about the predicate which failed ienil violates constraints (type?(String) failed)
(solnic)Struct
usesDry::Equalizer
too, just likeValue
(AMHOL)Sum::Constrained
which has a disjunction rule built from its types (solnic)- ๐ Compiler supports
[:constructor, [primitive, fn_proc]]
nodes (solnic) - ๐ Compiler supports building schema-less
form.hash
types (solnic)
๐ Fixed
- ๐
Sum
now supports complex types likeArray
orHash
with member types and/or constraints (solnic) - 0๏ธโฃ
Default#constrained
will properly wrap a new constrained type (solnic)
๐ Changed
- [BREAKING] Renamed
Type#{optional=>maybe}
(AMHOL) - ๐ [BREAKING]
Type#optional(other)
builds a sum:Strict::Nil | other
(AMHOL) - [BREAKING] Type objects are now frozen (solnic)
- [BREAKING]
Value
instances are frozen (AMHOL) Array
is no longer a constructor and has aArray::Member
subclass (solnic)Hash
is no longer a constructor and is split intoHash::Safe
,Hash::Strict
andHash::Symbolized
(solnic)Constrained
has now aConstrained::Coercible
subclass which will try to apply its type prior applying its rule (solnic)#maybe
usesStrict::Nil
now (solnic)- 0๏ธโฃ
Type#default
will raise ifnil
was passed forMaybe
type (solnic) Hash
with a schema will set maybe values for missing keys or nils (flash-gordon)