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 ie nil violates constraints (type?(String) failed) (solnic)
    • Struct uses Dry::Equalizer too, just like Value (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 like Array or Hash 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 a Array::Member subclass (solnic)
    • Hash is no longer a constructor and is split into Hash::Safe, Hash::Strict and Hash::Symbolized (solnic)
    • Constrained has now a Constrained::Coercible subclass which will try to apply its type prior applying its rule (solnic)
    • #maybe uses Strict::Nil now (solnic)
    • 0๏ธโƒฃ Type#default will raise if nil was passed for Maybe type (solnic)
    • Hash with a schema will set maybe values for missing keys or nils (flash-gordon)

    Compare v0.6.0...v0.7.0