on master help sign in
Support GHC 8.0 only (#20)
c6e803cIndex Int
.travis.yml+4−12
@@ -1,16 +1,10 @@
1sudo: false
1sudo: false
2
2
3−env:
4− - GHCVER=7.8.4 STACK_YAML=stack-ghc-7.8.4.yaml
5− - GHCVER=7.10.3 STACK_YAML=stack.yaml
6− - GHCVER=8.0.1 STACK_YAML=stack-ghc-8.0.1.yaml COVERAGE="YES"
7−
8cache:
3cache:
9 directories:
4 directories:
10 - $HOME/.stack/
5 - $HOME/.stack/
11
6
12before_install:
7before_install:
13− - export PATH=/opt/ghc/$GHCVER/bin:$PATH
14 - mkdir -p ~/.local/bin
8 - mkdir -p ~/.local/bin
15 - travis_retry curl -L https://github.com/commercialhaskell/stack/releases/download/v1.0.4.3/stack-1.0.4.3-linux-x86_64.tar.gz | tar -xvz
9 - travis_retry curl -L https://github.com/commercialhaskell/stack/releases/download/v1.0.4.3/stack-1.0.4.3-linux-x86_64.tar.gz | tar -xvz
16 - mv stack-1.0.4.3-linux-x86_64/stack ~/.local/bin
10 - mv stack-1.0.4.3-linux-x86_64/stack ~/.local/bin
@@ -22,15 +16,13 @@ install:
22 - stack install --only-dependencies --no-terminal
16 - stack install --only-dependencies --no-terminal
23
17
24script:
18script:
25− - travis/test.sh
19+ - stack test :regression --coverage --no-terminal --ghc-options -Werror
26
20
27after_script:
21after_script:
28− - travis/shc.sh
22+ - curl -L https://github.com/rubik/stack-hpc-coveralls/releases/download/v0.0.3.0/shc-linux-x64-7.10.2.tar.bz2 | tar -xvj
23+ - ./shc ether regression
29
24
30addons:
25addons:
31 apt:
26 apt:
32− sources:
33− - hvr-ghc
34 packages:
27 packages:
35− - ghc-7.8.4
28+ - libgmp-dev
36− - ghc-7.10.3
ether.cabal+1−4
@@ -56,8 +56,6 @@ library
56 Control.Monad.Ether.Implicit.State.Strict
56 Control.Monad.Ether.Implicit.State.Strict
57 Control.Monad.Ether.Implicit.Except
57 Control.Monad.Ether.Implicit.Except
58
58
59− other-modules: Control.Ether.Util
60−
61 build-depends: base >=4.7 && <4.10
59 build-depends: base >=4.7 && <4.10
62 , transformers >=0.4.2
60 , transformers >=0.4.2
63 , transformers-lift >=0.1.0.1
61 , transformers-lift >=0.1.0.1
@@ -70,8 +68,7 @@ library
70 , ghc-prim >=0.3
68 , ghc-prim >=0.3
71
69
72 default-language: Haskell2010
70 default-language: Haskell2010
73− other-extensions: CPP
74− ConstraintKinds
71+ other-extensions: ConstraintKinds
75 DataKinds
72 DataKinds
76 DefaultSignatures
73 DefaultSignatures
77 DeriveGeneric
74 DeriveGeneric
src/Control/Ether/Util.hsdeleted−33
@@ -1,33 +0,0 @@
1−{-# LANGUAGE CPP #-}
2−{-# LANGUAGE ConstraintKinds #-}
3−module Control.Ether.Util
4− ( fmap
5− , MonadApplicative
6− ) where
7−
8−import Prelude hiding (fmap)
9−
10−#if __GLASGOW_HASKELL__ < 710
11−import qualified Control.Applicative
12−import qualified Control.Monad
13−#else
14−import qualified Prelude
15−#endif
16−
17−#if __GLASGOW_HASKELL__ < 710
18−fmap :: Monad f => (a -> b) -> f a -> f b
19−fmap = Control.Monad.liftM
20−#else
21−fmap :: Functor f => (a -> b) -> f a -> f b
22−fmap = Prelude.fmap
23−#endif
24−
25−{-# INLINE fmap #-}
26−
27−#if __GLASGOW_HASKELL__ < 710
28−type MonadApplicative m =
29− ( Control.Applicative.Applicative m
30− , Control.Monad.Monad m )
31−#else
32−type MonadApplicative = Monad
33−#endif
src/Control/Monad/Ether/Except/Class.hs−7
@@ -1,10 +1,3 @@
1−{-# LANGUAGE CPP #-}
2−
3−#if __GLASGOW_HASKELL__ < 710
4−{-# LANGUAGE OverlappingInstances #-}
5−{-# OPTIONS_GHC -fno-warn-unrecognised-pragmas #-}
6−#endif
7−
8{-# LANGUAGE MultiParamTypeClasses #-}
1{-# LANGUAGE MultiParamTypeClasses #-}
9{-# LANGUAGE FlexibleInstances #-}
2{-# LANGUAGE FlexibleInstances #-}
10{-# LANGUAGE UndecidableInstances #-}
3{-# LANGUAGE UndecidableInstances #-}
src/Control/Monad/Ether/Reader/Class.hs+1−9
@@ -1,10 +1,3 @@
1−{-# LANGUAGE CPP #-}
2−
3−#if __GLASGOW_HASKELL__ < 710
4−{-# LANGUAGE OverlappingInstances #-}
5−{-# OPTIONS_GHC -fno-warn-unrecognised-pragmas #-}
6−#endif
7−
8{-# LANGUAGE MultiParamTypeClasses #-}
1{-# LANGUAGE MultiParamTypeClasses #-}
9{-# LANGUAGE FlexibleInstances #-}
2{-# LANGUAGE FlexibleInstances #-}
10{-# LANGUAGE UndecidableInstances #-}
3{-# LANGUAGE UndecidableInstances #-}
@@ -23,7 +16,6 @@ module Control.Monad.Ether.Reader.Class
23import GHC.Prim (Proxy#)
16import GHC.Prim (Proxy#)
24import qualified Control.Monad.Trans.Ether.Reader as R
17import qualified Control.Monad.Trans.Ether.Reader as R
25import qualified Control.Monad.Trans.Lift.Local as Lift
18import qualified Control.Monad.Trans.Lift.Local as Lift
26−import qualified Control.Ether.Util as Util
27
19
28-- | See 'Control.Monad.Reader.MonadReader'.
20-- | See 'Control.Monad.Reader.MonadReader'.
29class Monad m => MonadReader tag r m | m tag -> r where
21class Monad m => MonadReader tag r m | m tag -> r where
@@ -49,7 +41,7 @@ class Monad m => MonadReader tag r m | m tag -> r where
49 -> (r -> a)
41 -> (r -> a)
50 -- ^ The selector function to apply to the environment.
42 -- ^ The selector function to apply to the environment.
51 -> m a
43 -> m a
52− reader t f = Util.fmap f (ask t)
44+ reader t f = fmap f (ask t)
53
45
54-- | Retrieves a function of the current environment.
46-- | Retrieves a function of the current environment.
55asks
47asks
src/Control/Monad/Ether/State/Class.hs+1−9
@@ -1,10 +1,3 @@
1−{-# LANGUAGE CPP #-}
2−
3−#if __GLASGOW_HASKELL__ < 710
4−{-# LANGUAGE OverlappingInstances #-}
5−{-# OPTIONS_GHC -fno-warn-unrecognised-pragmas #-}
6−#endif
7−
8{-# LANGUAGE MultiParamTypeClasses #-}
1{-# LANGUAGE MultiParamTypeClasses #-}
9{-# LANGUAGE FlexibleInstances #-}
2{-# LANGUAGE FlexibleInstances #-}
10{-# LANGUAGE UndecidableInstances #-}
3{-# LANGUAGE UndecidableInstances #-}
@@ -25,7 +18,6 @@ import GHC.Prim (Proxy#)
25import qualified Control.Monad.Trans.Ether.State.Lazy as S.L
18import qualified Control.Monad.Trans.Ether.State.Lazy as S.L
26import qualified Control.Monad.Trans.Ether.State.Strict as S.S
19import qualified Control.Monad.Trans.Ether.State.Strict as S.S
27import qualified Control.Monad.Trans as Lift
20import qualified Control.Monad.Trans as Lift
28−import qualified Control.Ether.Util as Util
29
21
30-- | See 'Control.Monad.State.MonadState'.
22-- | See 'Control.Monad.State.MonadState'.
31class Monad m => MonadState tag s m | m tag -> s where
23class Monad m => MonadState tag s m | m tag -> s where
@@ -54,7 +46,7 @@ modify t f = state t (\s -> ((), f s))
54
46
55-- | Gets specific component of the state, using a projection function supplied.
47-- | Gets specific component of the state, using a projection function supplied.
56gets :: MonadState tag s m => Proxy# tag -> (s -> a) -> m a
48gets :: MonadState tag s m => Proxy# tag -> (s -> a) -> m a
57−gets t f = Util.fmap f (get t)
49+gets t f = fmap f (get t)
58
50
59instance (Monad m, s ~ s') => MonadState tag s (S.L.StateT tag s' m) where
51instance (Monad m, s ~ s') => MonadState tag s (S.L.StateT tag s' m) where
60 get = S.L.get
52 get = S.L.get
src/Control/Monad/Ether/Writer/Class.hs−11
@@ -1,10 +1,3 @@
1−{-# LANGUAGE CPP #-}
2−
3−#if __GLASGOW_HASKELL__ < 710
4−{-# LANGUAGE OverlappingInstances #-}
5−{-# OPTIONS_GHC -fno-warn-unrecognised-pragmas #-}
6−#endif
7−
8{-# LANGUAGE MultiParamTypeClasses #-}
1{-# LANGUAGE MultiParamTypeClasses #-}
9{-# LANGUAGE FlexibleInstances #-}
2{-# LANGUAGE FlexibleInstances #-}
10{-# LANGUAGE UndecidableInstances #-}
3{-# LANGUAGE UndecidableInstances #-}
@@ -21,10 +14,6 @@ module Control.Monad.Ether.Writer.Class
21 , censor
14 , censor
22 ) where
15 ) where
23
16
24−#if __GLASGOW_HASKELL__ < 710
25−import Data.Monoid
26−#endif
27−
28import GHC.Prim (Proxy#)
17import GHC.Prim (Proxy#)
29import qualified Control.Monad.Trans.Ether.Writer as W
18import qualified Control.Monad.Trans.Ether.Writer as W
30import qualified Control.Monad.Trans.Lift.Listen as Lift
19import qualified Control.Monad.Trans.Lift.Listen as Lift
src/Control/Monad/Trans/Ether/Dispatch.hs−4
@@ -1,8 +1,4 @@
1−{-# LANGUAGE CPP #-}
2−
3−#if __GLASGOW_HASKELL__ >= 710
4{-# OPTIONS_GHC -fno-warn-unticked-promoted-constructors #-}
1{-# OPTIONS_GHC -fno-warn-unticked-promoted-constructors #-}
5−#endif
6
2
7{-# LANGUAGE DeriveGeneric #-}
3{-# LANGUAGE DeriveGeneric #-}
8{-# LANGUAGE MultiParamTypeClasses #-}
4{-# LANGUAGE MultiParamTypeClasses #-}
src/Control/Monad/Trans/Ether/Tagged.hs+2−4
@@ -40,8 +40,6 @@ import qualified Control.Monad.Error.Class as Class
40import GHC.Generics (Generic)
40import GHC.Generics (Generic)
41import Data.Coerce (coerce)
41import Data.Coerce (coerce)
42
42
43−import Control.Ether.Util (MonadApplicative)
44−
45-- | Tagged monad transformer.
43-- | Tagged monad transformer.
46newtype TaggedTrans tag trans (m :: * -> *) a = TaggedTrans (trans m a)
44newtype TaggedTrans tag trans (m :: * -> *) a = TaggedTrans (trans m a)
47 deriving
45 deriving
@@ -61,7 +59,7 @@ unpack = coerce
61instance
59instance
62 ( MB.MonadBase b m
60 ( MB.MonadBase b m
63 , MonadTrans trans
61 , MonadTrans trans
64− , MonadApplicative (trans m)
62+ , Monad (trans m)
65 ) => MB.MonadBase b (TaggedTrans tag trans m)
63 ) => MB.MonadBase b (TaggedTrans tag trans m)
66 where
64 where
67 liftBase = MB.liftBaseDefault
65 liftBase = MB.liftBaseDefault
@@ -77,7 +75,7 @@ instance
77instance
75instance
78 ( MC.MonadBaseControl b m
76 ( MC.MonadBaseControl b m
79 , MC.MonadTransControl trans
77 , MC.MonadTransControl trans
80− , MonadApplicative (trans m)
78+ , Monad (trans m)
81 ) => MC.MonadBaseControl b (TaggedTrans tag trans m)
79 ) => MC.MonadBaseControl b (TaggedTrans tag trans m)
82 where
80 where
83 type StM (TaggedTrans tag trans m) a = MC.ComposeSt trans m a
81 type StM (TaggedTrans tag trans m) a = MC.ComposeSt trans m a
src/Control/Monad/Trans/Ether/Writer.hs+2−19
@@ -1,4 +1,3 @@
1−{-# LANGUAGE CPP #-}
2{-# LANGUAGE DeriveGeneric #-}
1{-# LANGUAGE DeriveGeneric #-}
3{-# LANGUAGE MultiParamTypeClasses #-}
2{-# LANGUAGE MultiParamTypeClasses #-}
4{-# LANGUAGE TypeFamilies #-}
3{-# LANGUAGE TypeFamilies #-}
@@ -29,10 +28,6 @@ module Control.Monad.Trans.Ether.Writer
29 , pass
28 , pass
30 ) where
29 ) where
31
30
32−#if __GLASGOW_HASKELL__ < 710
33−import Data.Monoid
34−#endif
35−
36import GHC.Prim (Proxy#)
31import GHC.Prim (Proxy#)
37import Data.Functor.Identity (Identity(..))
32import Data.Functor.Identity (Identity(..))
38import qualified Control.Monad.Trans.Writer.Lazy as Trans
33import qualified Control.Monad.Trans.Writer.Lazy as Trans
@@ -86,22 +81,10 @@ tell :: Monad m => Proxy# tag -> w -> WriterT tag w m ()
86tell t w = writer t ((), w)
81tell t w = writer t ((), w)
87
82
88-- | Executes an action and adds its accumulator to the value of the computation.
83-- | Executes an action and adds its accumulator to the value of the computation.
89−listen
90−#if __GLASGOW_HASKELL__ < 800
91− :: (Monad m, Monoid w)
92−#else
93− :: Monad m
94−#endif
95− => Proxy# tag -> WriterT tag w m a -> WriterT tag w m (a, w)
84+listen :: Monad m => Proxy# tag -> WriterT tag w m a -> WriterT tag w m (a, w)
96listen _ = pack . Trans.listen . unpack
85listen _ = pack . Trans.listen . unpack
97
86
98-- | Executes an action which returns a value and a function, and returns the
87-- | Executes an action which returns a value and a function, and returns the
99-- value, applying the function to the accumulator.
88-- value, applying the function to the accumulator.
100−pass
101−#if __GLASGOW_HASKELL__ < 800
102− :: (Monad m, Monoid w)
103−#else
104− :: Monad m
105−#endif
106− => Proxy# tag -> WriterT tag w m (a, w -> w) -> WriterT tag w m a
89+pass :: Monad m => Proxy# tag -> WriterT tag w m (a, w -> w) -> WriterT tag w m a
107pass _ = pack . Trans.pass . unpack
90pass _ = pack . Trans.pass . unpack
stack-ghc-7.8.4.yamldeleted−35
@@ -1,35 +0,0 @@
1−flags:
2− text:
3− integer-simple: false
4− QuickCheck:
5− base4point8: false
6−packages:
7−- '.'
8−extra-deps:
9−- QuickCheck-2.8.1
10−- ansi-terminal-0.6.2.3
11−- ansi-wl-pprint-0.6.7.3
12−- async-2.0.2
13−- clock-0.5.1
14−- mmorph-1.0.4
15−- monad-control-1.0.0.4
16−- mtl-2.2.1
17−- optparse-applicative-0.12.0.0
18−- parsec-3.1.9
19−- primitive-0.6.1.0
20−- random-1.1
21−- regex-base-0.93.2
22−- regex-tdfa-rc-1.1.8.3
23−- stm-2.4.4
24−- tagged-0.8.1
25−- tasty-0.11.0.1
26−- tasty-quickcheck-0.8.4
27−- text-1.2.1.3
28−- tf-random-0.5
29−- transformers-0.4.3.0
30−- transformers-base-0.4.4
31−- transformers-compat-0.4.0.4
32−- transformers-lift-0.1.0.1
33−- unbounded-delays-0.1.0.9
34−- exceptions-0.8.0.2
35−resolver: ghc-7.8.4
stack-ghc-8.0.1.yamldeleted−35
@@ -1,35 +0,0 @@
1−packages:
2−- '.'
3−extra-deps:
4−- QuickCheck-2.8.2
5−- ansi-terminal-0.6.2.3
6−- ansi-wl-pprint-0.6.7.3
7−- async-2.1.0
8−- clock-0.7.2
9−- exceptions-0.8.2.1
10−- mmorph-1.0.6
11−- monad-control-1.0.1.0
12−- mtl-2.2.1
13−- optparse-applicative-0.12.1.0
14−- parsec-3.1.9
15−- primitive-0.6.1.0
16−- random-1.1
17−- regex-base-0.93.2
18−- regex-tdfa-1.2.2
19−- stm-2.4.4.1
20−- tagged-0.8.4
21−- tasty-0.11.0.3
22−- tasty-quickcheck-0.8.4
23−- text-1.2.2.1
24−- tf-random-0.5
25−- transformers-base-0.4.4
26−- transformers-compat-0.5.1.4
27−- transformers-lift-0.1.0.1
28−- unbounded-delays-0.1.0.9
29−compiler-check: match-exact
30−resolver: ghc-8.0.0.20160421
31−setup-info:
32− ghc:
33− linux64:
34− 8.0.0.20160421:
35− url: https://downloads.haskell.org/~ghc/8.0.1-rc4/ghc-8.0.0.20160421-x86_64-unknown-linux.tar.xz
stack.yaml+31−2
@@ -1,6 +1,35 @@
1−flags: {}
2packages:
1packages:
3- '.'
2- '.'
4extra-deps:
3extra-deps:
4+- QuickCheck-2.8.2
5+- ansi-terminal-0.6.2.3
6+- ansi-wl-pprint-0.6.7.3
7+- async-2.1.0
8+- clock-0.7.2
9+- exceptions-0.8.2.1
10+- mmorph-1.0.6
11+- monad-control-1.0.1.0
12+- mtl-2.2.1
13+- optparse-applicative-0.12.1.0
14+- parsec-3.1.9
15+- primitive-0.6.1.0
16+- random-1.1
17+- regex-base-0.93.2
18+- regex-tdfa-1.2.2
19+- stm-2.4.4.1
20+- tagged-0.8.4
21+- tasty-0.11.0.3
22+- tasty-quickcheck-0.8.4
23+- text-1.2.2.1
24+- tf-random-0.5
25+- transformers-base-0.4.4
26+- transformers-compat-0.5.1.4
5- transformers-lift-0.1.0.1
27- transformers-lift-0.1.0.1
28+- unbounded-delays-0.1.0.9
29+compiler-check: match-exact
6−resolver: lts-5.0
30+resolver: ghc-8.0.0.20160421
31+setup-info:
32+ ghc:
33+ linux64:
34+ 8.0.0.20160421:
35+ url: https://downloads.haskell.org/~ghc/8.0.1-rc4/ghc-8.0.0.20160421-x86_64-unknown-linux.tar.xz
travis/shc.shdeleted−4
@@ -1,4 +0,0 @@
1−if [ -n "$COVERAGE" ]; then
2− curl -L https://github.com/rubik/stack-hpc-coveralls/releases/download/v0.0.3.0/shc-linux-x64-7.10.2.tar.bz2 | tar -xvj
3− ./shc ether regression
4−fi
travis/test.shdeleted−7
@@ -1,7 +0,0 @@
1−if [ -n "$COVERAGE" ]; then
2− COVERAGE_OPT="--coverage"
3−fi
4−
5−echo "COVERAGE_OPT=$COVERAGE_OPT"
6−
7−stack test :regression $COVERAGE_OPT --no-terminal --ghc-options -Werror