Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Clarify the drawbacks of unsafe functions

Open
#305 4 comments 4 reactions 0 assignees View on GitHub

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

documentation help-wanted

Hi, I'm opening this issue regarding the documentation of the following functions:
Screenshot from 2020-05-08 20-50-20


Nowhere in the module documentation or in those functions it is said clearly the fact that:

  • Given an empty vector, head will raise a runtime error;
  • unsafe functions 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 using unsafe functions (who are then closer than Rust’s unsafe than 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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from haskell/vector

All issues in haskell/vector

Similar issues

More Haskell issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.