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

[ bsd3, control, library ] [ Propose Tags ]

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

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

module Main where

import Control.Natural (nat, (#))
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 = run $ runMonad $ nat runWP

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

Downloads

Note: This package has metadata revisions in the cabal description newer than included in the tarball. To unpack the package including the revisions, use 'cabal get'.

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

Versions [RSS] 0.1.0.0, 0.1.0.1, 0.2 (info)
Dependencies base (>=4.8 && <5), natural-transformation (>=0.3.1 && <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
Revised Revision 1 made by AndyGill at 2016-02-11T15:04:04Z
Category Control
Source repo head: git clone git://github.com/ku-fpg/remote-monad
Uploaded by AndyGill at 2016-02-08T22:09:25Z
Distributions
Reverse Dependencies 4 direct, 3 indirect [details]
Downloads 2205 total (8 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2016-02-12 [all 1 reports]