mirror of
https://github.com/xmonad/xmonad.git
synced 2025-07-26 09:41:53 -07:00
Core: derive 'MonadFail X' instance for GHC 8.6.x and beyond
A side effect of that change is that our code no longer compiles with GHC versions prior to 8.0.x. We could work around that, no doubt, but the resulting code would require CPP and Cabal flags and whatnot. It feels more reasonable to just require a moderately recent compiler instead of going through all that trouble.
This commit is contained in:
35
.travis.yml
35
.travis.yml
@@ -2,7 +2,7 @@
|
|||||||
#
|
#
|
||||||
# runghc make_travis_yml_2.hs '-o' '.travis.yml' 'xmonad.cabal' 'libxrandr-dev'
|
# runghc make_travis_yml_2.hs '-o' '.travis.yml' 'xmonad.cabal' 'libxrandr-dev'
|
||||||
#
|
#
|
||||||
# For more information, see https://github.com/hvr/multi-ghc-travis
|
# For more information, see https://github.com/haskell-CI/haskell-ci
|
||||||
#
|
#
|
||||||
language: c
|
language: c
|
||||||
sudo: false
|
sudo: false
|
||||||
@@ -28,6 +28,9 @@ before_cache:
|
|||||||
|
|
||||||
matrix:
|
matrix:
|
||||||
include:
|
include:
|
||||||
|
- compiler: "ghc-8.6.1"
|
||||||
|
env: GHCHEAD=true
|
||||||
|
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-head,ghc-8.6.1,libxrandr-dev], sources: [hvr-ghc]}}
|
||||||
- compiler: "ghc-8.4.3"
|
- compiler: "ghc-8.4.3"
|
||||||
# env: TEST=--disable-tests BENCH=--disable-benchmarks
|
# env: TEST=--disable-tests BENCH=--disable-benchmarks
|
||||||
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.2,ghc-8.4.3,libxrandr-dev], sources: [hvr-ghc]}}
|
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.2,ghc-8.4.3,libxrandr-dev], sources: [hvr-ghc]}}
|
||||||
@@ -37,15 +40,9 @@ matrix:
|
|||||||
- compiler: "ghc-8.0.2"
|
- compiler: "ghc-8.0.2"
|
||||||
# env: TEST=--disable-tests BENCH=--disable-benchmarks
|
# env: TEST=--disable-tests BENCH=--disable-benchmarks
|
||||||
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.2,ghc-8.0.2,libxrandr-dev], sources: [hvr-ghc]}}
|
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.2,ghc-8.0.2,libxrandr-dev], sources: [hvr-ghc]}}
|
||||||
- compiler: "ghc-7.10.3"
|
|
||||||
# env: TEST=--disable-tests BENCH=--disable-benchmarks
|
allow_failures:
|
||||||
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.2,ghc-7.10.3,libxrandr-dev], sources: [hvr-ghc]}}
|
- compiler: "ghc-8.6.1"
|
||||||
- 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,libxrandr-dev], sources: [hvr-ghc]}}
|
|
||||||
- compiler: "ghc-7.6.3"
|
|
||||||
# env: TEST=--disable-tests BENCH=--disable-benchmarks
|
|
||||||
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.2,ghc-7.6.3,libxrandr-dev], sources: [hvr-ghc]}}
|
|
||||||
|
|
||||||
before_install:
|
before_install:
|
||||||
- HC=${CC}
|
- HC=${CC}
|
||||||
@@ -69,6 +66,24 @@ install:
|
|||||||
- travis_retry cabal update -v
|
- travis_retry cabal update -v
|
||||||
- "sed -i.bak 's/^jobs:/-- jobs:/' ${HOME}/.cabal/config"
|
- "sed -i.bak 's/^jobs:/-- jobs:/' ${HOME}/.cabal/config"
|
||||||
- rm -fv cabal.project cabal.project.local
|
- rm -fv cabal.project cabal.project.local
|
||||||
|
# Overlay Hackage Package Index for GHC HEAD: https://github.com/hvr/head.hackage
|
||||||
|
- |
|
||||||
|
if $GHCHEAD; then
|
||||||
|
sed -i 's/-- allow-newer: .*/allow-newer: *:base/' ${HOME}/.cabal/config
|
||||||
|
for pkg in $($HCPKG list --simple-output); do pkg=$(echo $pkg | sed 's/-[^-]*$//'); sed -i "s/allow-newer: /allow-newer: *:$pkg, /" ${HOME}/.cabal/config; done
|
||||||
|
|
||||||
|
echo 'repository head.hackage' >> ${HOME}/.cabal/config
|
||||||
|
echo ' url: http://head.hackage.haskell.org/' >> ${HOME}/.cabal/config
|
||||||
|
echo ' secure: True' >> ${HOME}/.cabal/config
|
||||||
|
echo ' root-keys: 07c59cb65787dedfaef5bd5f987ceb5f7e5ebf88b904bbd4c5cbdeb2ff71b740' >> ${HOME}/.cabal/config
|
||||||
|
echo ' 2e8555dde16ebd8df076f1a8ef13b8f14c66bad8eafefd7d9e37d0ed711821fb' >> ${HOME}/.cabal/config
|
||||||
|
echo ' 8f79fd2389ab2967354407ec852cbe73f2e8635793ac446d09461ffb99527f6e' >> ${HOME}/.cabal/config
|
||||||
|
echo ' key-threshold: 3' >> ${HOME}/.cabal.config
|
||||||
|
|
||||||
|
grep -Ev -- '^\s*--' ${HOME}/.cabal/config | grep -Ev '^\s*$'
|
||||||
|
|
||||||
|
cabal new-update head.hackage -v
|
||||||
|
fi
|
||||||
- grep -Ev -- '^\s*--' ${HOME}/.cabal/config | grep -Ev '^\s*$'
|
- grep -Ev -- '^\s*--' ${HOME}/.cabal/config | grep -Ev '^\s*$'
|
||||||
- "printf 'packages: \".\"\\n' > cabal.project"
|
- "printf 'packages: \".\"\\n' > cabal.project"
|
||||||
- touch cabal.project.local
|
- touch cabal.project.local
|
||||||
|
@@ -11,6 +11,15 @@
|
|||||||
and to install them into proper locations where their users expect them.
|
and to install them into proper locations where their users expect them.
|
||||||
[https://github.com/xmonad/xmonad/pull/127]
|
[https://github.com/xmonad/xmonad/pull/127]
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* Add support for GHC 8.6.x by providing an instance for 'MonadFail X'. A
|
||||||
|
side effect of that change is that our code no longer compiles with GHC
|
||||||
|
versions prior to 8.0.x. We could work around that, no doubt, but the
|
||||||
|
resulting code would require CPP and Cabal flags and whatnot. It feels more
|
||||||
|
reasonable to just require a moderately recent compiler instead of going
|
||||||
|
through all that trouble.
|
||||||
|
|
||||||
## 0.14 (July 30, 2018)
|
## 0.14 (July 30, 2018)
|
||||||
|
|
||||||
### Bug Fixes
|
### Bug Fixes
|
||||||
|
@@ -37,6 +37,7 @@ import Prelude
|
|||||||
import Control.Exception.Extensible (fromException, try, bracket, throw, finally, SomeException(..))
|
import Control.Exception.Extensible (fromException, try, bracket, throw, finally, SomeException(..))
|
||||||
import qualified Control.Exception.Extensible as E
|
import qualified Control.Exception.Extensible as E
|
||||||
import Control.Applicative(Applicative, pure, (<$>), (<*>))
|
import Control.Applicative(Applicative, pure, (<$>), (<*>))
|
||||||
|
import Control.Monad.Fail
|
||||||
import Control.Monad.State
|
import Control.Monad.State
|
||||||
import Control.Monad.Reader
|
import Control.Monad.Reader
|
||||||
import Data.Semigroup
|
import Data.Semigroup
|
||||||
@@ -147,7 +148,7 @@ data ScreenDetail = SD { screenRect :: !Rectangle } deriving (Eq,Show, Read)
|
|||||||
-- instantiated on 'XConf' and 'XState' automatically.
|
-- instantiated on 'XConf' and 'XState' automatically.
|
||||||
--
|
--
|
||||||
newtype X a = X (ReaderT XConf (StateT XState IO) a)
|
newtype X a = X (ReaderT XConf (StateT XState IO) a)
|
||||||
deriving (Functor, Monad, MonadIO, MonadState XState, MonadReader XConf, Typeable)
|
deriving (Functor, Monad, MonadFail, MonadIO, MonadState XState, MonadReader XConf, Typeable)
|
||||||
|
|
||||||
instance Applicative X where
|
instance Applicative X where
|
||||||
pure = return
|
pure = return
|
||||||
|
12
xmonad.cabal
12
xmonad.cabal
@@ -28,13 +28,7 @@ cabal-version: >= 1.8
|
|||||||
bug-reports: https://github.com/xmonad/xmonad/issues
|
bug-reports: https://github.com/xmonad/xmonad/issues
|
||||||
build-type: Simple
|
build-type: Simple
|
||||||
|
|
||||||
tested-with:
|
tested-with: GHC==8.0.2, GHC==8.2.2, GHC==8.4.3, GHC==8.6.1
|
||||||
GHC==7.6.3,
|
|
||||||
GHC==7.8.4,
|
|
||||||
GHC==7.10.3,
|
|
||||||
GHC==8.0.2,
|
|
||||||
GHC==8.2.2,
|
|
||||||
GHC==8.4.3
|
|
||||||
|
|
||||||
source-repository head
|
source-repository head
|
||||||
type: git
|
type: git
|
||||||
@@ -62,7 +56,7 @@ library
|
|||||||
XMonad.StackSet
|
XMonad.StackSet
|
||||||
other-modules: Paths_xmonad
|
other-modules: Paths_xmonad
|
||||||
|
|
||||||
build-depends: base >= 4.6 && < 4.12,
|
build-depends: base >= 4.6 && < 5,
|
||||||
containers,
|
containers,
|
||||||
data-default,
|
data-default,
|
||||||
directory,
|
directory,
|
||||||
@@ -86,6 +80,8 @@ library
|
|||||||
-- needed for XMonad.Config's instance Default (XConfig a)
|
-- needed for XMonad.Config's instance Default (XConfig a)
|
||||||
if flag(testing)
|
if flag(testing)
|
||||||
buildable: False
|
buildable: False
|
||||||
|
if !impl(ghc > 8)
|
||||||
|
build-depends: fail
|
||||||
|
|
||||||
executable xmonad
|
executable xmonad
|
||||||
main-is: Main.hs
|
main-is: Main.hs
|
||||||
|
Reference in New Issue
Block a user