[Git][ghc/ghc][wip/fix-users-guide] users-guide: Fix a few markup issues
Ben Gamari
gitlab at gitlab.haskell.org
Tue Jun 11 04:32:43 UTC 2019
Ben Gamari pushed to branch wip/fix-users-guide at Glasgow Haskell Compiler / GHC
Commits:
785ce626 by Ben Gamari at 2019-06-11T04:32:22Z
users-guide: Fix a few markup issues
Strangely these were only causing the build to fail in the aarch64-linux
job, despite Sphinx throwing errors in all jobs I checked.
Also changes some `#ifdef`s to `#if defined` to satisfy the linter.
- - - - -
2 changed files:
- docs/users_guide/ffi-chap.rst
- docs/users_guide/ghci.rst
Changes:
=====================================
docs/users_guide/ffi-chap.rst
=====================================
@@ -87,7 +87,7 @@ Newtype wrapping of the IO monad
The FFI spec requires the IO monad to appear in various places, but it
can sometimes be convenient to wrap the IO monad in a ``newtype``, thus: ::
- newtype MyIO a = MIO (IO a)
+ newtype MyIO a = MIO (IO a)
(A reason for doing so might be to prevent the programmer from calling
arbitrary IO procedures in some part of the program.)
@@ -112,15 +112,15 @@ The type variables in the type of a foreign declaration may be quantified with
an explicit ``forall`` by using the :extension:`ExplicitForAll` language
extension, as in the following example: ::
- {-# LANGUAGE ExplicitForAll #-}
- foreign import ccall "mmap" c_mmap :: forall a. CSize -> IO (Ptr a)
+ {-# LANGUAGE ExplicitForAll #-}
+ foreign import ccall "mmap" c_mmap :: forall a. CSize -> IO (Ptr a)
Note that an explicit ``forall`` must appear at the front of the type signature
and is not permitted to appear nested within the type, as in the following
(erroneous) examples: ::
- foreign import ccall "mmap" c_mmap' :: CSize -> forall a. IO (Ptr a)
- foreign import ccall quux :: (forall a. Ptr a) -> IO ()
+ foreign import ccall "mmap" c_mmap' :: CSize -> forall a. IO (Ptr a)
+ foreign import ccall quux :: (forall a. Ptr a) -> IO ()
.. _ffi-prim:
@@ -372,7 +372,7 @@ program. Here's the C code:
#include <stdio.h>
#include "HsFFI.h"
- #ifdef __GLASGOW_HASKELL__
+ #if defined(__GLASGOW_HASKELL__)
#include "Foo_stub.h"
#endif
@@ -391,7 +391,7 @@ program. Here's the C code:
}
We've surrounded the GHC-specific bits with
-``#ifdef __GLASGOW_HASKELL__``; the rest of the code should be portable
+``#if defined(__GLASGOW_HASKELL__)``; the rest of the code should be portable
across Haskell implementations that support the FFI standard.
The call to ``hs_init()`` initializes GHC's runtime system. Do NOT try
@@ -435,7 +435,7 @@ GHC-specific API instead of ``hs_init()``:
#include <stdio.h>
#include "HsFFI.h"
- #ifdef __GLASGOW_HASKELL__
+ #if defined(__GLASGOW_HASKELL__)
#include "Foo_stub.h"
#include "Rts.h"
#endif
=====================================
docs/users_guide/ghci.rst
=====================================
@@ -2582,21 +2582,22 @@ commonly used commands.
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’
+
+ > :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⟩
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/commit/785ce6263367184ea5251cd9f5784e23d9b349d3
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/commit/785ce6263367184ea5251cd9f5784e23d9b349d3
You're receiving this email because of your account on gitlab.haskell.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20190611/6213927f/attachment-0001.html>
More information about the ghc-commits
mailing list