diff --git a/.travis.yml b/.travis.yml index b2c5cb0..7180ce5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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 diff --git a/examples/src/Trace.hs b/examples/src/Trace.hs index 63e6b1c..9f8b80b 100644 --- a/examples/src/Trace.hs +++ b/examples/src/Trace.hs @@ -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) diff --git a/package.yaml b/package.yaml index 890fef3..cd8b445 100644 --- a/package.yaml +++ b/package.yaml @@ -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: diff --git a/src/Control/Monad/Freer/Writer.hs b/src/Control/Monad/Freer/Writer.hs index 604660d..45a0012 100644 --- a/src/Control/Monad/Freer/Writer.hs +++ b/src/Control/Monad/Freer/Writer.hs @@ -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) diff --git a/src/Data/OpenUnion/Internal.hs b/src/Data/OpenUnion/Internal.hs index b9bc4d6..2781ab9 100644 --- a/src/Data/OpenUnion/Internal.hs +++ b/src/Data/OpenUnion/Internal.hs @@ -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, that’s a failure, since it means the type isn’t -- 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 diff --git a/stack.ghc-8.4.yaml b/stack.ghc-8.4.yaml new file mode 100644 index 0000000..66e1922 --- /dev/null +++ b/stack.ghc-8.4.yaml @@ -0,0 +1,4 @@ +resolver: lts-12.26 +packages: [.] +extra-deps: +- extensible-effects-3.1.0.0 diff --git a/stack.ghc-8.8.yaml b/stack.ghc-8.8.yaml new file mode 100644 index 0000000..c91969a --- /dev/null +++ b/stack.ghc-8.8.yaml @@ -0,0 +1,3 @@ +resolver: nightly-2019-10-04 +packages: [.] +extra-deps: [] diff --git a/stack.yaml b/stack.yaml index ee19644..e04f6cc 100644 --- a/stack.yaml +++ b/stack.yaml @@ -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 diff --git a/stack.yaml.lock b/stack.yaml.lock new file mode 100644 index 0000000..035a407 --- /dev/null +++ b/stack.yaml.lock @@ -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