summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikitaVolkov <>2020-09-16 08:50:00 (GMT)
committerhdiff <hdiff@hdiff.luite.com>2020-09-16 08:50:00 (GMT)
commitc5e5ef8a6e223ad65b2d5aad454a42da7d8115b9 (patch)
tree8574bb502041018d88281539bdf45dc569da3dce
parent04dd37c0f2c5d72d2403b65498f14d0472d121d3 (diff)
version 0.5.2.1HEAD0.5.2.1master
-rw-r--r--json-bytes-builder.cabal14
-rw-r--r--library/JSONBytesBuilder/Private/Builder.hs33
-rw-r--r--library/JSONBytesBuilder/Private/ByteString/BoundedPrim.hs2
-rw-r--r--library/JSONBytesBuilder/Private/Prelude.hs80
4 files changed, 104 insertions, 25 deletions
diff --git a/json-bytes-builder.cabal b/json-bytes-builder.cabal
index 34983b2..939b3fa 100644
--- a/json-bytes-builder.cabal
+++ b/json-bytes-builder.cabal
@@ -1,7 +1,7 @@
name:
json-bytes-builder
version:
- 0.5.2
+ 0.5.2.1
synopsis:
Direct-to-bytes JSON Builder
description:
@@ -55,12 +55,10 @@ library
JSONBytesBuilder.ByteString.ByteString
JSONBytesBuilder.ByteString.LazyByteString
build-depends:
- scientific == 0.3.*,
- text == 1.*,
+ base >= 4.11 && < 5,
bytestring == 0.10.*,
- semigroups >= 0.16 && < 0.20,
- base-prelude < 2,
- base >= 4.7 && < 5
+ scientific == 0.3.*,
+ text == 1.*
test-suite demo
type:
@@ -106,7 +104,7 @@ benchmark benchmark
build-depends:
json-bytes-builder,
-- benchmarking:
- criterion == 1.1.*,
+ criterion == 1.5.*,
--
- aeson >= 0.10 && < 2,
+ aeson == 1.*,
rebase == 1.*
diff --git a/library/JSONBytesBuilder/Private/Builder.hs b/library/JSONBytesBuilder/Private/Builder.hs
index 0d24eaf..e7804d8 100644
--- a/library/JSONBytesBuilder/Private/Builder.hs
+++ b/library/JSONBytesBuilder/Private/Builder.hs
@@ -18,12 +18,8 @@ newtype Literal =
newtype Rows =
Rows (Maybe A.Builder)
-instance Monoid Rows where
- {-# INLINE mempty #-}
- mempty =
- Rows Nothing
- {-# INLINE mappend #-}
- mappend =
+instance Semigroup Rows where
+ (<>) =
\case
Rows (Just left) ->
\case
@@ -34,19 +30,21 @@ instance Monoid Rows where
Rows Nothing ->
id
-instance Semigroup Rows
+instance Monoid Rows where
+ {-# INLINE mempty #-}
+ mempty =
+ Rows Nothing
+ {-# INLINE mappend #-}
+ mappend =
+ (<>)
-- |
-- Builder of JSON Array elements.
newtype Elements =
Elements (Maybe A.Builder)
-instance Monoid Elements where
- {-# INLINE mempty #-}
- mempty =
- Elements Nothing
- {-# INLINE mappend #-}
- mappend =
+instance Semigroup Elements where
+ (<>) =
\case
Elements (Just left) ->
\case
@@ -57,7 +55,14 @@ instance Monoid Elements where
Elements Nothing ->
id
-instance Semigroup Elements
+instance Monoid Elements where
+ {-# INLINE mempty #-}
+ mempty =
+ Elements Nothing
+ {-# INLINE mappend #-}
+ mappend =
+ (<>)
+
-- |
-- JSON Null literal.
diff --git a/library/JSONBytesBuilder/Private/ByteString/BoundedPrim.hs b/library/JSONBytesBuilder/Private/ByteString/BoundedPrim.hs
index dfe4bc0..b91d2f0 100644
--- a/library/JSONBytesBuilder/Private/ByteString/BoundedPrim.hs
+++ b/library/JSONBytesBuilder/Private/ByteString/BoundedPrim.hs
@@ -1,7 +1,7 @@
module JSONBytesBuilder.Private.ByteString.BoundedPrim
where
-import JSONBytesBuilder.Private.Prelude
+import JSONBytesBuilder.Private.Prelude hiding ((>$<))
import Data.ByteString.Builder.Prim
diff --git a/library/JSONBytesBuilder/Private/Prelude.hs b/library/JSONBytesBuilder/Private/Prelude.hs
index 5885897..d8153c3 100644
--- a/library/JSONBytesBuilder/Private/Prelude.hs
+++ b/library/JSONBytesBuilder/Private/Prelude.hs
@@ -4,8 +4,84 @@ module JSONBytesBuilder.Private.Prelude
)
where
-import BasePrelude as Exports hiding ((<>))
-import Data.Semigroup as Exports (Semigroup(..))
+-- base
+-------------------------
+import Control.Applicative as Exports hiding (WrappedArrow(..))
+import Control.Arrow as Exports hiding (first, second)
+import Control.Category as Exports
+import Control.Concurrent as Exports
+import Control.Exception as Exports
+import Control.Monad as Exports hiding (fail, mapM_, sequence_, forM_, msum, mapM, sequence, forM)
+import Control.Monad.IO.Class as Exports
+import Control.Monad.Fail as Exports
+import Control.Monad.Fix as Exports hiding (fix)
+import Control.Monad.ST as Exports
+import Data.Bifunctor as Exports
+import Data.Bits as Exports
+import Data.Bool as Exports
+import Data.Char as Exports
+import Data.Coerce as Exports
+import Data.Complex as Exports
+import Data.Data as Exports
+import Data.Dynamic as Exports
+import Data.Either as Exports
+import Data.Fixed as Exports
+import Data.Foldable as Exports hiding (toList)
+import Data.Function as Exports hiding (id, (.))
+import Data.Functor as Exports
+import Data.Functor.Compose as Exports
+import Data.Functor.Contravariant as Exports
+import Data.Int as Exports
+import Data.IORef as Exports
+import Data.Ix as Exports
+import Data.List as Exports hiding (sortOn, isSubsequenceOf, uncons, concat, foldr, foldl1, maximum, minimum, product, sum, all, and, any, concatMap, elem, foldl, foldr1, notElem, or, find, maximumBy, minimumBy, mapAccumL, mapAccumR, foldl')
+import Data.List.NonEmpty as Exports (NonEmpty(..))
+import Data.Maybe as Exports
+import Data.Monoid as Exports hiding (Alt)
+import Data.Ord as Exports
+import Data.Proxy as Exports
+import Data.Ratio as Exports
+import Data.STRef as Exports
+import Data.String as Exports
+import Data.Traversable as Exports
+import Data.Tuple as Exports
+import Data.Unique as Exports
+import Data.Version as Exports
+import Data.Void as Exports
+import Data.Word as Exports
+import Debug.Trace as Exports
+import Foreign.ForeignPtr as Exports
+import Foreign.Ptr as Exports
+import Foreign.StablePtr as Exports
+import Foreign.Storable as Exports
+import GHC.Conc as Exports hiding (orElse, withMVar, threadWaitWriteSTM, threadWaitWrite, threadWaitReadSTM, threadWaitRead)
+import GHC.Exts as Exports (IsList(..), lazy, inline, sortWith, groupWith)
+import GHC.Generics as Exports (Generic)
+import GHC.IO.Exception as Exports
+import Numeric as Exports
+import Prelude as Exports hiding (fail, concat, foldr, mapM_, sequence_, foldl1, maximum, minimum, product, sum, all, and, any, concatMap, elem, foldl, foldr1, notElem, or, mapM, sequence, id, (.))
+import System.Environment as Exports
+import System.Exit as Exports
+import System.IO as Exports (Handle, hClose)
+import System.IO.Error as Exports
+import System.IO.Unsafe as Exports
+import System.Mem as Exports
+import System.Mem.StableName as Exports
+import System.Timeout as Exports
+import Text.ParserCombinators.ReadP as Exports (ReadP, ReadS, readP_to_S, readS_to_P)
+import Text.ParserCombinators.ReadPrec as Exports (ReadPrec, readPrec_to_P, readP_to_Prec, readPrec_to_S, readS_to_Prec)
+import Text.Printf as Exports (printf, hPrintf)
+import Text.Read as Exports (Read(..), readMaybe, readEither)
+import Unsafe.Coerce as Exports
+
+-- text
+-------------------------
import Data.Text as Exports (Text)
+
+-- bytestring
+-------------------------
import Data.ByteString as Exports (ByteString)
+
+-- scientific
+-------------------------
import Data.Scientific as Exports (Scientific)