effect-stack 0.3 → 0.3.0.1
raw patch · 10 files changed
+33/−13 lines, 10 filesdep ~basedep ~constraintsdep ~mtlPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
Dependency ranges changed: base, constraints, mtl, transformers
API changes (from Hackage documentation)
- Control.Monad.Stack.Accum: type family PopAccum m :: * -> *;
- Control.Monad.Stack.Cont: type family PopCont m :: * -> *;
- Control.Monad.Stack.Error: type family PopError m :: * -> *;
- Control.Monad.Stack.Fail: type family PopFail m :: * -> *;
- Control.Monad.Stack.Reader: type family PopReader m :: * -> *;
- Control.Monad.Stack.Select: type family PopSelect m :: * -> *;
- Control.Monad.Stack.State: type family PopState m :: * -> *;
- Control.Monad.Stack.Writer: type family PopWriter m :: * -> *;
+ Control.Monad.Stack.Accum: type PopAccum (m :: Type -> Type) :: Type -> Type;
+ Control.Monad.Stack.Cont: type PopCont (m :: Type -> Type) :: Type -> Type;
+ Control.Monad.Stack.Error: type PopError (m :: Type -> Type) :: Type -> Type;
+ Control.Monad.Stack.Fail: type PopFail (m :: Type -> Type) :: Type -> Type;
+ Control.Monad.Stack.Reader: type PopReader (m :: Type -> Type) :: Type -> Type;
+ Control.Monad.Stack.Select: type PopSelect (m :: Type -> Type) :: Type -> Type;
+ Control.Monad.Stack.State: type PopState (m :: Type -> Type) :: Type -> Type;
+ Control.Monad.Stack.Writer: type PopWriter (m :: Type -> Type) :: Type -> Type;
- Control.Monad.Stack.Accum: class Monad m => AccumStack m where {
+ Control.Monad.Stack.Accum: class Monad m => AccumStack (m :: Type -> Type) where {
- Control.Monad.Stack.Accum: depthAccum :: forall n m a. AccumConstraints n m => AccumDepth n m a -> m a
+ Control.Monad.Stack.Accum: depthAccum :: forall (n :: Nat) m a. AccumConstraints n m => AccumDepth n m a -> m a
- Control.Monad.Stack.Accum: type AccumConstraints n m = (KnownNat n, StackConstraints n AccumT AccumStack m)
+ Control.Monad.Stack.Accum: type AccumConstraints (n :: Nat) (m :: Type -> Type) = (KnownNat n, StackConstraints n AccumT AccumStack m)
- Control.Monad.Stack.Accum: type AccumDepth n m = IteratePop n AccumT m
+ Control.Monad.Stack.Accum: type AccumDepth (n :: Nat) (m :: Type -> Type) = IteratePop n AccumT m
- Control.Monad.Stack.Cont: class Monad m => ContStack m where {
+ Control.Monad.Stack.Cont: class Monad m => ContStack (m :: Type -> Type) where {
- Control.Monad.Stack.Cont: depthCont :: forall n m a. ContConstraints n m => ContDepth n m a -> m a
+ Control.Monad.Stack.Cont: depthCont :: forall (n :: Nat) m a. ContConstraints n m => ContDepth n m a -> m a
- Control.Monad.Stack.Cont: type ContConstraints n m = (KnownNat n, StackConstraints n ContTag ContStack m)
+ Control.Monad.Stack.Cont: type ContConstraints (n :: Nat) (m :: Type -> Type) = (KnownNat n, StackConstraints n ContTag ContStack m)
- Control.Monad.Stack.Cont: type ContDepth n m = IteratePop n ContTag m
+ Control.Monad.Stack.Cont: type ContDepth (n :: Nat) (m :: Type -> Type) = IteratePop n ContTag m
- Control.Monad.Stack.Cont: type MonadContDepth n m = (ContConstraints n m, MonadCont (ContDepth n m))
+ Control.Monad.Stack.Cont: type MonadContDepth (n :: Nat) (m :: Type -> Type) = (ContConstraints n m, MonadCont ContDepth n m)
- Control.Monad.Stack.Error: class Monad m => ErrorStack m where {
+ Control.Monad.Stack.Error: class Monad m => ErrorStack (m :: Type -> Type) where {
- Control.Monad.Stack.Error: depthError :: forall n m a. ErrorConstraints n m => ErrorDepth n m a -> m a
+ Control.Monad.Stack.Error: depthError :: forall (n :: Nat) m a. ErrorConstraints n m => ErrorDepth n m a -> m a
- Control.Monad.Stack.Error: type ErrorConstraints n m = (KnownNat n, StackConstraints n ExceptT ErrorStack m)
+ Control.Monad.Stack.Error: type ErrorConstraints (n :: Nat) (m :: Type -> Type) = (KnownNat n, StackConstraints n ExceptT ErrorStack m)
- Control.Monad.Stack.Error: type ErrorDepth n m = IteratePop n ExceptT m
+ Control.Monad.Stack.Error: type ErrorDepth (n :: Nat) (m :: Type -> Type) = IteratePop n ExceptT m
- Control.Monad.Stack.Error: type MonadErrorDepth n m e = (ErrorConstraints n m, MonadError e (ErrorDepth n m))
+ Control.Monad.Stack.Error: type MonadErrorDepth (n :: Nat) (m :: Type -> Type) e = (ErrorConstraints n m, MonadError e ErrorDepth n m)
- Control.Monad.Stack.Fail: class Monad m => FailStack m where {
+ Control.Monad.Stack.Fail: class Monad m => FailStack (m :: Type -> Type) where {
- Control.Monad.Stack.Fail: depthFail :: forall n m a. FailConstraints n m => FailDepth n m a -> m a
+ Control.Monad.Stack.Fail: depthFail :: forall (n :: Nat) m a. FailConstraints n m => FailDepth n m a -> m a
- Control.Monad.Stack.Fail: type FailConstraints n m = (KnownNat n, StackConstraints n MaybeT FailStack m)
+ Control.Monad.Stack.Fail: type FailConstraints (n :: Nat) (m :: Type -> Type) = (KnownNat n, StackConstraints n MaybeT FailStack m)
- Control.Monad.Stack.Fail: type FailDepth n m = IteratePop n MaybeT m
+ Control.Monad.Stack.Fail: type FailDepth (n :: Nat) (m :: Type -> Type) = IteratePop n MaybeT m
- Control.Monad.Stack.Fail: type MonadFailDepth n m = (FailConstraints n m, MonadFail (FailDepth n m))
+ Control.Monad.Stack.Fail: type MonadFailDepth (n :: Nat) (m :: Type -> Type) = (FailConstraints n m, MonadFail FailDepth n m)
- Control.Monad.Stack.Internal: depth :: forall n c cSucc m a. (KnownNat n, StackConstraints n c cSucc m) => (forall m. cSucc m => Pop c m a -> m a) -> IteratePop n c m a -> m a
+ Control.Monad.Stack.Internal: depth :: forall {k} (n :: Nat) (c :: k) cSucc m a. (KnownNat n, StackConstraints n c cSucc m) => (forall (m1 :: Type -> Type). cSucc m1 => Pop c m1 a -> m1 a) -> IteratePop n c m a -> m a
- Control.Monad.Stack.Internal: nonZeroNat :: forall n c cSucc m a. KnownNat (n - 1) => (IteratePop n c m a :~: IteratePop (n - 1) c (Pop c m) a, StackConstraints n c cSucc m :~: (cSucc m, StackConstraints (n - 1) c cSucc (Pop c m)))
+ Control.Monad.Stack.Internal: nonZeroNat :: forall {k} (n :: Natural) (c :: k) cSucc (m :: Type -> Type) a. KnownNat (n - 1) => (IteratePop n c m a :~: IteratePop (n - 1) c (Pop c m) a, StackConstraints n c cSucc m :~: (cSucc m, StackConstraints (n - 1) c cSucc (Pop c m)))
- Control.Monad.Stack.Internal: predNat :: forall n. KnownNat n => Either (n :~: 0) (Dict (KnownNat (n - 1)))
+ Control.Monad.Stack.Internal: predNat :: forall (n :: Nat). KnownNat n => Either (n :~: 0) (Dict (KnownNat (n - 1)))
- Control.Monad.Stack.Internal: type family Pop (c :: k) (m :: k') :: k'
+ Control.Monad.Stack.Internal: type family StackConstraints (n :: Nat) (c :: k) (cSucc :: k' -> Constraint) (m :: k')
- Control.Monad.Stack.Reader: class Monad m => ReaderStack m where {
+ Control.Monad.Stack.Reader: class Monad m => ReaderStack (m :: Type -> Type) where {
- Control.Monad.Stack.Reader: depthReader :: forall n m a. ReaderConstraints n m => ReaderDepth n m a -> m a
+ Control.Monad.Stack.Reader: depthReader :: forall (n :: Nat) m a. ReaderConstraints n m => ReaderDepth n m a -> m a
- Control.Monad.Stack.Reader: type MonadReaderDepth n m r = (ReaderConstraints n m, MonadReader r (ReaderDepth n m))
+ Control.Monad.Stack.Reader: type MonadReaderDepth (n :: Nat) (m :: Type -> Type) r = (ReaderConstraints n m, MonadReader r ReaderDepth n m)
- Control.Monad.Stack.Reader: type ReaderConstraints n m = (KnownNat n, StackConstraints n ReaderT ReaderStack m)
+ Control.Monad.Stack.Reader: type ReaderConstraints (n :: Nat) (m :: Type -> Type) = (KnownNat n, StackConstraints n ReaderT ReaderStack m)
- Control.Monad.Stack.Reader: type ReaderDepth n m = IteratePop n ReaderT m
+ Control.Monad.Stack.Reader: type ReaderDepth (n :: Nat) (m :: Type -> Type) = IteratePop n ReaderT m
- Control.Monad.Stack.Select: class Monad m => SelectStack m where {
+ Control.Monad.Stack.Select: class Monad m => SelectStack (m :: Type -> Type) where {
- Control.Monad.Stack.Select: depthSelect :: forall n m a. SelectConstraints n m => SelectDepth n m a -> m a
+ Control.Monad.Stack.Select: depthSelect :: forall (n :: Nat) m a. SelectConstraints n m => SelectDepth n m a -> m a
- Control.Monad.Stack.Select: type SelectConstraints n m = (KnownNat n, StackConstraints n SelectT SelectStack m)
+ Control.Monad.Stack.Select: type SelectConstraints (n :: Nat) (m :: Type -> Type) = (KnownNat n, StackConstraints n SelectT SelectStack m)
- Control.Monad.Stack.Select: type SelectDepth n m = IteratePop n SelectT m
+ Control.Monad.Stack.Select: type SelectDepth (n :: Nat) (m :: Type -> Type) = IteratePop n SelectT m
- Control.Monad.Stack.State: class Monad m => StateStack m where {
+ Control.Monad.Stack.State: class Monad m => StateStack (m :: Type -> Type) where {
- Control.Monad.Stack.State: depthState :: forall n m a. StateConstraints n m => StateDepth n m a -> m a
+ Control.Monad.Stack.State: depthState :: forall (n :: Nat) m a. StateConstraints n m => StateDepth n m a -> m a
- Control.Monad.Stack.State: type MonadStateDepth n m s = (StateConstraints n m, MonadState s (StateDepth n m))
+ Control.Monad.Stack.State: type MonadStateDepth (n :: Nat) (m :: Type -> Type) s = (StateConstraints n m, MonadState s StateDepth n m)
- Control.Monad.Stack.State: type StateConstraints n m = (KnownNat n, StackConstraints n StateT StateStack m)
+ Control.Monad.Stack.State: type StateConstraints (n :: Nat) (m :: Type -> Type) = (KnownNat n, StackConstraints n StateT StateStack m)
- Control.Monad.Stack.State: type StateDepth n m = IteratePop n StateT m
+ Control.Monad.Stack.State: type StateDepth (n :: Nat) (m :: Type -> Type) = IteratePop n StateT m
- Control.Monad.Stack.Writer: class Monad m => WriterStack m where {
+ Control.Monad.Stack.Writer: class Monad m => WriterStack (m :: Type -> Type) where {
- Control.Monad.Stack.Writer: depthWriter :: forall n m a. WriterConstraints n m => WriterDepth n m a -> m a
+ Control.Monad.Stack.Writer: depthWriter :: forall (n :: Nat) m a. WriterConstraints n m => WriterDepth n m a -> m a
- Control.Monad.Stack.Writer: type MonadWriterDepth n m w = (WriterConstraints n m, MonadWriter w (WriterDepth n m))
+ Control.Monad.Stack.Writer: type MonadWriterDepth (n :: Nat) (m :: Type -> Type) w = (WriterConstraints n m, MonadWriter w WriterDepth n m)
- Control.Monad.Stack.Writer: type WriterConstraints n m = (KnownNat n, StackConstraints n WriterT WriterStack m)
+ Control.Monad.Stack.Writer: type WriterConstraints (n :: Nat) (m :: Type -> Type) = (KnownNat n, StackConstraints n WriterT WriterStack m)
- Control.Monad.Stack.Writer: type WriterDepth n m = IteratePop n WriterT m
+ Control.Monad.Stack.Writer: type WriterDepth (n :: Nat) (m :: Type -> Type) = IteratePop n WriterT m
Files
- ChangeLog.md +4/−0
- Control/Monad/Stack/Accum.hs +3/−1
- Control/Monad/Stack/Cont.hs +3/−1
- Control/Monad/Stack/Error.hs +3/−1
- Control/Monad/Stack/Fail.hs +3/−1
- Control/Monad/Stack/Reader.hs +3/−1
- Control/Monad/Stack/Select.hs +3/−1
- Control/Monad/Stack/State.hs +3/−1
- Control/Monad/Stack/Writer.hs +3/−1
- effect-stack.cabal +5/−5
ChangeLog.md view
@@ -1,5 +1,9 @@ # Revision history for effect-stack +## 0.3.0.1 -- 2025-06-05++* Relax dependency versions; thank you Aster89.+ ## 0.3 -- 2019-07-13 * Rename `Control.Monad.Except` to `Control.Monad.Error` for consistency.
Control/Monad/Stack/Accum.hs view
@@ -25,8 +25,10 @@ import Control.Monad.Trans.Writer.Lazy as WL import Control.Monad.Trans.Writer.Strict as WS +import Data.Kind+ class Monad m => AccumStack m where- type PopAccum m :: * -> *+ type PopAccum m :: Type -> Type liftAccum :: PopAccum m a -> m a type instance Pop AccumT m = PopAccum m
Control/Monad/Stack/Cont.hs view
@@ -27,8 +27,10 @@ import Control.Monad.Trans.Writer.Lazy as WL import Control.Monad.Trans.Writer.Strict as WS +import Data.Kind+ class Monad m => ContStack m where- type PopCont m :: * -> *+ type PopCont m :: Type -> Type liftCont :: PopCont m a -> m a type instance Pop ContTag m = PopCont m
Control/Monad/Stack/Error.hs view
@@ -27,8 +27,10 @@ import Control.Monad.Trans.Writer.Lazy as WL import Control.Monad.Trans.Writer.Strict as WS +import Data.Kind+ class Monad m => ErrorStack m where- type PopError m :: * -> *+ type PopError m :: Type -> Type liftError :: PopError m a -> m a type instance Pop ExceptT m = PopError m
Control/Monad/Stack/Fail.hs view
@@ -27,8 +27,10 @@ import Control.Monad.Trans.Writer.Lazy as WL import Control.Monad.Trans.Writer.Strict as WS +import Data.Kind+ class Monad m => FailStack m where- type PopFail m :: * -> *+ type PopFail m :: Type -> Type liftFail :: PopFail m a -> m a type instance Pop MaybeT m = PopFail m
Control/Monad/Stack/Reader.hs view
@@ -27,8 +27,10 @@ import Control.Monad.Trans.Writer.Lazy as WL import Control.Monad.Trans.Writer.Strict as WS +import Data.Kind+ class Monad m => ReaderStack m where- type PopReader m :: * -> *+ type PopReader m :: Type -> Type liftReader :: PopReader m a -> m a type instance Pop ReaderT m = PopReader m
Control/Monad/Stack/Select.hs view
@@ -25,8 +25,10 @@ import Control.Monad.Trans.Writer.Lazy as WL import Control.Monad.Trans.Writer.Strict as WS +import Data.Kind+ class Monad m => SelectStack m where- type PopSelect m :: * -> *+ type PopSelect m :: Type -> Type liftSelect :: PopSelect m a -> m a type instance Pop SelectT m = PopSelect m
Control/Monad/Stack/State.hs view
@@ -27,8 +27,10 @@ import Control.Monad.Trans.Writer.Lazy as WL import Control.Monad.Trans.Writer.Strict as WS +import Data.Kind+ class Monad m => StateStack m where- type PopState m :: * -> *+ type PopState m :: Type -> Type liftState :: PopState m a -> m a type instance Pop SL.StateT m = PopState m
Control/Monad/Stack/Writer.hs view
@@ -27,8 +27,10 @@ import Control.Monad.Trans.Writer.Lazy as WL import Control.Monad.Trans.Writer.Strict as WS +import Data.Kind+ class Monad m => WriterStack m where- type PopWriter m :: * -> *+ type PopWriter m :: Type -> Type liftWriter :: PopWriter m a -> m a type instance Pop WL.WriterT m = PopWriter m
effect-stack.cabal view
@@ -1,5 +1,5 @@ name: effect-stack-version: 0.3+version: 0.3.0.1 synopsis: Reducing the pain of transformer stacks with duplicated effects description: The @mtl@ provides a nice way to write monadic actions which take advantage of a particular kind of effect (say,@@ -69,9 +69,9 @@ TypeOperators, UndecidableInstances build-depends:- base ^>=4.12,- constraints ^>=0.11,- mtl ^>= 2.2,- transformers ^>=0.5.6+ base >= 4.12 && <= 4.20.0.0,+ constraints >= 0.11 && <= 0.14.2,+ mtl >= 2.2 && <= 2.3.1,+ transformers >= 0.5.6 && <= 0.6.1.1 default-language: Haskell2010 ghc-options: -fno-warn-tabs