Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -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)
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module Deriving_gadt where

data T a b where
Mk :: Int -> b -> T Int b
deriving (Functor)
3 changes: 3 additions & 0 deletions message-index/messages/GHC-16437/deriving_gadt/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
title: Attempt at using deriving clause with GADT.
---
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@

module Higher_rank where

-- unfortunately we just need a rank 1 type
data Bad = MkBad a deriving Eq
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{-# LANGUAGE RankNTypes #-}

module Higher_rank where

data Bad = MkBad (forall a. a) deriving Eq
3 changes: 3 additions & 0 deletions message-index/messages/GHC-16437/higher_rank/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
title: Use of higher-rank types with a derving clause.
---
11 changes: 11 additions & 0 deletions message-index/messages/GHC-16437/index.md
Original file line number Diff line number Diff line change
@@ -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.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

summary field is displayed on the index page. It's better to keep it short and move this sentence into the body of the page.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated. Thanks Bodigrim!

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