Skip to content

Commit df83212

Browse files
authored
Merge pull request #912 from haskell/bytestring-0.11.2.0
Add bytestring-0.11.2.0 constraint set
2 parents 1e9c3ce + b66b940 commit df83212

File tree

9 files changed

+36
-22
lines changed

9 files changed

+36
-22
lines changed

.github/workflows/haskell-ci.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
#
99
# For more information, see https://github.com/haskell-CI/haskell-ci
1010
#
11-
# version: 0.13.20211111
11+
# version: 0.13.20211116
1212
#
13-
# REGENDATA ("0.13.20211111",["github","cabal.project"])
13+
# REGENDATA ("0.13.20211116",["github","cabal.project"])
1414
#
1515
name: Haskell-CI
1616
on:
@@ -233,6 +233,10 @@ jobs:
233233
- name: prepare for constraint sets
234234
run: |
235235
rm -f cabal.project.local
236+
- name: constraint set bytestring-0.11.2.0
237+
run: |
238+
$CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks --constraint='bytestring >= 0.11.2.0' --dependencies-only -j2 all
239+
$CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks --constraint='bytestring >= 0.11.2.0' all
236240
- name: constraint set ordered-keymap-off
237241
run: |
238242
$CABAL v2-build $ARG_COMPILER --enable-tests --disable-benchmarks --constraint='aeson -ordered-keymap' --dependencies-only -j2 all

attoparsec-iso8601/attoparsec-iso8601.cabal

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: attoparsec-iso8601
2-
version: 1.0.2.1
2+
version: 1.0.2.2
33
synopsis: Parsing of ISO 8601 dates, originally from aeson.
44
description: Parsing of ISO 8601 dates, originally from aeson.
55
license: BSD3

