From 50e3f4e0cc313828aa6682ebd270e2abbfef422a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roman=20Smr=C5=BE?= Date: Mon, 7 Sep 2026 21:39:17 +0200 Subject: Test: commands working with custom shared state --- main/Test/State.hs | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 main/Test/State.hs (limited to 'main/Test') 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) -- cgit v1.2.3