From 7f647a811bdf40de168428faeccb549ccf56804c Mon Sep 17 00:00:00 2001 From: "simon.hengel" Date: Mon, 12 Apr 2010 19:09:16 +0000 Subject: Add documentation for interactive examples --- doc/haddock.xml | 38 ++++++++++++++++++++++++++++++++------ 1 file changed, 32 insertions(+), 6 deletions(-) (limited to 'doc') diff --git a/doc/haddock.xml b/doc/haddock.xml index 680f7980..b779f835 100644 --- a/doc/haddock.xml +++ b/doc/haddock.xml @@ -1409,12 +1409,15 @@ module A where one of these special characters, precede it with a backslash (\). - Additionally, the character > has - a special meaning at the beginning of a line, and the - following characters have special meanings at the beginning of - a paragraph: - *, -. These characters - can also be escaped using \. + Additionally, the character > and + the character sequence ghci> have special + meanings at the beginning of a line. The following characters + have special meanings at the beginning of a paragraph: + *, -. The single + characters can also be escaped using \. To + get a literal ghci> at the beginning of a + line, prefix the > with a + backslash.
@@ -1465,6 +1468,29 @@ module A where interprets markup as normal inside the code block.
+
+ Interactive Examples + + Haddock has markup support for interactive examples, that + illustrate the use of source constructs in a + read-eval-print loop (REPL). An + interactive example is introduced with + ghci> followed by an expression followed + by zero or more result lines: + + +-- | Two examples are given bellow: +-- +-- ghci> fib 10 +-- 55 +-- +-- ghci> putStrLn "foo\nbar" +-- foo +-- bar + +
+ +
Hyperlinked Identifiers -- cgit v1.2.3