-
Notifications
You must be signed in to change notification settings - Fork 8
Implement initial BindLeft and MonadLeft #17
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
Conversation
src/Control/MonadLeft/Qualified.purs
Outdated
-- | import Control.MonadLeft.Qualified as MonadLeft | ||
-- | | ||
-- | foo :: Either Int String -> Either String String | ||
-- | foo comp = MonadLeft.ado |
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.
Should the convention be Flip.do
rather than MonadLeft.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.
MonadLeft.do
seems more meaningful to me than Flip.do
, but writing MonadLeft.ado
for a type with only an ApplicativeLeft
instance and no MonadLeft
is odd.
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 read MonadLeft.do
/ MonadLeft.ado
less of a "hey, this thing is a monad!" and more of a "hey, we're using the MonadLeft
type class hierarchy here." That's how I read Ix.do
, React.do
, and Hooks.do
.
What advantage would there be for defining an instance of |
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.
While lapply
, lpure
, lbind
and ldiscard
are consistent with lmap
, llift*
is awkward and lifM
reads like a typo. This is consistent with the prefixes from bifunctors and indexed-monad though, so perhaps this ship has already sailed.
src/Control/MonadLeft/Qualified.purs
Outdated
-- | import Control.MonadLeft.Qualified as MonadLeft | ||
-- | | ||
-- | foo :: Either Int String -> Either String String | ||
-- | foo comp = MonadLeft.ado |
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.
MonadLeft.do
seems more meaningful to me than Flip.do
, but writing MonadLeft.ado
for a type with only an ApplicativeLeft
instance and no MonadLeft
is odd.
We could always break convention here now and update bifunctors and indexed-monad to use a |
CI now builds. |
The only thing blocking this PR is deciding on the naming convention for referencing this qualified do. I think |
I moved all the modules implemented here into a I've also updated the naming convention for the qualified do to use Can I get an approval on this? |
This feels like a case of YAGNI to me. It's hard for me to see us ever wanting to do that in core; even this version of MonadLeft has only generated minimal interest. |
How about I publish this as a separate library then? |
I don't have a strong view on whether MonadLeft should be in core or not, but I think the argument that it should be here so that we can provide |
Ah... That does make sense. |
Closing as this hasn't received an approval or further feedback. |
Fixes #12
WIP
Things to do:
ldiscard
,lbind
,lmap
, andlapply