forked from miking-lang/miking
-
Notifications
You must be signed in to change notification settings - Fork 0
/
math-ext.ext-ocaml.mc
34 lines (32 loc) · 1.02 KB
/
math-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
include "map.mc"
include "ocaml/ast.mc"
let impl = lam arg : { expr : String, ty : Type }.
{ expr = arg.expr, ty = arg.ty, libraries = [], cLibraries = [] }
let mathExtMap =
use OCamlTypeAst in
mapFromSeq cmpString [
("externalExp", [
impl { expr = "Float.exp", ty = tyarrow_ tyfloat_ tyfloat_ }
]),
("externalLog", [
impl { expr = "Float.log", ty = tyarrow_ tyfloat_ tyfloat_ }
]),
("externalAtan", [
impl { expr = "Float.atan", ty = tyarrow_ tyfloat_ tyfloat_ }
]),
("externalSin", [
impl { expr = "Float.sin", ty = tyarrow_ tyfloat_ tyfloat_ }
]),
("externalCos", [
impl { expr = "Float.cos", ty = tyarrow_ tyfloat_ tyfloat_ }
]),
("externalAtan2", [
impl { expr = "Float.atan2", ty = tyarrows_ [tyfloat_, tyfloat_, tyfloat_] }
]),
("externalPow", [
impl { expr = "Float.pow", ty = tyarrows_ [tyfloat_, tyfloat_, tyfloat_] }
]),
("externalSqrt", [
impl { expr = "Float.sqrt", ty = tyarrow_ tyfloat_ tyfloat_ }
])
]