What's Changed
- Implement
Fear::Either#left
by @bolshakov in #169
Left projection allows performing right-biased operation of the left side of the Fear::Either
:
Fear.left(42).left.map(&:succ) #=> Fear.left(43)
Fear.right(42).left.map(&:succ) #=> Fear.left(42)
Before implementing left projection, the same operation was possible to achieve with double swapping:
Fear.left(42).swap.map(&:succ).swap #=> Fear.left(43)
Fear.right(42).swap.map(&:succ).swap #=> Fear.left(42)
- Add an alias
#apply
to the#each
method by @ngrebenshikov in #164
Fear.option(42).apply { puts "The answer is #{_1}" }
the above code is the same as the following:
Fear.option(42).each { puts "The answer is #{_1}" }
- Code cleanup by @bolshakov in #171
- Remove development dependencies from the gem-spec
- Reorganised files structure
- Test against ruby >= 3.1.0 by @bolshakov in #170
- Use zeitwerk to load fear files by @bolshakov in #172
Breaking Changes
- Extract Dry::Types integration into a separate gem by @bolshakov in #173
To use Fear::Option
as optional type for Dry::Types
use the dry-types-fear gem.
- Drop Fear::Struct by @bolshakov in #174
Consider using Data from the standard library.
New Contributors
- @ngrebenshikov made their first contribution in #164
Full Changelog: v2.0.1...v3.0.0