[Add website apfelmus@quantentunnel.de**20100425112151 Ignore-this: 73acd1a551508a758fa2ce8f73e6603 ] hunk ./docs/Makefile 3 +.PHONY: website doc hunk ./docs/Makefile 5 -.PHONY: doc +examples_hs=ListT LogicT PoorMansConcurrency TicTacToe State +examples_lhs=WebSessionState +examples=$(examples_hs:%=%.hs) $(examples_lhs:%=%.lhs) hunk ./docs/Makefile 9 -doc: Documentation.html -Documentation.html : Documentation.md docbook.css - pandoc --standalone --toc --css=docbook.css "$<" > "$@" +documentation=Documentation.html $(examples:%=examples/%.html) examples/operational-examples.tar.gz + +static=index.html examples.html fptools.css + +doc: $(documentation:%=web/%) + +HOST=apfelmus@code.haskell.org:/srv/projects/operational +website: $(documentation:%=web/%) $(static:%=web/%) + rsync $(static:%=web/%) web/Documentation.html $(HOST) + rsync $(examples:%=web/examples/%.html) web/examples/hscolour.css \ + $(HOST)/examples + +###################################################################### +### Generating documentation + +web/Documentation.html : Documentation.md + pandoc --standalone --toc --css=fptools.css \ + --number-sections "$<" > "$@" hunk ./docs/Makefile 31 +web/%.hs.html: %.hs + HsColour "$<" -css -o"$@" +web/%.lhs.html: %.lhs + HsColour "$<" -css -o"$@" + +web/examples/operational-examples.tar.gz: $(examples:%=examples/%) + tar czvf "$@" $^ + adddir ./docs/web adddir ./docs/web/examples addfile ./docs/web/examples.html hunk ./docs/web/examples.html 1 - +The 'operational' package - Example Code + +

Example Code

+for the operational package. + +

List of examples

+ +
+
LogicT.hs +
Oleg Kiselyov's LogicT monad transformer. +
ListT.hs +
Correct implementation of the list monad transformer. +
PoorMansConcurrency.hs +
Koen Claessen's poor man's concurrency monad, implements cooperative multitasking. +
State.hs +
Very simple example showing how to implement the state monad. +
TicTacToe.hs +
The game of TicTacToe. Mix and mash humans and AI as you like; players are implemented in a special monad that looks like there is only one player playing. +
WebSessionState.lhs +
CGI Script that is written in a style seems to require exeution in a persistent process, but actually stores a log of the session in the client. +
+ +

Download

+Download a tar.gz archive of all the current examples. + + addfile ./docs/web/examples/hscolour.css hunk ./docs/web/examples/hscolour.css 1 - +.hs-keyglyph, .hs-layout { color: red; } +.hs-keyword { color: blue; } +.hs-comment, .hs-comment a { color: green; } +.hs-str, .hs-chr { color: teal; } +.hs-keyword,.hs-conid, .hs-varid, .hs-conop, .hs-varop, .hs-num, .hs-cpp, .hs-sel, .hs-definition {} addfile ./docs/web/fptools.css hunk ./docs/web/fptools.css 1 +body { + font-family: Verdana, sans-serif; + width: 43em; + margin: 1ex 3em 1ex; +} + +div { + font-family: sans-serif; + color: black; + background: white +} + +h1, h2, h3, h4, h5, h6, p.title, h1 > a:visited, h2 > a:visited, h1 > a, h2 > a { color: #005A9C; text-decoration:none; } + +h1 { font: 170% sans-serif; } +h2 { font: 140% sans-serif; } +h3 { font: 120% sans-serif; } +h4 { font: bold 100% sans-serif; } +h5 { font: italic 100% sans-serif; } +h6 { font: small-caps 100% sans-serif; } + +pre { + font-family: monospace; + border-width: 1px; + border-style: solid; + padding: 0.3em; + color: maroon; +} + +pre.screen { color: #006400; } +pre.programlisting { color: maroon; } + +div.example { + margin: 1ex 0em; + border: solid #412e25 1px; + padding: 0ex 0.4em; +} + +div.example, div.example-contents { + background-color: #fffcf5; +} + +a:link { color: #0000C8; } +a:hover { background: #FFFFA8; } +a:active { color: #D00000; } +a:visited { color: #680098; } + +h1 > a { color: #000; } addfile ./docs/web/index.html hunk ./docs/web/index.html 1 - +The 'operational' package + +

The 'operational' package

+ +Implement monads by specifying instructions and their desired operational semantics. + +

Download

+ + +

Documentation

+ + +

Authors

+Heinrich Apfelmus +
April 2010 + + hunk ./operational.cabal 31 + docs/web/fptools.css + docs/web/*.html + docs/web/examples/hscolour.css + docs/web/examples/*.html