diff --git a/message-index/messages/GHC-30281/deriving-strategies/after/DerivingStrategies.hs b/message-index/messages/GHC-30281/deriving-strategies/after/DerivingStrategies.hs new file mode 100644 index 00000000..682ffa36 --- /dev/null +++ b/message-index/messages/GHC-30281/deriving-strategies/after/DerivingStrategies.hs @@ -0,0 +1,7 @@ +{-# LANGUAGE DerivingStrategies #-} + +module DerivingStrategies where + +data Foo = Foo + deriving Eq + deriving Ord diff --git a/message-index/messages/GHC-30281/deriving-strategies/before/DerivingStrategies.hs b/message-index/messages/GHC-30281/deriving-strategies/before/DerivingStrategies.hs new file mode 100644 index 00000000..72382563 --- /dev/null +++ b/message-index/messages/GHC-30281/deriving-strategies/before/DerivingStrategies.hs @@ -0,0 +1,5 @@ +module Deriving-DerivingStrategies where + +data Foo = Foo + deriving Eq + deriving Ord diff --git a/message-index/messages/GHC-30281/deriving-strategies/index.md b/message-index/messages/GHC-30281/deriving-strategies/index.md new file mode 100644 index 00000000..03aec649 --- /dev/null +++ b/message-index/messages/GHC-30281/deriving-strategies/index.md @@ -0,0 +1,4 @@ +--- +title: Resolve by using the `DerivingStrategies` language extension +order: 2 +--- diff --git a/message-index/messages/GHC-30281/deriving-tuple/after/Tuple.hs b/message-index/messages/GHC-30281/deriving-tuple/after/Tuple.hs new file mode 100644 index 00000000..51d97e26 --- /dev/null +++ b/message-index/messages/GHC-30281/deriving-tuple/after/Tuple.hs @@ -0,0 +1,4 @@ +module Tuple where + +data Foo = Foo + deriving (Eq, Show) diff --git a/message-index/messages/GHC-30281/deriving-tuple/before/Tuple.hs b/message-index/messages/GHC-30281/deriving-tuple/before/Tuple.hs new file mode 100644 index 00000000..185350af --- /dev/null +++ b/message-index/messages/GHC-30281/deriving-tuple/before/Tuple.hs @@ -0,0 +1,5 @@ +module Tuple where + +data Foo = Foo + deriving Eq + deriving Show diff --git a/message-index/messages/GHC-30281/deriving-tuple/index.md b/message-index/messages/GHC-30281/deriving-tuple/index.md new file mode 100644 index 00000000..4da2988e --- /dev/null +++ b/message-index/messages/GHC-30281/deriving-tuple/index.md @@ -0,0 +1,4 @@ +--- +title: Resolve by `deriving` a tuple of type classes +order: 1 +--- diff --git a/message-index/messages/GHC-30281/index.md b/message-index/messages/GHC-30281/index.md new file mode 100644 index 00000000..3059510e --- /dev/null +++ b/message-index/messages/GHC-30281/index.md @@ -0,0 +1,14 @@ +--- +title: Multiple `deriving` clauses +summary: Multiple `deriving` clauses are not allowed. +severity: error +introduced: 9.6.1 +--- + +Using the `deriving` clause multiple times on the same `data` or `newtype` definition is illegal. + +Can be resolved by either: + +- Using deriving with a tuple (`deriving (Eq, Ord)`) +- Using the `DerivingStrategies` language extension +