HORIZON HASKELLDocslts/ghc-10.0.x8fef28d2026-11-02Search packagesCtrl K
Theme: |

GHC 10.0.0.20260917 · lts/ghc-10.0.x · 8fef28d · 2026-11-02

Modulepolysemy-extra-0.2.1.0Haskell2010

Polysemy.Extra

Extra convenience functions for polysemy.

Contents
  1. Input
  2. Output
  3. Raise
  4. Reinterpreters
  5. Rotation
  6. Reverse
Synopsis

Input

Output

Raise

valueraise4Under
  1. :: Sem (e1 ': e2 ': e3 ': e4 ': r) a
  2. -> Sem (e1 ': e2 ': e3 ': e4 ': e5 ': r) a

Like raise, but introduces an effect four levels underneath the head of the list.

Reinterpreters

valuereinterpretUnder
  1. :: (forall (m :: [Effect]) x. Sem (e2 ': m) x -> Sem (e3 ': m) x)

    A natural transformation from the handled effect to the new effects.

  2. -> Sem (e1 ': e2 ': r) a
  3. -> Sem (e1 ': e3 ': r) a

Reinterpret the second effect in the stack into a single effect.

valuereinterpretUnder2
  1. :: (forall (m :: [Effect]) x. Sem (e3 ': m) x -> Sem (e4 ': m) x)

    A natural transformation from the handled effect to the new effects.

  2. -> Sem (e1 ': e2 ': e3 ': r) a
  3. -> Sem (e1 ': e2 ': e4 ': r) a

Reinterpret the third effect in the stack into a single effect.

valuereinterpret2Under
  1. :: (forall (m :: [Effect]) x. Sem (e2 ': m) x -> Sem (e3 ': e4 ': m) x)

    A natural transformation from the handled effect to the new effects.

  2. -> Sem (e1 ': e2 ': r) a
  3. -> Sem (e1 ': e3 ': e4 ': r) a

Reinterpret the second effect in the stack in terms of two effects.

Rotation

valuerotateEffects2 :: Sem (e1 ': e2 ': r) a -> Sem (e2 ': e1 ': r) a

Swap the positions of the first two effects in the stack.

valuerotateEffects3L
  1. :: Sem (e1 ': e2 ': e3 ': r) a
  2. -> Sem (e2 ': e3 ': e1 ': r) a

Rotate the first three effects in the stack to the left.

valuerotateEffects3R
  1. :: Sem (e1 ': e2 ': e3 ': r) a
  2. -> Sem (e3 ': e1 ': e2 ': r) a

Rotate the first three effects in the stack to the right.

valuerotateEffects4L
  1. :: Sem (e1 ': e2 ': e3 ': e4 ': r) a
  2. -> Sem (e2 ': e3 ': e4 ': e1 ': r) a

Rotate the first four effects in the stack to the left.

valuerotateEffects4R
  1. :: Sem (e1 ': e2 ': e3 ': e4 ': r) a
  2. -> Sem (e4 ': e1 ': e2 ': e3 ': r) a

Rotate the first four effects in the stack to the right.

Reverse

valuereverseEffects3
  1. :: Sem (e1 ': e2 ': e3 ': r) a
  2. -> Sem (e3 ': e2 ': e1 ': r) a

Reverse the position of the first three effects in the stack.

valuereverseEffects4
  1. :: Sem (e1 ': e2 ': e3 ': e4 ': r) a
  2. -> Sem (e4 ': e3 ': e2 ': e1 ': r) a

Reverse the position of the first four effects in the stack.