Skip to content

Commit

Permalink
Add a suggestion to use the 'force' function in the 'uninitialised el…
Browse files Browse the repository at this point in the history
…ement' error message (#231)

Compaction of an immutable vector may crash with the confusing 'uninitialised element' error message (#220). The workaround is to use the 'force' function.
  • Loading branch information
alexwl authored and cartazio committed Jan 16, 2020
1 parent c8d2d94 commit fd35bac
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Data/Vector/Mutable.hs
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ loopM !n k = let
in go 0

uninitialised :: a
uninitialised = error "Data.Vector.Mutable: uninitialised element"
uninitialised = error "Data.Vector.Mutable: uninitialised element. If you are trying to compact a vector, use the 'force' function to remove uninitialised elements from the underlying array."

-- Length information
-- ------------------
Expand Down

0 comments on commit fd35bac

Please sign in to comment.