Clarify the drawbacks of unsafe functions
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 35/100
- Issue type
- Documentation
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- haskell
- Domain
- documentation
Research direction
Start with the module documentation and the documentation for the head and unsafe functions mentioned in the issue. Verify how an empty vector passed to head behaves and how the unsafe functions fail; the documentation is done when it clearly warns about the runtime error and possible segmentation fault.
Written by the indexing model from the issue text.
Description
Hi, I'm opening this issue regarding the documentation of the following functions:

Nowhere in the module documentation or in those functions it is said clearly the fact that:
- Given an empty vector,
headwill raise a runtime error; unsafefunctions do not lead to RTS exceptions (like they may do in other container-like APIs), but will segfault the program. Beginners and more generally people who did not experience this behaviour first-hand are in no way warned of the implications of usingunsafefunctions (who are then closer than Rust’sunsafethan the commonly accepted definition of safety in the Haskell ecosystem).
I personally think it is dangerous to leave such gaps in the documentation and wanted to discuss this with the maintainers before opening a PR to rectify this.
cc @cartazio
- Dominant language
- Haskell
- Stars
- 401
- Forks
- 145
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from haskell/vector
-
Difficulty 1/5 Under an hour Newbie friendliness 68/100
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
-
Difficulty 3/5 1-2 days Newbie friendliness 55/100
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
Similar issues
-
documentation
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
-
enhancement tricorder
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
-
zip-archive-0.5 Open
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
commercialhaskell/stackage#8124 · 1 comment ·
-
chore
Difficulty 1/5 Under an hour Newbie friendliness 91/100
alunduil/alunduil-chezmoi#792 ·