Branch
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56
<h2>Comments</h2>
<pre><code>-- Single line comment
{- Multi-line
comment -}</code></pre>
<h2>Strings and characters</h2>
<pre><code>'a'
'\n'
'\^A'
'\^]'
'\NUL'
'\23'
'\o75'
'\xFE'</code></pre>
<h2>Numbers</h2>
<pre><code>42
123.456
123.456e-789
1e+3
0o74
0XAF</code></pre>
<h2>Larger example</h2>
<pre><code>module Main
import Data.Vect
-- this is comment
record Person where
constructor MkPerson2
age : Integer
name : String
||| identity function
id : a -> a
id x = x
{-
Bool type can be defined in
userland
-}
data Bool = True | False
implementation Show Bool where
show True = "True"
show False = "False"
not : Bool -> Bool
not b = case b of
True => False
False => True
vect3 : Vect 3 Int
vect3 = with Vect (1 :: 2 :: 3 :: Nil)
</code></pre>