Skip to content

Commit cc67979

Browse files
committed
Apply suggested changes
1 parent f1d773f commit cc67979

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

message-index/messages/GHC-54540/constructorsNotInScope/after/ConstructorsNotInScope.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ module ConstructorsNotInScope where
33

44
import System.IO( Handle )
55

6-
-- It is not possible to derive an instance for the typeclass in this module.
6+
-- It is not possible to derive an instance for the type class in this module.

message-index/messages/GHC-93557/illegalSynonymInstance/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
title: Cannot implement a typeclass for type synonyms by default
33
---
44

5-
The programmer defined a data type `RGB`, and a type synonym `T`, and then tried to implement an instance of the typeclass `Eq` for `T`.
6-
In the language version Haskell2010 this is not allowed, since all typeclass instances have to start with a type constructor.
5+
The programmer defined a data type `RGB`, and a type synonym `T`, and then tried to implement an instance of the type class `Eq` for `T`.
6+
In the language version Haskell 2010 this is not allowed, since all type class instances have to start with a type constructor.
77
This problem can be fixed by implementing the typeclass instance directly for the type `RGB` instead of the type synonym `T`.
88

99
```

message-index/messages/GHC-93557/index.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,12 @@ severity: error
55
introduced: 9.8.1
66
---
77

8-
Using the language version Haskell2010, only certain types are allowed as instances of a typeclass.
9-
Every typeclass instance in Haskell2010 has the following form:
8+
Using the language version Haskell 2010, only certain types are allowed as instances of a type class.
9+
Every type class instance in Haskell 2010 has the following form:
1010
```
1111
instance C t where
1212
````
13-
Here, `C` is the name of a typeclass, such as `Eq`, `Show` or `Read`, and `t` is a type.
13+
Here, `C` is the name of a type class, such as `Eq`, `Show`, `Read` or `Functor`, and `t` is a type.
1414
But only a subset of types `t` is allowed to appear in typeclass instances.
1515
These types must all have the form `T` or `T a ... b`, where `T` has to be the name of a type introduced by a data or newtype declaration, and the arguments `a` to `b` all have to be type variables.
16+
For example, `Maybe a` is allowed as a type in an instance, because the data type `Maybe` instantiates `T` and `a` is a type variable`, but `Maybe Int` is not allowed, since `Int` is not a type variable.

0 commit comments

Comments
 (0)