summaryrefslogtreecommitdiff
path: root/events/src/Events/Spec/Types.hs
diff options
context:
space:
mode:
Diffstat (limited to 'events/src/Events/Spec/Types.hs')
-rw-r--r--events/src/Events/Spec/Types.hs13
1 files changed, 13 insertions, 0 deletions
diff --git a/events/src/Events/Spec/Types.hs b/events/src/Events/Spec/Types.hs
index 665958d..5216f46 100644
--- a/events/src/Events/Spec/Types.hs
+++ b/events/src/Events/Spec/Types.hs
@@ -3,11 +3,16 @@
3module Events.Spec.Types 3module Events.Spec.Types
4 ( Expr(..) 4 ( Expr(..)
5 , Val(..) 5 , Val(..)
6 , Spec
7 , Cmnd(..)
6 , Elem(..) 8 , Elem(..)
7 , Length(..) 9 , Length(..)
8 , type (++)(..) 10 , type (++)(..)
11 , module Events.Types
9 ) where 12 ) where
10 13
14import Events.Types
15
11data Expr :: (* -> *) -> [*] -> * -> * where 16data Expr :: (* -> *) -> [*] -> * -> * where
12 ELit :: Val m a -> Expr m ctx a 17 ELit :: Val m a -> Expr m ctx a
13 EVar :: Elem a ctx -> Expr m ctx a 18 EVar :: Elem a ctx -> Expr m ctx a
@@ -18,6 +23,13 @@ type family Val m a where
18 Val m (a -> b) = Expr m '[a] b 23 Val m (a -> b) = Expr m '[a] b
19 Val m a = m a 24 Val m a = m a
20 25
26type Spec m = Expr (Eval m) '[] Cmnd
27
28data Cmnd = COverride Object
29 | COccurs Bool
30 | CNop
31 deriving (Show)
32
21data Elem :: a -> [a] -> * where 33data Elem :: a -> [a] -> * where
22 EZ :: Elem x (x ': xs) 34 EZ :: Elem x (x ': xs)
23 ES :: Elem x xs -> Elem x (y ': xs) 35 ES :: Elem x xs -> Elem x (y ': xs)
@@ -30,3 +42,4 @@ type family (xs :: [a]) ++ (ys :: [a]) :: [a]
30type instance '[] ++ ys = ys 42type instance '[] ++ ys = ys
31type instance (x ': xs) ++ ys = x ': (xs ++ ys) 43type instance (x ': xs) ++ ys = x ': (xs ++ ys)
32infixr 5 ++ 44infixr 5 ++
45