From 1cc8caf93c806adb3fdbf1fc6f708f47f1f3754b Mon Sep 17 00:00:00 2001 From: Diogo Castro Date: Mon, 30 Sep 2019 19:46:42 +0100 Subject: [PATCH 1/3] Added `WrappedPoly` newtype (solved #179) --- mono-traversable/ChangeLog.md | 4 +++ mono-traversable/package.yaml | 2 +- mono-traversable/src/Data/MonoTraversable.hs | 26 ++++++++++++++++++++ 3 files changed, 31 insertions(+), 1 deletion(-) diff --git a/mono-traversable/ChangeLog.md b/mono-traversable/ChangeLog.md index 29815b43..5af9ef72 100644 --- a/mono-traversable/ChangeLog.md +++ b/mono-traversable/ChangeLog.md @@ -1,3 +1,7 @@ +## 1.0.13.0 +* Added `WrappedPoly` to `Data.MonoTraversable` + [#180](https://github.com/snoyberg/mono-traversable/pull/180) + ## 1.0.12.0 * Added `filterSet` to `Data.Containers` * Use container specific implementations for `filterSet` and `filterMap` diff --git a/mono-traversable/package.yaml b/mono-traversable/package.yaml index 847f9e8e..fc4f1fcd 100644 --- a/mono-traversable/package.yaml +++ b/mono-traversable/package.yaml @@ -1,5 +1,5 @@ name: mono-traversable -version: 1.0.12.0 +version: 1.0.13.0 synopsis: Type classes for mapping, folding, and traversing monomorphic containers description: Please see the README at category: Data diff --git a/mono-traversable/src/Data/MonoTraversable.hs b/mono-traversable/src/Data/MonoTraversable.hs index 700b0fa9..effab6b0 100644 --- a/mono-traversable/src/Data/MonoTraversable.hs +++ b/mono-traversable/src/Data/MonoTraversable.hs @@ -1,11 +1,13 @@ {-# LANGUAGE ConstrainedClassMethods #-} {-# LANGUAGE CPP #-} {-# LANGUAGE DefaultSignatures #-} +{-# LANGUAGE DerivingStrategies #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators #-} {-# LANGUAGE UndecidableInstances #-} +{-# LANGUAGE GeneralizedNewtypeDeriving #-} -- | Type classes mirroring standard typeclasses, but working with monomorphic containers. -- -- The motivation is that some commonly used data types (i.e., 'ByteString' and @@ -1382,3 +1384,27 @@ ointercalate x = mconcat . List.intersperse x . otoList ointercalate x = T.intercalate x . otoList #-} {-# RULES "intercalate LText" forall x. ointercalate x = TL.intercalate x . otoList #-} + +-- | Provides a `MonoFoldable`, `MonoFunctor` or `MonoPointed` for an arbitrary +-- `F.Foldable`, `Functor` or `Applicative`. +-- +-- Useful for, e.g., passing a `F.Foldable` type you don't own into a +-- function that expects a `MonoFoldable`. +-- +-- > // package A +-- > data MyList a = MyList [a] deriving Foldable +-- > +-- > // package B +-- > process :: MonoFoldable mono => mono -> IO () +-- > +-- > // package C +-- > process (WrappedPoly (MyList [])) +-- +-- @since 1.0.13.0 +newtype WrappedPoly f a = WrappedPoly { unwrapPoly :: f a } + deriving newtype (F.Foldable, Functor, Applicative, Monad) + +type instance Element (WrappedPoly f a) = a +instance F.Foldable f => MonoFoldable (WrappedPoly f a) +instance Functor f => MonoFunctor (WrappedPoly f a) +instance Applicative f => MonoPointed (WrappedPoly f a) From 37863343256ffbc6f8dd153d8e96b92e0b555c81 Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Thu, 3 Oct 2019 13:30:47 +0300 Subject: [PATCH 2/3] Drop GHC 8.0.2 --- .travis.yml | 12 ++-- chunked-data/package.yaml | 2 +- classy-prelude-conduit/package.yaml | 2 +- classy-prelude-yesod/package.yaml | 2 +- classy-prelude/package.yaml | 2 +- minlen/package.yaml | 2 +- mono-traversable-instances/package.yaml | 2 +- mono-traversable/package.yaml | 2 +- mutable-containers/package.yaml | 2 +- stack-lts-9.yaml | 23 ------ stack-lts-9.yaml.lock | 96 ------------------------- 11 files changed, 14 insertions(+), 133 deletions(-) delete mode 100644 stack-lts-9.yaml delete mode 100644 stack-lts-9.yaml.lock diff --git a/.travis.yml b/.travis.yml index c09ed5e4..232576dd 100644 --- a/.travis.yml +++ b/.travis.yml @@ -98,9 +98,9 @@ matrix: # compiler: ": #stack 8.0.1" # addons: {apt: {packages: [libgmp-dev]}} - - env: BUILD=stack ARGS="--stack-yaml stack-lts-9.yaml" - compiler: ": #stack 8.0.2" - addons: {apt: {packages: [libgmp-dev]}} + #- env: BUILD=stack ARGS="--stack-yaml stack-lts-9.yaml" + # compiler: ": #stack 8.0.2" + # addons: {apt: {packages: [libgmp-dev]}} - env: BUILD=stack ARGS="--resolver lts-11" compiler: ": #stack 8.2.2" @@ -145,9 +145,9 @@ matrix: # compiler: ": #stack 8.0.1 osx" # os: osx - - env: BUILD=stack ARGS="--stack-yaml stack-lts-9.yaml" - compiler: ": #stack 8.0.2 osx" - os: osx + #- env: BUILD=stack ARGS="--stack-yaml stack-lts-9.yaml" + # compiler: ": #stack 8.0.2 osx" + # os: osx - env: BUILD=stack ARGS="--resolver lts-11" compiler: ": #stack 8.2.2 osx" diff --git a/chunked-data/package.yaml b/chunked-data/package.yaml index a9890a4f..f6d6eb57 100644 --- a/chunked-data/package.yaml +++ b/chunked-data/package.yaml @@ -13,7 +13,7 @@ extra-source-files: - ChangeLog.md dependencies: -- base >= 4.9 && <5 +- base >= 4.10 && <5 - transformers - bytestring >=0.10.2 - text >=1.2 diff --git a/classy-prelude-conduit/package.yaml b/classy-prelude-conduit/package.yaml index b2933037..7cfb3713 100644 --- a/classy-prelude-conduit/package.yaml +++ b/classy-prelude-conduit/package.yaml @@ -13,7 +13,7 @@ extra-source-files: - ChangeLog.md dependencies: -- base >= 4.9 && <5 +- base >= 4.10 && <5 - transformers - bytestring diff --git a/classy-prelude-yesod/package.yaml b/classy-prelude-yesod/package.yaml index fe5108f0..ae433971 100644 --- a/classy-prelude-yesod/package.yaml +++ b/classy-prelude-yesod/package.yaml @@ -13,7 +13,7 @@ extra-source-files: - ChangeLog.md dependencies: -- base >= 4.9 && <5 +- base >= 4.10 && <5 - classy-prelude >=1.5.0 && <1.5.1 - classy-prelude-conduit >=1.5.0 && <1.5.1 - yesod >=1.2 diff --git a/classy-prelude/package.yaml b/classy-prelude/package.yaml index e6b0a6a4..72d1cf47 100644 --- a/classy-prelude/package.yaml +++ b/classy-prelude/package.yaml @@ -13,7 +13,7 @@ extra-source-files: - ChangeLog.md dependencies: -- base >= 4.9 && <5 +- base >= 4.10 && <5 - transformers - unordered-containers diff --git a/minlen/package.yaml b/minlen/package.yaml index 1feb59e7..27cd6f46 100644 --- a/minlen/package.yaml +++ b/minlen/package.yaml @@ -13,7 +13,7 @@ extra-source-files: - ChangeLog.md dependencies: -- base >= 4.9 && <5 +- base >= 4.10 && <5 - mono-traversable - semigroups - transformers diff --git a/mono-traversable-instances/package.yaml b/mono-traversable-instances/package.yaml index d334964f..5969e7f4 100644 --- a/mono-traversable-instances/package.yaml +++ b/mono-traversable-instances/package.yaml @@ -13,7 +13,7 @@ extra-source-files: - ChangeLog.md dependencies: -- base >= 4.9 && <5 +- base >= 4.10 && <5 - mono-traversable >=1.0 && <1.1 - semigroupoids >=3.0 - comonad >=3.0.3 diff --git a/mono-traversable/package.yaml b/mono-traversable/package.yaml index fc4f1fcd..8b8a598e 100644 --- a/mono-traversable/package.yaml +++ b/mono-traversable/package.yaml @@ -16,7 +16,7 @@ library: source-dirs: src ghc-options: -Wall dependencies: - - base >= 4.9 && <5 + - base >= 4.10 && <5 - containers >=0.5.8 - unordered-containers >=0.2 - hashable diff --git a/mutable-containers/package.yaml b/mutable-containers/package.yaml index 9bfc3b8a..fbc91c72 100644 --- a/mutable-containers/package.yaml +++ b/mutable-containers/package.yaml @@ -13,7 +13,7 @@ extra-source-files: - ChangeLog.md dependencies: -- base >= 4.9 && <5 +- base >= 4.10 && <5 - containers - vector diff --git a/stack-lts-9.yaml b/stack-lts-9.yaml deleted file mode 100644 index 6b778a4c..00000000 --- a/stack-lts-9.yaml +++ /dev/null @@ -1,23 +0,0 @@ -resolver: lts-9.9 -packages: -- minlen -- mono-traversable -- mono-traversable-instances -- chunked-data -- classy-prelude -- classy-prelude-conduit -#- classy-prelude-yesod -- mutable-containers -extra-deps: -- resourcet-1.2.0@rev:0 -- conduit-1.3.0@rev:0 -- conduit-extra-1.3.0@rev:0 -- containers-0.5.11.0@sha256:28ad7337057442f75bc689315ab4ec7bdf5e6b2c39668f306672cecd82c02798,16685 -- typed-process-0.2.1.0@rev:0 -- unliftio-0.2.4.0@rev:0 -- unliftio-core-0.1.1.0@rev:0 -- http-conduit-2.3.0@rev:0 -- basic-prelude-0.7.0@rev:0 -- gauge-0.2.1@rev:0 -- basement-0.0.6@rev:0 -- binary-0.8.7.0@sha256:ae3e6cca723ac55c54bbb3fa771bcf18142bc727afd57818e66d6ee6c8044f12,7705 diff --git a/stack-lts-9.yaml.lock b/stack-lts-9.yaml.lock deleted file mode 100644 index 85b382a6..00000000 --- a/stack-lts-9.yaml.lock +++ /dev/null @@ -1,96 +0,0 @@ -# This file was autogenerated by Stack. -# You should not edit this file by hand. -# For more information, please see the documentation at: -# https://docs.haskellstack.org/en/stable/lock_files - -packages: -- completed: - hackage: resourcet-1.2.0@sha256:7e1ac5c7b82801ce11892a3ab79e1b4d967bcdee8e4dabc807ade8a91261c5af,1606 - pantry-tree: - size: 647 - sha256: 7f2f35b3e4d5880fe3a7d43f3671d9a29bf3692614410ceffc2c3657c756a097 - original: - hackage: resourcet-1.2.0@rev:0 -- completed: - hackage: conduit-1.3.0@sha256:3ce37554c6f1dcd67572074484c7961d0b65491aca1bec35bd3075777ba082e7,4963 - pantry-tree: - size: 1956 - sha256: b51de745fcf5a5b1d4b0d958723bb6bc5328745fde063ac1f33ee6d030c97fd3 - original: - hackage: conduit-1.3.0@rev:0 -- completed: - hackage: conduit-extra-1.3.0@sha256:a2993f5632675bd042e802392d464b39fc2fc89c7d720882b85f4f306b77a1d6,4244 - pantry-tree: - size: 2332 - sha256: 391aef5239b1a116057780f60d4b8be60f5fe80325def0038417534b0ac2379c - original: - hackage: conduit-extra-1.3.0@rev:0 -- completed: - hackage: containers-0.5.11.0@sha256:28ad7337057442f75bc689315ab4ec7bdf5e6b2c39668f306672cecd82c02798,16685 - pantry-tree: - size: 4849 - sha256: faa4e75922a28f7cfe9920c1d7ab3866b792cefcd29bf79f54cfe3b6b5f57cbf - original: - hackage: containers-0.5.11.0@sha256:28ad7337057442f75bc689315ab4ec7bdf5e6b2c39668f306672cecd82c02798,16685 -- completed: - hackage: typed-process-0.2.1.0@sha256:5731c4b4417797ce3a0d27a86785c29b2cc80dcccb3f2875e191a3299d3a0d5d,1626 - pantry-tree: - size: 452 - sha256: 93c8a1c89609f4c85d6f10769fc35bd7249b5d66d33dff21395f12bae100cce9 - original: - hackage: typed-process-0.2.1.0@rev:0 -- completed: - hackage: unliftio-0.2.4.0@sha256:ec362271f50126c63a92723b5c7586d1801ae2ed766514ebcf1f045e9554285f,2036 - pantry-tree: - size: 1296 - sha256: 646d0f59c93b6afa86e61d591ef56195c234ad75e2569be31b5c4d25dbbd5406 - original: - hackage: unliftio-0.2.4.0@rev:0 -- completed: - hackage: unliftio-core-0.1.1.0@sha256:b6ff4083ed814ea85fce524628bdccaad8fcaf9ccf72b5f80850bf91af559453,1032 - pantry-tree: - size: 328 - sha256: e6f88f1b00c4175c543e7494345907acf55c922ab9513759da4e5461252f99a9 - original: - hackage: unliftio-core-0.1.1.0@rev:0 -- completed: - hackage: http-conduit-2.3.0@sha256:7ffdbf5f3149f86aea4e948d36abad881bbd06063292b43fe2d5bec553f2fd59,2837 - pantry-tree: - size: 784 - sha256: 57dd7f1092cd3bfa08906b533b1407eb56eee141a252ab78f3364ab195706ad0 - original: - hackage: http-conduit-2.3.0@rev:0 -- completed: - hackage: basic-prelude-0.7.0@sha256:efe61aec70e6f523435d46fcd18587f28febbb1bc7d20d20e5aa249d93ed9e96,1251 - pantry-tree: - size: 377 - sha256: c32802b5ecbd49d0c73f3302ada16aeb33e55d9be49e38c84fb4bd700aae9fb8 - original: - hackage: basic-prelude-0.7.0@rev:0 -- completed: - hackage: gauge-0.2.1@sha256:b93b196a599d495306a3a0bc0e8c415aae613f868b748089852f818c6d7afc44,4852 - pantry-tree: - size: 3745 - sha256: cdf1d115ca6db15189f9faa4b78a9ff2fe1f6780a72b91b2a667773bc8c58073 - original: - hackage: gauge-0.2.1@rev:0 -- completed: - hackage: basement-0.0.6@sha256:4a74e888df45f518a0f2b93e440d982e8453fe4c0efc45dcdd7fa982fd7acb59,5675 - pantry-tree: - size: 6026 - sha256: 101570ebef31c4ace1309661a087ca710f89c924ff8dbb8eb53ebc53d2a69b8a - original: - hackage: basement-0.0.6@rev:0 -- completed: - hackage: binary-0.8.7.0@sha256:ae3e6cca723ac55c54bbb3fa771bcf18142bc727afd57818e66d6ee6c8044f12,7705 - pantry-tree: - size: 1976 - sha256: 35e44b6d3ccf0d56fc5407dc3f0895e74696a66da189afbd65973c95743f5e25 - original: - hackage: binary-0.8.7.0@sha256:ae3e6cca723ac55c54bbb3fa771bcf18142bc727afd57818e66d6ee6c8044f12,7705 -snapshots: -- completed: - size: 535260 - url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/9/9.yaml - sha256: 19713287614a8a7567eae3ab5da11fde0ff68ff0e0ab49fc42ce582a00b7ad73 - original: lts-9.9 From 2de4326112f71c5e182b43bcbcf79e687c75939a Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Thu, 3 Oct 2019 13:53:06 +0300 Subject: [PATCH 3/3] Simplify CI matrix and script --- .travis.yml | 198 +++------------------------------------------------- 1 file changed, 9 insertions(+), 189 deletions(-) diff --git a/.travis.yml b/.travis.yml index 232576dd..ce6a75bd 100644 --- a/.travis.yml +++ b/.travis.yml @@ -34,153 +34,44 @@ cache: # addons: {apt: {packages: [libfcgi-dev,libgmp-dev]}} matrix: include: - # We grab the appropriate GHC and cabal-install versions from hvr's PPA. See: - # https://github.com/hvr/multi-ghc-travis - #- env: BUILD=cabal GHCVER=7.0.4 CABALVER=1.16 HAPPYVER=1.19.5 ALEXVER=3.1.7 - # compiler: ": #GHC 7.0.4" - # addons: {apt: {packages: [cabal-install-1.16,ghc-7.0.4,happy-1.19.5,alex-3.1.7], sources: [hvr-ghc]}} - #- env: BUILD=cabal GHCVER=7.2.2 CABALVER=1.16 HAPPYVER=1.19.5 ALEXVER=3.1.7 - # compiler: ": #GHC 7.2.2" - # addons: {apt: {packages: [cabal-install-1.16,ghc-7.2.2,happy-1.19.5,alex-3.1.7], sources: [hvr-ghc]}} - #- env: BUILD=cabal GHCVER=7.4.2 CABALVER=1.16 HAPPYVER=1.19.5 ALEXVER=3.1.7 - # compiler: ": #GHC 7.4.2" - # addons: {apt: {packages: [cabal-install-1.16,ghc-7.4.2,happy-1.19.5,alex-3.1.7], sources: [hvr-ghc]}} - #- env: BUILD=cabal GHCVER=7.6.3 CABALVER=1.16 HAPPYVER=1.19.5 ALEXVER=3.1.7 - # compiler: ": #GHC 7.6.3" - # addons: {apt: {packages: [cabal-install-1.16,ghc-7.6.3,happy-1.19.5,alex-3.1.7], sources: [hvr-ghc]}} - #- env: BUILD=cabal GHCVER=7.8.4 CABALVER=1.18 HAPPYVER=1.19.5 ALEXVER=3.1.7 - # compiler: ": #GHC 7.8.4" - # addons: {apt: {packages: [cabal-install-1.18,ghc-7.8.4,happy-1.19.5,alex-3.1.7], sources: [hvr-ghc]}} - #- env: BUILD=cabal GHCVER=7.10.3 CABALVER=1.22 HAPPYVER=1.19.5 ALEXVER=3.1.7 - # compiler: ": #GHC 7.10.3" - # addons: {apt: {packages: [cabal-install-1.22,ghc-7.10.3,happy-1.19.5,alex-3.1.7], sources: [hvr-ghc]}} - - # Disabling cabal for now, the dependency structure here confuses it. - - #- env: BUILD=cabal GHCVER=8.0.2 CABALVER=1.24 HAPPYVER=1.19.5 ALEXVER=3.1.7 - # compiler: ": #GHC 8.0.2" - # addons: {apt: {packages: [cabal-install-1.24,ghc-8.0.2,happy-1.19.5,alex-3.1.7], sources: [hvr-ghc]}} - #- env: BUILD=cabal GHCVER=8.2.2 CABALVER=2.0 HAPPYVER=1.19.5 ALEXVER=3.1.7 - # compiler: ": #GHC 8.2.2" - # addons: {apt: {packages: [cabal-install-2.0,ghc-8.2.2,happy-1.19.5,alex-3.1.7], sources: [hvr-ghc]}} - #- env: BUILD=cabal GHCVER=8.4.4 CABALVER=2.2 HAPPYVER=1.19.5 ALEXVER=3.1.7 - # compiler: ": #GHC 8.4.4" - # addons: {apt: {packages: [cabal-install-2.2,ghc-8.4.4,happy-1.19.5,alex-3.1.7], sources: [hvr-ghc]}} - #- env: BUILD=cabal GHCVER=8.6.3 CABALVER=2.2 HAPPYVER=1.19.5 ALEXVER=3.1.7 - # compiler: ": #GHC 8.6.3" - # addons: {apt: {packages: [cabal-install-2.4,ghc-8.6.3,happy-1.19.5,alex-3.1.7], sources: [hvr-ghc]}} - - # Build with the newest GHC and cabal-install. This is an accepted failure, - # see below. - #- env: BUILD=cabal GHCVER=head CABALVER=head HAPPYVER=1.19.5 ALEXVER=3.1.7 - # compiler: ": #GHC HEAD" - # addons: {apt: {packages: [cabal-install-head,ghc-head,happy-1.19.5,alex-3.1.7], sources: [hvr-ghc]}} - - # The Stack builds. We can pass in arbitrary Stack arguments via the ARGS - # variable, such as using --stack-yaml to point to a different file. - - env: BUILD=stack ARGS="" - compiler: ": #stack default" - addons: {apt: {packages: [libgmp-dev]}} - - #- env: BUILD=stack ARGS="--resolver lts-2" - # compiler: ": #stack 7.8.4" - # addons: {apt: {packages: [libgmp-dev]}} - - #- env: BUILD=stack ARGS="--resolver lts-3" - # compiler: ": #stack 7.10.2" - # addons: {apt: {packages: [libgmp-dev]}} - - #- env: BUILD=stack ARGS="--resolver lts-6" - # compiler: ": #stack 7.10.3" - # addons: {apt: {packages: [libgmp-dev]}} - - #- env: BUILD=stack ARGS="--resolver lts-7" - # compiler: ": #stack 8.0.1" - # addons: {apt: {packages: [libgmp-dev]}} - - #- env: BUILD=stack ARGS="--stack-yaml stack-lts-9.yaml" - # compiler: ": #stack 8.0.2" - # addons: {apt: {packages: [libgmp-dev]}} - - env: BUILD=stack ARGS="--resolver lts-11" - compiler: ": #stack 8.2.2" + compiler: ": #GHC 8.2 Linux" addons: {apt: {packages: [libgmp-dev]}} - env: BUILD=stack ARGS="--resolver lts-12" - compiler: ": #stack 8.4.4" + compiler: ": #GHC 8.4 Linux" addons: {apt: {packages: [libgmp-dev]}} - env: BUILD=stack ARGS="--resolver lts-14" - compiler: ": #stack 8.6.5" + compiler: ": #GHC 8.6 Linux" addons: {apt: {packages: [libgmp-dev]}} - env: BUILD=stack ARGS="--stack-yaml stack-nightly.yaml" - compiler: ": #stack 8.8.1" - addons: {apt: {packages: [libgmp-dev]}} - - # Nightly builds are allowed to fail - - env: BUILD=stack ARGS="--resolver nightly" - compiler: ": #stack nightly" + compiler: ": #GHC 8.8 Linux" addons: {apt: {packages: [libgmp-dev]}} # Build on macOS in addition to Linux - - env: BUILD=stack ARGS="" - compiler: ": #stack default osx" - os: osx - - # Travis includes an macOS which is incompatible with GHC 7.8.4 - #- env: BUILD=stack ARGS="--resolver lts-2" - # compiler: ": #stack 7.8.4 osx" - # os: osx - - #- env: BUILD=stack ARGS="--resolver lts-3" - # compiler: ": #stack 7.10.2 osx" - # os: osx - - #- env: BUILD=stack ARGS="--resolver lts-6" - # compiler: ": #stack 7.10.3 osx" - # os: osx - - #- env: BUILD=stack ARGS="--resolver lts-7" - # compiler: ": #stack 8.0.1 osx" - # os: osx - - #- env: BUILD=stack ARGS="--stack-yaml stack-lts-9.yaml" - # compiler: ": #stack 8.0.2 osx" - # os: osx - env: BUILD=stack ARGS="--resolver lts-11" - compiler: ": #stack 8.2.2 osx" + compiler: ": #GHC 8.2 OS X" os: osx - env: BUILD=stack ARGS="--resolver lts-12" - compiler: ": #stack 8.4.4 osx" + compiler: ": #GHC 8.4 OS X" os: osx - env: BUILD=stack ARGS="--resolver lts-14" - compiler: ": #stack 8.6.5 osx" + compiler: ": #GHC 8.6 OS X" os: osx - env: BUILD=stack ARGS="--stack-yaml stack-nightly.yaml" - compiler: ": #stack 8.8.1" - os: osx - - - env: BUILD=stack ARGS="--resolver nightly" - compiler: ": #stack nightly osx" + compiler: ": #GHC 8.8 OS X" os: osx - allow_failures: - - env: BUILD=cabal GHCVER=head CABALVER=head HAPPYVER=1.19.5 ALEXVER=3.1.7 - - env: BUILD=stack ARGS="--resolver nightly" - before_install: # Using compiler above sets CC to an invalid value, so unset it - unset CC -# We want to always allow newer versions of packages when building on GHC HEAD -- CABALARGS="" -- if [ "x$GHCVER" = "xhead" ]; then CABALARGS=--allow-newer; fi - # Download and unpack the stack executable - export PATH=/opt/ghc/$GHCVER/bin:/opt/cabal/$CABALVER/bin:$HOME/.local/bin:/opt/alex/$ALEXVER/bin:/opt/happy/$HAPPYVER/bin:$HOME/.cabal/bin:$PATH - mkdir -p ~/.local/bin @@ -192,76 +83,5 @@ before_install: travis_retry curl -L https://get.haskellstack.org/stable/linux-x86_64.tar.gz | tar xz --wildcards --strip-components=1 -C ~/.local/bin '*/stack' fi - # Use the more reliable S3 mirror of Hackage - mkdir -p $HOME/.cabal - echo 'remote-repo: hackage.haskell.org:http://hackage.fpcomplete.com/' > $HOME/.cabal/config - echo 'remote-repo-cache: $HOME/.cabal/packages' >> $HOME/.cabal/config - - -install: -- echo "$(ghc --version) [$(ghc --print-project-git-commit-id 2> /dev/null || echo '?')]" -- if [ -f configure.ac ]; then autoreconf -i; fi -- | - set -ex - case "$BUILD" in - stack) - # Add in extra-deps for older snapshots, as necessary - # - # This is disabled by default, as relying on the solver like this can - # make builds unreliable. Instead, if you have this situation, it's - # recommended that you maintain multiple stack-lts-X.yaml files. - - #stack --no-terminal --install-ghc $ARGS test --bench --dry-run || ( \ - # stack --no-terminal $ARGS build cabal-install && \ - # stack --no-terminal $ARGS solver --update-config) - - # Build the dependencies - stack --no-terminal --install-ghc $ARGS test --bench --only-dependencies - ;; - cabal) - cabal --version - travis_retry cabal update - - # Get the list of packages from the stack.yaml file. Note that - # this will also implicitly run hpack as necessary to generate - # the .cabal files needed by cabal-install. - PACKAGES=$(stack --install-ghc query locals | grep '^ *path' | sed 's@^ *path:@@') - - cabal install --only-dependencies --enable-tests --enable-benchmarks --force-reinstalls --ghc-options=-O0 --reorder-goals --max-backjumps=-1 $CABALARGS $PACKAGES - ;; - esac - set +ex - script: -- | - set -ex - case "$BUILD" in - stack) - stack --no-terminal $ARGS test --bench --no-run-benchmarks # --haddock --no-haddock-deps - ;; - cabal) - cabal install --enable-tests --enable-benchmarks --force-reinstalls --ghc-options=-O0 --reorder-goals --max-backjumps=-1 $CABALARGS $PACKAGES - - ORIGDIR=$(pwd) - for dir in $PACKAGES - do - cd $dir - cabal check || [ "$CABALVER" == "1.16" ] - cabal sdist - PKGVER=$(cabal info . | awk '{print $2;exit}') - SRC_TGZ=$PKGVER.tar.gz - cd dist - tar zxfv "$SRC_TGZ" - cd "$PKGVER" - cabal configure --enable-tests --ghc-options -O0 - cabal build - if [ "$CABALVER" = "1.16" ] || [ "$CABALVER" = "1.18" ]; then - cabal test - else - cabal test --show-details=streaming --log=/dev/stdout - fi - cd $ORIGDIR - done - ;; - esac - set +ex +- stack --no-terminal $ARGS test --bench --no-run-benchmarks # --haddock --no-haddock-deps