summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXavier Denis <xldenis@gmail.com>2020-01-15 12:08:25 (GMT)
committerMarge Bot <ben+marge-bot@smart-cactus.org>2020-01-20 20:35:21 (GMT)
commit14bced999dc8c826a9a10dfd922dadf2d681ffe3 (patch)
tree10bb7d0e63057a47abad36a0b3ec8ee3d3afa7fb
parent2bfabd2282e9ced19a273aa94b5d8dd1a27d6bfa (diff)
downloadghc-14bced999dc8c826a9a10dfd922dadf2d681ffe3.zip
ghc-14bced999dc8c826a9a10dfd922dadf2d681ffe3.tar.gz
ghc-14bced999dc8c826a9a10dfd922dadf2d681ffe3.tar.bz2
Put the docs for :instances in alphabetical position
-rw-r--r--docs/users_guide/ghci.rst66
1 files changed, 33 insertions, 33 deletions
diff --git a/docs/users_guide/ghci.rst b/docs/users_guide/ghci.rst
index 2e5d1ed..21102c6 100644
--- a/docs/users_guide/ghci.rst
+++ b/docs/users_guide/ghci.rst
@@ -2483,6 +2483,39 @@ commonly used commands.
restriction (b), showing all instances that are in scope and mention
⟨name⟩ in their head.
+.. ghci-cmd:: :instances; ⟨type⟩
+
+ Displays all the class instances available to the argument ⟨type⟩.
+ The command will match ⟨type⟩ with the first parameter of every
+ instance and then check that all constraints are satisfiable.
+
+ When combined with :extension:`PartialTypeSignatures`, a user can insert
+ wildcards into a query and learn the constraints required of each
+ wildcard for ⟨type⟩ match with an instance.
+
+ The output is a listing of all matching instances, simplified and
+ instantiated as much as possible.
+
+ For example:
+
+ .. code-block:: none
+
+ > :instances Maybe (Maybe Int)
+ instance Eq (Maybe (Maybe Int)) -- Defined in ‘GHC.Maybe’
+ instance Ord (Maybe (Maybe Int)) -- Defined in ‘GHC.Maybe’
+ instance Show (Maybe (Maybe Int)) -- Defined in ‘GHC.Show’
+ instance Read (Maybe (Maybe Int)) -- Defined in ‘GHC.Read’
+
+ > :set -XPartialTypeSignatures -fno-warn-partial-type-signatures
+
+ > :instances Maybe _
+ instance Eq _ => Eq (Maybe _) -- Defined in ‘GHC.Maybe’
+ instance Semigroup _ => Monoid (Maybe _) -- Defined in ‘GHC.Base’
+ instance Ord _ => Ord (Maybe _) -- Defined in ‘GHC.Maybe’
+ instance Semigroup _ => Semigroup (Maybe _) -- Defined in ‘GHC.Base’
+ instance Show _ => Show (Maybe _) -- Defined in ‘GHC.Show’
+ instance Read _ => Read (Maybe _) -- Defined in ‘GHC.Read’
+
.. ghci-cmd:: :issafe; [⟨module⟩]
Displays Safe Haskell information about the given module (or the
@@ -2571,39 +2604,6 @@ commonly used commands.
The ``:loc-at`` command requires :ghci-cmd:`:set +c` to be set.
-.. ghci-cmd:: :instances; ⟨type⟩
-
- Displays all the class instances available to the argument ⟨type⟩.
- The command will match ⟨type⟩ with the first parameter of every
- instance and then check that all constraints are satisfiable.
-
- When combined with :extension:`PartialTypeSignatures`, a user can insert
- wildcards into a query and learn the constraints required of each
- wildcard for ⟨type⟩ match with an instance.
-
- The output is a listing of all matching instances, simplified and
- instantiated as much as possible.
-
- For example:
-
- .. code-block:: none
-
- > :instances Maybe (Maybe Int)
- instance Eq (Maybe (Maybe Int)) -- Defined in ‘GHC.Maybe’
- instance Ord (Maybe (Maybe Int)) -- Defined in ‘GHC.Maybe’
- instance Show (Maybe (Maybe Int)) -- Defined in ‘GHC.Show’
- instance Read (Maybe (Maybe Int)) -- Defined in ‘GHC.Read’
-
- > :set -XPartialTypeSignatures -fno-warn-partial-type-signatures
-
- > :instances Maybe _
- instance Eq _ => Eq (Maybe _) -- Defined in ‘GHC.Maybe’
- instance Semigroup _ => Monoid (Maybe _) -- Defined in ‘GHC.Base’
- instance Ord _ => Ord (Maybe _) -- Defined in ‘GHC.Maybe’
- instance Semigroup _ => Semigroup (Maybe _) -- Defined in ‘GHC.Base’
- instance Show _ => Show (Maybe _) -- Defined in ‘GHC.Show’
- instance Read _ => Read (Maybe _) -- Defined in ‘GHC.Read’
-
.. ghci-cmd:: :main; ⟨arg1⟩ ... ⟨argn⟩
When a program is compiled and executed, it can use the ``getArgs``