Create interactive HTML applications with type-safe serverside Haskell. Inspired by HTMX, Elm, and Phoenix LiveView.
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveAnyClass #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TypeFamilies #-}
moduleMainwhereimportData.Text (Text)
importWeb.Atomic.CSS (border, (~))
importWeb.Hyperbolemain::IO()
main =do
run 3000$do
liveApp quickStartDocument (runPage page)
page:: (Hyperbole:>es) =>Pagees '[Message]
page =dopure$do
hyper Message1$ messageView "Hello"
hyper Message2$ messageView "World!"dataMessage=Message1 | Message2deriving (Generic, ViewId)
instanceHyperViewMessageeswheredataActionMessage=LouderTextderiving (Generic, ViewAction)
update (Louder msg) =dolet new = msg <>"!"pure$ messageView new
messageView::Text->ViewMessage()
messageView msg =do
button (Louder msg) ~ border 1$ text msgVisit hyperbole.live for documentation and live examples. Also see the Hackage Documentation

Create a new application:
$ mkdir myapp
$ cd myapp
$ cabal init
Add hyperbole and text as dependencies to the .cabal file:
build-depends:
base
, hyperbole
, atomic-css
, text
default-language: GHC2021
Paste the above example into Main.hs, then run it:
$ cabal run
Visit http://localhost:3000 to view the application

The NSO uses Hyperbole to manage Level 2 Data pipelines for the DKIST telescope
