diff options
Diffstat (limited to 'events/src/Events/Spec/Types.hs')
-rw-r--r-- | events/src/Events/Spec/Types.hs | 13 |
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 @@ | |||
3 | module Events.Spec.Types | 3 | module 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 | ||
14 | import Events.Types | ||
15 | |||
11 | data Expr :: (* -> *) -> [*] -> * -> * where | 16 | data 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 | ||
26 | type Spec m = Expr (Eval m) '[] Cmnd | ||
27 | |||
28 | data Cmnd = COverride Object | ||
29 | | COccurs Bool | ||
30 | | CNop | ||
31 | deriving (Show) | ||
32 | |||
21 | data Elem :: a -> [a] -> * where | 33 | data 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] | |||
30 | type instance '[] ++ ys = ys | 42 | type instance '[] ++ ys = ys |
31 | type instance (x ': xs) ++ ys = x ': (xs ++ ys) | 43 | type instance (x ': xs) ++ ys = x ': (xs ++ ys) |
32 | infixr 5 ++ | 44 | infixr 5 ++ |
45 | |||