haskell / haskell/os-string

Clarify unsafety

Open
#38 1 comment 0 reactions 0 assignees View on GitHub
documentation
Dominant language
Haskell
Stars
7
Forks
13
PR merge metrics
No merged PRs in 30d

Description

`unsafeEncodeUtf` only throws a (pure) exception on invalid input. This is not unsafe in the same way as e.g. `unsafePerformIO`, which can cause undefined behaviour. Other functions that also throw pure exceptions (like `head`) are documented as partial (which is more correct in my opinion).

`unsafeFromChar` only truncates its input. In what way is this unsafe? Can it cause undefined behaviour?

I think the documentation for these functions should be clarified.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.