Skip to content

Monad writer, fixes #889#911

Merged
adelbertc merged 3 commits into
typelevel:masterfrom
adelbertc:monad-writer
Apr 17, 2016
Merged

Monad writer, fixes #889#911
adelbertc merged 3 commits into
typelevel:masterfrom
adelbertc:monad-writer

Conversation

@adelbertc

Copy link
Copy Markdown
Contributor

Other instances are possible: https://hackage.haskell.org/package/mtl-2.2.1/docs/Control-Monad-Writer-Class.html

But I realized we also don't have similar instances for the other MTL type classes, so I'll add it all in one fell swoop

@codecov-io

Copy link
Copy Markdown

Current coverage is 88.90%

Merging #911 into master will decrease coverage by -0.69% as of cc24bac

@@            master   #911   diff @@
=====================================
  Files          181    182     +1
  Stmts         2423   2155   -268
  Branches        76     42    -34
  Methods          0      0       
=====================================
- Hit           2171   1916   -255
  Partial          0      0       
+ Missed         252    239    -13

Review entire Coverage Diff as of cc24bac

Powered by Codecov. Updated on successful CI builds.

@stew

stew commented Mar 4, 2016

Copy link
Copy Markdown
Contributor

👍

@ceedubs

ceedubs commented Mar 8, 2016

Copy link
Copy Markdown
Contributor

In several places this has (A, W), but (W, A) seems like it would line up more nicely with our WriterT. Is there any particular reason you went with the former?

Do people have experience using listen and listens? I will admit to never using MonadWriter, but it seems to me like working with the tuples could be a bit of a hassle. I find myself wondering if it would often be simpler to discard the A component and let people use flatMap and then a method like these if they want a reference to the A component. Just a brain dump: I'm curious about the experience of people who have actually used MonadWriter.

@adelbertc

Copy link
Copy Markdown
Contributor Author

So I copied it from https://github.com/purescript/purescript-transformers/blob/master/docs/Control/Monad/Writer/Class.md - I think it uses tuples instead of separate args because the underlying representation for Writer is a tuple.

@adelbertc adelbertc mentioned this pull request Apr 4, 2016
5 tasks
@non

non commented Apr 17, 2016

Copy link
Copy Markdown
Contributor

Looks good to me. 👍

@adelbertc adelbertc merged commit f529669 into typelevel:master Apr 17, 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.

5 participants