[Add documentation for interactive examples simon.hengel@wiktory.org**20100412190916 Ignore-this: 6f58f9b4e80b7c434c9679246f760294 ] { hunk ./doc/haddock.xml 1412 - 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. hunk ./doc/haddock.xml 1471 +
+ 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 + +
+ + }