Template:HaskellGHCiExample

From Wikibooks, open books for an open world
Jump to: navigation, search

Example: {{{1}}}

{{{2}}}
Template documentation

This template is used for Haskell GHCi transcript examples in Haskell books.

The content is automatically colored following Template:HaskellGHCi.

If you want to display Haskell code examples use Template:HaskellExample.

Example:

{{HaskellGHCiExample|1=Source example|2=
Prelude> let f a b = a * b
Prelude> f 3 5
15
Prelude> 
}}

Is rendered as:

Example: Source example

Prelude> let f a b = a * b
Prelude> f 3 5
15
Prelude>

The |1= and |2= are necessary as the text may contain equal signs. Otherwise just {{{1}}} would get displayed.