From fd35bac4b2d67d2639cf9249b1f187a523d06151 Mon Sep 17 00:00:00 2001 From: Alexey Kiryushin <alexey.a.kiryushin@gmail.com> Date: Thu, 16 Jan 2020 21:35:01 +0300 Subject: [PATCH] Add a suggestion to use the 'force' function in the 'uninitialised element' 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. --- Data/Vector/Mutable.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Data/Vector/Mutable.hs b/Data/Vector/Mutable.hs index f346bc0..8891889 100644 --- a/Data/Vector/Mutable.hs +++ b/Data/Vector/Mutable.hs @@ -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 -- ------------------ -- GitLab