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

Copyright(C) 2016, The University of Kansas
LicenseBSD-style (see the file LICENSE)
MaintainerAndy Gill
StabilityAlpha
PortabilityGHC
Safe HaskellSafe
LanguageHaskell2010

Control.Remote.Monad.Packet.Applicative

Contents

Description

 

Synopsis

The remote applicative

data ApplicativePacket c p a where Source

A Remote Applicative, that can encode both commands and procedures, bundled together.

Constructors

Command :: ApplicativePacket c p b -> c -> ApplicativePacket c p b 
Procedure :: ApplicativePacket c p (a -> b) -> p a -> ApplicativePacket c p b 
Pure :: a -> ApplicativePacket c p a 

Utility

superCommand :: ApplicativePacket c p a -> Maybe a Source

This simulates a ApplicativePacket, to see if it only contains commands, and if so, returns the static result. The commands still need executed. The term super-command is a play on Hughes' super-combinator terminology.