Skip to content

Commit

Permalink
Merge remote-tracking branch 'brandon-leapyear/chinn/ghc-9.2' into 'a…
Browse files Browse the repository at this point in the history
…eson-2'
  • Loading branch information
istathar committed Feb 4, 2022
2 parents 2016522 + 47043e3 commit 7d2cb28
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 5 deletions.
7 changes: 6 additions & 1 deletion lib/Network/Http/Inconvenience.hs
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,12 @@ hexd c0 =
!low = toDigit $ fromEnum $ c .&. 0xf
!hi = toDigit $ (c .&. 0xf0) `shiftr` 4

shiftr (W8# a#) (I# b#) = I# (word2Int# (uncheckedShiftRL# a# b#))
shiftr (W8# a#) (I# b#) = I# (word2Int# (uncheckedShiftRL'# a# b#))
#if MIN_VERSION_base(4,16,0)
uncheckedShiftRL'# a# b# = word8ToWord# (uncheckedShiftRLWord8# a# b#)
#else
uncheckedShiftRL'# = uncheckedShiftRL#
#endif

urlEncodeTable :: HashSet Char
urlEncodeTable = HashSet.fromList $! filter f $! map w2c [0 .. 255]
Expand Down
13 changes: 11 additions & 2 deletions stack.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,19 @@
resolver: lts-18.23
resolver: nightly-2021-11-14
compiler: ghc-9.2.1

packages:
- ../http-common
- .

extra-deps:
- aeson-2.0.2.0
- attoparsec-0.14.2
- base-compat-0.12.1
- base-compat-batteries-0.12.1
- io-streams-haproxy-1.0.1.0
- snap-server-1.1.2.0
# https://github.com/snapframework/snap-core/pull/312
- github: snapframework/snap-core
commit: b87aed3ca64b88c7ab71b5bf460a3c4e8cb70a9b

flags:
http-streams:
Expand Down
9 changes: 7 additions & 2 deletions tests/TestSuite.hs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
-- available to you by its authors as open source software: you can
-- redistribute it and/or modify it under a BSD licence.
--
{-# LANGUAGE CPP #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE OverloadedStrings #-}

Expand Down Expand Up @@ -40,8 +41,12 @@ import Data.Aeson (
(.=),
)
import Data.Aeson.Encode.Pretty
#if MIN_VERSION_aeson(2,0,0)
import qualified Data.Aeson.KeyMap as KeyMap
#else
import qualified Data.HashMap.Strict as KeyMap
#endif
import Data.Bits
import qualified Data.HashMap.Strict as Map
import Data.Maybe (fromJust)
import Data.Monoid
import Data.String
Expand Down Expand Up @@ -746,7 +751,7 @@ testParsingJson1 =

x <- get url jsonHandler
let (Object o) = x
let (Just v) = Map.lookup "label" o
let (Just v) = KeyMap.lookup "label" o
let (String t) = v

assertEqual "Incorrect response" "Europe (EU27)" t
Expand Down

0 comments on commit 7d2cb28

Please sign in to comment.