OSDN Git Service
(root)
/
happyabc
/
happyabc.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
fix instance/method link
[happyabc/happyabc.git]
/
base
/
tuple.ml
1
module T2 = struct
2
type ('a,'b) t = 'a * 'b
3
let map1 f (x,y) =
4
(f x,y)
5
let map2 f (x,y) =
6
(x,f y)
7
let fst =
8
Pervasives.fst
9
let snd =
10
Pervasives.snd
11
end
12
13
module T3 = struct
14
type ('a,'b,'c) t = 'a * 'b * 'c
15
let map1 f (x,y,z) =
16
(f x,y,z)
17
let map2 f (x,y,z) =
18
(x,f y,z)
19
let map3 f (x,y,z) =
20
(x,y,f z)
21
22
let fst (a,_,_) =
23
a
24
let snd (_,b,_) =
25
b
26
let trd (_,_,c) =
27
c
28
end