@@ -6,7 +6,9 @@
66{-# LANGUAGE DataKinds #-}
77{-# LANGUAGE PolyKinds #-}
88{-# LANGUAGE GeneralizedNewtypeDeriving #-}
9−{-# LANGUAGE MagicHash #-}
9+{-# LANGUAGE AllowAmbiguousTypes #-}
10+{-# LANGUAGE TypeApplications #-}
11+{-# LANGUAGE ScopedTypeVariables #-}
1012
1113-- | See "Control.Monad.Trans.Writer".
1214
@@ -28,7 +30,6 @@ module Control.Monad.Trans.Ether.Writer
2830 , pass
2931 ) where
3032
31−import GHC.Prim (Proxy#)
3233import Data.Functor.Identity (Identity(..))
3334import qualified Control.Monad.Trans.Writer.Lazy as Trans
3435import Control.Monad.Trans.Ether.Tagged
@@ -48,43 +49,43 @@ type Writer tag w = WriterT tag w Identity
4849type WriterT tag w = TaggedTrans tag (Trans.WriterT w)
4950
5051-- | Constructor for computations in the writer monad transformer.
51−writerT :: Proxy# tag -> m (a, w) -> WriterT tag w m a
52−writerT _ = pack . Trans.WriterT
52+writerT :: forall tag w m a . m (a, w) -> WriterT tag w m a
53+writerT = pack . Trans.WriterT
5354
5455-- | Constructor for computations in the writer monad
5556-- (the inverse of 'runWriter').
56−writer :: Monad m => Proxy# tag -> (a, w) -> WriterT tag w m a
57−writer _ = pack . Trans.writer
57+writer :: forall tag w m a . Monad m => (a, w) -> WriterT tag w m a
58+writer = pack . Trans.writer
5859
5960-- | Runs a 'WriterT' and returns both the normal value
6061-- and the final accumulator.
61−runWriterT :: Proxy# tag -> WriterT tag w m a -> m (a, w)
62−runWriterT _ = Trans.runWriterT . unpack
62+runWriterT :: forall tag w m a . WriterT tag w m a -> m (a, w)
63+runWriterT = Trans.runWriterT . unpack
6364
6465-- | Runs a 'Writer' and returns both the normal value
6566-- and the final accumulator.
66−runWriter :: Proxy# tag -> Writer tag w a -> (a, w)
67−runWriter _ = Trans.runWriter . unpack
67+runWriter :: forall tag w a . Writer tag w a -> (a, w)
68+runWriter = Trans.runWriter . unpack
6869
6970-- | Runs a 'WriterT' and returns the final accumulator,
7071-- discarding the normal value.
71−execWriterT :: Monad m => Proxy# tag -> WriterT tag w m a -> m w
72−execWriterT _ = Trans.execWriterT . unpack
72+execWriterT :: forall tag w m a . Monad m => WriterT tag w m a -> m w
73+execWriterT = Trans.execWriterT . unpack
7374
7475-- | Runs a 'Writer' and returns the final accumulator,
7576-- discarding the normal value.
76−execWriter :: Proxy# tag -> Writer tag w a -> w
77−execWriter _ = Trans.execWriter . unpack
77+execWriter :: forall tag w a . Writer tag w a -> w
78+execWriter = Trans.execWriter . unpack
7879
7980-- | Appends a value to the accumulator within the monad.
80−tell :: Monad m => Proxy# tag -> w -> WriterT tag w m ()
81−tell t w = writer t ((), w)
81+tell :: forall tag w m . Monad m => w -> WriterT tag w m ()
82+tell w = writer @tag ((), w)
8283
8384-- | Executes an action and adds its accumulator to the value of the computation.
84−listen :: Monad m => Proxy# tag -> WriterT tag w m a -> WriterT tag w m (a, w)
85−listen _ = pack . Trans.listen . unpack
85+listen :: forall tag w m a . Monad m => WriterT tag w m a -> WriterT tag w m (a, w)
86+listen = pack . Trans.listen . unpack
8687
8788-- | Executes an action which returns a value and a function, and returns the
8889-- value, applying the function to the accumulator.
89−pass :: Monad m => Proxy# tag -> WriterT tag w m (a, w -> w) -> WriterT tag w m a
90−pass _ = pack . Trans.pass . unpack
90+pass :: forall tag w m a . Monad m => WriterT tag w m (a, w -> w) -> WriterT tag w m a
91+pass = pack . Trans.pass . unpack