Skip to content

Commit a6a0bf6

Browse files
authored
Document GHC-15708 (#518)
1 parent 300cae4 commit a6a0bf6

File tree

4 files changed

+37
-0
lines changed

4 files changed

+37
-0
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{-# LANGUAGE FunctionalDependencies #-}
2+
3+
module FunDepsDisabled where
4+
5+
class Convert a b | a -> b where
6+
convert :: a -> b
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
module FunDepsDisabled where
2+
3+
class Convert a b | a -> b where
4+
convert :: a -> b
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
title: Missing FunctionalDependencies language extension
3+
---
4+
5+
Cannot specify functional dependencies for a class - `FunctionalDependencies` language extension is missing.
6+
7+
## Error Message
8+
9+
```
10+
FunDepsDisabled.hs:1:1: error: [GHC-15708]
11+
• Fundeps in class ‘Convert’
12+
• In the class declaration for ‘Convert’
13+
Suggested fix: Perhaps you intended to use FunctionalDependencies
14+
|
15+
1 | class Convert a b | a -> b where
16+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^...
17+
```
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
title: Missing FunctionalDependencies
3+
summary: Missing FunctionalDependencies language extension
4+
severity: error
5+
introduced: 9.6.1
6+
---
7+
8+
The [Functional Dependencies extension](https://downloads.haskell.org/ghc/latest/docs/users_guide/exts/functional_dependencies.html#extension-FunctionalDependencies) enables dependencies in multiparameter class declarations.
9+
10+
When the extension is missing, the syntax for specifying dependencies is not recognized.

0 commit comments

Comments
 (0)