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 union type to sanctuary-def #60

Closed
jgoux opened this issue Apr 27, 2016 · 3 comments
Closed

Add union type to sanctuary-def #60

jgoux opened this issue Apr 27, 2016 · 3 comments

Comments

@jgoux
Copy link

jgoux commented Apr 27, 2016

Hello,
would it be possible to add union type to sanctuary-def ?

Other related projects :

@davidchambers
Copy link
Member

I'd love to know more about what you have in mind, @jgoux.

Are you thinking we could provide pattern matching, so a function needn't determine which "tag" it is dealing with? If so, how do you imagine the following definition might change?

S.either =
def('either',
    {},
    [$.Function, $.Function, $Either(a, b), c],
    function(l, r, either) {
      return either.isLeft ? l(either.value) : r(either.value);
    });

@davidchambers
Copy link
Member

Closing in favour of sanctuary-js/sanctuary-adt#1

@rockymadden
Copy link

As a note to anyone else looking for this as well, the repo seems to be: https://github.com/JAForbes/sum-type

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

No branches or pull requests

3 participants