Safe Haskell | None |
---|---|
Language | Haskell2010 |
Uses a more involved example to test some
of the functionalities of generics-mrsop
.
Synopsis
- data Stmt var
- data Decl var
- data Exp var
- type FamStmtString = '[Stmt String, Exp String, Decl String]
- 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]]]
- pattern DeclStringDFun_ :: kon KString -> kon KString -> phi Z -> View kon phi (Lkup (S (S Z)) CodesStmtString)
- pattern DeclStringDVar_ :: kon KString -> View kon phi (Lkup (S (S Z)) CodesStmtString)
- pattern ExpStringELit_ :: kon KInt -> View kon phi (Lkup (S Z) CodesStmtString)
- pattern ExpStringESub_ :: phi (S Z) -> phi (S Z) -> View kon phi (Lkup (S Z) CodesStmtString)
- pattern ExpStringEAdd_ :: phi (S Z) -> phi (S Z) -> View kon phi (Lkup (S Z) CodesStmtString)
- pattern ExpStringECall_ :: kon KString -> phi (S Z) -> View kon phi (Lkup (S Z) CodesStmtString)
- pattern ExpStringEVar_ :: kon KString -> View kon phi (Lkup (S Z) CodesStmtString)
- pattern StmtStringSSkip_ :: View kon phi (Lkup Z CodesStmtString)
- pattern StmtStringSDecl_ :: phi (S (S Z)) -> View kon phi (Lkup Z CodesStmtString)
- pattern StmtStringSReturn_ :: phi (S Z) -> View kon phi (Lkup Z CodesStmtString)
- pattern StmtStringSSeq_ :: phi Z -> phi Z -> View kon phi (Lkup Z CodesStmtString)
- pattern StmtStringSIf_ :: phi (S Z) -> phi Z -> phi Z -> View kon phi (Lkup Z CodesStmtString)
- pattern StmtStringSAssign_ :: kon KString -> phi (S Z) -> View kon phi (Lkup Z CodesStmtString)
- pattern IdxDeclString :: forall (a :: Nat). () => forall (n :: Nat) (n1 :: Nat). (a ~# S n, n ~# S n1, n1 ~# Z) => SNat a
- pattern IdxExpString :: forall (a :: Nat). () => forall (n :: Nat). (a ~# S n, n ~# Z) => SNat a
- pattern IdxStmtString :: forall (a :: Nat). () => a ~# Z => SNat a
- tyInfo_2 :: [Char]
- tyInfo_1 :: [Char]
- tyInfo_0 :: [Char]
- type FIX = Fix Singl CodesStmtString
- alphaEqD :: Decl String -> Decl String -> Bool
- test1 :: String -> String -> String -> Decl String
- test2 :: String -> String -> String -> Decl String
- test3 :: String -> String -> String -> Decl String
- (>>>) :: (a -> b) -> (b -> c) -> a -> c
- test4 :: Int -> Decl String
- test5 :: Maybe (Decl String)
Simple IMPerative Language:
SAssign var (Exp var) | |
SIf (Exp var) (Stmt var) (Stmt var) | |
SSeq (Stmt var) (Stmt var) | |
SReturn (Exp var) | |
SDecl (Decl var) | |
SSkip |
Instances
Family Singl FamStmtString CodesStmtString Source # | |
Defined in Generics.MRSOP.Examples.SimpTH sfrom' :: SNat ix -> El FamStmtString ix -> Rep Singl (El FamStmtString) (Lkup ix CodesStmtString) Source # sto' :: SNat ix -> Rep Singl (El FamStmtString) (Lkup ix CodesStmtString) -> El FamStmtString ix Source # | |
HasDatatypeInfo Singl FamStmtString CodesStmtString Source # | |
Defined in Generics.MRSOP.Examples.SimpTH datatypeInfo :: Proxy FamStmtString -> SNat ix -> DatatypeInfo (Lkup ix CodesStmtString) Source # | |
Show var => Show (Stmt var) Source # | |
Instances
Family Singl FamStmtString CodesStmtString Source # | |
Defined in Generics.MRSOP.Examples.SimpTH sfrom' :: SNat ix -> El FamStmtString ix -> Rep Singl (El FamStmtString) (Lkup ix CodesStmtString) Source # sto' :: SNat ix -> Rep Singl (El FamStmtString) (Lkup ix CodesStmtString) -> El FamStmtString ix Source # | |
HasDatatypeInfo Singl FamStmtString CodesStmtString Source # | |
Defined in Generics.MRSOP.Examples.SimpTH datatypeInfo :: Proxy FamStmtString -> SNat ix -> DatatypeInfo (Lkup ix CodesStmtString) Source # | |
Show var => Show (Decl var) Source # | |
Instances
Family Singl FamStmtString CodesStmtString Source # | |
Defined in Generics.MRSOP.Examples.SimpTH sfrom' :: SNat ix -> El FamStmtString ix -> Rep Singl (El FamStmtString) (Lkup ix CodesStmtString) Source # sto' :: SNat ix -> Rep Singl (El FamStmtString) (Lkup ix CodesStmtString) -> El FamStmtString ix Source # | |
HasDatatypeInfo Singl FamStmtString CodesStmtString Source # | |
Defined in Generics.MRSOP.Examples.SimpTH datatypeInfo :: Proxy FamStmtString -> SNat ix -> DatatypeInfo (Lkup ix CodesStmtString) Source # | |
Show var => Show (Exp var) Source # | |
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 StmtStringSSkip_ :: View kon phi (Lkup 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 #
Alpha Equality Functionality
Zipper test
Orphan instances
Family Singl FamStmtString CodesStmtString Source # | |
sfrom' :: SNat ix -> El FamStmtString ix -> Rep Singl (El FamStmtString) (Lkup ix CodesStmtString) Source # sto' :: SNat ix -> Rep Singl (El FamStmtString) (Lkup ix CodesStmtString) -> El FamStmtString ix Source # |