tonyday567 / mvc-todo

A haskell implementation of todoMVC

Home Page:https://tonyday567.github.io/other/mvc-todo-auto.html

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Haskell TodoMVC Example

Haskell is a strongly-typed, lazily-evaluated, functional programming language.

This example demonstrates an idiomatic haskell approach to the TodoMVC problem domain involving:

  • compilation of haskell to javascript using ghcjs.
  • The specification of a Model representing the problem domain, consisting of
  • specification of Abstract Data Types (ADTs) for inputs, state and outputs.
  • an algebra between state and actions.
  • Use of the mvc library for specification, asynchronicity and separation of model, view and controllers.
  • The creation of Views that consume model outputs, by using vanilla javascript effects.
  • The creation of Controllers that produce model inputs, by listening for Dom events using vanilla javascript.

recipe

The recipe below handles the bits and bobs you need to do every re-compile. This includes a compression step via closure.

  
stack build --exec "pandoc -f markdown -i other/index.md -t html -o index.html --filter pandoc-include" --exec "java -jar $(stack path --local-bin)/closure-compiler-v20170124.jar --js_output_file=other/mvc-todo-auto.js $(stack path --local-install-root)/bin/mvc-todo-auto.jsexe/all.js" --exec "java -jar $(stack path --local-bin)/closure-compiler-v20170124.jar --js_output_file=other/mvc-todo.js $(stack path --local-install-root)/bin/mvc-todo.jsexe/all.js"
  

About

A haskell implementation of todoMVC

https://tonyday567.github.io/other/mvc-todo-auto.html

License:BSD 3-Clause "New" or "Revised" License


Languages

Language:Haskell 100.0%