HORIZON HASKELLDocslts/ghc-10.0.xfc4e5982026-10-11Search names, modules, packages, or :: a typeCtrl K

GHC 10.0.0.20260917 · lts/ghc-10.0.x · fc4e598 · 2026-10-11

Moduleeffectful-core-2.7.1.2GHC2021

Effectful.Internal.Effect

Type-safe indexing for Effectful.Internal.Monad.Env.

This module is intended for internal use only, and may change without warning in subsequent releases.

  • 2 types
  • 5 classes
classclass (:>) (e :: Effect) (es :: [Effect]) where
#

A constraint that requires that a particular effect e is a member of the type-level list es. This is used to parameterize an Eff computation over an arbitrary list of effects, so long as e is somewhere in the list.

For example, a computation that only needs access to a mutable value of type Integer would have the following type:

State Integer :> es => Eff es ()

Methods

  • reifyIndex :: Int

    Get the position of e in es.

    Note: GHC is kind enough to cache these values as they're top level CAFs, so the lookup is amortized O(1) without any language level tricks.

Instances3:>
  • TypeError (('Text "There is no handler for '" ':<>: 'ShowType e) ':<>: 'Text "' in the context") => e :> '[]Defined in effectful-core-2.7.1.2 · Effectful.Internal.Effect
  • e :> (e ': es)Defined in effectful-core-2.7.1.2 · Effectful.Internal.Effect
  • e :> es => e :> (x ': es)Defined in effectful-core-2.7.1.2 · Effectful.Internal.Effect
familytype family (:>>) (xs :: [Effect]) (es :: [Effect]) :: Constraint where
#

Deprecated. Usage of (:>>) slows down GHC too much. See https://github.com/haskell-effectful/effectful/issues/52#issuecomment-1269155485 for more information.

Convenience operator for expressing that a function uses multiple effects in a more concise way than enumerating them all with (:>).

[E1, E2, ..., En] :>> es ≡ (E1 :> es, E2 :> es, ..., En :> es)

Equations

  • (:>>) '[] es = ()
  • (:>>) (x ': xs) es = (x :> es, xs :>> es)
classclass KnownPrefix es => Subset (subEs :: [Effect]) (es :: [Effect]) where
#

Provide evidence that subEs is a subset of es.

Instances3Subset
  • (KnownPrefix es, IsUnknownSuffixOf subEs es) => Subset subEs esDefined in effectful-core-2.7.1.2 · Effectful.Internal.Effect
  • KnownPrefix es => Subset '[] esDefined in effectful-core-2.7.1.2 · Effectful.Internal.Effect
  • (e :> es, Subset subEs es) => Subset (e ': subEs) esDefined in effectful-core-2.7.1.2 · Effectful.Internal.Effect
classclass Subset subEs es => KnownSubset (subEs :: [Effect]) (es :: [Effect])
#

Provide evidence that subEs is a known subset of es.

Instances2KnownSubset
  • KnownSubset '[] esDefined in effectful-core-2.7.1.2 · Effectful.Internal.Effect
  • (e :> es, KnownSubset subEs es) => KnownSubset (e ': subEs) esDefined in effectful-core-2.7.1.2 · Effectful.Internal.Effect
familytype family (++) (xs :: [Effect]) (ys :: [Effect]) :: [Effect] where
#

Append two type-level lists together.

Equations

  • (++) '[] ys = ys
  • (++) (x ': xs) ys = x ': xs ++ ys

Re-exports

1 declaration
typetype Type = TYPE LiftedRep
#

The kind of types with lifted values. For example Int :: Type.