}
}
{{Documentation|content=This template is used for Haskell (source) examples in Haskell books.
If you want do display GHCi transcripts use HaskellGHCi or HaskellGHCiExample.
This template is also used if you want do display Haskell source code examples; in this
case use the ...
tags as shown below (it's not possible to use a custom template for source code
 in template context
which is used by Haskell guards).
Source only example:
{{HaskellExample|1=The abs function.|2=
abs x
    | x < 0     = 0 - x
    | otherwise = x
Is rendered as:
{{HaskellExample|1=The abs function.|2=
abs x
    | x < 0     = 0 - x
    | otherwise = x
Another example:
{{HaskellExample|1=The signum function.|2=
mySignum x =
    if x < 0 then 
        -1
    else if x > 0 then 
        1
    else 
        0
You can experiment with this as:
{{HaskellGHCi|1=
1
0
-1
-1
Is rendered as:
{{HaskellExample|1=The signum function.|2=
mySignum x =
    if x < 0 then 
        -1
    else if x > 0 then 
        1
    else 
        0
You can experiment with this as:
{{HaskellGHCi|1=
1
0
-1
-1
} would get displayed.
Template:HaskellExample