Skip to content

phischu/monad-examples

Repository files navigation

Example uses of monads

What are monads and why should I care? This repository answers this question by showcasing a selection of examples.

Each example is in a ...-example subfolder. For example the example for software transactional memory (STM) is in stm-example/Main.hs.

See also my related blog post.

Installation

Tested with cabal-install-2.2, GHC 8.2 and GHC 8.4 and Stackage lts-12.13 on Ubuntu 16.04.

Install with cabal

git clone https://github.com/phischu/monad-examples
cd monad-examples
cabal sandbox init
cabal install
cabal configure
cabal build

or with stack

git clone https://github.com/phischu/monad-examples
cd monad-examples
stack install

Featured

The ticked examples are camera-ready. The others are in progress.

  • STM: Software transactional memory for concurrency.
  • (Build) Action: GNU make embedded in Haskell.
  • Pipe: Stream processing.
  • Process: Distributed programming.
  • Probability: Probability distributions.
  • Scotty: Web server framework.
  • Relation: SQL embedded in Haskell.
  • ST: Mutable references.
  • Logic: Backtracking search.
  • Spec: Test specification.
  • Parser: Parse binary and textual data.
  • Canvas: Draw on HTML 5 Canvas.
  • Gen: Generate random inputs.
  • Suave: Talk with a browser.

Contributions welcome!

About

Example uses of monads

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published