effectful-core-2.3.0.1: An easy to use, performant extensible effects library.
Safe HaskellSafe-Inferred
LanguageHaskell2010

Effectful.Internal.Effect

Contents

Description

Type-safe indexing for Env.

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

Synopsis

Documentation

type Effect = (Type -> Type) -> Type -> Type Source #

The kind of effects.

class (e :: Effect) :> (es :: [Effect]) where Source #

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 ()

Minimal complete definition

Nothing

Methods

reifyIndex :: Int Source #

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.

Instances

Instances details
(TypeError (('Text "There is no handler for '" :<>: 'ShowType e) :<>: 'Text "' in the context") :: Constraint) => e :> ('[] :: [Effect]) Source # 
Instance details

Defined in Effectful.Internal.Effect

e :> (e ': es) Source # 
Instance details

Defined in Effectful.Internal.Effect

e :> es => e :> (x ': es) Source # 
Instance details

Defined in Effectful.Internal.Effect

type family xs :>> es :: Constraint where ... Source #

Deprecated: Usage of (:>>) slows down GHC too much, so it will be removed in 3.0.0.0. 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) 

class KnownPrefix es => Subset (xs :: [Effect]) (es :: [Effect]) where Source #

Provide evidence that xs is a subset of es.

Minimal complete definition

Nothing

Instances

Instances details
(KnownPrefix es, IsUnknownSuffixOf xs es) => Subset xs es Source # 
Instance details

Defined in Effectful.Internal.Effect

KnownPrefix es => Subset ('[] :: [Effect]) es Source # 
Instance details

Defined in Effectful.Internal.Effect

(e :> es, Subset xs es) => Subset (e ': xs) es Source # 
Instance details

Defined in Effectful.Internal.Effect

class KnownPrefix (es :: [Effect]) where Source #

Calculate length of a statically known prefix of es.

Instances

Instances details
KnownPrefix es Source # 
Instance details

Defined in Effectful.Internal.Effect

KnownPrefix es => KnownPrefix (e ': es) Source # 
Instance details

Defined in Effectful.Internal.Effect

class IsUnknownSuffixOf (xs :: [Effect]) (es :: [Effect]) Source #

Require that xs is the unknown suffix of es.

Instances

Instances details
xs ~ es => IsUnknownSuffixOf xs es Source # 
Instance details

Defined in Effectful.Internal.Effect

IsUnknownSuffixOf xs es => IsUnknownSuffixOf xs (e ': es) Source # 
Instance details

Defined in Effectful.Internal.Effect

Re-exports

type Type = TYPE LiftedRep #

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