Implement initial BindLeft and MonadLeft#17
Implement initial BindLeft and MonadLeft#17JordanMartinez wants to merge 24 commits intopurescript:masterfrom JordanMartinez:addBindLeft
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.
Should the convention be Flip.do rather than MonadLeft.do?
There was a problem hiding this comment.
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.
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 |
kl0tl
left a comment
There was a problem hiding this comment.
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.
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