Update 09/24/2019: Support of GHC 8.6.5 and Elm 0.19
Todo app build with Haskell
(Servant
, Persistent
) on server-side and Elm
on client-side.
The modular structure of the Elm
app based on the article "How I Structure Elm Apps" by Kris Jenkins. It also uses the elm-return
library by Isaac Shapira for using a Writer monad
approach with any update
function.
It might be overkill somehow to use all these things for a simple Todo app. Anyway, I just wanted to check it out what is possible and how does it feel to write a bigger Elm
application in any future...
- Build:
stack build
- Execute:
stack exec haskell-elm-todo
- Run tests:
stack test
by using httpie:
# add a todo
http POST localhost:3000/todo/ completed:=false description="my todo"
# get a todo
http localhost:3000/todo/1
# delete a todo
http DELETE localhost:3000/todo/1
# update a todo
http PUT localhost:3000/todo/1 description="any other description" completed:=true
# get all todos
http localhost:3000/todos
- Goto project folder
cd {project}/client/
- Build:
npm i
- Run:
npm start
Open http://localhost:3333.
-
Haskell + Persistent: http://www.yesodweb.com/book/persistent
-
School of Haskell "Querying an existing database"
-
Example Servant + Persistent: https://github.com/haskell-servant/example-servant-persistent/
-
Example Servant + Persistent by Matt Parsons: https://github.com/parsonsmatt/servant-persistent
-
Example Servant + Elm: https://github.com/haskell-servant/example-servant-elm
-
"Todobackend" with Servant: https://github.com/jhedev/todobackend-haskell/tree/master/todobackend-servant
-
Album app (Haskell + Elm) by Magnus Rundberget / @rundis: https://github.com/rundis/albums
-
DB example of "5 Ways to Test Application Code that Accesses a Database in Haskell"
-
Blog post "How I Structure Elm Apps" by Kris Jenkins / @krisajenkins
-
Advanced example of
elm-dialog
by Kris Jenkins / @krisajenkins -
Blog post "The Return Monad" by Isaac Shapira / @Fresheyeball
-
Blog post "Optical Swordplay With Components" by Kyle J. Kress / @toastal