generics-mrsop-2.0.0: Generic Programming with Mutually Recursive Sums of Products.

Safe HaskellNone
LanguageHaskell2010

Generics.MRSOP.Examples.SimpTH

Contents

Description

Uses a more involved example to test some of the functionalities of generics-mrsop.

Synopsis

Simple IMPerative Language:

data Stmt var Source #

Constructors

SAssign var (Exp var) 
SIf (Exp var) (Stmt var) (Stmt var) 
SSeq (Stmt var) (Stmt var) 
SReturn (Exp var) 
SDecl (Decl var) 
SSkip 

data Exp var Source #

Constructors

EVar var 
ECall var (Exp var) 
EAdd (Exp var) (Exp var) 
ESub (Exp var) (Exp var) 
ELit Int 

type CodesStmtString = '['['[K KString, I (S Z)], '[I (S Z), I Z, I Z], '[I Z, I Z], '[I (S Z)], '[I (S (S Z))], '[]], '['[K KString], '[K KString, I (S Z)], '[I (S Z), I (S Z)], '[I (S Z), I (S Z)], '[K KInt]], '['[K KString], '[K KString, K KString, I Z]]] Source #

pattern DeclStringDFun_ :: kon KString -> kon KString -> phi Z -> View kon phi (Lkup (S (S Z)) CodesStmtString) Source #

pattern DeclStringDVar_ :: kon KString -> View kon phi (Lkup (S (S Z)) CodesStmtString) Source #

pattern ExpStringELit_ :: kon KInt -> View kon phi (Lkup (S Z) CodesStmtString) Source #

pattern ExpStringESub_ :: phi (S Z) -> phi (S Z) -> View kon phi (Lkup (S Z) CodesStmtString) Source #

pattern ExpStringEAdd_ :: phi (S Z) -> phi (S Z) -> View kon phi (Lkup (S Z) CodesStmtString) Source #

pattern ExpStringECall_ :: kon KString -> phi (S Z) -> View kon phi (Lkup (S Z) CodesStmtString) Source #

pattern ExpStringEVar_ :: kon KString -> View kon phi (Lkup (S Z) CodesStmtString) Source #

pattern StmtStringSDecl_ :: phi (S (S Z)) -> View kon phi (Lkup Z CodesStmtString) Source #

pattern StmtStringSReturn_ :: phi (S Z) -> View kon phi (Lkup Z CodesStmtString) Source #

pattern StmtStringSSeq_ :: phi Z -> phi Z -> View kon phi (Lkup Z CodesStmtString) Source #

pattern StmtStringSIf_ :: phi (S Z) -> phi Z -> phi Z -> View kon phi (Lkup Z CodesStmtString) Source #

pattern StmtStringSAssign_ :: kon KString -> phi (S Z) -> View kon phi (Lkup Z CodesStmtString) Source #

pattern IdxDeclString :: forall (a :: Nat). () => forall (n :: Nat) (n1 :: Nat). (a ~# S n, n ~# S n1, n1 ~# Z) => SNat a Source #

pattern IdxExpString :: forall (a :: Nat). () => forall (n :: Nat). (a ~# S n, n ~# Z) => SNat a Source #

pattern IdxStmtString :: forall (a :: Nat). () => a ~# Z => SNat a Source #

Alpha Equality Functionality

Zipper test

(>>>) :: (a -> b) -> (b -> c) -> a -> c infixr 4 Source #

Orphan instances