Commit 70b5eefe authored by Ben Gamari's avatar Ben Gamari 🐢 Committed by Marge Bot

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.
parent 35113117
......@@ -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
......
......@@ -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⟩
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment