Skip to content

Code for Gabriel Gonzalez's fantastic write up on free monads

License

Notifications You must be signed in to change notification settings

pindaroso/free-monads

Repository files navigation

Build Status

free-monads

Code inspired by Gabriel Gonzalez's fantastic article on free monads

Setup

Requirements

  • Docker or Stack

Building

Stack

make

Docker

make docker

Examples

Run stack ghci to play with the example programs and interpreter:

interpreter0 = putStrLn (showProgram program6)
  where
    subroutine2 :: Subroutine
    subroutine2 = output 'A'

    program6 :: Program
    program6 = do
        subroutine2
        bell
        done
λ > interpreter0
output 'A'
bell
done
interpreter1 = putStrLn (showProgram program7)
  where
    program7 :: Program
    program7 = do
      output 'A'
      output 'B'
      output 'C'
      bell
λ > interpreter1
output 'A'
output 'B'
output 'C'
bell
done

About

Code for Gabriel Gonzalez's fantastic write up on free monads

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published