[commit: ghc] master: Documentation tweaks (4caad16)
git at git.haskell.org
git at git.haskell.org
Fri Sep 7 11:53:40 UTC 2018
Repository : ssh://git@git.haskell.org/ghc
On branch : master
Link : http://ghc.haskell.org/trac/ghc/changeset/4caad1660a641995caee3ee6da6fee4a93ee99b5/ghc
>---------------------------------------------------------------
commit 4caad1660a641995caee3ee6da6fee4a93ee99b5
Author: Krzysztof Gogolewski <krz.gogolewski at gmail.com>
Date: Fri Sep 7 13:53:11 2018 +0200
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
>---------------------------------------------------------------
4caad1660a641995caee3ee6da6fee4a93ee99b5
docs/users_guide/glasgow_exts.rst | 25 +++++++------------------
1 file changed, 7 insertions(+), 18 deletions(-)
diff --git a/docs/users_guide/glasgow_exts.rst b/docs/users_guide/glasgow_exts.rst
index 4659351..ead020c 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
More information about the ghc-commits
mailing list