[commit: packages/haskeline] master: Fix all warnings, and set `-Werror` in CI. (#96) (6a00113)
git at git.haskell.org
git at git.haskell.org
Tue Nov 27 20:23:24 UTC 2018
Repository : ssh://git@git.haskell.org/haskeline
On branch : master
Link : http://git.haskell.org/packages/haskeline.git/commitdiff/6a00113ab77337b2838ee247013574544c3d4644
>---------------------------------------------------------------
commit 6a00113ab77337b2838ee247013574544c3d4644
Author: Judah Jacobson <judah at users.noreply.github.com>
Date: Sat Oct 6 08:09:34 2018 -0700
Fix all warnings, and set `-Werror` in CI. (#96)
>---------------------------------------------------------------
6a00113ab77337b2838ee247013574544c3d4644
.travis.yml | 2 +-
System/Console/Haskeline/Backend/Posix.hsc | 2 +-
System/Console/Haskeline/Backend/Terminfo.hs | 3 +++
System/Console/Haskeline/Backend/Win32.hsc | 1 -
System/Console/Haskeline/History.hs | 2 +-
System/Console/Haskeline/MonadException.hs | 2 +-
System/Console/Haskeline/Monads.hs | 2 +-
System/Console/Haskeline/RunCommand.hs | 2 +-
System/Console/Haskeline/Term.hs | 2 +-
stack.yaml | 3 +++
10 files changed, 13 insertions(+), 8 deletions(-)
diff --git a/.travis.yml b/.travis.yml
index e8ca54d..29407d4 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -22,6 +22,6 @@ install:
- cabal install --only-dependencies
script:
- - cabal configure -v2 # -v2 provides useful information for debugging
+ - cabal configure -v2 --ghc-options='-Werror' # -v2 provides useful information for debugging
- cabal build # this builds all libraries and executables (including tests/benchmarks)
- cabal check
diff --git a/System/Console/Haskeline/Backend/Posix.hsc b/System/Console/Haskeline/Backend/Posix.hsc
index 846e227..678c97d 100644
--- a/System/Console/Haskeline/Backend/Posix.hsc
+++ b/System/Console/Haskeline/Backend/Posix.hsc
@@ -303,7 +303,7 @@ posixRunTerm hs layoutGetters keys wrapGetEvent evalBackend = do
type PosixT m = ReaderT Handles m
-runPosixT :: Monad m => Handles -> PosixT m a -> m a
+runPosixT :: Handles -> PosixT m a -> m a
runPosixT h = runReaderT' h
fileRunTerm :: Handle -> IO RunTerm
diff --git a/System/Console/Haskeline/Backend/Terminfo.hs b/System/Console/Haskeline/Backend/Terminfo.hs
index 6a41c53..fb28553 100644
--- a/System/Console/Haskeline/Backend/Terminfo.hs
+++ b/System/Console/Haskeline/Backend/Terminfo.hs
@@ -1,3 +1,6 @@
+#if __GLASGOW_HASKELL__ <= 802
+{-# OPTIONS_GHC -Wno-redundant-constraints #-}
+#endif
module System.Console.Haskeline.Backend.Terminfo(
Draw(),
runTerminfoDraw
diff --git a/System/Console/Haskeline/Backend/Win32.hsc b/System/Console/Haskeline/Backend/Win32.hsc
index 7ba41d4..49bd0c6 100644
--- a/System/Console/Haskeline/Backend/Win32.hsc
+++ b/System/Console/Haskeline/Backend/Win32.hsc
@@ -15,7 +15,6 @@ import Control.Concurrent.STM
import Control.Concurrent hiding (throwTo)
import Data.Char(isPrint)
import Data.Maybe(mapMaybe)
-import Control.Applicative
import Control.Monad
import System.Console.Haskeline.Key
diff --git a/System/Console/Haskeline/History.hs b/System/Console/Haskeline/History.hs
index 3a92030..3328b03 100644
--- a/System/Console/Haskeline/History.hs
+++ b/System/Console/Haskeline/History.hs
@@ -86,7 +86,7 @@ addHistory :: String -> History -> History
addHistory s h = h {histLines = maybeDropLast (stifleAmt h) (s <| (histLines h))}
-- If the sequence is too big, drop the last entry.
-maybeDropLast :: Ord a => Maybe Int -> Seq a -> Seq a
+maybeDropLast :: Maybe Int -> Seq a -> Seq a
maybeDropLast maxAmt hs
| rightSize = hs
| otherwise = case viewr hs of
diff --git a/System/Console/Haskeline/MonadException.hs b/System/Console/Haskeline/MonadException.hs
index 7ced927..aa939d3 100644
--- a/System/Console/Haskeline/MonadException.hs
+++ b/System/Console/Haskeline/MonadException.hs
@@ -1,3 +1,4 @@
+{-# OPTIONS_GHC -fno-warn-warnings-deprecations #-}
{- | This module redefines some of the functions in "Control.Exception" to
work for more general monads built on top of 'IO'.
-}
@@ -38,7 +39,6 @@ import Control.Monad.Trans.List
import Control.Monad.Trans.Maybe
import Control.Monad.Trans.RWS
import Control.Monad.Trans.Writer
-import Data.Monoid
import Control.Concurrent(ThreadId)
-- This approach is based on that of the monad-control package.
diff --git a/System/Console/Haskeline/Monads.hs b/System/Console/Haskeline/Monads.hs
index b8e8369..008c7a8 100644
--- a/System/Console/Haskeline/Monads.hs
+++ b/System/Console/Haskeline/Monads.hs
@@ -65,7 +65,7 @@ update f = do
put s'
return x
-runReaderT' :: Monad m => r -> ReaderT r m a -> m a
+runReaderT' :: r -> ReaderT r m a -> m a
runReaderT' = flip runReaderT
newtype StateT s m a = StateT { getStateTFunc
diff --git a/System/Console/Haskeline/RunCommand.hs b/System/Console/Haskeline/RunCommand.hs
index 45472f6..879b2ef 100644
--- a/System/Console/Haskeline/RunCommand.hs
+++ b/System/Console/Haskeline/RunCommand.hs
@@ -20,7 +20,7 @@ runCommandLoop tops at TermOps{evalTerm = e} prefix cmds initState
cmds
runCommandLoop' :: forall m n s a . (Term n, CommandMonad n,
- MonadState Layout m, MonadReader Prefs n, LineState s)
+ MonadState Layout m, LineState s)
=> (forall b . m b -> n b) -> TermOps -> Prefix -> s -> KeyCommand m s a -> n Event
-> n a
runCommandLoop' liftE tops prefix initState cmds getEvent = do
diff --git a/System/Console/Haskeline/Term.hs b/System/Console/Haskeline/Term.hs
index d1b5203..1f3d9d6 100644
--- a/System/Console/Haskeline/Term.hs
+++ b/System/Console/Haskeline/Term.hs
@@ -160,7 +160,7 @@ hWithBinaryMode h = bracket (liftIO $ hGetEncoding h)
-- | Utility function for changing a property of a terminal for the duration of
-- a computation.
-bracketSet :: (Eq a, MonadException m) => IO a -> (a -> IO ()) -> a -> m b -> m b
+bracketSet :: MonadException m => IO a -> (a -> IO ()) -> a -> m b -> m b
bracketSet getState set newState f = bracket (liftIO getState)
(liftIO . set)
(\_ -> liftIO (set newState) >> f)
diff --git a/stack.yaml b/stack.yaml
index bb59f14..a17f99f 100644
--- a/stack.yaml
+++ b/stack.yaml
@@ -2,3 +2,6 @@ resolver: lts-9.14
packages:
- .
+
+ghc-options:
+ "$locals": -Wall -Werror
More information about the ghc-commits
mailing list