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 Decl var Source #

Constructors

DVar var 
DFun var var (Stmt var) 

data Exp var Source #

Constructors

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

Instances

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). ((~#) Nat Nat a (S n), (~#) Nat Nat n (S n1), (~#) Nat Nat n1 Z) => SNat a Source #

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

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

Alpha Equality Functionality

Zipper test

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

Orphan instances