Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions changelog.d/5-internal/redundant-constraints
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Enabling warnings for redundant constraints and removing the redundant
constraints.
1 change: 1 addition & 0 deletions libs/api-bot/api-bot.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ library
ghc-options:
-O2 -Wall -Wincomplete-uni-patterns -Wincomplete-record-updates
-Wpartial-fields -fwarn-tabs -optP-Wno-nonportable-include-path
-Wredundant-constraints

build-depends:
aeson >=2.0.1.0
Expand Down
1 change: 1 addition & 0 deletions libs/api-client/api-client.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ library
ghc-options:
-O2 -Wall -Wincomplete-uni-patterns -Wincomplete-record-updates
-Wpartial-fields -fwarn-tabs -optP-Wno-nonportable-include-path
-Wredundant-constraints

build-depends:
aeson >=2.0.1.0
Expand Down
2 changes: 1 addition & 1 deletion libs/api-client/src/Network/Wire/Client/API/Push.hs
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ data Notification = Notification
}

awaitNotifications ::
(MonadSession m, Functor m) =>
MonadSession m =>
-- TODO: Maybe ClientId
(Notification -> IO ()) ->
m (Async ())
Expand Down
3 changes: 1 addition & 2 deletions libs/api-client/src/Network/Wire/Client/API/Search.hs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ module Network.Wire.Client.API.Search
where

import Bilge
import Control.Monad.Catch (MonadMask)
import qualified Data.ByteString.Char8 as C
import Data.Default.Class
import Data.List.NonEmpty
Expand All @@ -51,7 +50,7 @@ instance Default SearchParams where
def = SearchParams "" 2 10 True

-- | Search for already connected and/or potential contacts.
search :: (MonadSession m, MonadUnliftIO m, MonadMask m) => SearchParams -> m (SearchResult Contact)
search :: MonadSession m => SearchParams -> m (SearchResult Contact)
search SearchParams {..} = sessionRequest req rsc readBody
where
req =
Expand Down
10 changes: 5 additions & 5 deletions libs/api-client/src/Network/Wire/Client/API/User.hs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ activateKey (ActivationKey key) (ActivationCode code) = do
-------------------------------------------------------------------------------
-- Authenticated

getSelfProfile :: (MonadSession m, MonadUnliftIO m, MonadMask m) => m User
getSelfProfile :: MonadSession m => m User
getSelfProfile = sessionRequest req rsc readBody
where
req =
Expand All @@ -87,7 +87,7 @@ getSelfProfile = sessionRequest req rsc readBody
$ empty
rsc = status200 :| []

getProfile :: (MonadSession m, MonadUnliftIO m, MonadMask m) => UserId -> m UserProfile
getProfile :: MonadSession m => UserId -> m UserProfile
getProfile uid = sessionRequest req rsc readBody
where
req =
Expand All @@ -97,7 +97,7 @@ getProfile uid = sessionRequest req rsc readBody
$ empty
rsc = status200 :| []

connectTo :: (MonadSession m, MonadUnliftIO m, MonadMask m) => ConnectionRequest -> m UserConnection
connectTo :: MonadSession m => ConnectionRequest -> m UserConnection
connectTo cr = sessionRequest req rsc readBody
where
req =
Expand All @@ -108,7 +108,7 @@ connectTo cr = sessionRequest req rsc readBody
$ empty
rsc = status201 :| [status200]

updateConnection :: (MonadSession m, MonadUnliftIO m, MonadMask m) => UserId -> ConnectionUpdate -> m UserConnection
updateConnection :: MonadSession m => UserId -> ConnectionUpdate -> m UserConnection
updateConnection u cu = sessionRequest req rsc readBody
where
req =
Expand All @@ -119,7 +119,7 @@ updateConnection u cu = sessionRequest req rsc readBody
$ empty
rsc = status200 :| []

getConnection :: (MonadSession m, MonadUnliftIO m, MonadMask m) => UserId -> m (Maybe UserConnection)
getConnection :: (MonadSession m, MonadMask m) => UserId -> m (Maybe UserConnection)
getConnection u = do
rs <- sessionRequest req rsc consumeBody
case statusCode rs of
Expand Down
2 changes: 1 addition & 1 deletion libs/api-client/src/Network/Wire/Client/HTTP.hs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ instance FromJSON Error where

