summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKrzysztof Gogolewski <krz.gogolewski@gmail.com>2018-09-07 13:53:11 +0200
committerKrzysztof Gogolewski <krz.gogolewski@gmail.com>2018-09-07 13:53:12 +0200
commit4caad1660a641995caee3ee6da6fee4a93ee99b5 (patch)
tree61a0f622cd342a456da8d3c58d75dc254da7c445
parentd9a26c7e8d9bb96ccb676d6a23da21b64559c7c2 (diff)
downloadhaskell-4caad1660a641995caee3ee6da6fee4a93ee99b5.tar.gz
Documentation tweaks
Summary: - Mention static pointers in "stolen syntax" - Suggest importing Constraint and IsString from Data.* instead of GHC.* - Remove obsolete SPECIALISE syntax; it was removed in or before 1999 (d66d409bf6) - Fix link in pattern signatures Test Plan: build Reviewers: bgamari, takenobu Reviewed By: takenobu Subscribers: rwbarton, carter Differential Revision: https://phabricator.haskell.org/D5132
-rw-r--r--docs/users_guide/glasgow_exts.rst25
1 files changed, 7 insertions, 18 deletions
diff --git a/docs/users_guide/glasgow_exts.rst b/docs/users_guide/glasgow_exts.rst
index 465935119e..ead020c916 100644
--- a/docs/users_guide/glasgow_exts.rst
+++ b/docs/users_guide/glasgow_exts.rst
@@ -2290,6 +2290,9 @@ The following syntax is stolen:
``pattern``
Stolen by: :extension:`PatternSynonyms`
+``static``
+ Stolen by: :extension:`StaticPointers`
+
.. _data-type-extensions:
Extensions to data types and type synonyms
@@ -7034,7 +7037,7 @@ usual: ::
The class ``IsString`` is not in scope by default. If you want to
mention it explicitly (for example, to give an instance declaration for
-it), you can import it from module ``GHC.Exts``.
+it), you can import it from module ``Data.String``.
Haskell's defaulting mechanism (`Haskell Report, Section
4.3.4 <http://www.haskell.org/onlinereport/decls.html#sect4.3.4>`__) is
@@ -7062,7 +7065,7 @@ A small example:
module Main where
- import GHC.Exts( IsString(..) )
+ import Data.String( IsString(..) )
newtype MyString = MyString String deriving (Eq, Show)
instance IsString MyString where
@@ -9619,7 +9622,7 @@ The following things have kind ``Constraint``:
- Anything whose form is not yet known, but the user has declared to
have kind ``Constraint`` (for which they need to import it from
- ``GHC.Exts``). So for example
+ ``Data.Kind``). So for example
``type Foo (f :: Type -> Constraint) = forall b. f b => b -> b``
is allowed, as well as examples involving type families: ::
@@ -10205,8 +10208,7 @@ Lexically scoped type variables
To trigger those forms of ``ScopedTypeVariables``, the ``forall`` must appear against the top-level signature (or outer expression)
but *not* against nested signatures referring to the same type variables.
- Explicit ``forall`` is not always required -- see :ref:`pattern signature equivalent pattern-equiv-form` for the example in this section, or :ref:`pattern-type-sigs` .
-
+ Explicit ``forall`` is not always required -- see :ref:`pattern signature equivalent <pattern-equiv-form>` for the example in this section, or :ref:`pattern-type-sigs`.
GHC supports *lexically scoped type variables*, without which some type
signatures are simply impossible to write. For example: ::
@@ -14810,19 +14812,6 @@ to be called at type ``T``:
However, sometimes there are no such calls, in which case the pragma can
be useful.
-Obsolete ``SPECIALIZE`` syntax
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-In earlier versions of GHC, it was possible to provide your own
-specialised function for a given type:
-
-::
-
- {-# SPECIALIZE hammeredLookup :: [(Int, value)] -> Int -> value = intLookup #-}
-
-This feature has been removed, as it is now subsumed by the ``RULES``
-pragma (see :ref:`rule-spec`).
-
.. _specialize-instance-pragma:
``SPECIALIZE`` instance pragma