haskell / haskell/filepath

Is it safe to use 'unsafeDupablePerformIO' for decoding/encoding?

Open
#163 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Haskell
Stars
74
Forks
38
PR merge metrics
No merged PRs in 30d

Description

In GitLab by @maerwald on Jul 17, 2022, 04:47

It is said that `unsafePerformIO` is single-threaded, but `unsafeDupablePerformIO` can break bracket-like functions. Yet, bytestring uses it with `unsafeWithForeignPtr`.

Similar discussion here https://github.com/haskell/unix/issues/157#issuecomment-1183965932

Use sites: https://gitlab.haskell.org/haskell/filepath/-/blob/c7d80e16e71bc1c85f4cd6158a96f2be6de64a1c/System/OsString/Common.hs#L113-124

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.