monad-classes 0.3.2.0 → 0.3.2.1
raw patch · 6 files changed
+23/−9 lines, 6 files
Files
- Control/Monad/Classes/ReadState.hs +1/−2
- Control/Monad/Classes/Writer.hs +0/−1
- Control/Monad/Classes/Zoom.hs +0/−1
- README.md +1/−1
- monad-classes.cabal +6/−2
- tests/test.hs +15/−2
Control/Monad/Classes/ReadState.hs view
@@ -6,7 +6,6 @@ import Control.Monad.Classes.State import Control.Monad.Trans.Identity import Control.Monad.Trans.Class-import Control.Applicative import Control.Monad.Base import Control.Monad.Trans.Control import Data.Peano@@ -39,7 +38,7 @@ liftBase = lift . liftBase instance MonadTransControl (ReadStateT x) where- type StT (ReadStateT s) a = StT IdentityT a+ type StT (ReadStateT x) a = StT IdentityT a liftWith = defaultLiftWith ReadStateT (\(ReadStateT a) -> a) restoreT = defaultRestoreT ReadStateT
Control/Monad/Classes/Writer.hs view
@@ -12,7 +12,6 @@ import Control.Monad.Classes.Core import Control.Monad.Classes.Effects import Control.Monad.Classes.Proxied-import Data.Monoid import Data.Peano type instance CanDo (WL.WriterT w m) eff = WriterCanDo w eff
Control/Monad/Classes/Zoom.hs view
@@ -13,7 +13,6 @@ import Control.Monad.Classes.Writer import Control.Monad.Classes.Proxied import Data.Functor.Identity-import Data.Monoid import Data.Peano (Peano (..)) newtype ZoomT big small m a = ZoomT (Proxied (VLLens big small) m a)
README.md view
@@ -1,4 +1,4 @@-[](https://travis-ci.org/feuerbach/monad-classes)+[](https://travis-ci.org/strake/monad-classes.hs) See [this series of articles][1] for the detailed description and motivation.
monad-classes.cabal view
@@ -1,5 +1,5 @@ name: monad-classes-version: 0.3.2.0+version: 0.3.2.1 synopsis: more flexible mtl -- description: homepage: https://github.com/strake/monad-classes.hs@@ -13,6 +13,10 @@ extra-source-files: README.md cabal-version: >=1.10+tested-with: GHC >=7.8.2 && <7.9,+ GHC ==7.10.*,+ GHC ==7.12.*,+ GHC ==8.0.* library exposed-modules:@@ -63,7 +67,7 @@ Test-suite test Default-language: Haskell2010- Extensions:+ Default-extensions: FlexibleContexts Type: exitcode-stdio-1.0
tests/test.hs view
@@ -48,6 +48,7 @@ , liftConduitTest , mapWriterTest , readStateTest+ , polymorphicTests ] readerTests = testGroup "Reader Tests"@@ -151,7 +152,7 @@ => Proxy# eff -> C.ConduitM i o effM r -> C.ConduitM i o m r-liftConduit _ = hoist (liftN (proxy# :: Proxy# n))+liftConduit _ = C.transPipe (liftN (proxy# :: Proxy# n)) liftConduitTest = testCase "lift conduit" $ (let@@ -163,7 +164,7 @@ C.await >>= maybe (return ()) (\x -> do lift $ tell [x::Int]; sink) in- W.execWriter $ hoist (liftN (proxy# :: Proxy# (Succ Zero))) src C.$$ sink+ W.execWriter $ C.transPipe (liftN (proxy# :: Proxy# (Succ Zero))) src C.$$ sink ) @?= [1,2] {- @@ -189,3 +190,15 @@ a2 = runReadState (Proxy :: Proxy Char) a1 run (evalStateStrict 'w' a2) @?= 'w'++polymorphicTests = testGroup "Polymorphic monadic values"+ [ testCase "MonadReader WriterT" $ do+ run (runReader 'c' (W.runWriterT polyReader1)) @?= ('c', ())+ , testCase "MonadReader ReaderT" $ do+ run (runReader 'c' (runReader False polyReader2)) @?= 'c'+ ]+ where+ polyReader1 :: MonadReader Char m => W.WriterT () m Char+ polyReader1 = ask+ polyReader2 :: MonadReader Char m => R.ReaderT Bool m Char+ polyReader2 = ask