14let add'' : int -> int -> int = fun x -> fun y -> x + y
16let unwrap_option default opt =
21let string_of_bool = function true -> "true" | false -> "false"
27let _ = Printf.printf "%s" "hello"
28let () = Printf.printf "%s\n" "world"
33type my_bool = True | False
35type shape = Circle of float | Square of float | Rectangle of (float * float)
42type 'a my_ref = { mutable ref_value : 'a }
44let (:=) r v = r.ref_value <- v
48exception Bad_value of string
50let bad_value_error () = raise (Bad_value "your value is bad and you should feel bad")
53 try bad_value_error ()
54 with Bad_value _ -> ()
57 try bad_value_error ()
66module Foo : FOO = struct
71 val greeting = "Hello"
72 method greet name = Printf.sprintf "%s, %s!" greeting name
75let greeting = greeter#greet "world"
77class greeter_factory greeting_text = object (self)
78 val greeting = greeting_text
79 method greet name = Printf.sprintf "%s, %s!" greeting name
80 initializer Printf.printf "Objects will greet the user with \"%s\"\n" greeting
83let g = new greeter_factory "Hi"
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list