Hoogle Search

Within LTS Haskell 24.34 (ghc-9.10.3)

Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.

  1. subsume :: forall (e :: Effect) (r :: EffectRow) a . Member e r => Sem (e ': r) a -> Sem r a

    polysemy Polysemy

    Interprets an effect in terms of another identical effect. This is useful for defining interpreters that use reinterpretH without immediately consuming the newly introduced effect. Using such an interpreter recursively may result in duplicate effects, which may then be eliminated using subsume. For a version that can introduce an arbitrary number of new effects and reorder existing ones, see subsume_.

  2. subsume_ :: forall (r :: EffectRow) (r' :: EffectRow) a . Subsume r r' => Sem r a -> Sem r' a

    polysemy Polysemy

    Allows reordering and adding known effects on top of the effect stack, as long as the polymorphic "tail" of new stack is a raise-d version of the original one. This function is highly polymorphic, so it may be a good idea to use its more concrete version (subsume), fitting functions from the raise family or type annotations to avoid vague errors in ambiguous contexts.

  3. subsumeBundle :: forall (r' :: [Effect]) (r :: EffectRow) a . Members r' r => Sem (Bundle r' ': r) a -> Sem r a

    polysemy Polysemy.Bundle

    Run a Bundle r if the effect stack contains all effects of r.

  4. class Subsume (r :: EffectRow) (r' :: EffectRow)

    polysemy Polysemy.Internal

    See subsume_.

  5. subsume :: forall (e :: Effect) (r :: EffectRow) a . Member e r => Sem (e ': r) a -> Sem r a

    polysemy Polysemy.Internal

    Interprets an effect in terms of another identical effect. This is useful for defining interpreters that use reinterpretH without immediately consuming the newly introduced effect. Using such an interpreter recursively may result in duplicate effects, which may then be eliminated using subsume. For a version that can introduce an arbitrary number of new effects and reorder existing ones, see subsume_.

  6. subsumeUnion :: forall (m :: Type -> Type) a . Subsume r r' => Union r m a -> Union r' m a

    polysemy Polysemy.Internal

    No documentation available.

  7. subsumeUsing :: forall (e :: Effect) (r :: [Effect]) a . ElemOf e r -> Sem (e ': r) a -> Sem r a

    polysemy Polysemy.Internal

    Interprets an effect in terms of another identical effect, given an explicit proof that the effect exists in r. This is useful in conjunction with tryMembership in order to conditionally make use of effects. For example:

    tryListen :: KnownRow r => Sem r a -> Maybe (Sem r ([Int], a))
    tryListen m = case tryMembership @(Writer [Int]) of
    Just pr -> Just $ subsumeUsing pr (listen (raise m))
    _       -> Nothing
    

  8. subsume_ :: forall (r :: EffectRow) (r' :: EffectRow) a . Subsume r r' => Sem r a -> Sem r' a

    polysemy Polysemy.Internal

    Allows reordering and adding known effects on top of the effect stack, as long as the polymorphic "tail" of new stack is a raise-d version of the original one. This function is highly polymorphic, so it may be a good idea to use its more concrete version (subsume), fitting functions from the raise family or type annotations to avoid vague errors in ambiguous contexts.

  9. subsumeMembership :: forall (r :: [Effect]) (r' :: EffectRow) (e :: Effect) . Members r r' => ElemOf e r -> ElemOf e r'

    polysemy Polysemy.Internal.Bundle

    Transform a membership proof's stack by arbitrary effects using evidence from the context.

  10. subsumeUsing :: forall (e :: Effect) (r :: [Effect]) a . ElemOf e r -> Sem (e ': r) a -> Sem r a

    polysemy Polysemy.Membership

    Interprets an effect in terms of another identical effect, given an explicit proof that the effect exists in r. This is useful in conjunction with tryMembership in order to conditionally make use of effects. For example:

    tryListen :: KnownRow r => Sem r a -> Maybe (Sem r ([Int], a))
    tryListen m = case tryMembership @(Writer [Int]) of
    Just pr -> Just $ subsumeUsing pr (listen (raise m))
    _       -> Nothing
    

Page 122 of many | Previous | Next