MyNixOS website logo
Description

A pure simulator for monadic concurrency with STM.

A pure simulator monad with support of concurency (base & async style), stm, synchronous and asynchronous exceptions, timeouts & delays, dynamic traces, partial order reduction and more.

IO Simulator Monad

A pure simulator monad built on top of the lazy ST monad which supports:

  • optional dynamic race discovery and schedule exploration
  • synchronous and asynchronous exceptions; including: throwing, catching and masking synchronous and asynchronous exceptions;
  • concurrency (using simulated threads), with interfaces shaped by the base and async libraries;
  • software transactional memory (STM);
  • simulated time;
  • timeouts;
  • dynamically typed traces and event log tracing;
  • lifting any ST computations;
  • inspection of STM mutable data structures;
  • deadlock detection;
  • MonadFix instances for both IOSim and its corresponding STM monad.
  • partial order reduction (see IOSimPOR).

io-sim together with io-classes is a drop-in replacement for the IO monad (with some ramifications). It was designed to write easily testable Haskell code (including simulating socket programming or disk IO). Using io-classes and si-timers libraries one can write code that can run in both: the real IO and the IOSim monad provided by this package. One of the design goals was to keep the API as close as possible to base, exceptions, async, and stm packages.

io-sim package also provides two interpreters, a standard one and IOSimPOR which supports dynamic discovery of race conditions and schedule exploration with partial order reduction.

io-sim provides API to explore traces produced by a simulation. It can contain arbitrary Haskell terms, a feature that is very useful to build property-based tests using QuickCheck.

The package contains thorough tests, including tests of STM against the original specification (as described in Composable Memory Transactions and its GHC implementation. This can be seen in both ways: as a check that our implementation matches the specification and the GHC implementation, but also the other way around: that GHCs STM implementation meets the specification.

Metadata

Version

1.5.0.0

License

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows