diff options
-rw-r--r-- | erebos.cabal | 227 | ||||
-rw-r--r-- | main/Main.hs (renamed from src/Main.hs) | 29 | ||||
-rw-r--r-- | main/Test.hs (renamed from src/Test.hs) | 28 | ||||
-rw-r--r-- | src/Erebos/Attach.hs (renamed from src/Attach.hs) | 18 | ||||
-rw-r--r-- | src/Erebos/Channel.hs (renamed from src/Channel.hs) | 8 | ||||
-rw-r--r-- | src/Erebos/Contact.hs (renamed from src/Contact.hs) | 20 | ||||
-rw-r--r-- | src/Erebos/Discovery.hs (renamed from src/Discovery.hs) | 12 | ||||
-rw-r--r-- | src/Erebos/Flow.hs (renamed from src/Flow.hs) | 2 | ||||
-rw-r--r-- | src/Erebos/ICE.chs (renamed from src/ICE.chs) | 6 | ||||
-rw-r--r-- | src/Erebos/ICE/pjproject.c (renamed from src/ICE/pjproject.c) | 2 | ||||
-rw-r--r-- | src/Erebos/ICE/pjproject.h (renamed from src/ICE/pjproject.h) | 0 | ||||
-rw-r--r-- | src/Erebos/Identity.hs (renamed from src/Identity.hs) | 10 | ||||
-rw-r--r-- | src/Erebos/Message.hs (renamed from src/Message.hs) | 14 | ||||
-rw-r--r-- | src/Erebos/Network.hs (renamed from src/Network.hs) | 22 | ||||
-rw-r--r-- | src/Erebos/Network.hs-boot (renamed from src/Network.hs-boot) | 4 | ||||
-rw-r--r-- | src/Erebos/Network/Protocol.hs (renamed from src/Network/Protocol.hs) | 14 | ||||
-rw-r--r-- | src/Erebos/Network/ifaddrs.c (renamed from src/Network/ifaddrs.c) | 0 | ||||
-rw-r--r-- | src/Erebos/Network/ifaddrs.h (renamed from src/Network/ifaddrs.h) | 0 | ||||
-rw-r--r-- | src/Erebos/Pairing.hs (renamed from src/Pairing.hs) | 14 | ||||
-rw-r--r-- | src/Erebos/PubKey.hs (renamed from src/PubKey.hs) | 6 | ||||
-rw-r--r-- | src/Erebos/Service.hs (renamed from src/Service.hs) | 10 | ||||
-rw-r--r-- | src/Erebos/Set.hs (renamed from src/Set.hs) | 8 | ||||
-rw-r--r-- | src/Erebos/State.hs (renamed from src/State.hs) | 10 | ||||
-rw-r--r-- | src/Erebos/Storage.hs (renamed from src/Storage.hs) | 4 | ||||
-rw-r--r-- | src/Erebos/Storage/Internal.hs (renamed from src/Storage/Internal.hs) | 2 | ||||
-rw-r--r-- | src/Erebos/Storage/Key.hs (renamed from src/Storage/Key.hs) | 6 | ||||
-rw-r--r-- | src/Erebos/Storage/List.hs (renamed from src/Storage/List.hs) | 8 | ||||
-rw-r--r-- | src/Erebos/Storage/Merge.hs (renamed from src/Storage/Merge.hs) | 8 | ||||
-rw-r--r-- | src/Erebos/Sync.hs (renamed from src/Sync.hs) | 12 | ||||
-rw-r--r-- | src/Erebos/Util.hs (renamed from src/Util.hs) | 2 |
30 files changed, 270 insertions, 236 deletions
diff --git a/erebos.cabal b/erebos.cabal index 12cb9ac..3680ecd 100644 --- a/erebos.cabal +++ b/erebos.cabal @@ -1,106 +1,139 @@ --- Initial erebos.cabal generated by cabal init. For further --- documentation, see http://haskell.org/cabal/users-guide/ +Cabal-Version: 2.2 -name: erebos -version: 0.1.0.0 +Name: erebos +Version: 0.1.0.0 -- synopsis: -- description: -license: BSD3 -license-file: LICENSE -author: Roman Smrž -maintainer: roman.smrz@seznam.cz +License: BSD-3-Clause +License-File: LICENSE +Author: Roman Smrž +Maintainer: roman.smrz@seznam.cz -- copyright: -- category: -build-type: Simple -extra-source-files: CHANGELOG.md -cabal-version: >=1.10 +Build-type: Simple +Extra-Source-Files: + src/Erebos/ICE/pjproject.h -executable erebos - ghc-options: -Wall -threaded - main-is: Main.hs - other-modules: Attach - ICE - Identity, - Channel, - Contact - Discovery - Flow - Message, - Network, - Network.Protocol - Pairing - PubKey, - Service - Set - State, - Storage, - Storage.Internal - Storage.List - Storage.Key - Storage.Merge - Sync - Test - Util +common common + ghc-options: -Wall + + build-depends: + base >=4.13 && <4.17, + + default-extensions: + DefaultSignatures + ExistentialQuantification + FlexibleContexts + FlexibleInstances + FunctionalDependencies + GeneralizedNewtypeDeriving + ImportQualifiedPost + LambdaCase + MultiWayIf + RankNTypes + RecordWildCards + ScopedTypeVariables + StandaloneDeriving + TypeOperators + TupleSections + TypeApplications + TypeFamilies + TypeFamilyDependencies + + other-extensions: + ForeignFunctionInterface + OverloadedStrings + RecursiveDo + UndecidableInstances + +library + import: common + default-language: Haskell2010 - default-extensions: DefaultSignatures - ExistentialQuantification - FlexibleContexts, - FlexibleInstances, - FunctionalDependencies, - GeneralizedNewtypeDeriving - ImportQualifiedPost - LambdaCase, - MultiWayIf, - RankNTypes, - RecordWildCards - ScopedTypeVariables, - StandaloneDeriving, - TypeOperators - TupleSections, - TypeApplications, - TypeFamilies - TypeFamilyDependencies + hs-source-dirs: src + exposed-modules: + Erebos.Attach + Erebos.Channel + Erebos.Contact + Erebos.Discovery + Erebos.ICE + Erebos.Identity + Erebos.Message + Erebos.Network + Erebos.Network.Protocol + Erebos.Pairing + Erebos.PubKey + Erebos.Service + Erebos.Set + Erebos.State + Erebos.Storage + Erebos.Storage.Key + Erebos.Storage.Merge + Erebos.Sync + + -- Used by test tool: + Erebos.Storage.Internal + other-modules: + Erebos.Flow + Erebos.Storage.List + Erebos.Util + + c-sources: + src/Erebos/ICE/pjproject.c + src/Erebos/Network/ifaddrs.c + include-dirs: + src/Erebos/ICE + src + includes: + src/Erebos/ICE/pjproject.h + build-tool-depends: c2hs:c2hs + pkgconfig-depends: libpjproject >= 2.9 + + build-depends: + aeson >=1.4 && <2.1, + async >=2.2 && <2.3, + binary >=0.8 && <0.11, + bytestring >=0.10 && <0.12, + cereal >= 0.5 && <0.6, + clock >=0.8 && < 0.9, + containers >= 0.6 && <0.7, + cryptonite >=0.25 && <0.31, + deepseq >= 1.4 && <1.5, + directory >= 1.3 && <1.4, + filepath >=1.4 && <1.5, + hashable >=1.3 && <1.5, + hashtables >=1.2 && <1.4, + hinotify >=0.4 && <0.5, + iproute >=1.7 && <1.8, + memory >=0.14 && <0.18, + mime >= 0.4 && < 0.5, + mtl >=2.2 && <2.3, + network >= 3.1 && <3.2, + stm >=2.5 && <2.6, + tagged >= 0.8 && <0.9, + text >= 1.2 && <2.1, + time >= 1.8 && <1.14, + unix >=2.7 && <2.8, + uuid >=1.3 && <1.4, + zlib >=0.6 && <0.7 + +executable erebos + import: common + default-language: Haskell2010 + hs-source-dirs: main + ghc-options: -threaded - other-extensions: ForeignFunctionInterface - OverloadedStrings - RecursiveDo - UndecidableInstances + main-is: Main.hs + other-modules: + Test - build-depends: aeson >=1.4 && <2.1, - async >=2.2 && <2.3, - base >=4.13 && <4.17, - binary >=0.8 && <0.11, - bytestring >=0.10 && <0.12, - cereal >= 0.5 && <0.6, - clock >=0.8 && < 0.9, - containers >= 0.6 && <0.7, - cryptonite >=0.25 && <0.31, - deepseq >= 1.4 && <1.5, - directory >= 1.3 && <1.4, - filepath >=1.4 && <1.5, - hashable >=1.3 && <1.5, - hashtables >=1.2 && <1.4, - haskeline >=0.7 && <0.9, - hinotify >=0.4 && <0.5, - iproute >=1.7 && <1.8, - memory >=0.14 && <0.18, - mime >= 0.4 && < 0.5, - mtl >=2.2 && <2.3, - network >= 3.1 && <3.2, - stm >=2.5 && <2.6, - tagged >= 0.8 && <0.9, - text >= 1.2 && <2.1, - time >= 1.8 && <1.14, - transformers >= 0.5 && <0.7, - unix >=2.7 && <2.8, - uuid >=1.3 && <1.4, - zlib >=0.6 && <0.7 - hs-source-dirs: src - default-language: Haskell2010 - c-sources: src/ICE/pjproject.c - src/Network/ifaddrs.c - includes: src/ICE/pjproject.h - include-dirs: src/ICE - src - build-tools: c2hs - pkgconfig-depends: libpjproject >= 2.9 + build-depends: + bytestring, + cryptonite, + erebos, + haskeline >=0.7 && <0.9, + mtl, + network, + text, + time, + transformers >= 0.5 && <0.7, diff --git a/src/Main.hs b/main/Main.hs index cbefeb2..72af295 100644 --- a/src/Main.hs +++ b/main/Main.hs @@ -30,20 +30,21 @@ import System.Console.GetOpt import System.Console.Haskeline import System.Environment -import Attach -import Contact -import Discovery -import ICE -import Identity -import Message -import Network -import PubKey -import Service -import Set -import State -import Storage -import Storage.Merge -import Sync +import Erebos.Attach +import Erebos.Contact +import Erebos.Discovery +import Erebos.ICE +import Erebos.Identity +import Erebos.Message +import Erebos.Network +import Erebos.PubKey +import Erebos.Service +import Erebos.Set +import Erebos.State +import Erebos.Storage +import Erebos.Storage.Merge +import Erebos.Sync + import Test data Options = Options diff --git a/src/Test.hs b/main/Test.hs index ab9a78c..7f0f7d9 100644 --- a/src/Test.hs +++ b/main/Test.hs @@ -27,20 +27,20 @@ import Network.Socket import System.IO import System.IO.Error -import Attach -import Contact -import Identity -import Message -import Network -import Pairing -import PubKey -import Service -import Set -import State -import Storage -import Storage.Internal (unsafeStoreRawBytes) -import Storage.Merge -import Sync +import Erebos.Attach +import Erebos.Contact +import Erebos.Identity +import Erebos.Message +import Erebos.Network +import Erebos.Pairing +import Erebos.PubKey +import Erebos.Service +import Erebos.Set +import Erebos.State +import Erebos.Storage +import Erebos.Storage.Internal (unsafeStoreRawBytes) +import Erebos.Storage.Merge +import Erebos.Sync data TestState = TestState diff --git a/src/Attach.hs b/src/Erebos/Attach.hs index 436f786..4fd976f 100644 --- a/src/Attach.hs +++ b/src/Erebos/Attach.hs @@ -1,4 +1,4 @@ -module Attach ( +module Erebos.Attach ( AttachService, attachToOwner, attachAccept, @@ -13,14 +13,14 @@ import Data.Maybe import Data.Proxy import qualified Data.Text as T -import Identity -import Network -import Pairing -import PubKey -import Service -import State -import Storage -import Storage.Key +import Erebos.Identity +import Erebos.Network +import Erebos.Pairing +import Erebos.PubKey +import Erebos.Service +import Erebos.State +import Erebos.Storage +import Erebos.Storage.Key type AttachService = PairingService AttachIdentity diff --git a/src/Channel.hs b/src/Erebos/Channel.hs index 167c1ba..c10f971 100644 --- a/src/Channel.hs +++ b/src/Erebos/Channel.hs @@ -1,4 +1,4 @@ -module Channel ( +module Erebos.Channel ( Channel, ChannelRequest, ChannelRequestData(..), ChannelAccept, ChannelAcceptData(..), @@ -24,9 +24,9 @@ import Data.ByteArray qualified as BA import Data.ByteString.Lazy qualified as BL import Data.List -import Identity -import PubKey -import Storage +import Erebos.Identity +import Erebos.PubKey +import Erebos.Storage data Channel = Channel { chPeers :: [Stored (Signed IdentityData)] diff --git a/src/Contact.hs b/src/Erebos/Contact.hs index a232b8c..d90aa50 100644 --- a/src/Contact.hs +++ b/src/Erebos/Contact.hs @@ -1,4 +1,4 @@ -module Contact ( +module Erebos.Contact ( Contact, contactIdentity, contactCustomName, @@ -21,15 +21,15 @@ import Data.Proxy import Data.Text (Text) import qualified Data.Text as T -import Identity -import Network -import Pairing -import PubKey -import Service -import Set -import State -import Storage -import Storage.Merge +import Erebos.Identity +import Erebos.Network +import Erebos.Pairing +import Erebos.PubKey +import Erebos.Service +import Erebos.Set +import Erebos.State +import Erebos.Storage +import Erebos.Storage.Merge data Contact = Contact { contactData :: [Stored ContactData] diff --git a/src/Discovery.hs b/src/Erebos/Discovery.hs index a05fdac..86bdbe7 100644 --- a/src/Discovery.hs +++ b/src/Erebos/Discovery.hs @@ -1,4 +1,4 @@ -module Discovery ( +module Erebos.Discovery ( DiscoveryService(..), DiscoveryConnection(..) ) where @@ -15,11 +15,11 @@ import qualified Data.Text as T import Network.Socket -import ICE -import Identity -import Network -import Service -import Storage +import Erebos.ICE +import Erebos.Identity +import Erebos.Network +import Erebos.Service +import Erebos.Storage keepaliveSeconds :: Int diff --git a/src/Flow.hs b/src/Erebos/Flow.hs index b52712d..ba2607a 100644 --- a/src/Flow.hs +++ b/src/Erebos/Flow.hs @@ -1,4 +1,4 @@ -module Flow ( +module Erebos.Flow ( Flow, SymFlow, newFlow, newFlowIO, readFlow, tryReadFlow, canReadFlow, diff --git a/src/ICE.chs b/src/Erebos/ICE.chs index d553a88..096ee0d 100644 --- a/src/ICE.chs +++ b/src/Erebos/ICE.chs @@ -1,7 +1,7 @@ {-# LANGUAGE ForeignFunctionInterface #-} {-# LANGUAGE RecursiveDo #-} -module ICE ( +module Erebos.ICE ( IceSession, IceSessionRole(..), IceRemoteInfo, @@ -39,8 +39,8 @@ import Foreign.Marshal.Array import Foreign.Ptr import Foreign.StablePtr -import Flow -import Storage +import Erebos.Flow +import Erebos.Storage #include "pjproject.h" diff --git a/src/ICE/pjproject.c b/src/Erebos/ICE/pjproject.c index 0ae69e9..bb06b1f 100644 --- a/src/ICE/pjproject.c +++ b/src/Erebos/ICE/pjproject.c @@ -1,5 +1,5 @@ #include "pjproject.h" -#include "ICE_stub.h" +#include "Erebos/ICE_stub.h" #include <stdio.h> #include <stdlib.h> diff --git a/src/ICE/pjproject.h b/src/Erebos/ICE/pjproject.h index e230e75..e230e75 100644 --- a/src/ICE/pjproject.h +++ b/src/Erebos/ICE/pjproject.h diff --git a/src/Identity.hs b/src/Erebos/Identity.hs index 7c49c9f..8761fde 100644 --- a/src/Identity.hs +++ b/src/Erebos/Identity.hs @@ -1,6 +1,6 @@ {-# LANGUAGE UndecidableInstances #-} -module Identity ( +module Erebos.Identity ( Identity, ComposedIdentity, UnifiedIdentity, IdentityData(..), ExtendedIdentityData(..), IdentityExtension(..), idData, idDataF, idExtData, idExtDataF, @@ -41,10 +41,10 @@ import qualified Data.Set as S import Data.Text (Text) import qualified Data.Text as T -import PubKey -import Storage -import Storage.Merge -import Util +import Erebos.PubKey +import Erebos.Storage +import Erebos.Storage.Merge +import Erebos.Util data Identity m = IdentityKind m => Identity { idData_ :: m (Stored (Signed ExtendedIdentityData)) diff --git a/src/Message.hs b/src/Erebos/Message.hs index 334cd1e..7fe25e6 100644 --- a/src/Message.hs +++ b/src/Erebos/Message.hs @@ -1,4 +1,4 @@ -module Message ( +module Erebos.Message ( DirectMessage(..), sendDirectMessage, @@ -27,12 +27,12 @@ import qualified Data.Text as T import Data.Time.Format import Data.Time.LocalTime -import Identity -import Network -import Service -import State -import Storage -import Storage.Merge +import Erebos.Identity +import Erebos.Network +import Erebos.Service +import Erebos.State +import Erebos.Storage +import Erebos.Storage.Merge data DirectMessage = DirectMessage { msgFrom :: ComposedIdentity diff --git a/src/Network.hs b/src/Erebos/Network.hs index 58e9816..dc3df4b 100644 --- a/src/Network.hs +++ b/src/Erebos/Network.hs @@ -1,4 +1,4 @@ -module Network ( +module Erebos.Network ( Server, startServer, stopServer, @@ -43,16 +43,16 @@ import GHC.Conc.Sync (unsafeIOToSTM) import Network.Socket hiding (ControlMessage) import qualified Network.Socket.ByteString as S -import Channel -import ICE -import Identity -import Network.Protocol -import PubKey -import Service -import State -import Storage -import Storage.Key -import Storage.Merge +import Erebos.Channel +import Erebos.ICE +import Erebos.Identity +import Erebos.Network.Protocol +import Erebos.PubKey +import Erebos.Service +import Erebos.State +import Erebos.Storage +import Erebos.Storage.Key +import Erebos.Storage.Merge discoveryPort :: PortNumber diff --git a/src/Network.hs-boot b/src/Erebos/Network.hs-boot index f251e5e..849bfc1 100644 --- a/src/Network.hs-boot +++ b/src/Erebos/Network.hs-boot @@ -1,6 +1,6 @@ -module Network where +module Erebos.Network where -import Storage +import Erebos.Storage data Server data Peer diff --git a/src/Network/Protocol.hs b/src/Erebos/Network/Protocol.hs index 1240fde..d7253e3 100644 --- a/src/Network/Protocol.hs +++ b/src/Erebos/Network/Protocol.hs @@ -1,4 +1,4 @@ -module Network.Protocol ( +module Erebos.Network.Protocol ( TransportPacket(..), transportToObject, TransportHeader(..), @@ -20,7 +20,7 @@ module Network.Protocol ( connGetChannel, connSetChannel, - module Flow, + module Erebos.Flow, ) where import Control.Applicative @@ -42,11 +42,11 @@ import Data.Text qualified as T import System.Clock -import Channel -import Flow -import Identity -import Service -import Storage +import Erebos.Channel +import Erebos.Flow +import Erebos.Identity +import Erebos.Service +import Erebos.Storage protocolVersion :: Text diff --git a/src/Network/ifaddrs.c b/src/Erebos/Network/ifaddrs.c index 37c3e00..37c3e00 100644 --- a/src/Network/ifaddrs.c +++ b/src/Erebos/Network/ifaddrs.c diff --git a/src/Network/ifaddrs.h b/src/Erebos/Network/ifaddrs.h index 06d26ec..06d26ec 100644 --- a/src/Network/ifaddrs.h +++ b/src/Erebos/Network/ifaddrs.h diff --git a/src/Pairing.hs b/src/Erebos/Pairing.hs index 0b31625..4541f6e 100644 --- a/src/Pairing.hs +++ b/src/Erebos/Pairing.hs @@ -1,4 +1,4 @@ -module Pairing ( +module Erebos.Pairing ( PairingService(..), PairingState(..), PairingAttributes(..), @@ -24,12 +24,12 @@ import Data.Maybe import Data.Typeable import Data.Word -import Identity -import Network -import PubKey -import Service -import State -import Storage +import Erebos.Identity +import Erebos.Network +import Erebos.PubKey +import Erebos.Service +import Erebos.State +import Erebos.Storage data PairingService a = PairingRequest (Stored (Signed IdentityData)) (Stored (Signed IdentityData)) RefDigest | PairingResponse Bytes diff --git a/src/PubKey.hs b/src/Erebos/PubKey.hs index 5f235eb..09a8e02 100644 --- a/src/PubKey.hs +++ b/src/Erebos/PubKey.hs @@ -1,4 +1,4 @@ -module PubKey ( +module Erebos.PubKey ( PublicKey, SecretKey, KeyPair(generateKeys), loadKey, loadKeyMb, Signature(sigKey), Signed, signedData, signedSignature, @@ -21,8 +21,8 @@ import Data.ByteArray import Data.ByteString (ByteString) import qualified Data.Text as T -import Storage -import Storage.Key +import Erebos.Storage +import Erebos.Storage.Key data PublicKey = PublicKey ED.PublicKey deriving (Show) diff --git a/src/Service.hs b/src/Erebos/Service.hs index f15662e..f8428d1 100644 --- a/src/Service.hs +++ b/src/Erebos/Service.hs @@ -1,4 +1,4 @@ -module Service ( +module Erebos.Service ( Service(..), SomeService(..), someService, someServiceAttr, someServiceID, SomeServiceState(..), fromServiceState, someServiceEmptyState, @@ -32,10 +32,10 @@ import Data.Typeable import Data.UUID (UUID) import qualified Data.UUID as U -import Identity -import {-# SOURCE #-} Network -import State -import Storage +import Erebos.Identity +import {-# SOURCE #-} Erebos.Network +import Erebos.State +import Erebos.Storage class (Typeable s, Storable s, Typeable (ServiceState s), Typeable (ServiceGlobalState s)) => Service s where serviceID :: proxy s -> ServiceID diff --git a/src/Set.hs b/src/Erebos/Set.hs index 263103f..0abe02d 100644 --- a/src/Set.hs +++ b/src/Erebos/Set.hs @@ -1,4 +1,4 @@ -module Set ( +module Erebos.Set ( Set, emptySet, @@ -18,9 +18,9 @@ import Data.Map qualified as M import Data.Maybe import Data.Ord -import Storage -import Storage.Merge -import Util +import Erebos.Storage +import Erebos.Storage.Merge +import Erebos.Util data Set a = Set [Stored (SetItem (Component a))] diff --git a/src/State.hs b/src/Erebos/State.hs index e1ddcea..1f0bf7d 100644 --- a/src/State.hs +++ b/src/Erebos/State.hs @@ -1,4 +1,4 @@ -module State ( +module Erebos.State ( LocalState(..), SharedState, SharedType(..), SharedTypeID, mkSharedTypeID, @@ -32,10 +32,10 @@ import qualified Data.UUID as U import System.IO -import Identity -import PubKey -import Storage -import Storage.Merge +import Erebos.Identity +import Erebos.PubKey +import Erebos.Storage +import Erebos.Storage.Merge data LocalState = LocalState { lsIdentity :: Stored (Signed ExtendedIdentityData) diff --git a/src/Storage.hs b/src/Erebos/Storage.hs index 7edae8b..50e0241 100644 --- a/src/Storage.hs +++ b/src/Erebos/Storage.hs @@ -1,4 +1,4 @@ -module Storage ( +module Erebos.Storage ( Storage, PartialStorage, openStorage, memoryStorage, deriveEphemeralStorage, derivePartialStorage, @@ -104,7 +104,7 @@ import System.INotify import System.IO.Error import System.IO.Unsafe -import Storage.Internal +import Erebos.Storage.Internal type Storage = Storage' Complete diff --git a/src/Storage/Internal.hs b/src/Erebos/Storage/Internal.hs index 7b29193..47d344f 100644 --- a/src/Storage/Internal.hs +++ b/src/Erebos/Storage/Internal.hs @@ -1,4 +1,4 @@ -module Storage.Internal where +module Erebos.Storage.Internal where import Codec.Compression.Zlib diff --git a/src/Storage/Key.hs b/src/Erebos/Storage/Key.hs index 7730f9f..4a97976 100644 --- a/src/Storage/Key.hs +++ b/src/Erebos/Storage/Key.hs @@ -1,4 +1,4 @@ -module Storage.Key ( +module Erebos.Storage.Key ( KeyPair(..), storeKey, loadKey, loadKeyMb, moveKeys, @@ -17,8 +17,8 @@ import System.Directory import System.FilePath import System.IO.Error -import Storage -import Storage.Internal +import Erebos.Storage +import Erebos.Storage.Internal class Storable pub => KeyPair sec pub | sec -> pub, pub -> sec where generateKeys :: Storage -> IO (sec, Stored pub) diff --git a/src/Storage/List.hs b/src/Erebos/Storage/List.hs index 2bef401..ef56c60 100644 --- a/src/Storage/List.hs +++ b/src/Erebos/Storage/List.hs @@ -1,4 +1,4 @@ -module Storage.List ( +module Erebos.Storage.List ( StoredList, emptySList, fromSList, storedFromSList, slistAdd, slistAddS, @@ -16,9 +16,9 @@ import Data.List import Data.Maybe import qualified Data.Set as S -import Storage -import Storage.Internal -import Storage.Merge +import Erebos.Storage +import Erebos.Storage.Internal +import Erebos.Storage.Merge data List a = ListNil | ListItem { listPrev :: [StoredList a] diff --git a/src/Storage/Merge.hs b/src/Erebos/Storage/Merge.hs index 7c6992f..7234b87 100644 --- a/src/Storage/Merge.hs +++ b/src/Erebos/Storage/Merge.hs @@ -1,4 +1,4 @@ -module Storage.Merge ( +module Erebos.Storage.Merge ( Mergeable(..), merge, storeMerge, @@ -30,9 +30,9 @@ import Data.Set qualified as S import System.IO.Unsafe (unsafePerformIO) -import Storage -import Storage.Internal -import Util +import Erebos.Storage +import Erebos.Storage.Internal +import Erebos.Util class Storable (Component a) => Mergeable a where type Component a :: Type diff --git a/src/Sync.hs b/src/Erebos/Sync.hs index dd801b5..04b5f11 100644 --- a/src/Sync.hs +++ b/src/Erebos/Sync.hs @@ -1,4 +1,4 @@ -module Sync ( +module Erebos.Sync ( SyncService(..), ) where @@ -7,11 +7,11 @@ import Control.Monad.Reader import Data.List -import Identity -import Service -import State -import Storage -import Storage.Merge +import Erebos.Identity +import Erebos.Service +import Erebos.State +import Erebos.Storage +import Erebos.Storage.Merge data SyncService = SyncPacket (Stored SharedState) diff --git a/src/Util.hs b/src/Erebos/Util.hs index c69adee..ffca9c7 100644 --- a/src/Util.hs +++ b/src/Erebos/Util.hs @@ -1,4 +1,4 @@ -module Util where +module Erebos.Util where uniq :: Eq a => [a] -> [a] uniq (x:y:xs) | x == y = uniq (x:xs) |