attoparsec-iso8601/changelog.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
For the latest version of this document, please see [https://github.com/bos/aeson/blob/master/attoparsec-iso8601/changelog.md](https://github.com/bos/aeson/blob/master/attoparsec-iso8601/changelog.md).
22

3+
### 1.0.2.2
4+
5+
* Avoid wild imports
6+
37
### 1.0.2.1
48

59
* Code (re)organization.

attoparsec-iso8601/src/Data/Attoparsec/Time.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import Prelude.Compat
2727

2828
import Control.Applicative ((<|>))
2929
import Control.Monad (void, when)
30-
import Data.Attoparsec.Text as A
30+
import Data.Attoparsec.Text (Parser, char, decimal, digit, option, anyChar, peekChar, peekChar', takeWhile1, satisfy)
3131
import Data.Attoparsec.Time.Internal (toPico)
3232
import Data.Bits ((.&.))
3333
import Data.Char (isDigit, ord)

attoparsec-iso8601/src/Data/Attoparsec/Time/Internal.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import Prelude.Compat
2121
import Data.Fixed (Fixed(MkFixed), Pico)
2222
import Data.Int (Int64)
2323
import Data.Time (TimeOfDay(..))
24-
import Data.Time.Clock.Compat
24+
import Data.Time.Clock.Compat (DiffTime, diffTimeToPicoseconds)
2525

2626
toPico :: Integer -> Pico
2727
toPico = MkFixed

cabal.haskell-ci

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,6 @@ constraint-set ordered-keymap-off
2222
constraints: aeson -ordered-keymap
2323
tests: True
2424
run-tests: True
25+
26+
constraint-set bytestring-0.11.2.0
27+
constraints: bytestring >= 0.11.2.0

src/Data/Aeson/Encoding/Builder.hs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,10 @@ import Data.Aeson.Internal.Time
4444
import Data.Aeson.Types.Internal (Value (..), Key)
4545
import qualified Data.Aeson.Key as Key
4646
import qualified Data.Aeson.KeyMap as KM
47-
import Data.ByteString.Builder as B
48-
import Data.ByteString.Builder.Prim as BP
47+
import Data.ByteString.Builder (Builder)
48+
import qualified Data.ByteString.Builder as B
49+
import Data.ByteString.Builder.Prim ((>$<), (>*<))
50+
import qualified Data.ByteString.Builder.Prim as BP
4951
import Data.ByteString.Builder.Scientific (scientificBuilder)
5052
import Data.Char (chr, ord)
5153
import Data.Scientific (Scientific, base10Exponent, coefficient)
@@ -54,7 +56,7 @@ import Data.Time (UTCTime(..))
5456
import Data.Time.Calendar (Day(..), toGregorian)
5557
import Data.Time.Calendar.Month.Compat (Month, toYearMonth)
5658
import Data.Time.Calendar.Quarter.Compat (Quarter, toYearQuarter, QuarterOfYear (..))
57-
import Data.Time.LocalTime
59+
import Data.Time.LocalTime (LocalTime (..), TimeZone (..), ZonedTime (..), TimeOfDay (..))
5860
import Data.Word (Word8)
5961
import qualified Data.Text as T
6062
import qualified Data.Vector as V

src/Data/Aeson/Encoding/Internal.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,14 +68,14 @@ import Data.Aeson.Types.Internal (Value, Key)
6868
import Data.ByteString.Builder (Builder, char7, toLazyByteString)
6969
import Data.ByteString.Short (ShortByteString)
7070
import qualified Data.Aeson.Key as Key
71-
import Data.Int
71+
import Data.Int (Int8, Int16, Int32, Int64)
7272
import Data.Scientific (Scientific)
7373
import Data.Text (Text)
7474
import Data.Time (Day, LocalTime, TimeOfDay, UTCTime, ZonedTime)
7575
import Data.Time.Calendar.Month.Compat (Month)
7676
import Data.Time.Calendar.Quarter.Compat (Quarter)
7777
import Data.Typeable (Typeable)
78-
import Data.Word
78+
import Data.Word (Word8, Word16, Word32, Word64)
7979
import qualified Data.Aeson.Encoding.Builder as EB
8080
import qualified Data.ByteString.Builder as B
8181
import qualified Data.ByteString.Lazy as BSL

src/Data/Aeson/Text.hs

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ import Data.Aeson.Types (Value(..), ToJSON(..))
2828
import Data.Aeson.Encoding (encodingToLazyByteString)
2929
import qualified Data.Aeson.KeyMap as KM
3030
import Data.Scientific (FPFormat(..), Scientific, base10Exponent)
31-
import Data.Text.Lazy.Builder
31+
import Data.Text.Lazy.Builder (Builder)
32+
import qualified Data.Text.Lazy.Builder as TB
3233
import Data.Text.Lazy.Builder.Scientific (formatScientificBuilder)
3334
import Numeric (showHex)
3435
import qualified Data.Aeson.Key as Key
@@ -62,23 +63,23 @@ encodeToTextBuilder =
6263
go (Array v)
6364
| V.null v = {-# SCC "go/Array" #-} "[]"
6465
| otherwise = {-# SCC "go/Array" #-}
65-
singleton '[' <>
66+
TB.singleton '[' <>
6667
go (V.unsafeHead v) <>
67-
V.foldr f (singleton ']') (V.unsafeTail v)
68-
where f a z = singleton ',' <> go a <> z
68+
V.foldr f (TB.singleton ']') (V.unsafeTail v)
69+
where f a z = TB.singleton ',' <> go a <> z
6970
go (Object m) = {-# SCC "go/Object" #-}
7071
case KM.toList m of
71-
(x:xs) -> singleton '{' <> one x <> foldr f (singleton '}') xs
72+
(x:xs) -> TB.singleton '{' <> one x <> foldr f (TB.singleton '}') xs
7273
_ -> "{}"
73-
where f a z = singleton ',' <> one a <> z
74-
one (k,v) = string (Key.toText k) <> singleton ':' <> go v
74+
where f a z = TB.singleton ',' <> one a <> z
75+
one (k,v) = string (Key.toText k) <> TB.singleton ':' <> go v
7576

7677
string :: T.Text -> Builder
77-
string s = {-# SCC "string" #-} singleton '"' <> quote s <> singleton '"'
78+
string s = {-# SCC "string" #-} TB.singleton '"' <> quote s <> TB.singleton '"'
7879
where
7980
quote q = case T.uncons t of
80-
Nothing -> fromText h
81-
Just (!c,t') -> fromText h <> escape c <> quote t'
81+
Nothing -> TB.fromText h
82+
Just (!c,t') -> TB.fromText h <> escape c <> quote t'
8283
where (h,t) = {-# SCC "break" #-} T.break isEscape q
8384
isEscape c = c == '\"' ||
8485
c == '\\' ||
@@ -90,8 +91,8 @@ string s = {-# SCC "string" #-} singleton '"' <> quote s <> singleton '"'
9091
escape '\t' = "\\t"
9192

9293
escape c
93-
| c < '\x20' = fromString $ "\\u" ++ replicate (4 - length h) '0' ++ h
94-
| otherwise = singleton c
94+
| c < '\x20' = TB.fromString $ "\\u" ++ replicate (4 - length h) '0' ++ h
95+
| otherwise = TB.singleton c
9596
where h = showHex (fromEnum c) ""
9697

9798
fromScientific :: Scientific -> Builder

0 commit comments

Comments
 (0)