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

[#46] Document typeclasses laws #47

Merged
merged 2 commits into from
Oct 21, 2020

Conversation

chshersh
Copy link
Contributor

Resolves #46

@chshersh chshersh requested a review from vrom911 as a code owner October 21, 2020 10:15
@chshersh chshersh self-assigned this Oct 21, 2020
@chshersh chshersh added the documentation Improvements or additions to documentation label Oct 21, 2020
Copy link

@hint-man hint-man bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no place for me here... I will choose the truth I like.

Copy link
Member

@vrom911 vrom911 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wonderful 🎇 Thanks for documenting this! ❤️

src/Prolens.hs Outdated
Comment on lines 293 to 305
swapEither :: Either a b -> Either b a
swapEither (Left a) = Right a
swapEither (Right b) = Left b

unnestLeft :: Either (Either a b) c -> Either a (Either b c)
unnestLeft (Left (Left a)) = Left a
unnestLeft (Left (Right b)) = Right (Left b)
unnestLeft (Right c) = Right (Right c)

nestLeft :: Either a (Either b c) -> Either (Either a b) c
nestLeft (Left a) = Left (Left a)
nestLeft (Right (Left b)) = Left (Right b)
nestLeft (Right (Right c)) = Right c
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think for docs it is okay to just leave types of these functions. They are very clear in what the functions do 👍🏼 🔮

Copy link
Member

@vrom911 vrom911 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🍬

@vrom911 vrom911 merged commit 5f03ae6 into master Oct 21, 2020
@vrom911 vrom911 deleted the chshersh/46-Document-typeclasses-laws branch October 21, 2020 11:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Document typeclasses laws
2 participants