From 792877d60192db21641bfdbe09c1cb1e99040bce Mon Sep 17 00:00:00 2001 From: Krishna Padmasola Date: Wed, 11 Oct 2023 20:52:57 +0530 Subject: [PATCH] Suppress some warnings with `-Wno-operator-whitespace` --- lib/Language/Souffle/Class.hs | 24 ++++++++++++------------ lib/Language/Souffle/Marshal.hs | 12 ++++++------ package.yaml | 1 + souffle-haskell.cabal | 6 +++--- 4 files changed, 22 insertions(+), 21 deletions(-) diff --git a/lib/Language/Souffle/Class.hs b/lib/Language/Souffle/Class.hs index 7d4f086..cf1588f 100644 --- a/lib/Language/Souffle/Class.hs +++ b/lib/Language/Souffle/Class.hs @@ -64,9 +64,9 @@ type family IsInput fact dir where IsInput _ 'Input = () IsInput _ 'InputOutput = () IsInput fact dir = TypeError - ( 'Text "You tried to use an " ' :<>: 'ShowType (FormatDirection dir) ' :<>: 'Text " fact of type " ' :<>: 'ShowType fact ' :<>: 'Text " as an input." - ' :$$: 'Text "Possible solution: change the FactDirection of " ' :<>: 'ShowType fact - ' :<>: 'Text " to either 'Input' or 'InputOutput'." + ( 'Text "You tried to use an " ':<>: 'ShowType (FormatDirection dir) ':<>: 'Text " fact of type " ':<>: 'ShowType fact ':<>: 'Text " as an input." + ':$$: 'Text "Possible solution: change the FactDirection of " ':<>: 'ShowType fact + ':<>: 'Text " to either 'Input' or 'InputOutput'." ) type IsOutput :: Type -> Direction -> Constraint @@ -74,9 +74,9 @@ type family IsOutput fact dir where IsOutput _ 'Output = () IsOutput _ 'InputOutput = () IsOutput fact dir = TypeError - ( 'Text "You tried to use an " ' :<>: 'ShowType (FormatDirection dir) ' :<>: 'Text " fact of type " ' :<>: 'ShowType fact ' :<>: 'Text " as an output." - ' :$$: 'Text "Possible solution: change the FactDirection of " ' :<>: 'ShowType fact - ' :<>: 'Text " to either 'Output' or 'InputOutput'." + ( 'Text "You tried to use an " ':<>: 'ShowType (FormatDirection dir) ':<>: 'Text " fact of type " ':<>: 'ShowType fact ':<>: 'Text " as an output." + ':$$: 'Text "Possible solution: change the FactDirection of " ':<>: 'ShowType fact + ':<>: 'Text " to either 'Output' or 'InputOutput'." ) type FormatDirection :: Direction -> Symbol @@ -96,12 +96,12 @@ type family ContainsFact prog fact where type CheckContains :: Type -> [Type] -> Type -> Constraint type family CheckContains prog facts fact :: Constraint where CheckContains prog '[] fact = - TypeError ('Text "You tried to perform an action with a fact of type '" ' :<>: 'ShowType fact - ' :<>: 'Text "' for program '" ' :<>: 'ShowType prog ' :<>: 'Text "'." - ' :$$: 'Text "The program contains the following facts: " ' :<>: 'ShowType (ProgramFacts prog) ' :<>: 'Text "." - ' :$$: 'Text "It does not contain fact: " ' :<>: 'ShowType fact ' :<>: 'Text "." - ' :$$: 'Text "You can fix this error by adding the type '" ' :<>: 'ShowType fact - ' :<>: 'Text "' to the ProgramFacts type in the Program instance for " ' :<>: 'ShowType prog ' :<>: 'Text ".") + TypeError ('Text "You tried to perform an action with a fact of type '" ':<>: 'ShowType fact + ':<>: 'Text "' for program '" ':<>: 'ShowType prog ':<>: 'Text "'." + ':$$: 'Text "The program contains the following facts: " ':<>: 'ShowType (ProgramFacts prog) ':<>: 'Text "." + ':$$: 'Text "It does not contain fact: " ':<>: 'ShowType fact ':<>: 'Text "." + ':$$: 'Text "You can fix this error by adding the type '" ':<>: 'ShowType fact + ':<>: 'Text "' to the ProgramFacts type in the Program instance for " ':<>: 'ShowType prog ':<>: 'Text ".") CheckContains _ (a ': _) a = () CheckContains prog (_ ': as) b = CheckContains prog as b diff --git a/lib/Language/Souffle/Marshal.hs b/lib/Language/Souffle/Marshal.hs index ce73c28..6b242d5 100644 --- a/lib/Language/Souffle/Marshal.hs +++ b/lib/Language/Souffle/Marshal.hs @@ -179,14 +179,14 @@ type family ProductLike t f where ProductLike t (M1 _ _ a) = ProductLike t a ProductLike _ (K1 _ _) = () ProductLike t (_ :+: _) = - TypeError ( 'Text "Error while deriving marshalling code for type " ' :<>: 'ShowType t ' :<>: 'Text ":" - ' :$$: 'Text "Cannot derive sum type, only product types are supported.") + TypeError ( 'Text "Error while deriving marshalling code for type " ':<>: 'ShowType t ':<>: 'Text ":" + ':$$: 'Text "Cannot derive sum type, only product types are supported.") ProductLike t U1 = - TypeError ( 'Text "Error while deriving marshalling code for type " ' :<>: 'ShowType t ' :<>: 'Text ":" - ' :$$: 'Text "Cannot automatically derive code for 0 argument constructor.") + TypeError ( 'Text "Error while deriving marshalling code for type " ':<>: 'ShowType t ':<>: 'Text ":" + ':$$: 'Text "Cannot automatically derive code for 0 argument constructor.") ProductLike t V1 = - TypeError ( 'Text "Error while deriving marshalling code for type " ' :<>: 'ShowType t ' :<>: 'Text ":" - ' :$$: 'Text "Cannot derive void type.") + TypeError ( 'Text "Error while deriving marshalling code for type " ':<>: 'ShowType t ':<>: 'Text ":" + ':$$: 'Text "Cannot derive void type.") type OnlyMarshallableFields :: (Type -> Type) -> Constraint type family OnlyMarshallableFields f where diff --git a/package.yaml b/package.yaml index 6ffbeb5..c45e352 100644 --- a/package.yaml +++ b/package.yaml @@ -44,6 +44,7 @@ ghc-options: - -Wno-monomorphism-restriction - -Wno-prepositive-qualified-module - -Wno-missing-safe-haskell-mode + - -Wno-operator-whitespace - -optP-Wno-nonportable-include-path - -fhide-source-paths - -fno-show-valid-hole-fits diff --git a/souffle-haskell.cabal b/souffle-haskell.cabal index 3d3ce35..7ca42a3 100644 --- a/souffle-haskell.cabal +++ b/souffle-haskell.cabal @@ -96,7 +96,7 @@ library OverloadedStrings ScopedTypeVariables StandaloneKindSignatures - ghc-options: -Wall -Weverything -Wno-safe -Wno-unsafe -Wno-implicit-prelude -Wno-missed-specializations -Wno-all-missed-specializations -Wno-missing-import-lists -Wno-type-defaults -Wno-missing-local-signatures -Wno-monomorphism-restriction -Wno-prepositive-qualified-module -Wno-missing-safe-haskell-mode -optP-Wno-nonportable-include-path -fhide-source-paths -fno-show-valid-hole-fits -fno-sort-valid-hole-fits + ghc-options: -Wall -Weverything -Wno-safe -Wno-unsafe -Wno-implicit-prelude -Wno-missed-specializations -Wno-all-missed-specializations -Wno-missing-import-lists -Wno-type-defaults -Wno-missing-local-signatures -Wno-monomorphism-restriction -Wno-prepositive-qualified-module -Wno-missing-safe-haskell-mode -Wno-operator-whitespace -optP-Wno-nonportable-include-path -fhide-source-paths -fno-show-valid-hole-fits -fno-sort-valid-hole-fits cxx-options: -std=c++17 -Wall include-dirs: cbits @@ -189,7 +189,7 @@ test-suite souffle-haskell-test OverloadedStrings ScopedTypeVariables StandaloneKindSignatures - ghc-options: -Wall -Weverything -Wno-safe -Wno-unsafe -Wno-implicit-prelude -Wno-missed-specializations -Wno-all-missed-specializations -Wno-missing-import-lists -Wno-type-defaults -Wno-missing-local-signatures -Wno-monomorphism-restriction -Wno-prepositive-qualified-module -Wno-missing-safe-haskell-mode -optP-Wno-nonportable-include-path -fhide-source-paths -fno-show-valid-hole-fits -fno-sort-valid-hole-fits -Wno-missing-kind-signatures -Wno-operator-whitespace + ghc-options: -Wall -Weverything -Wno-safe -Wno-unsafe -Wno-implicit-prelude -Wno-missed-specializations -Wno-all-missed-specializations -Wno-missing-import-lists -Wno-type-defaults -Wno-missing-local-signatures -Wno-monomorphism-restriction -Wno-prepositive-qualified-module -Wno-missing-safe-haskell-mode -Wno-operator-whitespace -optP-Wno-nonportable-include-path -fhide-source-paths -fno-show-valid-hole-fits -fno-sort-valid-hole-fits -Wno-missing-kind-signatures -Wno-operator-whitespace cxx-options: -std=c++17 -D__EMBEDDED_SOUFFLE__ include-dirs: cbits @@ -278,7 +278,7 @@ benchmark souffle-haskell-benchmarks OverloadedStrings ScopedTypeVariables StandaloneKindSignatures - ghc-options: -Wall -Weverything -Wno-safe -Wno-unsafe -Wno-implicit-prelude -Wno-missed-specializations -Wno-all-missed-specializations -Wno-missing-import-lists -Wno-type-defaults -Wno-missing-local-signatures -Wno-monomorphism-restriction -Wno-prepositive-qualified-module -Wno-missing-safe-haskell-mode -optP-Wno-nonportable-include-path -fhide-source-paths -fno-show-valid-hole-fits -fno-sort-valid-hole-fits +RTS -N1 -RTS + ghc-options: -Wall -Weverything -Wno-safe -Wno-unsafe -Wno-implicit-prelude -Wno-missed-specializations -Wno-all-missed-specializations -Wno-missing-import-lists -Wno-type-defaults -Wno-missing-local-signatures -Wno-monomorphism-restriction -Wno-prepositive-qualified-module -Wno-missing-safe-haskell-mode -Wno-operator-whitespace -optP-Wno-nonportable-include-path -fhide-source-paths -fno-show-valid-hole-fits -fno-sort-valid-hole-fits +RTS -N1 -RTS cxx-options: -std=c++17 -D__EMBEDDED_SOUFFLE__ -std=c++17 -march=native include-dirs: cbits