remote-monad: An parametrizable Remote Monad, and parametrizable Applicative Functor

This is a package candidate release! Here you can preview how this package release will appear once published to the main package index (which can be accomplished via the 'maintain' link below). Please note that once a package has been published to the main package index it cannot be undone! Please consult the package uploading documentation for more information.

[maintain] [Publish]

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

Versions 0.1.0.0, 0.1.0.1, 0.1.0.1, 0.2
Change log None available
Dependencies base (>=4.7 && <5), natural-transformation (>=0.3 && <0.4), transformers (>=0.4 && <0.6) [details]
License BSD-3-Clause
Copyright (c) 2016 The University of Kansas
Author Andy Gill, Justin Dawson
Maintainer andygill@ku.edu
Category Control
Source repo head: git clone git://github.com/ku-fpg/remote-monad
Uploaded by AndyGill at 2016-02-05T22:06:58Z

Modules

[Index]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees