Skip to content

Commit dd3dfbc

Browse files
committed
Support aeson-2.0, and more bound relaxations
1 parent 2d3bd03 commit dd3dfbc

File tree

5 files changed

+15
-3
lines changed

5 files changed

+15
-3
lines changed

.github/workflows/haskell-ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,7 @@ jobs:
192192
allow-newer: deepseq-generics-0.2.0.0:base
193193
allow-newer: deepseq-generics-0.2.0.0:ghc-prim
194194
allow-newer: cryptohash-sha1-0.11.100.1:base
195+
allow-newer: http-link-header-1.2.0:attoparsec
195196
optimization: False
196197
EOF
197198
$HCPKG list --simple-output --names-only | perl -ne 'for (split /\s+/) { print "constraints: $_ installed\n" unless /^(github|github-samples)$/; }' >> cabal.project.local

cabal.project

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,4 @@ constraints: github-samples +openssl
1313
allow-newer: deepseq-generics-0.2.0.0:base
1414
allow-newer: deepseq-generics-0.2.0.0:ghc-prim
1515
allow-newer: cryptohash-sha1-0.11.100.1:base
16+
allow-newer: http-link-header-1.2.0:attoparsec

github.cabal

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -170,8 +170,8 @@ library
170170

171171
-- other packages
172172
build-depends:
173-
aeson >=1.4.0.0 && <1.6
174-
, base-compat >=0.11.1 && <0.12
173+
aeson >=1.4.0.0 && <1.6 || >=2.0.1.0 && <2.1
174+
, base-compat >=0.11.1 && <0.13
175175
, base16-bytestring >=0.1.1.6 && <1.1
176176
, binary-instances >=1 && <1.1
177177
, cryptohash-sha1 >=0.11.100.1 && <0.12
@@ -184,7 +184,7 @@ library
184184
, iso8601-time >=0.1.5 && <0.2
185185
, network-uri >=2.6.1.0 && <2.7
186186
, tagged >=0.8.5 && <0.9
187-
, transformers-compat >=0.6.5 && <0.7
187+
, transformers-compat >=0.6.5 && <0.8
188188
, unordered-containers >=0.2.10.0 && <0.3
189189
, vector >=0.12.0.1 && <0.13
190190
, vector-instances >=3.4 && <3.5

src/GitHub/Data/Content.hs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{-# LANGUAGE RecordWildCards #-}
2+
{-# LANGUAGE CPP #-}
23
-----------------------------------------------------------------------------
34
-- |
45
-- License : BSD-3-Clause
@@ -15,6 +16,10 @@ import Data.Aeson.Types (Pair)
1516
import Data.Maybe (maybe)
1617
import qualified Data.Text as T
1718

19+
#if MIN_VERSION_aeson(2,0,0)
20+
import Data.Aeson (Key)
21+
#endif
22+
1823
data Content
1924
= ContentFile !ContentFileData
2025
| ContentDirectory !(Vector ContentItem)
@@ -205,5 +210,9 @@ instance ToJSON DeleteFile where
205210
++ "author" .=? deleteFileAuthor
206211
++ "committer" .=? deleteFileCommitter
207212

213+
#if MIN_VERSION_aeson(2,0,0)
214+
(.=?) :: ToJSON v => Key -> Maybe v -> [Pair]
215+
#else
208216
(.=?) :: ToJSON v => Text -> Maybe v -> [Pair]
217+
#endif
209218
name .=? value = maybe [] (pure . (name .=)) value

src/GitHub/Internal/Prelude.hs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{-# LANGUAGE NoImplicitPrelude #-}
2+
{-# LANGUAGE CPP #-}
23
-----------------------------------------------------------------------------
34
-- |
45
-- License : BSD-3-Clause

0 commit comments

Comments
 (0)