Skip to content

Commit c438e60

Browse files
committed
Enable -Wall and a few other warnings in cabal file. Fix warnings, cleanup cabal file
1 parent 4ff6a67 commit c438e60

5 files changed

Lines changed: 17 additions & 23 deletions

File tree

src/Data/Functor/Of.hs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ instance (Monoid a, Monoid b) => Monoid (Of a b) where
3636
instance Functor (Of a) where
3737
fmap f (a :> x) = a :> f x
3838
{-#INLINE fmap #-}
39-
a <$ (b :> x) = b :> a
39+
a <$ (b :> _) = b :> a
4040
{-#INLINE (<$) #-}
4141

4242
#if MIN_VERSION_base(4,8,0)
@@ -52,19 +52,19 @@ instance Bifunctor Of where
5252
instance Monoid a => Applicative (Of a) where
5353
pure x = mempty :> x
5454
{-#INLINE pure #-}
55-
m :> f <*> m' :> x = mappend m m' :> f x
55+
(m :> f) <*> (m' :> x) = mappend m m' :> f x
5656
{-#INLINE (<*>) #-}
57-
m :> x *> m' :> y = mappend m m' :> y
57+
(m :> _) *> (m' :> y) = mappend m m' :> y
5858
{-#INLINE (*>) #-}
59-
m :> x <* m' :> y = mappend m m' :> x
59+
(m :> x) <* (m' :> _) = mappend m m' :> x
6060
{-#INLINE (<*) #-}
6161

6262
instance Monoid a => Monad (Of a) where
63-
return x = mempty :> x
63+
return = pure
6464
{-#INLINE return #-}
65-
m :> x >> m' :> y = mappend m m' :> y
65+
(m :> _) >> (m' :> y) = mappend m m' :> y
6666
{-#INLINE (>>) #-}
67-
m :> x >>= f = let m' :> y = f x in mappend m m' :> y
67+
(m :> x) >>= f = let m' :> y = f x in mappend m m' :> y
6868
{-#INLINE (>>=) #-}
6969

7070
#if MIN_VERSION_base(4,9,0)

src/Streaming.hs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
{-# LANGUAGE RankNTypes #-}
22

3-
{-# OPTIONS_GHC -Wall #-}
43
module Streaming
54
(
65
-- * An iterable streaming monad transformer

src/Streaming/Internal.hs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,8 @@
66
{-# LANGUAGE MultiParamTypeClasses #-}
77
{-# LANGUAGE RankNTypes #-}
88
{-# LANGUAGE ScopedTypeVariables #-}
9-
{-# LANGUAGE StandaloneDeriving #-}
109
{-# LANGUAGE UndecidableInstances #-}
1110

12-
{-# OPTIONS_GHC -Wall #-}
1311
module Streaming.Internal (
1412
-- * The free monad transformer
1513
-- $stream
@@ -1360,4 +1358,4 @@ cutoff = loop where
13601358
e <- lift $ inspect str
13611359
case e of
13621360
Left r -> return (Just r)
1363-
Right (frest) -> Step $ fmap (loop (n-1)) frest
1361+
Right frest -> Step $ fmap (loop (n-1)) frest

src/Streaming/Prelude.hs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,6 @@
5757
{-# LANGUAGE ScopedTypeVariables #-}
5858
{-# LANGUAGE TypeFamilies #-}
5959

60-
{-# OPTIONS_GHC -Wall #-}
61-
6260
module Streaming.Prelude (
6361
-- * Types
6462
Of (..)

streaming.cabal

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,7 @@ homepage: https://github.com/haskell-streaming/streaming
192192
bug-reports: https://github.com/haskell-streaming/streaming/issues
193193
category: Data, Pipes, Streaming
194194
extra-source-files: README.md, changelog.md
195+
tested-with: GHC ==7.10.3, GHC ==8.0.2, GHC ==8.2.2
195196

196197
source-repository head
197198
type: git
@@ -203,16 +204,6 @@ library
203204
, Streaming.Prelude
204205
, Streaming.Internal
205206
, Data.Functor.Of
206-
other-extensions:
207-
RankNTypes
208-
, CPP
209-
, StandaloneDeriving
210-
, FlexibleContexts
211-
, DeriveDataTypeable
212-
, DeriveFoldable
213-
, DeriveFunctor
214-
, DeriveTraversable
215-
, UndecidableInstances
216207
build-depends:
217208
base >=4.8 && <5
218209
, mtl >=2.1 && <2.3
@@ -224,3 +215,11 @@ library
224215
, containers
225216
hs-source-dirs: src
226217
default-language: Haskell2010
218+
ghc-options:
219+
-Wall
220+
-fwarn-name-shadowing
221+
if impl(ghc >= 8.0)
222+
ghc-options:
223+
-Wincomplete-uni-patterns
224+
-Wincomplete-record-updates
225+
-Wcompat

0 commit comments

Comments
 (0)