summaryrefslogtreecommitdiff
path: root/src/Sync.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Sync.hs')
-rw-r--r--src/Sync.hs12
1 files changed, 3 insertions, 9 deletions
diff --git a/src/Sync.hs b/src/Sync.hs
index 37941b8..afb45e6 100644
--- a/src/Sync.hs
+++ b/src/Sync.hs
@@ -1,6 +1,5 @@
module Sync (
- SyncService,
- ServicePacket(..),
+ SyncService(..),
) where
import Control.Monad
@@ -12,16 +11,11 @@ import State
import Storage
import Storage.Merge
-data SyncService
+data SyncService = SyncPacket (Stored SharedState)
instance Service SyncService where
serviceID _ = mkServiceID "a4f538d0-4e50-4082-8e10-7e3ec2af175d"
- data ServiceState SyncService = SyncService
- emptyServiceState = SyncService
-
- newtype ServicePacket SyncService = SyncPacket (Stored SharedState)
-
serviceHandler packet = do
let SyncPacket added = fromStored packet
ls <- svcGetLocal
@@ -31,6 +25,6 @@ instance Service SyncService where
when (current /= updated) $ do
svcSetLocal =<< wrappedStore st (fromStored ls) { lsShared = updated }
-instance Storable (ServicePacket SyncService) where
+instance Storable SyncService where
store' (SyncPacket smsg) = store' smsg
load' = SyncPacket <$> load'