Debian Codegraph @

test/syntax/source/code/fsharp

raw
1 open System
2
3 // Single line comment...
4 (*
5 This is a
6 multiline comment.
7 *)
8 let checkList alist =
9 match alist with
10 | [] -> 0
11 | [a] -> 1
12 | [a; b] -> 2
13 | [a; b; c] -> 3
14 | _ -> failwith "List is too big!"
15
16
17 let text = "Some text..."
18 let text2 = @"A ""verbatim"" string..."
19 let catalog = """
20 Some "long" string...
21 """
22
23 let rec fib x = if x <= 2 then 1 else fib(x-1) + fib(x-2)
24
25 let fibs =
26 Async.Parallel [ for i in 0..40 -> async { return fib(i) } ]
27 |> Async.RunSynchronously
28
29 type Sprocket(gears) =
30 member this.Gears : int = gears
31
32 [<AbstractClass>]
33 type Animal =
34 abstract Speak : unit -> unit
35
36 type Widget =
37 | RedWidget
38 | GreenWidget
39
40 type Point = {X: float; Y: float;}
41
42 [<Measure>]
43 type s
44 let minutte = 60<s>
45
46 type DefaultMailbox<'a>() =
47 let mutable inbox = ConcurrentQueue<'a>()
48 let awaitMsg = new AutoResetEvent(false)