HORIZON HASKELLDocslts/ghc-9.10.x248f8f02026-10-05Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · 248f8f0 · 2026-10-05

Moduleproto-lens-0.7.1.5Haskell2010

Data.ProtoLens.Encoding.Parser.Unsafe

  • 1 value
valueunsafeLiftIO :: IO a -> Parser a
#

Runs an arbitrary IO action inside a Parser. The generated code uses this function to construct vectors efficiently by incrementally building up mutable vectors.

NOTE: This is unsafe since runParser is a pure function, which lets us lift arbitrary IO into pure operations. However, here are some guarantees that we do get:

  • For each individual call to runParser, the action wrapped by unsafeLiftIO will be called exactly once.

  • Different calls to unsafeLiftIO within the same call to runParser will be sequenced according to their order in the Parser monad.