File: 0001-Fix-tests-on-32-bit-architectures.patch

package info (click to toggle)
ocaml-iter 1.9-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 328 kB
  • sloc: ml: 2,503; makefile: 39
file content (45 lines) | stat: -rw-r--r-- 1,336 bytes parent folder | download
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
From: =?utf-8?q?St=C3=A9phane_Glondu?= <glondu@debian.org>
Date: Sun, 14 Sep 2025 09:35:05 +0200
Subject: Fix tests on 32-bit architectures

---
 README.md | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/README.md b/README.md
index 4c8f158..d6b09be 100644
--- a/README.md
+++ b/README.md
@@ -6,8 +6,8 @@ Clean and efficient loop fusion for all your iterating needs!
 ```ocaml
 # #require "iter";;
 # let p x = x mod 5 = 0 in
-  Iter.(1 -- 5_000 |> filter p |> map (fun x -> x * x) |> fold (+) 0);;
-- : int = 8345837500
+  Iter.(1 -- 5_000 |> filter p |> map (fun x -> Int64.of_int (x * x)) |> fold Int64.add 0L);;
+- : int64 = 8345837500L
 ```
 
 `Iter` is a simple abstraction over `iter` functions
@@ -94,16 +94,16 @@ Instead, it can be more convenient and readable to
 use `Iter.(--) : int -> int -> int Iter.t`.
 
 ```ocaml
-# Iter.(1 -- 10_000_000 |> fold (+) 0);;
-- : int = 50000005000000
+# Iter.(1 -- 10_000_000 |> fold (fun a b -> Int64.(add a (of_int b))) 0L);;
+- : int64 = 50000005000000L
 
 # let p x = x mod 5 = 0 in
   Iter.(1 -- 5_000
     |> filter p
-    |> map (fun x -> x * x)
-    |> fold (+) 0
+    |> map (fun x -> Int64.of_int (x * x))
+    |> fold Int64.add 0L
   );;
-- : int = 8345837500
+- : int64 = 8345837500L
 ```
 
 **NOTE**: with _flambda_ under sufficiently strong