| Safe Haskell | Safe |
|---|---|
| Language | Haskell2010 |
Data.ProtoLens.Encoding.Parser.Unsafe
Synopsis
- unsafeLiftIO :: IO a -> Parser a
Documentation
unsafeLiftIO :: IO a -> Parser a Source #
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 byunsafeLiftIOwill be called exactly once. - Different calls to
unsafeLiftIOwithin the same call torunParserwill be sequenced according to their order in the Parser monad.