packages feed

polysemy-uncontrolled 0.1.1.0 → 0.1.1.1

raw patch · 3 files changed

+9/−23 lines, 3 filesdep ~basedep ~polysemyPVP: major bump suggested

API removals or changes: PVP suggests a major version bump

Dependency ranges changed: base, polysemy

API changes (from Hackage documentation)

- 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: receive :: forall c_a54J b_a54K r_a6q6. Member (Uncontrolled c_a54J b_a54K) r_a6q6 => Sem r_a6q6 b_a54K
- Polysemy.Uncontrolled: send :: forall c_a4lg b_a4lh r_a5JT. MemberWithError (Uncontrolled c_a4lg b_a4lh) r_a5JT => c_a4lg -> Sem r_a5JT ()
+ Polysemy.Uncontrolled: send :: forall c_a54G b_a54H r_a6q4. Member (Uncontrolled c_a54G b_a54H) r_a6q4 => c_a54G -> Sem r_a6q4 ()

Files

README.md view
@@ -1,6 +1,3 @@ # polysemy-uncontrolled -An insane way to represent pure side effects in polysemy.--This is for evil, people who are pure of heart should not-look in here.+An way to represent pure side effects in polysemy.
polysemy-uncontrolled.cabal view
@@ -1,11 +1,11 @@ cabal-version: 1.12 --- This file has been generated from package.yaml by hpack version 0.34.4.+-- This file has been generated from package.yaml by hpack version 0.34.7. -- -- see: https://github.com/sol/hpack  name:           polysemy-uncontrolled-version:        0.1.1.0+version:        0.1.1.1 synopsis:       Uncontrolled toy effect for polysemy. category:       Polysemy author:         Daniel Firth@@ -20,7 +20,7 @@  source-repository head   type: git-  location: https://gitlab.com/homotopic-tech/polysemy-uncontrolled+  location: https://gitlab.homotopic.tech/haskell/polysemy-uncontrolled  library   exposed-modules:@@ -31,7 +31,7 @@       src   ghc-options: -Wall -Wcompat -Wincomplete-record-updates -Wincomplete-uni-patterns -Wredundant-constraints   build-depends:-      base >=4.7 && <4.16-    , polysemy >=1.3.0.0 && <1.7+      base >=4.7 && <4.18+    , polysemy >=1.3.0.0 && <1.8     , polysemy-methodology >=0.2.1.0 && <0.3   default-language: Haskell2010
src/Polysemy/Uncontrolled.hs view
@@ -15,23 +15,12 @@ --   License    : MIT --   Stability  : experimental ----- `Uncontrolled` is the evil dual of `Methodology`. Where a `Methodology b c`+-- `Uncontrolled` is the dual of `Methodology`. Where a `Methodology b c` -- represents a way to turn `b` into `c` in a controlled decomposition, -- `Uncontrolled` represents a purely unknown side effect - that materialises -- `b`s out of nowhere, and sends `c`s into the void where we have no knowledge -- of what happens to them. This is equivalent to the combination of `Input` -- and `Output` considered as a single unit.------ This exists for symmetry with `Methodology` and out of curiosity, but should--- be considered extremely dangerous. `Uncontrolled` can only ever be--- reinterpreted as an equally or more severe side effect than the context in--- which it's introduced. For experimentation though, this module might be fun--- to see how much evil you can get away with.------ There is a simple interpretation in the form of `runUncontrolledAsState`, as--- well as ways of getting between `Uncontrolled` and `Input`/`Output`.--- Combined with `teeMethodology` and `plugMethodology`, this may give you a--- way to teleport state around your architecture. module Polysemy.Uncontrolled   ( -- * Definition     Uncontrolled (..),@@ -76,7 +65,7 @@ runUncontrolledAsState f g = runUncontrolledAsStateSem (pure . f) (pure . g) {-# INLINE runUncontrolledAsState #-} --- | Like `runUncontrolledAsState`, but uses monadic accessors. Using this would be completely insane. ;)+-- | Like `runUncontrolledAsState`, but uses monadic accessors. -- -- @since 0.1.0.0 runUncontrolledAsStateSem :: forall s b c r a. Members '[State s] r => (c -> Sem r s) -> (s -> Sem r b) -> Sem (Uncontrolled c b ': r) a -> Sem r a@@ -101,7 +90,7 @@ adaptUncontrolledPure f g = adaptUncontrolledSem (pure . f) (pure . g) {-# INLINE adaptUncontrolledPure #-} --- | Like `adaptUncontrolledPure`, but with monadic adapters. If you use this I have no idea what you're trying to accomplish.+-- | Like `adaptUncontrolledPure`, but with monadic adapters. -- -- @since 0.1.0.0 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