mtl-uplift-0.1.0.1: Lift substacks of monad transformer stacks
Copyright(c) Samuel Schlesinger 2020
Maintainersgschlesinger@gmail.com
Stabilityexperimental
PortabilityPOSIX, Windows
Safe HaskellSafe-Inferred
LanguageHaskell2010

Control.Monad.Trans.Uplift

Description

 
Synopsis

Documentation

uplift :: forall t f a. Uplift (IndexOf t f) f => Substack (IndexOf t f) f a -> f a Source #

Uplift the substack starting with the given transformer into the full stack. This function is expected to be used with type applications when working with polymorphic code.

type family Substack n f where ... Source #

A type family for computing the substack of a monad transformer stack, dropping the top n transformers.

Equations

Substack 'Z f = f 
Substack ('S n) (t f) = Substack n f 

class Uplift n f Source #

A class for lifting arbitrary substacks of our transformer stack.

Minimal complete definition

liftSubstack

Instances

Instances details
Uplift 'Z (f :: k -> Type) Source # 
Instance details

Defined in Control.Monad.Trans.Uplift

Methods

liftSubstack :: forall (a :: k0). Substack 'Z f a -> f a

(Monad f, MonadTrans t, Uplift n f) => Uplift ('S n) (t f :: Type -> Type) Source # 
Instance details

Defined in Control.Monad.Trans.Uplift

Methods

liftSubstack :: forall (a :: k). Substack ('S n) (t f) a -> t f a

type family IndexOf t f where ... Source #

A type family for computing the index of a particular transformer in a stack.

Equations

IndexOf t (t f) = 'Z 
IndexOf t (t' f) = 'S (IndexOf t f) 

data N Source #

Type level natural numbers

Constructors

S N 
Z