BiGUL-0.9.0.0: The Bidirectional Generic Update Language

Safe HaskellNone
LanguageHaskell2010

Generics.BiGUL.AST

Documentation

data BiGUL :: * -> * -> * where Source

Constructors

Fail :: String -> BiGUL s v 
Skip :: BiGUL s () 
Replace :: BiGUL s s 
Prod :: BiGUL s v -> BiGUL s' v' -> BiGUL (s, s') (v, v') infixr 1 
RearrS :: Pat s env con -> Expr env s' -> BiGUL s' v -> BiGUL s v 
RearrV :: Pat v env con -> Expr env v' -> BiGUL s v' -> BiGUL s v 
Dep :: Eq v' => BiGUL s v -> (s -> v -> v') -> BiGUL s (v, v') 
Case :: [(s -> v -> Bool, CaseBranch s v)] -> BiGUL s v 
Compose :: BiGUL s u -> BiGUL u v -> BiGUL s v 

Instances

Show (BiGUL s v) Source 

data CaseBranch s v Source

Constructors

Normal (BiGUL s v) (s -> Bool) 
Adaptive (s -> v -> s) 

Instances

data Pat :: * -> * -> * -> * where Source

Constructors

PVar :: Eq a => Pat a (Var a) (Maybe a) 
PVar' :: Pat a (Var a) (Maybe a) 
PConst :: Eq a => a -> Pat a () () 
PProd :: Pat a a' a'' -> Pat b b' b'' -> Pat (a, b) (a', b') (a'', b'') 
PLeft :: Pat a a' a'' -> Pat (Either a b) a' a'' 
PRight :: Pat b b' b'' -> Pat (Either a b) b' b'' 
PIn :: InOut a => Pat (F a) b c -> Pat a b c 

Instances

Show (Pat v e c) Source 

data Direction :: * -> * -> * where Source

Constructors

DVar :: Direction (Var a) a 
DLeft :: Direction a t -> Direction (a, b) t 
DRight :: Direction b t -> Direction (a, b) t 

Instances

data Expr :: * -> * -> * where Source

Constructors

EDir :: Direction orig a -> Expr orig a 
EConst :: Eq a => a -> Expr orig a 
EIn :: InOut a => Expr orig (F a) -> Expr orig a 
EProd :: Expr orig a -> Expr orig b -> Expr orig (a, b) 
ELeft :: Expr orig a -> Expr orig (Either a b) 
ERight :: Expr orig b -> Expr orig (Either a b) 

Instances

Show (Expr orig a) Source 

deconstruct :: Pat a env con -> a -> Either (PatExprDirError a) env Source

construct :: Pat a env con -> env -> a Source

eval :: Expr env a' -> env -> a' Source

uneval :: Pat a env con -> Expr env a' -> a' -> con -> Either (PatExprDirError a') con Source

emptyContainer :: Pat v env con -> con Source

fromContainerS :: Pat s env con -> env -> con -> env Source

fromContainerV :: Pat v env con -> con -> Either (PatExprDirError v) env Source