-
-
Notifications
You must be signed in to change notification settings - Fork 4
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
Conversation
Resolves #46
There was a problem hiding this 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.
There was a problem hiding this 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
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 |
There was a problem hiding this comment.
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 👍🏼 🔮
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🍬
Resolves #46