forked from rescript-lang/rescript
-
Notifications
You must be signed in to change notification settings - Fork 0
/
bang_primitive.ml
49 lines (34 loc) · 922 Bytes
/
bang_primitive.ml
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
46
47
48
49
(*
external log : 'a -> unit = "#console.log"
external log2 : 'a -> unit = "#console.log"
let f x =
log x;
log2 x
*)
external xx : 'a -> string = "#anything_to_string"
external lt : 'a -> 'a -> bool = "#unsafe_lt"
external le : 'a -> 'a -> bool = "#unsafe_le"
external gt : 'a -> 'a -> bool = "#unsafe_gt"
external ge : 'a -> 'a -> bool = "#unsafe_ge"
external eq : 'a -> 'a -> bool = "#unsafe_eq"
external neq : 'a -> 'a -> bool = "#unsafe_neq"
let test x y=
lt x y,
le x y,
gt x y,
ge x y,
eq x y,
neq x y
(*
external append : 'a array -> 'a array -> 'a array = "#array_append"
let f x y = append x y
*)
external of_small_int_array :
(_ [@bs.as {json|null|json}] ) ->
int array -> string =
"String.fromCharCode.apply"
[@@bs.val]
(* external string_of_char : char -> string = "#string_of_char" *)
(* string_of_char y *)
let f x y =
of_small_int_array x, 0