free-vl-0.1.0.0: Initial project template from stack

Copyright(C) 2016 Aaron Levin
LicenseBSD-style (see the file LICENSE)
MaintainerAaron Levin <aaron.michael.benjamin.levin@gmail.com>
Stabilityprovisional
Portabilitynon-portable (rank-2 polymorphism)
Safe HaskellSafe
LanguageHaskell2010

Control.Monad.Free.VanLaarhovenE

Description

"van Laarhoven encoded Free Monad with extensible effects"

Synopsis

Documentation

(.:.) :: effect m -> Effects effects m -> Effects (effect ': effects) m infixr 4 Source #

Helper combinator for creating values of 'Effects effects m'

data Effects a m where Source #

a customized HList of effects. We need to carry the m param around for type inference.

Constructors

EmptyE :: Effects '[] m 
ConsE :: effect m -> Effects effects m -> Effects (effect ': effects) m 

data Free effects a Source #

The van Laarhoven-encoded Free Monad with Extensible effects

Instances

Monad (Free effect) Source # 

Methods

(>>=) :: Free effect a -> (a -> Free effect b) -> Free effect b #

(>>) :: Free effect a -> Free effect b -> Free effect b #

return :: a -> Free effect a #

fail :: String -> Free effect a #

Functor (Free effect) Source # 

Methods

fmap :: (a -> b) -> Free effect a -> Free effect b #

(<$) :: a -> Free effect b -> Free effect a #

Applicative (Free effect) Source # 

Methods

pure :: a -> Free effect a #

(<*>) :: Free effect (a -> b) -> Free effect a -> Free effect b #

(*>) :: Free effect a -> Free effect b -> Free effect b #

(<*) :: Free effect a -> Free effect b -> Free effect a #

class HasEffect effects effect Source #

A class to help us fetch effects from our effect stack.

Minimal complete definition

getEffect

Instances

HasEffect ((:) ((* -> *) -> *) effect effects) effect Source #

An instance of HasEffect that handles the case where our desired effect type matches the head of the list. We then return that effect.

Methods

getEffect :: Effects ((((* -> *) -> *) ': effect) effects) m -> effect m

HasEffect effects effect => HasEffect ((:) ((* -> *) -> *) notIt effects) effect Source #

An instance of HasEffect that handles the case where our desired effect type doesn't match the head of the HList.

Methods

getEffect :: Effects ((((* -> *) -> *) ': notIt) effects) m -> effect m

iterM :: Monad m => Effects effects m -> Free effects a -> m a Source #

Tear down a Free Monad using the supplied effects value.

liftF :: HasEffect effects effect => (forall m. effect m -> m a) -> Free effects a Source #

A version of lift that can be used with an effect stack.