Skip to content

Commit

Permalink
Merge pull request fizruk#84 from phadej/squashed-83
Browse files Browse the repository at this point in the history
Squashed 83
  • Loading branch information
phadej authored Sep 24, 2018
2 parents 409923c + ff11afe commit 1beba5a
Show file tree
Hide file tree
Showing 10 changed files with 115 additions and 192 deletions.
28 changes: 9 additions & 19 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#
# runghc make_travis_yml_2.hs '--config' '--output' '.travis.yml' 'http-api-data.cabal'
#
# For more information, see https://github.com/hvr/multi-ghc-travis
# For more information, see https://github.com/haskell-CI/haskell-ci
#
language: c
sudo: false
Expand Down Expand Up @@ -32,21 +32,24 @@ before_cache:

matrix:
include:
- compiler: "ghc-8.6.1"
# env: TEST=--disable-tests BENCH=--disable-benchmarks
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.4,ghc-8.6.1], sources: [hvr-ghc]}}
- compiler: "ghc-8.4.3"
# env: TEST=--disable-tests BENCH=--disable-benchmarks
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.2,ghc-8.4.3], sources: [hvr-ghc]}}
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.4,ghc-8.4.3], sources: [hvr-ghc]}}
- compiler: "ghc-8.2.2"
# env: TEST=--disable-tests BENCH=--disable-benchmarks
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.2,ghc-8.2.2], sources: [hvr-ghc]}}
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.4,ghc-8.2.2], sources: [hvr-ghc]}}
- compiler: "ghc-8.0.2"
# env: TEST=--disable-tests BENCH=--disable-benchmarks
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.2,ghc-8.0.2], sources: [hvr-ghc]}}
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.4,ghc-8.0.2], sources: [hvr-ghc]}}
- compiler: "ghc-7.10.3"
# env: TEST=--disable-tests BENCH=--disable-benchmarks
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.2,ghc-7.10.3], sources: [hvr-ghc]}}
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.4,ghc-7.10.3], sources: [hvr-ghc]}}
- compiler: "ghc-7.8.4"
# env: TEST=--disable-tests BENCH=--disable-benchmarks
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.2,ghc-7.8.4], sources: [hvr-ghc]}}
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.4,ghc-7.8.4], sources: [hvr-ghc]}}

before_install:
- HC=${CC}
Expand Down Expand Up @@ -116,18 +119,5 @@ script:
# Build without installed constraints for packages in global-db
- if $UNCONSTRAINED; then rm -f cabal.project.local; echo cabal new-build -w ${HC} --disable-tests --disable-benchmarks all; else echo "Not building without installed constraints"; fi

# Constraint sets
- rm -rf cabal.project.local

# Constraint set lower-bounds-7.8.4
- if [ $HCNUMVER -eq 70804 ]; then cabal new-build -w ${HC} --disable-tests --disable-benchmarks --constraint='attoparsec ==0.13.0.1' --constraint='attoparsec-iso8601 ==1.0.0.0' --constraint='bytestring ==0.10.4.0' --constraint='containers ==0.5.5.1' --constraint='hashable ==1.1.2.4' --constraint='http-types ==0.8.6' --constraint='semigroups ==0.16' --constraint='text ==1.1.1.3' --constraint='time ==1.4.2' --constraint='time-local-compat ==0.1.1.0' --constraint='unordered-containers ==0.2.6.0' --constraint='uri-bytestring ==0.1.7' --constraint='uuid-types ==1.0.2' all; else echo skipping...; fi

# Constraint set lower-bounds-7.10.3
- if [ $HCNUMVER -eq 71003 ]; then cabal new-build -w ${HC} --disable-tests --disable-benchmarks --constraint='attoparsec ==0.13.0.1' --constraint='attoparsec-iso8601 ==1.0.0.0' --constraint='bytestring ==0.10.6.0' --constraint='containers ==0.5.6.1' --constraint='hashable ==1.2.3.2' --constraint='http-types ==0.8.6' --constraint='semigroups ==0.16.0.1' --constraint='text ==1.2.0.2' --constraint='time ==1.5.0.1' --constraint='time-local-compat ==0.1.1.0' --constraint='unordered-containers ==0.2.6.0' --constraint='uri-bytestring ==0.1.7' --constraint='uuid-types ==1.0.2' all; else echo skipping...; fi

