Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add case and caseOn as instance methods for types #44

Merged
merged 2 commits into from
May 28, 2016

Conversation

pelotom
Copy link
Contributor

@pelotom pelotom commented May 19, 2016

Add instance methods for case and caseOn so you can do e.g.

const { Just, Nothing } = Type({
  Just: [T],
  Nothing: []
})

const m = Just(3)

m.case({
  Nothing: () => 0,
  Just: (n) => n + 2
})

@paldepind
Copy link
Owner

Thank you. It seems sensible.

@paldepind paldepind merged commit 1bf0989 into paldepind:master May 28, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants