Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 205f06a

Browse files
committed
added: MonadWriter class
1 parent f0237de commit 205f06a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

‎WriterT.hs‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,13 @@ module WriterT where
33

44
import Control.Monad
55
import Control.Monad.Trans
6-
import Control.Monad.Writer
76
import Data.Monoid
87

98
newtype MyWriterT w m a = MyWriterT { runMyWriterT :: m (a,w) }
109

10+
class Monad m => (MonadWriter w m) where
11+
tell :: (Monoid w, Monad m) => w -> MyWriterT w m ()
12+
1113
instance (Monoid w, Monad m) => Functor (MyWriterT w m) where
1214
fmap = liftM
1315

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /