Skip to content

Commit

Permalink
_
Browse files Browse the repository at this point in the history
  • Loading branch information
yminsky committed Jan 18, 2022
1 parent 2c285a8 commit b7f09c6
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions book/gadts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -314,13 +314,13 @@ type _ expr =
| If : bool expr * 'a expr * 'a expr -> 'a expr
```

The syntax here requires some decoding. The colon to the right of
each tag is what tells you that this is a GADT. To the right of the
colon, you'll see what looks like an ordinary function signature, and
you can almost think of it that way; specifically, as the type
signature for that particular tag. The left-hand side of the
arrow states the types of the arguments to the tag, and the
right hand side determines the type of the constructed value.
The syntax here requires some decoding. The colon to the right of each
tag is what tells you that this is a GADT. To the right of the colon,
you'll see what looks like an ordinary, single-argument function
signature, and you can almost think of it that way; specifically, as
the type signature for that particular tag. The left-hand side of the
arrow states the types of the arguments to the tag, and the right hand
side determines the type of the constructed value.

Note that in the definition of each tag in a GADT, the right-hand side
is an instance of the type as the overall GADT, though the type
Expand Down

0 comments on commit b7f09c6

Please sign in to comment.