Skip to content

supermario/oak

Repository files navigation

⚠️ Oak is no longer in development, as research here led to the creation of Lamdera!

Oak is a minimal server-side application framework inspired by Elm and The Elm Architecture

See motivations for comparisons with other approaches.

Here is a full working example of an Oak application:

module App where

import Oak

main :: Program
main = Program 0 update view subscriptions

type Model = Int
data Msg = Increment | Decrement | Noop deriving (Read, Show, Eq)

update :: Model -> Msg -> Model
update model msg = case msg of
  Increment -> model + 1
  Decrement -> model - 1
  Noop      -> model

view = show

subscriptions = [onKeyEnter Increment]

See the examples folder for more complex examples, including a websocket server.

Currently oak only supports a very basic CLI app, which will always "re-render" regardless of the nature of Model changes.

Features

You can do anything you can do with Haskell (or even just use Oak in one area of an existing Haskell app).

Oak itself directly provides:

  • A reactive app architecture (mirroring The Elm Architecture)
  • Effect managers that work with that Architecture

Future things that may be explored are:

  • reading and writing system files
  • database querying (Postgres)
  • HTTP endpoints

A design goal is to have an exception-free experience.

Guides (TBC)

  • New to FP
  • Coming from Elm
  • Coming from Haskell

Installation (TBC)

About

A server-side application framework + dev toolkit for Haskell

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published