diff options
| author | Roman Smrž <roman.smrz@seznam.cz> | 2026-09-07 21:39:17 +0200 |
|---|---|---|
| committer | Roman Smrž <roman.smrz@seznam.cz> | 2026-09-09 22:09:21 +0200 |
| commit | 50e3f4e0cc313828aa6682ebd270e2abbfef422a (patch) | |
| tree | b682c84136dd2c54fab5be98227e8cd7359a1029 /main/Test/State.hs | |
| parent | ded08b19077fb8b36ff3e3aba30cd3b1fda1e87b (diff) | |
Test: commands working with custom shared state
Diffstat (limited to 'main/Test/State.hs')
| -rw-r--r-- | main/Test/State.hs | 24 |
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) |