Skip to content

Instantly share code, notes, and snippets.

@guilleiguaran
Last active August 29, 2015 14:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save guilleiguaran/adb32c0a2cf9b8c30c79 to your computer and use it in GitHub Desktop.
Save guilleiguaran/adb32c0a2cf9b8c30c79 to your computer and use it in GitHub Desktop.
Identity Monad
class Identity
attr_reader :value
def initialize(value)
@value = value
end
private_class_method :new
def self.unit(value)
new(value)
end
def bind
yield @value
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment