summaryrefslogtreecommitdiff
path: root/main/Test
diff options
context:
space:
mode:
Diffstat (limited to 'main/Test')
-rw-r--r--main/Test/State.hs24
1 files changed, 24 insertions, 0 deletions
diff --git a/main/Test/State.hs b/main/Test/State.hs
new file mode 100644
index 0000000..3ef1558
--- /dev/null
+++ b/main/Test/State.hs
@@ -0,0 +1,24 @@
+module Test.State (
+ CustomSharedState(..),
+) where
+
+import Data.Proxy
+
+import GHC.TypeLits
+
+import Erebos.Object
+import Erebos.State
+import Erebos.Storage.Merge
+
+
+data CustomSharedState (tid :: Symbol) = CustomSharedState
+ { customStateComponents :: StoredTips Object
+ }
+
+instance Mergeable (CustomSharedState tid) where
+ type Component (CustomSharedState tid) = Object
+ toComponents = customStateComponents
+ mergeSorted = CustomSharedState
+
+instance KnownSymbol tid => SharedType (CustomSharedState tid) where
+ sharedTypeID _ = mkSharedTypeID (symbolVal @tid Proxy)