Skip to content

Commit

Permalink
Merge pull request #901 from albertodvp/master
Browse files Browse the repository at this point in the history
Update docs: note on ghci multiline mode
  • Loading branch information
treeowl authored Jan 21, 2023
2 parents 0f4f7be + 47c0898 commit 49302ec
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 49302ec

Please sign in to comment.