There's a common analogy of viewing Monads as containers, but what about the dual concept: utilizing containers as monads?
In Docker we can spin up containers to execute arbitrary commands using docker run
. This will take a Docker image and apply the supplied commands to it; in other words, a String -> Container
. Let's say I then want to apply the results of that computation and "roll" it to another container, so I need something to take a Container -> Container
. With these two conditions I define a ContainerIO
type to hold containers.
- This only works in GHCI currently