Skip to content

Commit

Permalink
Commenting fix
Browse files Browse the repository at this point in the history
  • Loading branch information
jepst committed Jun 7, 2011
1 parent dce476a commit 097b5d4
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 28 deletions.
9 changes: 7 additions & 2 deletions README.md
@@ -1,4 +1,7 @@
This is **Cloud Haskell**. It's a Haskell framework for distributed applications. Basically, it's a tool for writing applications that coordinate their work on a cluster of commodity computers. This is useful for providing highly reliable, redundant, long-running services, as well as for building compute-intensive applications that can benefit from lots of hardware. Cloud Haskell
=============

This is **Cloud Haskell**. It's a Haskell framework for distributed applications. Basically, it's a tool for writing applications that coordinate their work on a cluster of commodity computers or virtual machines. This is useful for providing highly reliable, redundant, long-running services, as well as for building compute-intensive applications that can benefit from lots of hardware.


Cloud Haskell has two interfaces: Cloud Haskell has two interfaces:


Expand All @@ -7,7 +10,7 @@ Cloud Haskell has two interfaces:


This file contains a (slightly out-of-date) introduction to the process layer. We're working on proper documentation for the task layer, but there are example programs included in the distribution. This file contains a (slightly out-of-date) introduction to the process layer. We're working on proper documentation for the task layer, but there are example programs included in the distribution.


