diff --git a/message-index/messages/GHC-16437/deriving_gadt/after/Deriving_gadt.hs b/message-index/messages/GHC-16437/deriving_gadt/after/Deriving_gadt.hs new file mode 100644 index 00000000..08095b52 --- /dev/null +++ b/message-index/messages/GHC-16437/deriving_gadt/after/Deriving_gadt.hs @@ -0,0 +1,9 @@ +{-# LANGUAGE GADTs #-} +{-# LANGUAGE StandaloneDeriving #-} + +module Deriving_gadt where + +data T a b where + Mk :: Int -> b -> T Int b + +deriving instance Functor (T a) diff --git a/message-index/messages/GHC-16437/deriving_gadt/before/Deriving_gadt.hs b/message-index/messages/GHC-16437/deriving_gadt/before/Deriving_gadt.hs new file mode 100644 index 00000000..9498d993 --- /dev/null +++ b/message-index/messages/GHC-16437/deriving_gadt/before/Deriving_gadt.hs @@ -0,0 +1,5 @@ +module Deriving_gadt where + +data T a b where + Mk :: Int -> b -> T Int b + deriving (Functor) diff --git a/message-index/messages/GHC-16437/deriving_gadt/index.md b/message-index/messages/GHC-16437/deriving_gadt/index.md new file mode 100644 index 00000000..e5613854 --- /dev/null +++ b/message-index/messages/GHC-16437/deriving_gadt/index.md @@ -0,0 +1,3 @@ +--- +title: Attempt at using deriving clause with GADT. +--- diff --git a/message-index/messages/GHC-16437/higher_rank/after/Higher_rank.hs b/message-index/messages/GHC-16437/higher_rank/after/Higher_rank.hs new file mode 100644 index 00000000..bc28a09c --- /dev/null +++ b/message-index/messages/GHC-16437/higher_rank/after/Higher_rank.hs @@ -0,0 +1,5 @@ + +module Higher_rank where + +-- unfortunately we just need a rank 1 type +data Bad = MkBad a deriving Eq diff --git a/message-index/messages/GHC-16437/higher_rank/before/Higher_rank.hs b/message-index/messages/GHC-16437/higher_rank/before/Higher_rank.hs new file mode 100644 index 00000000..6d3947bd --- /dev/null +++ b/message-index/messages/GHC-16437/higher_rank/before/Higher_rank.hs @@ -0,0 +1,5 @@ +{-# LANGUAGE RankNTypes #-} + +module Higher_rank where + +data Bad = MkBad (forall a. a) deriving Eq diff --git a/message-index/messages/GHC-16437/higher_rank/index.md b/message-index/messages/GHC-16437/higher_rank/index.md new file mode 100644 index 00000000..2f78ca63 --- /dev/null +++ b/message-index/messages/GHC-16437/higher_rank/index.md @@ -0,0 +1,3 @@ +--- +title: Use of higher-rank types with a derving clause. +--- diff --git a/message-index/messages/GHC-16437/index.md b/message-index/messages/GHC-16437/index.md new file mode 100644 index 00000000..5dcb7b87 --- /dev/null +++ b/message-index/messages/GHC-16437/index.md @@ -0,0 +1,11 @@ +--- +title: Bad Constructor used with deriving clause +summary: The deriving mechanism expects constructors of a particular form. When the constructors do not comport to this form, this error is thrown. +severity: error +introduced: 9.6.1 +--- + + • Can't make a derived instance of ‘Functor (T a)’: + Constructor ‘Mk’ is a GADT + • In the data declaration for ‘T’ + Suggested fix: Use a standalone deriving declaration instead