Skip to content
master
Go to file
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

README.md

xhb-monad

This package contains some monads providing a uniform interface to X11 via xhb and xhb-requests. At its core are the following two classes:

import Graphics.XHB.Requests

class Monad x => XContext x where
    request :: Request a => a -> Connection -> x ()
    requestWithReply :: RequestWithReply a b => a -> Connection -> x (x (Either SomeError b))
    waitEvent :: Connection -> x SomeEvent
    pollEvent :: Connection -> x (Maybe SomeEvent)

class (XContext x, Monad m) => MonadX x m | m -> x where
    liftX :: x a -> m a
    askX :: m Connection
    catchErrorX :: m a -> (SomeError -> m a) -> m a
    throwErrorX :: SomeError -> m a

In addition, it includes an instance XContext IO, monad transformer instanaces, and some convenient types and operations.

Its purpose is to allow for pure X logic.

Documentation

This article describes this package and some of its friends in detail.

Haddock can be found here.

About

Monad transformer for xhb server connections

Resources

License

Releases

No releases published

Packages

No packages published
You can’t perform that action at this time.