Skip to content

Commit ad775e6

Browse files
sjsyrekhdgarrood
authored andcommitted
1 parent 682ed92 commit ad775e6

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

language/Type-Classes.md

+2-3
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
PureScript supports type classes via the `class` and `instance` keywords.
44

5-
Types appearing in class instances are must be of the form `String`, `Number`, `Boolean`, or `C t1 ... tn` where `C` is a type constructor (including `->` and `t_i` are types of the same form).
5+
Types appearing in class instances must be of the form `String`, `Number`, `Boolean`, or `C t1 ... tn` where `C` is a type constructor (including `->` and `t_i` are types of the same form).
66

7-
Type class instances are resolved based on the order in which they appeared in the source files. Overlapping instances are currently permitted but not recommended. In simple cases the compiler will display a warning and list the instances it found and which was chosen. In the future they may be disallowed completely.
7+
Type class instances are resolved based on the order in which they appear in the source files. Overlapping instances are currently permitted but not recommended. In simple cases the compiler will display a warning and list the instances it found and which was chosen. In the future, they may be disallowed completely.
88

99
Here is an example of the `Show` typeclass, with instances for `String`, `Boolean` and `Array`:
1010

@@ -80,7 +80,6 @@ In fact, a type similar to this `AddInt` is provided in `Data.Monoid.Additive`,
8080

8181
For multi-parameter type classes, the orphan instance check requires that the instance is either in the same module as the class, or the same module as at least one of the types occurring in the instance. (TODO: example)
8282

83-
8483
## Functional Dependencies
8584

8685
TODO. For now, see the section in [PureScript by Example](https://leanpub.com/purescript/read#leanpub-auto-functional-dependencies).

0 commit comments

Comments
 (0)