Example uses of monads
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
canvas-example
logic-example
parser-example
pipe-example
probability-example
process-example
relation-example
resourcet-example
scotty-example
shake-data
shake-example
spec-example
st-example
stm-example
.gitignore
LICENSE
README.md
Setup.hs
monad-examples.cabal
stack.yaml

README.md

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-1.24, GHC 7.10, 8.0 and stackage lts-6.16 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.
  • Resource: Automatic resource management.
  • (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.

Contributions welcome!