Skip to content

Add Alt instance #8

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

Merged
merged 1 commit into from
Jul 19, 2016
Merged

Add Alt instance #8

merged 1 commit into from
Jul 19, 2016

Conversation

paluh
Copy link
Contributor

@paluh paluh commented Jul 19, 2016

For this implementation we have (assumming: x, y, z :: Identity a):

  • associativity: (x <|> y) <|> z = x <|> z = x = x <|> y = x <|> (y <|> z)
  • distributivity: f <$> (x <|> y) = f <$> x = (f <$> x) <|> (f <$> y)

Is there any reason not to include such an instance?

@garyb
Copy link
Member

garyb commented Jul 19, 2016

I think this makes sense... it fits the laws and seems like the only reasonable instance for Identity.

@paf31
Copy link
Contributor

paf31 commented Jul 19, 2016

Yes looks good

Sent from my iPhone

On Jul 19, 2016, at 12:51 PM, Gary Burgess notifications@github.com wrote:

I think this makes sense... it fits the laws and seems like the only reasonable instance for Identity.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.

@garyb garyb merged commit 454fc4d into purescript:master Jul 19, 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.

3 participants