ixmonad-0.57: Embeds effect systems into Haskell using parameteric effect monads

Safe HaskellNone
LanguageHaskell98

Control.Effect.Reader

Synopsis

Documentation

data Reader s a Source

Provides a effect-parameterised version of the class reader monad. Effects are sets of variable-type pairs, providing an effect system for reader effects.

Constructors

IxR 

Fields

runReader :: Set s -> a
 

Instances

Effect [*] Reader 
Subset s t => Subeffect [*] Reader s t

If s is a subset of t then, s is a subeffect of t

type Unit [*] Reader = [] * 
type Plus [*] Reader f g = Union f g 
type Inv [*] Reader f g = (IsSet f, IsSet g, Split f g (Union f g)) 

ask :: Var v -> Reader `[v :-> a]` a Source

ask for a variable v of type a, raising an effect

merge :: Unionable s t => (a -> Reader (Union s t) b) -> Reader s (a -> Reader t b) Source

Provides a way to emulated the ImplicitParams features of GHC/Haskell

data k :-> v infixl 2 Source

Constructors

(Var k) :-> v infixl 2 

Instances

(Show (Var k), Show v) => Show ((:->) k v) 
Chooser (CmpSymbol j k) => OrdH ((:->) j u) ((:->) k v) 
(Monoid u, Nubable ((:) * ((:->) k u) s)) => Nubable ((:) * ((:->) k u) ((:) * ((:->) k u) s))

Define the operation for removing duplicates using mappend

Update ((:) * ((:->) j ((:!) b s)) as) as' => Update ((:) * ((:->) k ((:!) a W)) ((:) * ((:->) j ((:!) b s)) as)) as' 
Update ((:) * ((:->) k ((:!) a R)) as) as' => Update ((:) * ((:->) k ((:!) a W)) ((:) * ((:->) k ((:!) b R)) as)) as' 
Update ((:) * ((:->) k ((:!) b R)) as) as' => Update ((:) * ((:->) k ((:!) a s)) ((:) * ((:->) k ((:!) b s)) as)) as' 
Update ((:) * ((:->) j ((:!) b s)) as) as' => Update ((:) * ((:->) k ((:!) a R)) ((:) * ((:->) j ((:!) b s)) as)) ((:) * ((:->) k ((:!) a R)) as') 
type Max ((:->) j u) ((:->) k v) = (:->) (Select Symbol j k k j) (Select * j k v u) 
type Min ((:->) j u) ((:->) k v) = (:->) (Select Symbol j k j k) (Select * j k u v) 

data Var k where Source

Constructors

Var :: Var k 
X :: Var "x" 
Y :: Var "y" 
Z :: Var "z" 

Instances

Show (Var "x") 
Show (Var "y") 
Show (Var "z") 

class Subset s t Source

Minimal complete definition

subset

Instances

Subset s t => Subset s ((:) * x t) 
Subset ([] *) t 
Subset s t => Subset ((:) * x s) ((:) * x t) 

data Set n where Source

Constructors

Empty :: Set [] 
Ext :: e -> Set s -> Set (e : s) 

Instances

(Show e, Show' (Set s)) => Show (Set ((:) * e s)) 
Show (Set ([] *))