kleisli
kleisli copied to clipboard
Usable, idiomatic common monads in Ruby
Fixes #31 --- Ruby 3.1: Some actionable output. ``` DEPRECATED: Use assert_nil if expecting nil from /home/runner/work/kleisli/kleisli/test/kleisli/maybe_test.rb:9. This will fail in Minitest 6. /home/runner/work/kleisli/kleisli/test/kleisli/composition_test.rb:33: warning: constant ::Fixnum is deprecated /home/runner/work/kleisli/kleisli/test/kleisli/composition_test.rb:51:...
Saw this in output after #30 ``` Resolving dependencies... Bundler could not find compatible versions for gem "bundler": In Gemfile: bundler (~> 1.6) Current Bundler version: bundler (2.3.26) ```
It is not always desirable to mutate Ruby's global namespace. This PR creates a "safe" require, allowing the user to manually include the DSL into the desired scopes (see the...
My use case was aggregating a bunch of API calls that came back as an array of Lefts and Rights, and I wanted to explicitly deal with both. Using `#is_a?...
@txus will this resolve issue #19?
``` Ruby something = Maybe(12) something.value! #=> 12 nothing = Maybe(nil) nothing.value! #=> raises Kleisli::Maybe::UnwrappedNoneError ``` Based on https://twitter.com/wpiekutowski/status/720247573714440192.
It would be useful for debugging to store a stack trace when `None` or `Left` are initialized. Especially `None` can sometimes survive a long way until we need to unwrap...
I just published this gem built on top of yours- https://github.com/beezee/kleisli-validation If it's something you'd like to include in your gem I'm happy to structure a PR, just let me...
Added here - https://github.com/beezee/kleisli-run LMK if you would be interested in a PR as usual.