forked from Brucegatete/lab4
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsam.ml
More file actions
37 lines (27 loc) · 760 Bytes
/
sam.ml
File metadata and controls
37 lines (27 loc) · 760 Bytes
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
(*
A collection of statements contained in a "Sam" module.
*)
type info = {
hometown : string;
house : string;
year : int;
concentration : string
}
let least_favorite_function = (land)
let rec info = {
hometown = hometown;
house = house;
year = 2017;
concentration = "Computer Science"
}
and hometown = "New York, New York"
and house = "Cabot"
let grade_assignment assignment =
"Everyone gets -1/-1 for pset " ^ string_of_int assignment ^ ">:-?"
let favorite_function x y =
log x +. log y +. float_of_string "0x74686563616b656973616c6965";;
let print_info = fun _ ->
print_string (info.house ^ "\n" ^ info.hometown ^ "\n" ^
string_of_int info.year ^ "\n" ^ info.concentration)
let f = ( * )
let fold = List.fold_right f