packages feed

erebos 0.1.1 → 0.1.2

raw patch · 10 files changed

+27/−17 lines, 10 filesdep −cerealdep −mimedep −taggeddep ~basedep ~iproute

Dependencies removed: cereal, mime, tagged

Dependency ranges changed: base, iproute

Files

CHANGELOG.md view
@@ -1,5 +1,10 @@ # Revision history for erebos +## 0.1.2 -- 2024-02-20++* Compatibility with GHC up to 9.6+* Pruned unnecessary dependencies and fixed bounds+ ## 0.1.1 -- 2024-02-18  * Added build flag to enable/disable ICE support with pjproject.
erebos.cabal view
@@ -1,7 +1,7 @@ Cabal-Version:       2.2  Name:                erebos-Version:             0.1.1+Version:             0.1.2 Synopsis:            Decentralized messaging and synchronization Description:     Library and simple CLI interface implementing the Erebos identity@@ -41,7 +41,7 @@     ghc-options:         -Wall      build-depends:-        base >=4.13 && <4.17,+        base >=4.13 && <4.19,      default-extensions:         DefaultSignatures@@ -126,7 +126,6 @@         async >=2.2 && <2.3,         binary >=0.8 && <0.11,         bytestring >=0.10 && <0.13,-        cereal >= 0.5 && <0.6,         clock >=0.8 && < 0.9,         containers >= 0.6 && <0.8,         cryptonite >=0.25 && <0.31,@@ -136,13 +135,11 @@         hashable >=1.3 && <1.5,         hashtables >=1.2 && <1.4,         hinotify >=0.4 && <0.5,-        iproute >=1.7 && <1.8,+        iproute >=1.7.12 && <1.8,         memory >=0.14 && <0.19,-        mime >= 0.4 && < 0.5,         mtl >=2.2 && <2.4,         network >= 3.1 && <3.2,         stm >=2.5 && <2.6,-        tagged >= 0.8 && <0.9,         text >= 1.2 && <2.2,         time >= 1.8 && <1.14,         unix >=2.7 && <2.9,
main/Test.hs view
@@ -5,6 +5,7 @@ import Control.Arrow import Control.Concurrent import Control.Exception+import Control.Monad import Control.Monad.Except import Control.Monad.Reader import Control.Monad.State
src/Erebos/Attach.hs view
@@ -5,6 +5,7 @@     attachReject, ) where +import Control.Monad import Control.Monad.Except import Control.Monad.Reader 
src/Erebos/Channel.hs view
@@ -14,6 +14,7 @@ import Control.Concurrent.MVar import Control.Monad import Control.Monad.Except+import Control.Monad.IO.Class  import Crypto.Cipher.ChaChaPoly1305 import Crypto.Error
src/Erebos/Message.hs view
@@ -16,6 +16,7 @@     formatMessage, ) where +import Control.Monad import Control.Monad.Except import Control.Monad.Reader 
src/Erebos/Pairing.hs view
@@ -10,6 +10,7 @@     pairingReject, ) where +import Control.Monad import Control.Monad.Except import Control.Monad.Reader 
src/Erebos/Storage.hs view
@@ -61,9 +61,6 @@     beginHistory, modifyHistory, ) where -import qualified Codec.MIME.Type as MIME-import qualified Codec.MIME.Parse as MIME- import Control.Applicative import Control.Arrow import Control.Concurrent@@ -576,11 +573,11 @@  type StoreRec c = StoreRecM c () -newtype Load a = Load (ReaderT (Ref, Object) (Either String) a)+newtype Load a = Load (ReaderT (Ref, Object) (Except String) a)     deriving (Functor, Applicative, Alternative, Monad, MonadPlus, MonadError String)  evalLoad :: Load a -> Ref -> a-evalLoad (Load f) ref = either (error {- TODO throw -} . ((BC.unpack (showRef ref) ++ ": ")++)) id $ runReaderT f (ref, lazyLoadObject ref)+evalLoad (Load f) ref = either (error {- TODO throw -} . ((BC.unpack (showRef ref) ++ ": ")++)) id $ runExcept $ runReaderT f (ref, lazyLoadObject ref)  loadCurrentRef :: Load Ref loadCurrentRef = Load $ asks fst@@ -588,7 +585,7 @@ loadCurrentObject :: Load Object loadCurrentObject = Load $ asks snd -newtype LoadRec a = LoadRec (ReaderT (Ref, [(ByteString, RecItem)]) (Either String) a)+newtype LoadRec a = LoadRec (ReaderT (Ref, [(ByteString, RecItem)]) (Except String) a)     deriving (Functor, Applicative, Alternative, Monad, MonadPlus, MonadError String)  loadRecCurrentRef :: LoadRec Ref@@ -652,11 +649,7 @@ instance StorableText [Char] where     toText = T.pack; fromText = return . T.unpack -instance StorableText MIME.Type where-    toText = MIME.showType-    fromText = maybe (throwError "Malformed MIME type") return . MIME.parseMIMEType - class StorableDate a where     toDate :: a -> ZonedTime     fromDate :: ZonedTime -> a@@ -761,7 +754,7 @@ loadRec (LoadRec lrec) = loadCurrentObject >>= \case     Rec rs -> do         ref <- loadCurrentRef-        either throwError return $ runReaderT lrec (ref, rs)+        either throwError return $ runExcept $ runReaderT lrec (ref, rs)     _ -> throwError "Expecting record"  loadZero :: a -> Load a
src/Erebos/Storage/Internal.hs view
@@ -1,3 +1,5 @@+{-# LANGUAGE CPP #-}+ module Erebos.Storage.Internal where  import Codec.Compression.Zlib@@ -229,7 +231,14 @@ openLockFile path = do     createDirectoryIfMissing True (takeDirectory path)     fd <- retry 10 $+#if MIN_VERSION_unix(2,8,0)+        openFd path WriteOnly defaultFileFlags+            { creat = Just $ unionFileModes ownerReadMode ownerWriteMode+            , exclusive = True+            }+#else         openFd path WriteOnly (Just $ unionFileModes ownerReadMode ownerWriteMode) (defaultFileFlags { exclusive = True })+#endif     fdToHandle fd   where     retry :: Int -> IO a -> IO a
src/Erebos/Storage/Key.hs view
@@ -7,6 +7,7 @@ import Control.Concurrent.MVar import Control.Monad import Control.Monad.Except+import Control.Monad.IO.Class  import Data.ByteArray import qualified Data.ByteString.Char8 as BC