The remote-monad package

[maintain]

An implementation of the concepts behind Remote Monads. There is support for various bundling strategies.

{-# LANGUAGE GADTs #-}
{-# LANGUAGE KindSignatures #-}

module Main where

import Control.Remote.Monad
import Control.Remote.Monad.Packet.Weak

data Command :: * where
  Say :: String -> Command

data Procedure :: * -> * where
  Temperature :: Procedure Int

say :: String -> RemoteMonad Command Procedure ()
say s = command (Say s)

temperature :: RemoteMonad Command Procedure Int
temperature = procedure Temperature

runWP :: WeakPacket Command Procedure a -> IO a
runWP (Command (Say s))  = print s
runWP (Procedure Temperature) = return 42

send :: RemoteMonad Command Procedure a -> IO a
send m = runMonad runWP m

main = send $ do
  say "Howdy doodly do"
  say "How about a muffin?"
  t <- temperature
  say (show t ++ "F")

Properties

Versions0.1.0.0, 0.1.0.1, 0.1.0.1, 0.2
Dependenciesbase (>=4.7 && <5), natural-transformation (==0.3.*), transformers (>=0.4 && <0.6) [details]
LicenseBSD3
Copyright(c) 2016 The University of Kansas
AuthorAndy Gill, Justin Dawson
Maintainerandygill@ku.edu
CategoryControl
Source repositoryhead: git clone git://github.com/ku-fpg/remote-monad
UploadedFri Feb 5 22:06:58 UTC 2016 by AndyGill

Modules

[Index]

Downloads

Maintainers' corner

For package maintainers and hackage trustees