The ivar-simple package

[ Tags: concurrency, library, mit ] [ Propose Tags ]

IVars are write-once variables.

They can be read, an operation that will block until a value was written to the variable. They can be written to exactly once.

[Skip to Readme]


Versions,, 0.2, 0.3, 0.3.1, 0.3.2
Dependencies base [details]
License MIT
Copyright (c) 2008, 2009 Bertram Felgenhauer
Maintainer Bertram Felgenhauer <>
Category Concurrency
Uploaded Sun Jan 11 20:51:31 UTC 2009 by BertramFelgenhauer
Distributions NixOS:0.3.2
Downloads 1157 total (11 in the last 30 days)
Rating 0.0 (0 ratings) [clear rating]
  • λ
  • λ
  • λ
Status Docs uploaded by user
Build status unknown [no reports yet]
Hackage Matrix CI




Maintainer's Corner

For package maintainers and hackage trustees

Readme for ivar-simple-

[back to package description]
What is this?

ivar-simple provides immutable, write-once variables (IVars) in the
Data.IVar.Simple module.

It also provides two more experimental channel implementations built on
top of IVars,

        multi-cast channels with write-once semantics.

        channels with write semantics similar to Control.Concurrent.Chan

Comparison to data-ivar

Both data-ivar and ivar-simple provide a write-once variable. That's where
the similarities end:

- Reading an IVar with data-ivar is an IO operation. In ivar-simple it's a
  pure function.
- data-ivar provides a 'Reader' monoid, monad, etc. for reading from one of
  several IVars. ivar-simple has no such functionality.
- The data-ivar implementation can, in principle, add arbitrary IO actions
  that are called when an IVar is written. (This detail is not exposed,
- Technically, ivar-simple tries for efficiency by exploiting the existing
  locking structures in the RTS; in particular, reading a full IVar for a
  second time is as cheap as evaluating a record selector.
  I have no performance numbers for this.