Adapt to ghc-8.4, Drop support for ghc<8

pull/5/head
Lennart Spitzner 2018-04-13 20:39:21 +02:00
parent c63327e25c
commit e0dd252707
6 changed files with 34 additions and 24 deletions

View File

@ -42,12 +42,12 @@ library
other-modules: UI.Butcher.Monadic.Internal.Types
UI.Butcher.Monadic.Internal.Core
build-depends:
{ base >=4.8 && <4.11
{ base >=4.9 && <4.12
, free
, unsafe
, microlens <0.5
, microlens-th <0.5
, multistate
, multistate >=0.8 && <0.9
, pretty
, containers
, transformers
@ -103,7 +103,7 @@ test-suite tests
type: exitcode-stdio-1.0
default-language: Haskell2010
build-depends:
{ base >=4.8 && <4.11
{ base <999
, butcher
, free
, unsafe

View File

@ -21,12 +21,12 @@ checks:
location: "ChangeLog.md"
compiler-versions:
compilers:
- compiler: "ghc"
version: "7.10.3"
- compiler: "ghc"
version: "8.0.2"
- compiler: "ghc"
version: "8.2.1"
version: "8.2.2"
- compiler: "ghc"
version: "8.4.1"
compilers-help: |
for this to work, cabal will need the paths to the actual
compilers to be configured; see the note about the user-global

View File

@ -80,14 +80,20 @@ data Flag p = Flag
, _flag_visibility :: Visibility
}
appendFlag :: Flag p -> Flag p -> Flag p
appendFlag (Flag a1 b1 c1) (Flag a2 b2 c2) = Flag (a1 <|> a2)
(b1 <|> b2)
(appVis c1 c2)
where
appVis Visible Visible = Visible
appVis _ _ = Hidden
instance Semigroup (Flag p) where
(<>) = appendFlag
instance Monoid (Flag p) where
mempty = Flag Nothing Nothing Visible
Flag a1 b1 c1 `mappend` Flag a2 b2 c2 = Flag (a1 <|> a2)
(b1 <|> b2)
(appVis c1 c2)
where
appVis Visible Visible = Visible
appVis _ _ = Hidden
mappend = appendFlag
-- | Create a 'Flag' with just a help text.
flagHelp :: PP.Doc -> Flag p

View File

@ -55,17 +55,20 @@ data Param p = Param
, _param_suggestions :: Maybe [CompletionItem]
}
appendParam :: Param p -> Param p -> Param p
appendParam (Param a1 b1 c1) (Param a2 b2 c2) = Param (a1 `f` a2)
(b1 `mappend` b2)
(c1 `mappend` c2)
where
f Nothing x = x
f x _ = x
instance Semigroup (Param p) where
(<>) = appendParam
instance Monoid (Param p) where
mempty = Param Nothing Nothing Nothing
mappend (Param a1 b1 c1)
(Param a2 b2 c2)
= Param
(a1 `f` a2)
(b1 `mappend` b2)
(c1 `mappend` c2)
where
f Nothing x = x
f x _ = x
mappend = appendParam
-- | Create a 'Param' with just a help text.
paramHelpStr :: String -> Param p

View File

@ -325,7 +325,7 @@ ppPartDescUsage = \case
sgsDocs ->
PP.parens $ PP.fcat $ PP.punctuate (PP.text "|") $ sgsDocs ++ [d]
PartRedirect s _ -> Just $ PP.text s
PartMany p -> rec p <&> (<> PP.text "+")
PartMany p -> rec p <&> (PP.<> PP.text "+")
PartWithHelp _ p -> rec p
PartReorder ps ->
let flags = [ d | PartMany d <- ps ]

View File

@ -123,6 +123,7 @@ import Data.Void ( Void )
import System.IO ( IO )
import Data.Proxy ( Proxy(..) )
import Data.Sequence ( Seq )
import Data.Semigroup ( Semigroup(..) )
import Data.Map ( Map )
import Data.Set ( Set )
@ -336,8 +337,7 @@ import Debug.Trace ( trace
import Foreign.ForeignPtr ( ForeignPtr
)
import Data.Monoid ( (<>)
, mconcat
import Data.Monoid ( mconcat
, Monoid (..)
)
@ -388,6 +388,7 @@ import Data.Tree ( Tree(..)
import Control.Monad.Trans.MultiRWS ( MonadMultiReader(..)
, MonadMultiWriter(..)
, MonadMultiState(..)
, MonadMultiGet(..)
)
import Control.Monad.Trans.MultiReader ( runMultiReaderTNil