Skip to content

Commit

Permalink
chore: Suppress some warnings we'll fix later.
Browse files Browse the repository at this point in the history
  • Loading branch information
iphydf committed Sep 5, 2023
1 parent 1dd28ed commit 86b1d6b
Show file tree
Hide file tree
Showing 10 changed files with 14 additions and 9 deletions.
1 change: 1 addition & 0 deletions src/Data/Binary/Bits/Get.hs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
{-# OPTIONS_GHC -Wno-incomplete-patterns #-}
{-# OPTIONS_GHC -Wno-missing-signatures #-}
{-# OPTIONS_GHC -Wno-name-shadowing #-}
{-# OPTIONS_GHC -Wno-noncanonical-monad-instances #-}
{-# OPTIONS_GHC -Wno-unused-top-binds #-}

-----------------------------------------------------------------------------
Expand Down
1 change: 1 addition & 0 deletions src/Data/Binary/Bits/Put.hs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
-- Put bits easily.
-----------------------------------------------------------------------------

{-# OPTIONS_GHC -Wno-noncanonical-monad-instances #-}
module Data.Binary.Bits.Put
( BitPut
, runBitPut
Expand Down
1 change: 1 addition & 0 deletions src/Network/Tox/Crypto/KeyPair.lhs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ standard group element and the Secret Key. See the
\href{https://nacl.cr.yp.to/scalarmult.html}{NaCl documentation} for details.

\begin{code}
{-# OPTIONS_GHC -Wno-incomplete-uni-patterns #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE OverloadedStrings #-}
Expand Down
3 changes: 2 additions & 1 deletion src/Network/Tox/Crypto/Keyed.hs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{-# OPTIONS_GHC -Wno-noncanonical-monad-instances #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE Safe #-}
Expand All @@ -7,9 +8,9 @@
-- | Monad class for caching of combined keys
module Network.Tox.Crypto.Keyed where

import Control.Monad.RWS (RWST)
import Control.Monad.Random (RandT)
import Control.Monad.Reader (ReaderT)
import Control.Monad.RWS (RWST)
import Control.Monad.State (StateT)
import Control.Monad.Trans (lift)
import Control.Monad.Writer (WriterT)
Expand Down
1 change: 1 addition & 0 deletions src/Network/Tox/Crypto/Nonce.lhs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ the system as non friends could tie some people's DHT keys and long term keys
together.

\begin{code}
{-# OPTIONS_GHC -Wno-incomplete-uni-patterns #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE Trustworthy #-}
module Network.Tox.Crypto.Nonce where
Expand Down
4 changes: 2 additions & 2 deletions src/Network/Tox/DHT/Distance.lhs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
\section{Distance}

\begin{code}
{-# OPTIONS_GHC -Wno-noncanonical-monad-instances #-}
{-# LANGUAGE MagicHash #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE Trustworthy #-}
Expand Down Expand Up @@ -36,11 +37,10 @@ newtype Distance = Distance Integer
instance Semigroup Distance where
(Distance x) <> (Distance y) = Distance (x + y)
Distance x <> Distance y = Distance (x + y)
instance Monoid Distance where
mempty = Distance 0
mappend (Distance x) (Distance y) = Distance (x + y)
instance Show Distance where
Expand Down
3 changes: 2 additions & 1 deletion src/Network/Tox/DHT/KBuckets.lhs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ certain key called the base key. The base key is constant throughout the
lifetime of a k-buckets instance.

\begin{code}
{-# OPTIONS_GHC -Wno-incomplete-uni-patterns #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE StrictData #-}
Expand Down Expand Up @@ -194,7 +195,7 @@ traverseClientLists f kBuckets@KBuckets{ buckets } =
(\x -> kBuckets{ buckets = x }) <$> traverse f (reverseT buckets)
where
reverseT :: (Traversable t) => t a -> t a
reverseT t = snd (mapAccumR (\ (x:xs) _ -> (xs, x)) (toList t) t)
reverseT t = snd (mapAccumR (\(x:xs) _ -> (xs, x)) (toList t) t)
closeNodes :: PublicKey -> KBuckets -> [ (Distance, NodeInfo) ]
closeNodes publicKey KBuckets{ baseKey, buckets } =
Expand Down
2 changes: 0 additions & 2 deletions test/Data/Result.hs
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ instance Alternative Result where
_ <|> r = r

instance Monad Result where
return = Success

Success x >>= f = f x
Failure msg >>= _ = Failure msg

Expand Down
1 change: 1 addition & 0 deletions test/Network/Tox/Crypto/KeySpec.hs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{-# OPTIONS_GHC -Wno-incomplete-uni-patterns #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE StrictData #-}
Expand Down
6 changes: 3 additions & 3 deletions toxcore.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ flag library-only
library
default-language: Haskell2010
hs-source-dirs: src
ghc-options: -Wall -Wno-unused-imports
ghc-options: -Wall
exposed-modules:
Data.Binary.Bits
Data.Binary.Bits.Get
Expand Down Expand Up @@ -101,7 +101,7 @@ library
executable toxsave-convert
default-language: Haskell2010
hs-source-dirs: tools
ghc-options: -Wall -Wno-unused-imports
ghc-options: -Wall
main-is: toxsave-convert.hs
build-depends:
base <5
Expand Down Expand Up @@ -138,7 +138,7 @@ test-suite testsuite
default-language: Haskell2010
type: exitcode-stdio-1.0
hs-source-dirs: test
ghc-options: -Wall -Wno-unused-imports
ghc-options: -Wall
main-is: testsuite.hs
other-modules:
Data.Result
Expand Down

0 comments on commit 86b1d6b

Please sign in to comment.