Skip to content

Instantly share code, notes, and snippets.

@gvergnaud
Created January 10, 2016 11:19
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 gvergnaud/821ab866b5097b86a1f3 to your computer and use it in GitHub Desktop.
Save gvergnaud/821ab866b5097b86a1f3 to your computer and use it in GitHub Desktop.
export default class Identity {
constructor(v) {
this.value = v
}
static of(v) {
return new Identity(v)
}
run() {
return this.value
}
map(f) {
return Identity.of(f(this.value))
}
}
export const runIdentity = i => i.run()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment