A poor man's concurrency monad
暂无分享,去创建一个
Without adding any primitives to the language, we define a concurrency monad transformer in Haskell. This allows us to add a limited form of concurrency to any existing monad. The atomic actions of the new monad are lifted actions of the underlying monad. Some extra operations, such as fork, to initiate new processes, are provided. We discuss the implementation, and use some examples to illustrate the usefulness of this construction.
[1] Paul Hudak,et al. Monad transformers and modular interpreters , 1995, POPL '95.
[2] Simon Peyton Jones,et al. Type classes: an exploration of the design space , 1997 .
[3] Simon L. Peyton Jones,et al. Concurrent Haskell , 1996, POPL '96.