# Constraint set lower-bounds-8.0.2
- if [ $HCNUMVER -eq 80002 ]; then cabal new-build -w ${HC} --disable-tests --disable-benchmarks --constraint='attoparsec ==0.13.0.1' --constraint='attoparsec-iso8601 ==1.0.0.0' --constraint='bytestring ==0.10.6.0' --constraint='containers ==0.5.7.0' --constraint='hashable ==1.2.4.0' --constraint='http-types ==0.8.6' --constraint='text ==1.2.2.0' --constraint='time ==1.5.0.1' --constraint='time-local-compat ==0.1.1.0' --constraint='unordered-containers ==0.2.6.0' --constraint='uri-bytestring ==0.2.1.0' --constraint='uuid-types ==1.0.2' all; else echo skipping...; fi


# REGENDATA ["--config","--output",".travis.yml","http-api-data.cabal"]
# EOF
54 changes: 0 additions & 54 deletions cabal.make-travis-yml
Original file line number Diff line number Diff line change
@@ -1,56 +1,2 @@
jobs: :2
branches: master

-- we use http-types ==0.8.6
-- because build plan has blaze-builder-0.4
--
-- strict lower-bound for http-types ==0.8.3,
constraint-set lower-bounds-7.8.4
ghc: == 7.8.4
constraints:
attoparsec ==0.13.0.1,
attoparsec-iso8601 ==1.0.0.0,
bytestring ==0.10.4.0,
containers ==0.5.5.1,
hashable ==1.1.2.4,
http-types ==0.8.6,
semigroups ==0.16,
text ==1.1.1.3,
time ==1.4.2,
time-local-compat ==0.1.1.0,
unordered-containers ==0.2.6.0,
uri-bytestring ==0.1.7,
uuid-types ==1.0.2

constraint-set lower-bounds-7.10.3
ghc: == 7.10.3
constraints:
attoparsec ==0.13.0.1,
attoparsec-iso8601 ==1.0.0.0,
bytestring ==0.10.6.0,
containers ==0.5.6.1,
hashable ==1.2.3.2,
http-types ==0.8.6,
semigroups ==0.16.0.1,
text ==1.2.0.2,
time ==1.5.0.1,
time-local-compat ==0.1.1.0,
unordered-containers ==0.2.6.0,
uri-bytestring ==0.1.7,
uuid-types ==1.0.2

constraint-set lower-bounds-8.0.2
ghc: == 8.0.2
constraints:
attoparsec ==0.13.0.1,
attoparsec-iso8601 ==1.0.0.0,
bytestring ==0.10.6.0,
containers ==0.5.7.0,
hashable ==1.2.4.0,
http-types ==0.8.6,
text ==1.2.2.0,
time ==1.5.0.1,
time-local-compat ==0.1.1.0,
unordered-containers ==0.2.6.0,
uri-bytestring ==0.2.1.0,
uuid-types ==1.0.2
53 changes: 33 additions & 20 deletions http-api-data.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ tested-with:
GHC==7.10.3,
GHC==8.0.2,
GHC==8.2.2,
GHC==8.4.3
GHC==8.4.3,
GHC==8.6.1

custom-setup
setup-depends:
Expand All @@ -40,23 +41,32 @@ flag use-text-show
library
hs-source-dirs: src/
include-dirs: include/
build-depends: base >= 4.7 && < 4.12
, attoparsec >= 0.13.0.1 && < 0.14
, attoparsec-iso8601 >= 1.0.0.0 && < 1.1

-- GHC bundled
build-depends: base >= 4.7 && < 4.13
, bytestring >= 0.10.4.0 && < 0.11
, containers >= 0.5.5.1 && < 0.6
, hashable >= 1.1.2.4 && < 1.3
, http-types >= 0.8.6 && < 0.13
, text >= 1.1.1.3 && < 1.3
, containers >= 0.5.5.1 && < 0.7
, text >= 1.2.3.0 && < 1.3
, time >= 1.4.2 && < 1.9
, time-locale-compat >= 0.1.1.0 && < 0.2
, unordered-containers >= 0.2.6.0 && < 0.3
, uuid-types >= 1.0.2 && <1.1

-- other-dependencies
build-depends:
attoparsec >= 0.13.2.2 && < 0.14
, attoparsec-iso8601 >= 1.0.0.0 && < 1.1
, cookie >= 0.4.3 && < 0.4.5
, hashable >= 1.2.7.0 && < 1.3
, http-types >= 0.12.1 && < 0.13
, time-locale-compat >= 0.1.1.5 && < 0.2
, unordered-containers >= 0.2.9.0 && < 0.3
, uuid-types >= 1.0.3 && <1.1

if !impl(ghc >= 8.0)
build-depends: semigroups >= 0.16 && < 0.19
build-depends: semigroups >= 0.18.5 && < 0.19

