Skip to content

Clarify the drawbacks of unsafe functions #305

Open
@Kleidukos

Description

@Kleidukos

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions