BSD-3-Clause licensed by Edward A. Kmett, Rúnar Bjarnason, Josh Cough
Maintained by Edward A. Kmett
This version can be pinned in stack with:machines-0.4.1@sha256:d10058f6e32eabb6f1df264a6b0711227862fae22edbaf3d4fc226da7c47d429,2715

Module documentation for 0.4.1

  • Data
    • Data.Machine
      • Data.Machine.Fanout
      • Data.Machine.Is
      • Data.Machine.Mealy
      • Data.Machine.Moore
      • Data.Machine.Plan
      • Data.Machine.Process
      • Data.Machine.Source
      • Data.Machine.Stack
      • Data.Machine.Tee
      • Data.Machine.Type
      • Data.Machine.Wye


Build Status

Ceci n’est pas une pipe

Machines are demand driven input sources like pipes or conduits, but can support multiple inputs.

You design a Machine by writing a Plan. You then construct the machine.

Simple machines that take one input are called a Process and processes form a Category. More generally you can attach a Process to the output of any type of Machine, yielding a new Machine.

More complicated machines provide other ways of connecting to them.

Typically the use of machines proceeds by using simple plans into machine Tees and Wyes, capping many of the inputs to those with possibly monadic sources, feeding the rest input (possibly repeatedly) and calling run or runT to get the answers out.

There is a lot of flexibility when building a machine in choosing between empowering the machine to run its own monadic effects or delegating that responsibility to a custom driver.

A port of this design to scala is available from runarorama/scala-machines

Runar’s slides are also available from

Some worked examples are here

Contact Information

Contributions and bug reports are welcome!

Please feel free to contact me through github or on the #haskell IRC channel on

-Edward Kmett



  • Support void 0.7, fixed upper bounds on dependencies going forward.

  • Bumped the bounds for mtl and transformers



  • Added deconstruct, tagDone and finishWith


  • Added asPats, sinkPart_, autoM, and fitM


  • Fixed the Mealy Monad


  • Removed the input type parameter from (almost) all of the types.


  • Initial release