@@ -62,11 +62,11 @@ let string_op impl pure : located_primitive * Types.datatype * pure =
62
62
63
63
let numeric_op impli implf purei puref : located_primitive * Types.datatype * pure =
64
64
(`PFun (fun _ args -> match args with
65
- | [x; y] ->
65
+ | [x; y] ->
66
66
(match (x,y) with
67
67
| (`Int _ , `Int _ ) -> Lwt. return (`Int (impli (Value. unbox_int x) (Value. unbox_int y)))
68
68
| (`Float _ , `Float _ ) -> Lwt. return (`Float (implf (Value. unbox_float x) (Value. unbox_float y)))
69
- | _ -> raise (runtime_type_error " type error in numeric operation" ))
69
+ | _ -> raise (runtime_type_error " type error in numeric operation" ))
70
70
| _ -> raise (internal_error " arity error in numeric operation" ))),
71
71
datatype " (a::Numeric, a) -> a" ,
72
72
F2 (fun l r -> match (l, r) with
@@ -260,13 +260,13 @@ let env : (string * (located_primitive * Types.datatype * pure)) list = [
260
260
261
261
" ^^" , string_op ( ^ ) PURE ;
262
262
263
- (* moved abs to make use of ad hoc ability,
264
- ideally there could be a way to bootstrap prelude similar to #786 *)
263
+ (* moved abs to make use of ad hoc ability,
264
+ ideally there could be a way to bootstrap Prelude similar to #786 *)
265
265
" abs" ,
266
266
(p1 (fun n -> match n with
267
267
| `Int _ -> Value. box_int ( let x = (Value. unbox_int n) in if x > 0 then x else - x )
268
268
| `Float _ -> Value. box_float ( let x = (Value. unbox_float n) in if x > 0.0 then x else -. x )
269
- | _ -> raise (runtime_type_error (" Cannot computer absolute value: " ^ Value. string_of_value n))),
269
+ | _ -> raise (runtime_type_error (" Cannot computer absolute value: " ^ Value. string_of_value n))),
270
270
datatype " (a::Numeric) -> a" ,
271
271
PURE );
272
272
@@ -763,7 +763,7 @@ let env : (string * (located_primitive * Types.datatype * pure)) list = [
763
763
(p1 (fun n -> match n with
764
764
| `Int _ -> Value. box_int (- (Value. unbox_int n))
765
765
| `Float _ -> Value. box_float (-. (Value. unbox_float n))
766
- | _ -> raise (runtime_type_error (" Cannot negate: " ^ Value. string_of_value n))),
766
+ | _ -> raise (runtime_type_error (" Cannot negate: " ^ Value. string_of_value n))),
767
767
datatype " (a::Numeric) -> a" ,
768
768
PURE );
769
769
0 commit comments