Skip to content

Instantly share code, notes, and snippets.

@wpiekutowski
Created April 13, 2016 13:46
Show Gist options
  • Save wpiekutowski/bc9e54d05786763a849fde5aa01ef6a6 to your computer and use it in GitHub Desktop.
Save wpiekutowski/bc9e54d05786763a849fde5aa01ef6a6 to your computer and use it in GitHub Desktop.
kleisli gem: raise exception on None or unwrap value
require 'kleisli'
result = Maybe(something)
case result
when None()
raise 'operation failed'
else
puts result.value
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment