forked from miking-lang/miking
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathasync-ext.ext-ocaml.mc
45 lines (42 loc) · 1.12 KB
/
async-ext.ext-ocaml.mc
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
include "ocaml/ast.mc"
let asyncExtMap =
use OCamlTypeAst in
mapFromSeq cmpString
[
("asyncSleepSec", [
{ expr = "Lwt_unix.sleep",
ty = tyarrows_ [tyfloat_, otyvarext_ "'a Lwt.t" []],
libraries = ["lwt.unix"],
cLibraries = []
}
]),
("asyncRun", [
{ expr = "Lwt_main.run",
ty = tyarrows_ [otyvarext_ "'a Lwt.t" [], otyvarext_ "'a" []],
libraries = ["lwt.unix"],
cLibraries = []
}
]),
("asyncBind", [
{ expr = "Lwt.bind",
ty = tyarrows_ [otyvarext_ "'a Lwt.t" [],
(tyarrows_ [otyvarext_ "'a" [], otyvarext_ "'b Lwt.t" []]), otyvarext_ "'b Lwt.t" []],
libraries = ["lwt.unix"],
cLibraries = []
}
]),
("asyncPrint", [
{ expr = "Lwt_io.print",
ty = tyarrows_ [otystring_ , otyvarext_ "unit Lwt.t" []],
libraries = ["lwt.unix"],
cLibraries = []
}
]),
("asyncReturn", [
{ expr = "Lwt.return",
ty = tyarrows_ [otyvarext_ "'a" [], otyvarext_ "'a Lwt.t" []],
libraries = ["lwt.unix"],
cLibraries = []
}
])
]