Commits

Dmitry Grebeniuk  committed f840cd6

Subarray.fold bug fixed

  • Participants
  • Parent commits 80b6a8c

Comments (0)

Files changed (1)

 value length s = s.len
 ;
 
+value get s i =
+  if i < 0 || i >= s.len
+  then invalid_arg "Subarray.get"
+  else s.arr.(s.ofs + i)
+;
+
 value empty = C.empty;
 
 open C;
         inner
           ~i:(i + stp)
           ~left:(left - 1)
-          ~cur:(func init s.arr.(i))
+          ~cur:(func cur s.arr.(i))
 ;
 
 value to_list s =