-
Notifications
You must be signed in to change notification settings - Fork 139
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve "uninitialised element" error message #231
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…ement' error message Compaction of an immutable vector may crash with the confusing 'uninitialised element' error message (haskell#220). The workaround is to use the 'force' function.
Thanks! I’ll go over this and merge it in soonish.
…On Wed, Dec 12, 2018 at 9:18 AM Alexey Kiryushin ***@***.***> wrote:
Compaction (
http://hackage.haskell.org/package/ghc-compact-0.1.0.0/docs/GHC-Compact.html#v:compact)
of an immutable vector may crash with the confusing "uninitialised element"
error message #220 <#220>:
module Main where
import qualified Data.Vector as Vimport GHC.Compact
main :: IO ()
main = do
c <- compact $ V.fromList [1, 2, 3]
pure ()
*** Exception: Data.Vector.Mutable: uninitialised element
As far as I understand, there is no simple way to fix this. However, there
is an easy workaround: use the force function.
This code doesn't crash:
c <- compact $ V.force $ V.fromList [1, 2, 3]
The PR adds a suggestion to use the force function in the error message.
------------------------------
You can view, comment on, or merge this pull request online at:
#231
Commit Summary
- Add a suggestion to use the 'force' function in the 'uninitialised
element' error message
File Changes
- *M* Data/Vector/Mutable.hs
<https://github.com/haskell/vector/pull/231/files#diff-0> (2)
Patch Links:
- https://github.com/haskell/vector/pull/231.patch
- https://github.com/haskell/vector/pull/231.diff
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#231>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAAQwnVKCUh5Q4IpqLDA-TJauVFPjmrfks5u4RBFgaJpZM4ZPh5N>
.
|
Is this still mergable? It would help a user of both |
I’ll takw a look now.
…On Tue, Jul 9, 2019 at 1:37 PM recursion-ninja ***@***.***> wrote:
Is this still mergable?
It would help with a user of both vector & compact packages with
debugging diognostics.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#231?email_source=notifications&email_token=AAABBQWE2TJRRH5PROJHHBDP6TEETA5CNFSM4GJ6DZG2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODZQ7M4Q#issuecomment-509736562>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAABBQTSEWIUJXWK3H3QX4LP6TEETANCNFSM4GJ6DZGQ>
.
|
I wish this PR were merged and released. Would've saved us many hours of debugging. |
Please add it to the release checklist ticket if it’s not merged into
master already and I’ll get to it shortly.
…On Wed, Jan 15, 2020 at 3:15 AM Enis Bayramoğlu ***@***.***> wrote:
I wish this PR were merged and released. Would've saved us many hours of
debugging.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#231?email_source=notifications&email_token=AAABBQW775RJA4K5GGEG6E3Q53AZLA5CNFSM4GJ6DZG2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEI7OBMI#issuecomment-574546097>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAABBQSJVCYGDV62ZGBEFFLQ53AZLANCNFSM4GJ6DZGQ>
.
|
Closed
Thanks, I believe that's what you meant. |
Thanks, I've lost well over 40 man-hours getting bitten by this multiple times, usually in a trasitive dependency. It will be nice to get a moderately useful error message. |
nh2
added a commit
to nh2/vector
that referenced
this pull request
Aug 11, 2020
Follow-up to PR haskell#231. Users could easily be misled that it's `Control.DeepSeq.force`, not `Data.Vector.force`, and the former does not fix the issue at all.
nh2
added a commit
to nh2/vector
that referenced
this pull request
Aug 11, 2020
Follow-up to PR haskell#231. Users could easily be misled that it's `Control.DeepSeq.force`, not `Data.Vector.force`, and the former does not fix the issue at all.
lehins
pushed a commit
that referenced
this pull request
Jan 16, 2021
Follow-up to PR #231. Users could easily be misled that it's `Control.DeepSeq.force`, not `Data.Vector.force`, and the former does not fix the issue at all.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Compaction (http://hackage.haskell.org/package/ghc-compact-0.1.0.0/docs/GHC-Compact.html#v:compact) of an immutable vector may crash with the confusing "uninitialised element" error message #220:
As far as I understand, there is no simple way to fix this. However, there is an easy workaround: use the
force
function.This code doesn't crash:
The PR adds a suggestion to use the
force
function in the error message.