sunroof-compiler-0.2: Monadic Javascript Compiler

Safe HaskellNone

Language.Sunroof.JS.MVar

Description

JSMVar provides the same functionality and concurrency abstraction in Javascript computations as MVar in Haskell.

Synopsis

Documentation

data JSMVar a Source

JSMVar abstraction. The type parameter gives the type of values held in a JSMVar.

Instances

SunroofArgument o0 => Show (JSMVar o0) 
SunroofArgument o0 => IfB (JSMVar o0) 
SunroofArgument o => EqB (JSMVar o)

Reference equality, not value equality.

SunroofArgument o0 => Sunroof (JSMVar o0) 
SunroofArgument o0 => JSTuple (JSMVar o0) 

newMVar :: forall a t. SunroofArgument a => a -> JS t (JSMVar a)Source

Create a new JSMVar with the given value inside. See newEmptyMVar.

newEmptyMVar :: SunroofArgument a => JS t (JSMVar a)Source

Create a new empty JSMVar. See newMVar.

putMVar :: forall a. SunroofArgument a => a -> JSMVar a -> JS B ()Source

Put the value into the JSMVar. If there already is a value inside, this will block until it is taken out.

takeMVar :: forall a. (Sunroof a, SunroofArgument a) => JSMVar a -> JS B aSource

Take the value out of the JSMVar. If there is no value inside, this will block until one is available.