Based on "haskell:8.0.2" (starting with "v4"/"devex"; "v3" and below are based on "haskell:7.10.3") this images does two additional steps:
Hence this image can be used to provide a ghci (Haskell compiler) to compile and execute the local edited Haskell files.
To do this start a container and add the local e.g. scripts directory as volume:
docker run -it -v $PWD/scripts:/home/playground --rm mibo/pg-haskell /bin/bash
Locally the Haskell files can be edited in the scripts directory and executed in the container via e.g. ghci playground/sample.hs.
If the file is edited and updated locally it can be easily reloaded in ghci via :reload.
To run one of the provided sample scripts follow below steps:
docker run -it --rm mibo/pg-haskell:devex /bin/bash)ghci /home/samples/0_max_sample.hs) (<- in the Docker container)maxpm [42, 4711, 19, 3, 81, 1972] to get result of 4711 (<- in the Docker container)The result of all above commands should look like:
docker$ docker run -it --rm mibo/pg-haskell:devex /bin/bash
root@b0f44b36f76a:/home# ghci /home/samples/0_max_sample.hs
GHCi, version 7.10.3: http://www.haskell.org/ghc/ :? for help
[1 of 1] Compiling Main ( /home/samples/0_max_sample.hs, interpreted )
Ok, modules loaded: Main.
*Main> maxpm [42, 4711, 19, 3, 81, 1972]
4711
*Main>
When finished the GHCi shell can be exited with entering :quit (within the GHCi) and to exit the running Docker container enter exit (within the Linux OS).
Content type
Image
Digest
Size
239.5 MB
Last updated
about 9 years ago
docker pull mibo/pg-haskell