capnp v0.5.0.0 Release Notes

  • Serialization

    In Capnp.Untyped, The dataSection and ptrSection APIs have been โœ‚ removed. structDataSize has been replaced with structWordCount, and new functions structByteCount andstructPtrCount` have been added.


    ๐Ÿš€ This release brings some improvements to the RPC API:

    • โž• Add newPromiseClient for creating a promise-based client that can be fulfilled later.
    • ๐Ÿ‘‰ Make Client an instance of IsClient.
    • Previously, there were a number of functions that had two variants:
      • foo, which ran in IO
      • fooSTM, which ran in STM.

    Now there is just one variant, foo, which is polymorphic over MonadSTM, defined by the monad-stm package. There are instances of this class for IO, STM, and any monad transformer applied to an instance.

    Note that previously some of the foo variants were polymorphic over MonadIO. Unfortunately it is not possible to define a general instance MonadIO m => MonadSTM m, but for a particular mtl stack that has an instance of MonadIO, you can fix the problem by defining:

      instance MonadSTM MyStack where
          liftSTM = liftIO . liftSTM

    Or, you can add liftIO/liftSTM to the appropriate call sites.