The daemons package

[Tags: gpl, library, program]

Control.Pipe.C3 provides simple RPC-like wrappers for pipes.

Control.Pipe.Serialize provides serialization and incremental deserialization pipes.

Control.Pipe.Socket provides functions to setup pipes around sockets.

System.Daemon provides a high-level interface to starting daemonized programs that are controlled through sockets.

System.Posix.Daemon provides a low-level interface to starting, and controlling detached jobs.

See the file and the homepage for details.

[Skip to ReadMe]


Versions0.1.0, 0.1.1, 0.1.2, 0.2.0, 0.2.1
Change logNone available
Dependenciesbase (==4.*), bytestring, cereal, containers, data-default, directory, filepath, ghc-prim, network, pipes, transformers, unix [details]
AuthorAlexandru Scvortov <>
Home page
Source repositoryhead: git clone git://
Executablesqueue, addone, memo
UploadedWed Aug 15 02:16:55 UTC 2012 by AlexandruScvortov
Downloads1567 total (35 in last 30 days)
0 []
StatusDocs uploaded by user
Build status unknown [no reports yet]




Maintainers' corner

For package maintainers and hackage trustees

Readme for daemons-0.1.0


Daemons in Haskell made fun and easy


Here's AddOne, a simple daemon that waits for a number and responds with the incremented number.

import Data.Default ( def )
import System.Environment ( getArgs )
import System.Daemon

addOne :: Int -> IO Int
addOne n = return (n + 1)

main :: IO ()
main = do
    startDaemon "addOne" def addOne
    [n] <- getArgs
    res <- runClient "localhost" 5000 ((read n) :: Int)
    print (res :: Maybe Int)

Running it, we see:

% addone 22
Just 23
% addone 41
Just 42

The two important functions above are startDaemon, which checks if a daemon named addOne is already running, and starts it if not, and runClient which connects to the daemon running on localhost:5000, passes it a number, and waits for the response.

For a less trivial example, see the in-memory key-value store, Memo.

For an example that uses the streaming interface of daemons, see PMTQ (Poor Man's Task Queue).


This package is on Hackage. To install it, run:

cabal update
cabal install daemons


See also