HORIZON HASKELLDocslts/ghc-9.10.xc74966e2026-09-27Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · c74966e · 2026-09-27

Moduleeffectful-core-2.3.0.1Haskell2010

Effectful.Dispatch.Static.Unsafe

Unsafe utilities for statically dispatched effects.

  • 2 values
valuereallyUnsafeLiftMapIO :: (IO a -> IO b) -> Eff es a -> Eff es b
#

Utility for lifting IO computations of type

IO a -> IO b

to

Eff es a -> Eff es b

This function is really unsafe because:

  • It can be used to introduce arbitrary IO actions into pure Eff computations.

  • The IO computation must run its argument in a way that's perceived as sequential to the outside observer, e.g. in the same thread or in a worker thread that finishes before the argument is run again.

Warning: if you disregard the second point, you will experience weird bugs, data races or internal consistency check failures.

When in doubt, use unsafeLiftMapIO, especially since this version saves only a simple safety check per call of reallyUnsafeLiftMapIO f.

valuereallyUnsafeUnliftIO :: ((forall r. Eff es r -> IO r) -> IO a) -> Eff es a
#

Create an unlifting function.

This function is really unsafe because:

  • It can be used to introduce arbitrary IO actions into pure Eff computations.

  • Unlifted Eff computations must be run in a way that's perceived as sequential to the outside observer, e.g. in the same thread as the caller of reallyUnsafeUnliftIO or in a worker thread that finishes before another unlifted computation is run.

Warning: if you disregard the second point, you will experience weird bugs, data races or internal consistency check failures.

When in doubt, use unsafeSeqUnliftIO, especially since this version saves only a simple safety check per call of the unlifting function.