Skip to content

Add atomicModifyIORef_ and atomicModifyIORef'_ #294

@chshersh

Description

@chshersh

Relude already offers lifted versions of atomicModifyIORef and atomicModifyIORef' functions. But these functions often used with () in the second place of tuple. See example in hintman:

The new functions were proposed to be added to base but they haven't landed:

I propose to implement them by ourselves. And if they ever going to be implemented in base, we can easily reexport them.

The type signatures:

atomicModifyIORef_  :: MonadIO m => IORef a -> (a -> a) -> m ()
atomicModifyIORef'_ :: MonadIO m => IORef a -> (a -> a) -> m ()

Metadata

Metadata

Assignees

Labels

newBring something new into library (add function or type or interface)

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions