effet-0.1.0.0: An Effect System based on Type Classes
Copyright(c) Michael Szvetits 2020
LicenseBSD3 (see the file LICENSE)
Maintainertypedbyte@qualified.name
Stabilitystable
Portabilityportable
Safe HaskellNone
LanguageHaskell2010

Control.Effect.Machinery.Kind

Description

This module defines some constraint synonyms and kinds that are used throughout this library, hopefully to increase the readability of the code at some points.

Synopsis

Documentation

type SomeMonad = Type -> Type Source #

The kind of monads.

type Effect = SomeMonad -> Constraint Source #

The kind of effects, which are type classes with a monad type parameter at the end.

type Transformer = SomeMonad -> Type -> Type Source #

The kind of monad transformers, also known as effect handlers or effect interpreters.

type Handle (eff :: Effect) (t :: Transformer) m = eff (t m) Source #

This type synonym indicates that an effect is handled by a specific monad transformer.

type Lift (eff :: Effect) (t :: Transformer) m = (eff m, Monad (t m), MonadTrans t) Source #

This constraint synonym indicates that a first-order effect is not handled by a specific monad transformer and must thus be delegated ("lifted") further down the monad transformer stack in order to find its associated handler.

Roughly speaking, a first-order effect is a type class whose monad type parameter m appears only in positive position when looking at the types of its corresponding class methods (e.g., m appears only in the result type).

An example of a first-order effect is the State' effect.

type Control (eff :: Effect) (t :: Transformer) m = (eff m, Monad (t m), MonadTransControl t) Source #

This constraint synonym indicates that a higher-order effect is not handled by a specific monad transformer and must thus be delegated ("lifted") further down the monad transformer stack in order to find its associated handler.

Roughly speaking, a higher-order effect is a type class whose monad type parameter m appears in negative position when looking at the types of its corresponding class methods (e.g., m appears in the type of a method parameter).

An example of a higher-order effect is the Reader' effect, since its class method local' has a parameter of type m a.