if flag(use-text-show)
cpp-options: -DUSE_TEXT_SHOW
build-depends: text-show >= 2
build-depends: text-show >= 3.7.4 && <3.8

exposed-modules:
Web.HttpApiData
Web.FormUrlEncoded
Expand All @@ -75,26 +85,29 @@ test-suite spec
hs-source-dirs: test
ghc-options: -Wall
default-language: Haskell2010
build-tool-depends: hspec-discover:hspec-discover >= 2.4.7 && <2.5
build-depends: HUnit
, hspec >= 2.4.7
, base
build-tool-depends: hspec-discover:hspec-discover >= 2.5.5 && <2.6
-- inherited depndencies
build-depends:
base
, bytestring
, QuickCheck >=2.9
, quickcheck-instances >= 0.3.12
, unordered-containers
, http-api-data
, text
, time
, bytestring
, uuid-types

build-depends: HUnit >= 1.6.0.0 && <1.7
, hspec >= 2.5.5 && <2.6
, QuickCheck >= 2.11.3 && <2.13
, quickcheck-instances >= 0.3.19 && <0.4

test-suite doctests
ghc-options: -Wall
build-depends:
base,
directory >= 1.0,
doctest >= 0.11 && <0.17,
doctest >= 0.16.0 && <0.17,
filepath
default-language: Haskell2010
hs-source-dirs: test
Expand Down
2 changes: 1 addition & 1 deletion src/Web/FormUrlEncoded.hs
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,5 @@ module Web.FormUrlEncoded (
urlDecodeParams,
) where

import Web.Internal.FormUrlEncoded
import Web.Internal.FormUrlEncoded

2 changes: 1 addition & 1 deletion src/Web/HttpApiData.hs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ module Web.HttpApiData (
readTextData,
) where

import Web.Internal.HttpApiData
import Web.Internal.HttpApiData

-- $setup
--
Expand Down
26 changes: 13 additions & 13 deletions src/Web/Internal/FormUrlEncoded.hs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE CPP #-}
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DefaultSignatures #-}
{-# LANGUAGE DeriveGeneric #-}
Expand All @@ -18,14 +18,14 @@
module Web.Internal.FormUrlEncoded where

#if __GLASGOW_HASKELL__ < 710
import Control.Applicative
import Data.Traversable
import Control.Applicative
import Data.Traversable
#endif


import Control.Arrow ((***))
import Control.Monad ((<=<))
import Data.ByteString.Builder (toLazyByteString, shortByteString)
import Data.ByteString.Builder (shortByteString, toLazyByteString)
import qualified Data.ByteString.Lazy as BSL
import qualified Data.ByteString.Lazy.Char8 as BSL8
import qualified Data.Foldable as F
Expand All @@ -39,30 +39,30 @@ import Data.List (intersperse, sortBy)
import Data.Map (Map)
import qualified Data.Map as Map
import Data.Monoid
import qualified Data.Semigroup as Semi
import Data.Ord (comparing)
import qualified Data.Semigroup as Semi

import Data.Text (Text)
import qualified Data.Text as Text
import qualified Data.Text.Lazy as Lazy
import Data.Text.Encoding as Text
import Data.Text.Encoding.Error (lenientDecode)
import qualified Data.Text.Lazy as Lazy

import Data.Time
import Data.Proxy
import Data.Time
import Data.Word

#if MIN_VERSION_base(4,8,0)
import Data.Void
import Numeric.Natural
import Data.Void
import Numeric.Natural
#endif

import GHC.Exts (IsList (..), Constraint)
import GHC.Exts (Constraint, IsList (..))
import GHC.Generics
import GHC.TypeLits
import Network.HTTP.Types.URI (urlEncodeBuilder, urlDecode)
import Network.HTTP.Types.URI (urlDecode, urlEncodeBuilder)

import Web.Internal.HttpApiData
import Web.Internal.HttpApiData

-- $setup
-- >>> :set -XDeriveGeneric
Expand Down Expand Up @@ -546,7 +546,7 @@ urlEncodeParams = toLazyByteString . mconcat . intersperse (shortByteString "&")
escape = urlEncodeBuilder True . Text.encodeUtf8

encodePair (k, "") = escape k
encodePair (k, v) = escape k <> shortByteString "=" <> escape v
encodePair (k, v) = escape k <> shortByteString "=" <> escape v

-- | Decode an @application/x-www-form-urlencoded@ 'BSL.ByteString' to a 'Form'.
--
Expand Down
Loading

0 comments on commit 1beba5a

Please sign in to comment.