clientRequest ::
forall m a.
(Log.MonadLogger m, MonadClient m, MonadUnliftIO m, MonadMask m) =>
(MonadClient m, MonadUnliftIO m, MonadMask m) =>
-- | The request to send.
Request ->
-- | Expected response codes.
Expand Down
1 change: 1 addition & 0 deletions libs/bilge/bilge.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ library
ghc-options:
-O2 -Wall -Wincomplete-uni-patterns -Wincomplete-record-updates
-Wpartial-fields -fwarn-tabs -optP-Wno-nonportable-include-path
-Wredundant-constraints

build-depends:
aeson >=2.0.1.0
Expand Down
8 changes: 5 additions & 3 deletions libs/bilge/src/Bilge/Assert.hs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
-- Disabling to stop warnings on HasCallStack
{-# OPTIONS_GHC -Wno-redundant-constraints #-}

-- This file is part of the Wire Server implementation.
--
Expand Down Expand Up @@ -77,7 +79,7 @@ newtype Assertions a = Assertions
-- assertion that failed). It will also return the response,
-- so it can be used for further inspection.
(<!!) ::
(HasCallStack, Functor m, MonadIO m, MonadCatch m) =>
(HasCallStack, MonadIO m, MonadCatch m) =>
m (Response (Maybe Lazy.ByteString)) ->
Assertions () ->
m (Response (Maybe Lazy.ByteString))
Expand All @@ -95,12 +97,12 @@ io <!! aa = do
msg :: (Int, Maybe String) -> String
msg (i, Just m) = printf "%2d: " i ++ err m
msg _ = ""
printErr :: MonadIO m => SomeException -> m a
printErr :: SomeException -> m a
printErr e = error $ title "Error executing request: " ++ err (show e)

-- | Like '<!!' but discards the 'Response'.
(!!!) ::
(HasCallStack, Functor m, MonadIO m, MonadCatch m) =>
(HasCallStack, MonadIO m, MonadCatch m) =>
m (Response (Maybe Lazy.ByteString)) ->
Assertions () ->
m ()
Expand Down
11 changes: 6 additions & 5 deletions libs/bilge/src/Bilge/IO.hs
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ handleRequest :: MonadHttp m => Request -> m (Response (Maybe LByteString))
handleRequest req = handleRequestWithCont req consumeBody

instance MonadIO m => MonadHttp (HttpT m) where
handleRequestWithCont :: Request -> (Response BodyReader -> IO a) -> HttpT m a
handleRequestWithCont req h = do
m <- ask
liftIO $ withResponse req m h
Expand Down Expand Up @@ -210,7 +211,7 @@ instance MonadUnliftIO m => MonadUnliftIO (HttpT m) where
withRunInIO $ \run ->
inner (run . runHttpT r)

runHttpT :: Monad m => Manager -> HttpT m a -> m a
runHttpT :: Manager -> HttpT m a -> m a
runHttpT m h = runReaderT (unwrap h) m

-- | Given a 'Request' builder function, perform an actual HTTP request using the
Expand All @@ -224,7 +225,7 @@ get,
options,
trace,
patch ::
(MonadIO m, MonadHttp m) =>
MonadHttp m =>
(Request -> Request) ->
m (Response (Maybe LByteString))
get f = httpLbs empty (method GET . f)
Expand All @@ -244,7 +245,7 @@ get',
options',
trace',
patch' ::
(MonadIO m, MonadHttp m) =>
MonadHttp m =>
Request ->
(Request -> Request) ->
m (Response (Maybe LByteString))
Expand All @@ -258,14 +259,14 @@ trace' r f = httpLbs r (method TRACE . f)
patch' r f = httpLbs r (method PATCH . f)

httpLbs ::
(MonadIO m, MonadHttp m) =>
MonadHttp m =>
Request ->
(Request -> Request) ->
m (Response (Maybe LByteString))
httpLbs r f = http r f consumeBody

http ::
(MonadIO m, MonadHttp m) =>
MonadHttp m =>
Request ->
(Request -> Request) ->
(Response BodyReader -> IO a) ->
Expand Down
4 changes: 2 additions & 2 deletions libs/bilge/src/Bilge/RPC.hs
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ rpcExceptionMsg (RPCException sys req ex) =
hdr (k, v) x = x ~~ original k .= v

