Better support GHC 8.8

- Loosen bounds on template-haskell
- Remove some unused imports caught by the new import checker
- Support NoStarIsType
This commit is contained in:
Alexis King 2019-10-04 16:31:01 -05:00
parent ec84ae4e23
commit b2554e5078
9 changed files with 54 additions and 26 deletions

View File

@ -10,33 +10,37 @@ cache:
# cache file per set of arguments.
matrix:
include:
- env: ARGS="--resolver lts-7"
- env: ARGS="--stack-yaml=stack.ghc-8.4.yaml --resolver lts-7"
compiler: ": #stack 8.0.1"
addons: { apt: { packages: [libgmp-dev] } }
- env: ARGS="--resolver lts-8"
- env: ARGS="--stack-yaml=stack.ghc-8.4.yaml --resolver lts-8"
compiler: ": #stack 8.0.2"
addons: { apt: { packages: [libgmp-dev] } }
- env: ARGS="--resolver lts-10"
- env: ARGS="--stack-yaml=stack.ghc-8.4.yaml --resolver lts-10"
compiler: ": #stack 8.2.1"
addons: { apt: { packages: [libgmp-dev] } }
- env: ARGS="--resolver lts-11"
- env: ARGS="--stack-yaml=stack.ghc-8.4.yaml --resolver lts-11"
compiler: ": #stack 8.2.2"
addons: { apt: { packages: [libgmp-dev] } }
- env: ARGS="--resolver lts-12"
- env: ARGS="--stack-yaml=stack.ghc-8.4.yaml --resolver lts-12"
compiler: ": #stack 8.4.4"
addons: { apt: { packages: [libgmp-dev] } }
- env: ARGS="--resolver nightly"
- env: ARGS="--resolver lts-14"
compiler: ": #stack 8.6.5"
addons: { apt: { packages: [libgmp-dev] } }
- env: ARGS="--stack-yaml=stack.ghc-8.8.yaml --resolver nightly"
compiler: ": #stack nightly"
addons: { apt: { packages: [libgmp-dev] } }
allow_failures:
# Nightly builds are allowed to fail
- env: ARGS="--resolver nightly"
- env: ARGS="--stack-yaml=stack.ghc-8.8.yaml --resolver nightly"
before_install:
# Using compiler above sets CC to an invalid value, so unset it

View File

@ -1,13 +1,11 @@
{-# LANGUAGE CPP #-}
{-# LANGUAGE NoMonomorphismRestriction #-}
module Trace (module Trace) where
import Control.Applicative ((<$>), (<*>), pure)
import Data.Function (($))
import Data.Int (Int)
#if !MIN_VERSION_base(4,11,0)
import Data.Monoid ((<>))
import System.IO (IO)
import Text.Show (Show(show))
#endif
import Control.Monad.Freer (Eff, Member)
import Control.Monad.Freer.Reader (ask, runReader)

View File

@ -57,7 +57,7 @@ library:
dependencies:
- natural-transformation >= 0.2
- transformers-base
- template-haskell >= 2.11 && < 2.15
- template-haskell >= 2.11 && < 2.16
executables:
freer-examples:

View File

@ -1,3 +1,5 @@
{-# LANGUAGE CPP #-}
-- |
-- Module: Control.Monad.Freer.Writer
-- Description: Composable Writer effects.
@ -19,7 +21,10 @@ module Control.Monad.Freer.Writer
) where
import Control.Arrow (second)
#if !MIN_VERSION_base(4,11,0)
import Data.Monoid ((<>))
#endif
import Control.Monad.Freer.Internal (Eff, Member, handleRelay, send)

View File

@ -32,11 +32,12 @@
-- substitution for @Typeable@.
module Data.OpenUnion.Internal where
import Data.Kind (Type)
import GHC.TypeLits (TypeError, ErrorMessage(..))
import Unsafe.Coerce (unsafeCoerce)
-- | Open union is a strong sum (existential with an evidence).
data Union (r :: [* -> *]) a where
data Union (r :: [Type -> Type]) a where
Union :: {-# UNPACK #-} !Word -> t a -> Union r a
-- | Takes a request of type @t :: * -> *@, and injects it into the 'Union'.
@ -76,7 +77,7 @@ newtype P t r = P {unP :: Word}
-- prior to recursion, and it is used to produce better type errors.
--
-- This is essentially a compile-time computation without run-time overhead.
class FindElem (t :: * -> *) (r :: [* -> *]) where
class FindElem (t :: Type -> Type) (r :: [Type -> Type]) where
-- | Position of the element @t :: * -> *@ in a type list @r :: [* -> *]@.
--
-- Position is computed during compilation, i.e. there is no run-time
@ -96,7 +97,7 @@ instance {-# OVERLAPPABLE #-} FindElem t r => FindElem t (t' ': r) where
-- | Instance resolution for this class fails with a custom type error
-- if @t :: * -> *@ is not in the list @r :: [* -> *]@.
class IfNotFound (t :: * -> *) (r :: [* -> *]) (w :: [* -> *])
class IfNotFound (t :: Type -> Type) (r :: [Type -> Type]) (w :: [Type -> Type])
-- | If we reach an empty list, thats a failure, since it means the type isnt
-- in the list. For GHC >=8, we can render a custom type error that explicitly
@ -128,7 +129,7 @@ instance {-# INCOHERENT #-} IfNotFound t r w
-- @
-- 'Member' ('Control.Monad.Freer.State.State' 'Integer') effs => 'Control.Monad.Freer.Eff' effs ()
-- @
class FindElem eff effs => Member (eff :: * -> *) effs where
class FindElem eff effs => Member (eff :: Type -> Type) effs where
-- This type class is used for two following purposes:
--
-- * As a @Constraint@ it guarantees that @t :: * -> *@ is a member of a

4
stack.ghc-8.4.yaml Normal file
View File

@ -0,0 +1,4 @@
resolver: lts-12.26
packages: [.]
extra-deps:
- extensible-effects-3.1.0.0

3
stack.ghc-8.8.yaml Normal file
View File

@ -0,0 +1,3 @@
resolver: nightly-2019-10-04
packages: [.]
extra-deps: []

View File

@ -1,10 +1,4 @@
resolver: lts-12.18
packages:
- '.'
resolver: lts-14.7
packages: [.]
extra-deps:
- extensible-effects-3.1.0.0
flags: {}
extra-package-dbs: []
- extensible-effects-5.0.0.1@sha256:2ed0bee04c8bf334358147da6d92ff31e9fbbefceb75ef3e408a0d858aec0cc6,9013

19
stack.yaml.lock Normal file
View File

@ -0,0 +1,19 @@
# 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: extensible-effects-5.0.0.1@sha256:2ed0bee04c8bf334358147da6d92ff31e9fbbefceb75ef3e408a0d858aec0cc6,9013
pantry-tree:
size: 3306
sha256: 4c520f1ccb76ed1d304cb5967e6679e31c907d3c0ba5d7e4a459e827b9a08173
original:
hackage: extensible-effects-5.0.0.1@sha256:2ed0bee04c8bf334358147da6d92ff31e9fbbefceb75ef3e408a0d858aec0cc6,9013
snapshots:
- completed:
size: 523700
url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/14/7.yaml
sha256: 8e3f3c894be74d71fa4bf085e0a8baae7e4d7622d07ea31a52736b80f8b9bb1a
original: lts-14.7