packages feed

ron 0.9 → 0.10

raw patch · 7 files changed

+30/−33 lines, 7 filesdep −transformers

Dependencies removed: transformers

Files

CHANGELOG.md view
@@ -7,7 +7,14 @@  ## [Unreleased] +## [0.10] - 2019-10-07+### Added+- Instances of `Generic` and `Hashable` for `ObjectRef`+ ## [0.9] - 2019-09-06+### Added+- A useful message when UUID parsing fails+ ### Changed - Renamed `Object` to `ObjectRef` @@ -140,7 +147,8 @@   - RON-Schema   - RON-Schema TemplateHaskell code generator -[Unreleased]: https://github.com/ff-notes/ron/compare/ron-0.9...HEAD+[Unreleased]: https://github.com/ff-notes/ron/compare/ron-0.10...HEAD+[0.10]: https://github.com/ff-notes/ron/compare/ron-0.9...ron-0.10 [0.9]: https://github.com/ff-notes/ron/compare/ron-0.8...ron-0.9 [0.8]: https://github.com/ff-notes/ron/compare/ron-0.7...ron-0.8 [0.7]: https://github.com/ff-notes/ron/compare/ron-0.6...ron-0.7
lib/RON/Event.hs view
@@ -171,7 +171,7 @@     getEvents = lift . getEvents     advance   = lift . advance -instance ReplicaClock m => ReplicaClock (WriterT s m) where+instance (Monoid s, ReplicaClock m) => ReplicaClock (WriterT s m) where     getPid    = lift   getPid     getEvents = lift . getEvents     advance   = lift . advance
lib/RON/Prelude.hs view
@@ -23,7 +23,8 @@     (?:), ) where -import           RON.Prelude.Writer as X+-- TODO import           RON.Prelude.Writer as X+import Control.Monad.Writer.Strict as X (WriterT, runWriterT, tell)  -- base import           Control.Applicative as X (Alternative, Applicative, liftA2,
− lib/RON/Prelude/Writer.hs
@@ -1,23 +0,0 @@-{-# LANGUAGE FlexibleInstances #-}-{-# LANGUAGE MultiParamTypeClasses #-}-{-# OPTIONS_GHC -Wno-orphans #-}--module RON.Prelude.Writer-  ( module X-    )-where--import Control.Monad.Trans.Writer.CPS as X (WriterT, execWriterT, runWriterT)-import qualified Control.Monad.Trans.Writer.CPS as CPS-import Control.Monad.Writer.Class as X (MonadWriter, listen, pass, tell, writer)-import Prelude (Monad, Monoid)--instance (Monoid w, Monad m) => MonadWriter w (WriterT w m) where--  listen = CPS.listen--  pass = CPS.pass--  tell = CPS.tell--  writer = CPS.writer
lib/RON/Types.hs view
@@ -1,7 +1,9 @@ {-# LANGUAGE DeriveAnyClass #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-}+{-# LANGUAGE DerivingStrategies #-} {-# LANGUAGE DuplicateRecordFields #-}+{-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE NamedFieldPuns #-} {-# LANGUAGE PatternSynonyms #-}@@ -125,7 +127,8 @@  -- | Reference to an object newtype ObjectRef a = ObjectRef UUID-    deriving (Eq)+    deriving newtype (Eq, Hashable)+    deriving stock (Generic)  instance Typeable a => Show (ObjectRef a) where     showsPrec a (ObjectRef b) =
lib/RON/UUID.hs view
@@ -131,8 +131,8 @@     -> ByteString  -- ^ local name, max 10 Base64 letters     -> m UUID mkScopedName scope nam = do-    scope' <- maybe (fail "Bad scope") pure $ Base64.decode60 scope-    nam'   <- maybe (fail "Bad name")  pure $ Base64.decode60 nam+    scope' <- expectBase64x60 "UUID scope" scope $ Base64.decode60 scope+    nam'   <- expectBase64x60 "UUID name"  nam   $ Base64.decode60 nam     pure $ build UuidFields         { uuidVariety = B0000         , uuidValue   = scope'@@ -140,6 +140,14 @@         , uuidVersion = B00         , uuidOrigin  = nam'         }+  where+    expectBase64x60 field input =+        maybe+            (fail+                $   field+                <>  ": expected a Base64-encoded 60-character string, got "+                <>  show input)+            pure  -- | Convert UUID to a name getName
ron.cabal view
@@ -1,7 +1,7 @@ cabal-version:  2.2  name:           ron-version:        0.9+version:        0.10  bug-reports:    https://github.com/ff-notes/ron/issues category:       Distributed Systems, Protocol, Database@@ -41,8 +41,8 @@         template-haskell,         text,         time,-        transformers >= 0.5.6.0,-            -- ^ Writer.CPS+        -- transformers >= 0.5.6.0,+            -- ^ TODO Writer.CPS         unordered-containers     exposed-modules:         RON.Base64@@ -67,7 +67,7 @@     other-modules:         Attoparsec.Extra         Data.ZigZag-        RON.Prelude.Writer+        -- TODO RON.Prelude.Writer     hs-source-dirs: lib  benchmark bench