polysemy-uncontrolled 0.1.0.0 → 0.1.1.0
raw patch · 3 files changed
+20/−15 lines, 3 filesdep −polysemy-plugindep ~basedep ~polysemy-methodologyPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
Dependencies removed: polysemy-plugin
Dependency ranges changed: base, polysemy-methodology
API changes (from Hackage documentation)
- Polysemy.Uncontrolled: adaptUncontrolledSem :: Members '[Uncontrolled c' b'] r => (c -> Sem r c') -> (b' -> Sem r b) -> Sem (Uncontrolled c b : r) a -> Sem r a
+ Polysemy.Uncontrolled: adaptUncontrolledSem :: forall c b c' b' r a. Members '[Uncontrolled c' b'] r => (c -> Sem r c') -> (b' -> Sem r b) -> Sem (Uncontrolled c b : r) a -> Sem r a
- Polysemy.Uncontrolled: receive :: forall c_ab4X b_ab4Y r_actz. MemberWithError (Uncontrolled c_ab4X b_ab4Y) r_actz => Sem r_actz b_ab4Y
+ Polysemy.Uncontrolled: receive :: forall c_a4lj b_a4lk r_a5JV. MemberWithError (Uncontrolled c_a4lj b_a4lk) r_a5JV => Sem r_a5JV b_a4lk
- Polysemy.Uncontrolled: runInputAsUncontrolled :: Members '[Uncontrolled c b] r => Sem (Input b : r) a -> Sem r a
+ Polysemy.Uncontrolled: runInputAsUncontrolled :: forall c b r a. Members '[Uncontrolled c b] r => Sem (Input b : r) a -> Sem r a
- Polysemy.Uncontrolled: runMethodologyAsUncontrolled :: Members '[Uncontrolled b c] r => Sem (Methodology b c : r) a -> Sem r a
+ Polysemy.Uncontrolled: runMethodologyAsUncontrolled :: forall c b r a. Members '[Uncontrolled b c] r => Sem (Methodology b c : r) a -> Sem r a
- Polysemy.Uncontrolled: runOutputAsUncontrolled :: Members '[Uncontrolled c b] r => Sem (Output c : r) a -> Sem r a
+ Polysemy.Uncontrolled: runOutputAsUncontrolled :: forall c b r a. Members '[Uncontrolled c b] r => Sem (Output c : r) a -> Sem r a
- Polysemy.Uncontrolled: send :: forall c_ab4U b_ab4V r_actx. MemberWithError (Uncontrolled c_ab4U b_ab4V) r_actx => c_ab4U -> Sem r_actx ()
+ Polysemy.Uncontrolled: send :: forall c_a4lg b_a4lh r_a5JT. MemberWithError (Uncontrolled c_a4lg b_a4lh) r_a5JT => c_a4lg -> Sem r_a5JT ()
Files
- ChangeLog.md +4/−0
- polysemy-uncontrolled.cabal +4/−5
- src/Polysemy/Uncontrolled.hs +12/−10
ChangeLog.md view
@@ -1,5 +1,9 @@ # Changelog for polysemy-uncontrolled +## v0.1.1.0++* Remove dependency on polysemy-plugin.+ ## v0.1.0.0 * An insane way to represent evil side effects in polysemy.
polysemy-uncontrolled.cabal view
@@ -5,7 +5,7 @@ -- see: https://github.com/sol/hpack name: polysemy-uncontrolled-version: 0.1.0.0+version: 0.1.1.0 synopsis: Uncontrolled toy effect for polysemy. category: Polysemy author: Daniel Firth@@ -31,8 +31,7 @@ src ghc-options: -Wall -Wcompat -Wincomplete-record-updates -Wincomplete-uni-patterns -Wredundant-constraints build-depends:- base >=4.7 && <5- , polysemy >=1.3.0.0 && <1.5- , polysemy-methodology >=0.1.0.0 && <0.2- , polysemy-plugin+ base >=4.7 && <4.16+ , polysemy >=1.3.0.0 && <1.7+ , polysemy-methodology >=0.2.1.0 && <0.3 default-language: Haskell2010
src/Polysemy/Uncontrolled.hs view
@@ -9,7 +9,6 @@ {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE TypeApplications #-} {-# LANGUAGE TypeOperators #-}-{-# OPTIONS_GHC -fplugin=Polysemy.Plugin #-} -- | -- Module : Polysemy.Uncontrolled@@ -62,6 +61,8 @@ import Polysemy.State -- | An `Uncontrolled` generalises an unmanaged side effect.+--+-- @since 0.1.0.0 data Uncontrolled c b m a where Send :: c -> Uncontrolled c b m () Receive :: Uncontrolled c b m b@@ -103,31 +104,32 @@ -- | Like `adaptUncontrolledPure`, but with monadic adapters. If you use this I have no idea what you're trying to accomplish. -- -- @since 0.1.0.0-adaptUncontrolledSem :: Members '[Uncontrolled c' b'] r => (c -> Sem r c') -> (b' -> Sem r b) -> Sem (Uncontrolled c b ': r) a -> Sem r a+adaptUncontrolledSem :: forall c b c' b' r a. Members '[Uncontrolled c' b'] r => (c -> Sem r c') -> (b' -> Sem r b) -> Sem (Uncontrolled c b ': r) a -> Sem r a adaptUncontrolledSem f g = interpret $ \case- Send c -> f c >>= send- Receive -> receive >>= g+ Send c -> f c >>= send @c' @b'+ Receive -> receive @c' @b' >>= g {-# INLINE adaptUncontrolledSem #-} -- | Run an `Input` as one side of an `Uncontrolled`. -- -- @since 0.1.0.0-runInputAsUncontrolled :: Members '[Uncontrolled c b] r => Sem (Input b ': r) a -> Sem r a+runInputAsUncontrolled :: forall c b r a. Members '[Uncontrolled c b] r => Sem (Input b ': r) a -> Sem r a runInputAsUncontrolled = interpret $ \case- Input -> receive+ Input -> receive @c @b {-# INLINE runInputAsUncontrolled #-} -- | Run an `Output` as one side of an `Uncontrolled`. -- -- @since 0.1.0.0-runOutputAsUncontrolled :: Members '[Uncontrolled c b] r => Sem (Output c ': r) a -> Sem r a+runOutputAsUncontrolled :: forall c b r a. Members '[Uncontrolled c b] r => Sem (Output c ': r) a -> Sem r a runOutputAsUncontrolled = interpret $ \case- Output c -> send c+ Output c -> send @c @b c {-# INLINE runOutputAsUncontrolled #-} -- | Run a `Methodology` as an `Uncontrolled` pure side effect. -- -- @since 0.1.0.0-runMethodologyAsUncontrolled :: Members '[Uncontrolled b c] r => Sem (Methodology b c ': r) a -> Sem r a+runMethodologyAsUncontrolled :: forall c b r a. Members '[Uncontrolled b c] r => Sem (Methodology b c ': r) a -> Sem r a runMethodologyAsUncontrolled = interpret $ \case- Process b -> send b >> receive+ Process b -> send @b @c b >> receive @b @c+{-# INLINE runMethodologyAsUncontrolled #-}