Skip to content

Commit

Permalink
Suppress some warnings with -Wno-operator-whitespace
Browse files Browse the repository at this point in the history
  • Loading branch information
kpadmasola committed Oct 11, 2023
1 parent 5c95c12 commit 792877d
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 21 deletions.
24 changes: 12 additions & 12 deletions lib/Language/Souffle/Class.hs
Original file line number Diff line number Diff line change
Expand Up @@ -64,19 +64,19 @@ 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
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
Expand All @@ -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

Expand Down
12 changes: 6 additions & 6 deletions lib/Language/Souffle/Marshal.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions souffle-haskell.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 792877d

Please sign in to comment.