Skip to content

Commit

Permalink
Fix reversed order of toRope
Browse files Browse the repository at this point in the history
  • Loading branch information
larshum committed Nov 9, 2023
1 parent b9ec7eb commit 7a08726
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions stdlib/seq.mc
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ let toRope = lam seq.
in
if isRope seq then seq else
let s = work [] seq in
-- NOTE(larshum, 2023-10-24): The below line ensures the rope is collapsed to
-- yield constant-time random accesses.
map (lam. ()) s;
s
-- NOTE(larshum, 2023-10-24): The below line ensures the elements of the rope
-- are in the right order, and it also collapses the rope (to ensure
-- constant-time random access).
reverse s

let toList = lam seq.
createList (length seq) (lam i. get seq i)
Expand Down

0 comments on commit 7a08726

Please sign in to comment.