diff options
author | Matthew Yacavone <matthew@yacavone.net> | 2018-11-29 18:42:39 -0500 |
---|---|---|
committer | Ryan Scott <ryan.gl.scott@gmail.com> | 2018-11-29 18:44:13 -0500 |
commit | fe57a5bae3f8cb87637359f615c77f4afae86d46 (patch) | |
tree | d36f6a009aa8c027e8b02b032301ec1c535b787e /docs | |
parent | 2257a86daa72db382eb927df12a718669d5491f8 (diff) | |
download | haskell-fe57a5bae3f8cb87637359f615c77f4afae86d46.tar.gz |
Fix #15828, from `More explicit foralls`
Summary:
Fix a bug in commit 12eeb9 which permits the following:
```
class C a where
type T a b
instance C (Maybe a) where
type forall a b. T (Maybe a) b = b
```
where instead, the user should write:
```
instance C (Maybe a) where
type forall b. T (Maybe a) b = b
```
Update the users guide to discuss scoping of type variables in
explicit foralls in type family instances.
Test Plan: validate
Reviewers: bgamari, goldfire, monoidal
Reviewed By: goldfire
Subscribers: monoidal, rwbarton, carter
GHC Trac Issues: #15828
Differential Revision: https://phabricator.haskell.org/D5283
Diffstat (limited to 'docs')
-rw-r--r-- | docs/users_guide/glasgow_exts.rst | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/docs/users_guide/glasgow_exts.rst b/docs/users_guide/glasgow_exts.rst index a07adf377b..9b8df91916 100644 --- a/docs/users_guide/glasgow_exts.rst +++ b/docs/users_guide/glasgow_exts.rst @@ -7577,9 +7577,9 @@ the left hand side can be explicitly bound. For example: :: data instance forall a (b :: Proxy a). F (Proxy b) = FProxy Bool -When an explicit ``forall`` is present, all *type* variables mentioned must -be bound by the ``forall``. Kind variables will be implicitly bound if -necessary, for example: :: +When an explicit ``forall`` is present, all *type* variables mentioned which +are not already in scope must be bound by the ``forall``. Kind variables will +be implicitly bound if necessary, for example: :: data instance forall (a :: k). F a = FOtherwise |