Skip to content

Commit

Permalink
Merge pull request #2145 from spechub/fix_warnings
Browse files Browse the repository at this point in the history
Fixed warnings
  • Loading branch information
b-gehrke authored Jun 9, 2023
2 parents d290b99 + 97a2a10 commit adb6a48
Show file tree
Hide file tree
Showing 10 changed files with 23 additions and 25 deletions.
5 changes: 3 additions & 2 deletions CMDL/Interface.hs
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ import Comorphisms.LogicGraph (logicGraph)
import Logic.Grothendieck
#endif

import Proofs.AbstractState (getAllConsCheckers, sublogicOfTheory, getCcName
, getListOfConsCheckers, usableCC)
import Proofs.AbstractState (getListOfConsCheckers, usableCC)

import System.IO

Expand All @@ -45,6 +44,8 @@ import Control.Monad
import Control.Monad.Trans (MonadIO (..))

#ifdef HASKELINE
import Proofs.AbstractState (getAllConsCheckers, sublogicOfTheory, getCcName)

shellSettings :: IORef CmdlState -> Settings IO
shellSettings st =
Settings {
Expand Down
2 changes: 0 additions & 2 deletions Driver/ReadFn.hs
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,6 @@ import Text.XML.Light
import System.FilePath
import System.Directory

import Control.Monad

import Data.Char (isSpace)
import Data.List (isPrefixOf)
import Data.Maybe
Expand Down
4 changes: 3 additions & 1 deletion NeSyPatterns/Logic_NeSyPatterns.hs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ import NeSyPatterns.Morphism
import NeSyPatterns.Sign
import NeSyPatterns.Symbol as Symbol
import NeSyPatterns.Parse
import NeSyPatterns.Taxonomy
#ifdef UNI_PACKAGE
import NeSyPatterns.Taxonomy (nesy2Tax)
#endif

import Common.ProofTree
import ATC.ProofTree ()
Expand Down
15 changes: 8 additions & 7 deletions Persistence/Database.hs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import Control.Monad.Logger
import Control.Monad.IO.Unlift
import qualified Control.Monad.Fail as Fail

import Data.List (intercalate, isInfixOf)
import qualified Data.List
import Data.Text (Text, pack)

import Database.Persist.Sql
Expand Down Expand Up @@ -77,24 +77,25 @@ runFullMigrationSet dbConfig =

ignoreError :: MonadIO m
=> String -> SomeException -> DBMonad m [Single (Maybe Text)]
ignoreError searchInfix exception =
let message = show exception in
#ifdef MYSQL
if isMySql dbConfig && (searchInfix `isInfixOf` message)
ignoreError searchInfix exception =
if isMySql dbConfig && (searchInfix `Data.List.isInfixOf` message)
then
return []
else
#else
ignoreError _ exception =
#endif
Fail.fail message
Fail.fail message where message = show exception

indexesSQL :: DBConfig -> [String]
indexesSQL dbConfig =
map sqlString Persistence.Schema.indexes
where
sqlString :: (String, [String]) -> String
sqlString (table, columns) =
let indexName = "ix_" ++ table ++ "__" ++ intercalate "__" columns
indexedColumns = intercalate ", " columns
let indexName = "ix_" ++ table ++ "__" ++ Data.List.intercalate "__" columns
indexedColumns = Data.List.intercalate ", " columns
#ifdef MYSQL
indexNameMySql = take 64 indexName
mysqlString =
Expand Down
9 changes: 5 additions & 4 deletions Persistence/DatabaseConnection.hs
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,13 @@ getConnection :: ( MonadIO m
=> DBConfig -> IO ((Pool SqlBackend -> m a) -> m a)
getConnection dbConfig = case adapter dbConfig of
#ifdef MYSQL
Just "mysql" -> Fail.fail mySQLErrorMessage
Just "mysql2" -> Fail.fail mySQLErrorMessage
Just "mysql" -> return $ MySQL.connection dbConfig $
fromMaybe defaultPoolSize $ pool dbConfig
Just "mysql" -> return $ MySQL.connection dbConfig $
Just "mysql2" -> return $ MySQL.connection dbConfig $
fromMaybe defaultPoolSize $ pool dbConfig
#else
Just "mysql" -> Fail.fail mySQLErrorMessage
Just "mysql2" -> Fail.fail mySQLErrorMessage
#endif
#ifdef UNI_PACKAGE
Just "postgresql" -> Fail.fail postgreSQLErrorMessage
Expand All @@ -59,7 +60,7 @@ getConnection dbConfig = case adapter dbConfig of
_ -> Fail.fail ("Persistence.Database: No database adapter specified "
++ "or adapter unsupported.")
where
#ifdef MYSQL
#ifndef MYSQL
mySQLErrorMessage = "MySQL support is deactivated. If you need it, please use a hets-server package compiled with the mysql flag instead of hets-desktop."
#endif
#ifdef UNI_PACKAGE
Expand Down
1 change: 0 additions & 1 deletion Persistence/Range.hs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ module Persistence.Range where

import Persistence.Database
import Persistence.Schema as SchemaClass
import qualified Persistence.Schema as SchemaClass (FileRange (..))

import Common.Id

Expand Down
1 change: 0 additions & 1 deletion Persistence/Schema.hs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ module Persistence.Schema where

import Database.Persist.Sql
import Database.Persist.TH
import Database.Persist.TH (mkDeleteCascade)

import Data.Text (Text)

Expand Down
8 changes: 3 additions & 5 deletions hets.hs
Original file line number Diff line number Diff line change
Expand Up @@ -102,11 +102,9 @@ processFile opts file = if fileType opts then showFileType opts file else do
then cmdlRun opts >> return () else displayGraph file opts res

displayGraph :: FilePath -> HetcatsOpts -> Maybe (LibName, LibEnv) -> IO ()
displayGraph file opts res = case guiType opts of
NoGui -> return ()
UseGui ->
displayGraph _ (HcOpt {guiType = NoGui}) _ = return ()
#ifdef UNI_PACKAGE
showGraph file opts res
displayGraph file opts res = showGraph file opts res
#else
noUniPkg
displayGraph _ _ _ = noUniPkg
#endif
1 change: 0 additions & 1 deletion utils/DrIFT-src/ParseLib2.hs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ module ParseLib2
import Data.Char
import Control.Applicative
import Control.Monad
import Control.Monad.Fail (MonadFail, fail)

infixr 5 +++

Expand Down
2 changes: 1 addition & 1 deletion utils/DtdToHaskell-src/DtdToHaskell.hs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ to read and write XML files with your Haskell programs. -}
import System.Environment
import System.Exit
import System.IO
import Data.List (nub, takeWhile, dropWhile)
import Data.List (nub)
import Control.Monad

-- import Text.XML.HaXml.Wrappers (fix2Args)
Expand Down

0 comments on commit adb6a48

Please sign in to comment.