Skip to content

Commit

Permalink
Update note on ghci multiline mode
Browse files Browse the repository at this point in the history
  • Loading branch information
albertodvp committed Jan 21, 2023
1 parent 0f4f7be commit 47c0898
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,5 +80,5 @@ haddock` or `stack haddock`.

The external docs are served by ReadTheDocs at
https://haskell-containers.readthedocs.io and live in the `docs/` directory. To
build the docs locally run `pip install sphinx sphinx-autobuild` to install the
build the docs locally run `pip install sphinx sphinx-autobuild sphinx_rtd_theme` to install the
dependencies, `git submodule update --init`, and then `cd docs/ && make html`.
6 changes: 4 additions & 2 deletions containers/docs/sequence.rst
Original file line number Diff line number Diff line change
Expand Up @@ -236,13 +236,15 @@ Let's do the same thing with sequences!

-- Imports the patterns to match on.
import Data.Sequence (Seq (Empty, (:<|), (:|>)))
import qualified Data.Sequence as Seq

case Seq.fromList [1, 2, 3] of
Empty -> "empty sequence"
x :<| xs -> "first:" ++ x ++ " rest:" ++ show xs
x :<| xs -> "first:" ++ show x ++ " rest:" ++ show xs
> "first:1 rest:fromList [2,3]"

.. NOTE:: You can't copy/paste this into GHCi because it's multiple lines.
.. NOTE:: You can copy/paste this into GHCi using the syntax for multi-line input ``:{ ... :}`` or by enabling `multiline mode
<https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/ghci.html#multiline-input>`_ ``:set +m``.

You can also take an element off the end::

Expand Down

0 comments on commit 47c0898

Please sign in to comment.