effectful-core-2.2.2.0: An easy to use, performant extensible effects library.
Safe HaskellNone
LanguageHaskell2010

Effectful.Internal.Utils

Synopsis

Documentation

weakThreadId :: ThreadId -> Int Source #

Get an id of a thread that doesn't prevent its garbage collection.

eqThreadId :: ThreadId -> ThreadId -> Bool Source #

Eq instance for ThreadId is broken in GHC < 9, see https://gitlab.haskell.org/ghc/ghc/-/issues/16761 for more info.

Strict IORef

data IORef' a Source #

A strict variant of IORef.

newIORef' :: a -> IO (IORef' a) Source #

writeIORef' :: IORef' a -> a -> IO () Source #

Strict MVar

data MVar' a Source #

A strict variant of MVar.

toMVar' :: MVar a -> IO (MVar' a) Source #

newMVar' :: a -> IO (MVar' a) Source #

modifyMVar' :: MVar' a -> (a -> IO (a, r)) -> IO r Source #

modifyMVar_' :: MVar' a -> (a -> IO a) -> IO () Source #

Utils for Any

type family Any :: k where ... #

The type constructor Any is type to which you can unsafely coerce any lifted type, and back. More concretely, for a lifted type t and value x :: t, -- unsafeCoerce (unsafeCoerce x :: Any) :: t is equivalent to x.

toAny :: a -> Any Source #