statusCheck ::
(MonadError e m, MonadIO m) =>
(MonadError e m) =>
Int ->
(LText -> e) ->
Response (Maybe LByteString) ->
Expand All @@ -116,7 +116,7 @@ statusCheck c f r =
f ("unexpected status code: " <> pack (show $ statusCode r))

parseResponse ::
(Exception e, MonadThrow m, Monad m, FromJSON a) =>
(Exception e, MonadThrow m, FromJSON a) =>
(LText -> e) ->
Response (Maybe LByteString) ->
m a
Expand Down
2 changes: 2 additions & 0 deletions libs/bilge/src/Bilge/Response.hs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{-# LANGUAGE OverloadedStrings #-}
-- Disabling due to HasCallStack
{-# OPTIONS_GHC -Wno-redundant-constraints #-}

-- This file is part of the Wire Server implementation.
--
Expand Down
4 changes: 2 additions & 2 deletions libs/brig-types/brig-types.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ library
ghc-options:
-O2 -Wall -Wincomplete-uni-patterns -Wincomplete-record-updates
-Wpartial-fields -fwarn-tabs -optP-Wno-nonportable-include-path
-funbox-strict-fields
-funbox-strict-fields -Wredundant-constraints

build-depends:
aeson >=2.0.1.0
Expand Down Expand Up @@ -151,7 +151,7 @@ test-suite brig-types-tests
ghc-options:
-O2 -Wall -Wincomplete-uni-patterns -Wincomplete-record-updates
-Wpartial-fields -fwarn-tabs -optP-Wno-nonportable-include-path
-threaded -with-rtsopts=-N
-threaded -with-rtsopts=-N -Wredundant-constraints

build-depends:
aeson >=2.0.1.0
Expand Down
1 change: 1 addition & 0 deletions libs/cargohold-types/cargohold-types.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ library
ghc-options:
-O2 -Wall -Wincomplete-uni-patterns -Wincomplete-record-updates
-Wpartial-fields -fwarn-tabs -optP-Wno-nonportable-include-path
-Wredundant-constraints

build-depends:
base >=4 && <5
Expand Down
1 change: 1 addition & 0 deletions libs/cassandra-util/cassandra-util.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ library
ghc-options:
-O2 -Wall -Wincomplete-uni-patterns -Wincomplete-record-updates
-Wpartial-fields -fwarn-tabs -optP-Wno-nonportable-include-path
-Wredundant-constraints

build-depends:
aeson >=2.0.1.0
Expand Down
4 changes: 2 additions & 2 deletions libs/cassandra-util/src/Cassandra/Exec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ import Database.CQL.Protocol (Error, QueryParams (QueryParams), Tuple, pagingSta
import qualified Database.CQL.Protocol as Protocol
import Imports hiding (init)

params :: Tuple a => Consistency -> a -> QueryParams a
params :: Consistency -> a -> QueryParams a
params c p = QueryParams c False p Nothing Nothing Nothing Nothing
{-# INLINE params #-}

Expand Down Expand Up @@ -80,7 +80,7 @@ data CassandraError
| Other !SomeException
deriving (Show)

syncCassandra :: (Functor m, MonadIO m, MonadCatch m) => m a -> m (Either CassandraError a)
syncCassandra :: (MonadIO m, MonadCatch m) => m a -> m (Either CassandraError a)
syncCassandra m =
catches
(Right <$> m)
Expand Down
1 change: 1 addition & 0 deletions libs/deriving-swagger2/deriving-swagger2.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ library
ghc-options:
-O2 -Wall -Wincomplete-uni-patterns -Wincomplete-record-updates
-Wpartial-fields -fwarn-tabs -optP-Wno-nonportable-include-path
-Wredundant-constraints

build-depends:
base >=4 && <5
Expand Down
3 changes: 2 additions & 1 deletion libs/dns-util/dns-util.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ library
ghc-options:
-O2 -Wall -Wincomplete-uni-patterns -Wincomplete-record-updates
-Wpartial-fields -fwarn-tabs -optP-Wno-nonportable-include-path
-Wredundant-constraints

build-depends:
base >=4.6 && <5.0
Expand Down Expand Up @@ -124,7 +125,7 @@ test-suite spec
ghc-options:
-O2 -Wall -Wincomplete-uni-patterns -Wincomplete-record-updates
-Wpartial-fields -fwarn-tabs -optP-Wno-nonportable-include-path
-threaded -rtsopts -with-rtsopts=-N
-threaded -rtsopts -with-rtsopts=-N -Wredundant-constraints

build-tool-depends: hspec-discover:hspec-discover
build-depends:
Expand Down
3 changes: 2 additions & 1 deletion libs/extended/extended.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ library
ghc-options:
-O2 -Wall -Wincomplete-uni-patterns -Wincomplete-record-updates
-Wpartial-fields -fwarn-tabs -optP-Wno-nonportable-include-path
-Wredundant-constraints

build-depends:
aeson
Expand Down Expand Up @@ -143,7 +144,7 @@ test-suite extended-tests
ghc-options:
-O2 -Wall -Wincomplete-uni-patterns -Wincomplete-record-updates
-Wpartial-fields -fwarn-tabs -optP-Wno-nonportable-include-path
-threaded -with-rtsopts=-N
-threaded -with-rtsopts=-N -Wredundant-constraints

build-tool-depends: hspec-discover:hspec-discover
build-depends:
Expand Down
3 changes: 2 additions & 1 deletion libs/galley-types/galley-types.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ library
ghc-options:
-O2 -Wall -Wincomplete-uni-patterns -Wincomplete-record-updates
-Wpartial-fields -fwarn-tabs -optP-Wno-nonportable-include-path
-Wredundant-constraints

build-depends:
aeson >=2.0.1.0
Expand Down Expand Up @@ -146,7 +147,7 @@ test-suite galley-types-tests
ghc-options:
-O2 -Wall -Wincomplete-uni-patterns -Wincomplete-record-updates
-Wpartial-fields -fwarn-tabs -optP-Wno-nonportable-include-path
-threaded -with-rtsopts=-N
-threaded -with-rtsopts=-N -Wredundant-constraints

build-depends:
aeson
Expand Down
1 change: 1 addition & 0 deletions libs/gundeck-types/gundeck-types.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ library
ghc-options:
-O2 -Wall -Wincomplete-uni-patterns -Wincomplete-record-updates
-Wpartial-fields -fwarn-tabs -optP-Wno-nonportable-include-path
-Wredundant-constraints

build-depends:
aeson >=2.0.1.0
Expand Down
2 changes: 1 addition & 1 deletion libs/gundeck-types/src/Gundeck/Types/Common.hs
Original file line number Diff line number Diff line change
Expand Up @@ -57,5 +57,5 @@ instance ToByteString URI where
instance FromByteString URI where
parser = takeByteString >>= parse . Bytes.unpack

parse :: (Monad m, MonadFail m) => String -> m URI
parse :: MonadFail m => String -> m URI
parse = maybe (fail "Invalid URI") (pure . URI) . Net.parseURI
12 changes: 9 additions & 3 deletions libs/hscim/hscim.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ library
TypeOperators
TypeSynonymInstances

ghc-options: -Wall -Werror
ghc-options: -Wall -Werror -Wredundant-constraints
build-depends:
aeson
, aeson-qq
Expand Down Expand Up @@ -146,7 +146,10 @@ executable hscim-server
TypeOperators
TypeSynonymInstances

ghc-options: -Wall -Werror -threaded -rtsopts -with-rtsopts=-N
ghc-options:
-Wall -Werror -threaded -rtsopts -with-rtsopts=-N
-Wredundant-constraints

build-depends:
aeson
, aeson-qq
Expand Down Expand Up @@ -229,7 +232,10 @@ test-suite spec
TypeOperators
TypeSynonymInstances

ghc-options: -Wall -Werror -threaded -rtsopts -with-rtsopts=-N
ghc-options:
-Wall -Werror -threaded -rtsopts -with-rtsopts=-N
-Wredundant-constraints

build-tool-depends: hspec-discover:hspec-discover
build-depends:
aeson
Expand Down
2 changes: 1 addition & 1 deletion libs/hscim/src/Web/Scim/Class/Group.hs
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ class (Monad m, GroupTypes tag, AuthDB tag m) => GroupDB tag m where

groupServer ::
forall tag m.
(Show (GroupId tag), GroupDB tag m) =>
GroupDB tag m =>
Maybe (AuthData tag) ->
GroupSite tag (AsServerT (ScimHandler m))
groupServer authData =
Expand Down
Loading