We suggest perusing the up-to-date Haddock documentation [here](http://www.cl.cam.ac.uk/~jee36/remote/). The [paper](http://www.cl.cam.ac.uk/~jee36/remote.pdf) is also useful. We suggest perusing the up-to-date Haddock [documentation](http://www.cl.cam.ac.uk/~jee36/remote/) and the [paper](http://www.cl.cam.ac.uk/~jee36/remote.pdf).


Process layer: an introduction Process layer: an introduction
------------------------------ ------------------------------
Expand Down Expand Up @@ -51,6 +54,8 @@ I can run it on some node (and get its PID) like this:
pid <- spawn someNode (greet__closure "John Baptist") pid <- spawn someNode (greet__closure "John Baptist")
``` ```


The `greet__closure` symbol here identifies a _closure generator_ and is automatically created by the framework from user-defined functions; see the examples or documentation for more details.

You can send messages to a process with its PID. The `send` function corresponds to Erlang's ! operator. You can send messages to a process with its PID. The `send` function corresponds to Erlang's ! operator.


```haskell ```haskell
Expand Down
43 changes: 20 additions & 23 deletions Remote/Call.hs
Expand Up @@ -3,7 +3,6 @@
-- | Provides Template Haskell-based tools -- | Provides Template Haskell-based tools
-- and syntactic sugar for dealing with closures -- and syntactic sugar for dealing with closures
module Remote.Call ( module Remote.Call (
-- * Compile-time metadata
remotable, remotable,
mkClosure, mkClosure,
mkClosureRec, mkClosureRec,
Expand Down Expand Up @@ -81,43 +80,41 @@ mkClosureRec name =
-- --
-- 1. First, enable Template Haskell in the module: -- 1. First, enable Template Haskell in the module:
-- --
-- > {-# LANGUAGE TemplateHaskell #-} -- > {-# LANGUAGE TemplateHaskell #-}
-- > module Main where -- > module Main where
-- > import Remote.Call (remotable) -- > import Remote.Call (remotable)
-- > ... -- > ...
-- --
-- 2. Define your functions normally. Restrictions: function's type signature must be explicitly declared; no polymorphism; all parameters must be Serializable; return value must be pure, or in one of the 'ProcessM', 'TaskM', or 'IO' monads; probably other restrictions as well. -- 2. Define your functions normally. Restrictions: function's type signature must be explicitly declared; no polymorphism; all parameters must implement Serializable; return value must be pure, or in one of the 'ProcessM', 'TaskM', or 'IO' monads; probably other restrictions as well.
-- --
-- > greet :: String -> ProcessM () -- > greet :: String -> ProcessM ()
-- > greet name = say ("Hello, "++name) -- > greet name = say ("Hello, "++name)
-- > badFac :: Integer -> Integer -- > badFib :: Integer -> Integer
-- > badFac 0 = 1 -- > badFib 0 = 1
-- > badFac 1 = 1 -- > badFib 1 = 1
-- > badFac n = badFac (n-1) + badFac (n-2) -- > badFib n = badFib (n-1) + badFib (n-2)
-- --
-- 3. Automagically generate stubs and closures for your functions like this: -- 3. Use the 'remotable' function to automagically generate stubs and closure generators for your functions:
-- --
-- > $( remotable ['greet, 'badFac] ) -- > $( remotable ['greet, 'badFib] )
-- --
-- 'remotable' may be used only once per module. -- 'remotable' may be used only once per module.
-- --
-- 4. When you call 'remoteInit' (usually the first thing in your main function), -- 4. When you call 'remoteInit' (usually the first thing in your program),
-- be sure to give it the automagically generated function lookup tables -- be sure to give it the automagically generated function lookup tables
-- from all modules that use 'remotable': -- from all modules that use 'remotable':
-- --
-- > main = remoteInit (Just "config") [Main.__remoteCallMetaData, OtherModule.__remoteCallMetaData] initialProcess -- > main = remoteInit (Just "config") [Main.__remoteCallMetaData, OtherModule.__remoteCallMetaData] initialProcess
-- --
-- 5. Now you can invoke your functions remotely. When a function expects a closure, give it the name -- 5. Now you can invoke your functions remotely. When a function expects a closure, give it the name
-- of the generated closure, rather than the name of the original function. If the function takes parameters, -- of the generated closure, rather than the name of the original function. If the function takes parameters,
-- so will the closure. -- so will the closure. To start the @greet@ function on @someNode@:
--
-- To start the @greet@ function on @someNode@:
-- --
-- > spawn someNode (greet__closure "John Baptist") -- > spawn someNode (greet__closure "John Baptist")
-- --
-- Note that we say @greet__closure@ rather than just @greet@. If you prefer, you can use 'mkClosure' instead, i.e. @$(mkClosure 'greet)@, which will expand to @greet_closure@. To calculate a factorial remotely: -- Note that we say @greet__closure@ rather than just @greet@. If you prefer, you can use 'mkClosure' instead, i.e. @$(mkClosure 'greet)@, which will expand to @greet__closure@. To calculate a Fibonacci number remotely:
-- --
-- > val <- callRemotePure someNode (badFac__closure 5) -- > val <- callRemotePure someNode (badFib__closure 5)
remotable :: [Name] -> Q [Dec] remotable :: [Name] -> Q [Dec]
remotable names = remotable names =
do info <- liftM concat $ mapM getType names do info <- liftM concat $ mapM getType names
Expand Down
1 change: 0 additions & 1 deletion Remote/Closure.hs
Expand Up @@ -6,7 +6,6 @@
-- swapped out for the \"static\" mechanism described in the -- swapped out for the \"static\" mechanism described in the
-- paper. -- paper.
module Remote.Closure ( module Remote.Closure (
-- * Closure
Closure(..) Closure(..)
) where ) where


Expand Down
1 change: 0 additions & 1 deletion Remote/Reg.hs
@@ -1,7 +1,6 @@
-- | Runtime metadata functions, part of the -- | Runtime metadata functions, part of the
-- RPC mechanism -- RPC mechanism
module Remote.Reg ( module Remote.Reg (
-- * Runtime metadata
registerCalls, registerCalls,
Lookup, Lookup,
Identifier, Identifier,
Expand Down
2 changes: 1 addition & 1 deletion remote.cabal
Expand Up @@ -12,7 +12,7 @@ Build-Type: Simple
tested-with: GHC ==6.12.1 tested-with: GHC ==6.12.1


library library
Build-Depends: base >= 4, time, filepath, containers, network, syb, binary, mtl, bytestring, template-haskell, stm, pureMD5, utf8-string, directory Build-Depends: base >= 4, time, filepath, containers, network, syb, mtl, binary, bytestring, template-haskell, stm, pureMD5, utf8-string, directory
ghc-options: -Wall ghc-options: -Wall
Extensions: TemplateHaskell, FlexibleInstances, UndecidableInstances, CPP, ExistentialQuantification, DeriveDataTypeable Extensions: TemplateHaskell, FlexibleInstances, UndecidableInstances, CPP, ExistentialQuantification, DeriveDataTypeable
Exposed-Modules: Remote.Process, Remote.Encoding, Remote.Call, Remote.Reg, Remote.Peer, Remote.Init, Remote.Closure, Remote.Channel, Remote.Task, Remote Exposed-Modules: Remote.Process, Remote.Encoding, Remote.Call, Remote.Reg, Remote.Peer, Remote.Init, Remote.Closure, Remote.Channel, Remote.Task, Remote
Expand Down

0 comments on commit 097b5d4

Please sign in to comment.