Copyright | © 2021 Evan Relf |
---|---|
License | BSD-3-Clause |
Maintainer | evan@evanrelf.com |
Stability | experimental |
Safe Haskell | None |
Language | Haskell2010 |
Synopsis
- type Server msg a = Process (Envelope msg) a
- data Envelope (msg :: Type -> Type) where
- cast :: Address (Envelope msg) -> msg () -> Process _msg ()
- call :: HasMsg res => Address (Envelope msg) -> msg res -> Process _msg res
- handle :: (forall res. msg res -> Process _msg res) -> Envelope msg -> Process _msg ()
Documentation
data Envelope (msg :: Type -> Type) where Source #
Wrapper around higher-kinded message types, to make them compatible with
the lower-level Process
machinery.
Higher-kinded message types are defined as GADTs with a type parameter. This allows specifying the response type for messages.
Since: 0.3.0.0
Send a message to another process, expecting no response. Returns immediately without blocking.
Since: 0.3.0.0