hyperbole: Interactive HTML apps using type-safe serverside Haskell

This is a package candidate release! Here you can preview how this package release will appear once published to the main package index (which can be accomplished via the 'maintain' link below). Please note that once a package has been published to the main package index it cannot be undone! Please consult the package uploading documentation for more information.

[maintain] [Publish]

Interactive HTML applications with type-safe serverside Haskell. Inspired by HTMX, Elm, and Phoenix LiveView.


[Skip to Readme]

Properties

Versions 0.1.1, 0.1.2, 0.2.0, 0.3.5, 0.3.6, 0.4.2, 0.4.3, 0.5.0, 0.5.0
Change log CHANGELOG.md
Dependencies aeson (>=2.1.2.1 && <2.3), atomic-css (>=0.2 && <0.3), attoparsec (>=0.14 && <0.15), attoparsec-aeson (>=2.1 && <2.3), base (>=4.16 && <5), bytestring (>=0.11 && <0.13), casing (>0.1 && <0.2), containers (>=0.6 && <1), cookie (>=0.4 && <0.6), data-default (>0.8 && <0.9), effectful (>=2.4 && <3), file-embed (>=0.0.10 && <0.1), filepath (>=1.4 && <2), http-api-data (>=0.6 && <0.7), http-client (>=0.7 && <0.8), http-client-tls (>=0.3 && <0.4), http-types (>=0.12 && <0.13), network (>=3.1 && <4), network-uri (>=2.6.4.1 && <2.7), random (>=1.2 && <2), string-conversions (>=0.4 && <0.5), string-interpolate (>=0.3 && <0.4), text (>=1.2 && <3), time (>=1.12 && <2), wai (>=3.2 && <4), wai-websockets (>=3.0 && <4), warp (>=3.3 && <4), websockets (>=0.12 && <0.14) [details]
License BSD-3-Clause
Author Sean Hess
Maintainer seanhess@gmail.com
Category Web, Network
Home page https://github.com/seanhess/hyperbole
Bug tracker https://github.com/seanhess/hyperbole/issues
Source repo head: git clone https://github.com/seanhess/hyperbole
Uploaded by seanhess at 2025-09-26T16:48:45Z

Modules

[Index] [Quick Jump]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees


Readme for hyperbole-0.5.0

[back to package description]

Hyperbole

Hackage Version

Create interactive HTML applications with type-safe serverside Haskell. Inspired by HTMX, Elm, and Phoenix LiveView.

▶️ Simple Example

{-# LANGUAGE DeriveAnyClass #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TypeFamilies #-}
module Main where

import Data.Text (Text)
import Web.Hyperbole
import Web.Atomic.CSS


main :: IO ()
main = do
  run 3000 $ do
    liveApp quickStartDocument (runPage page)

page :: (Hyperbole :> es) => Eff es (Page '[Message])
page = do
  pure $ do
    hyper Message1 $ messageView "Hello"
    hyper Message2 $ messageView "World!"

data Message = Message1 | Message2
  deriving (Generic, ViewId)

instance HyperView Message es where
  data Action Message = Louder Text
    deriving (Generic, ViewAction)

  update (Louder msg) = do
    let new = msg <> "!"
    pure $ messageView new

messageView :: Text -> View Message ()
messageView msg = do
  button (Louder msg) ~ border 1 $ text msg

Examples

The examples directory contains an app demonstrating many features. See them in action at hyperbole.live

Hyperbole Examples

Getting Started with Cabal

Create a new application:

$ mkdir myapp
$ cd myapp
$ cabal init

Add hyperbole and text as dependencies to the .cabal file:

    build-depends:
        base
      , hyperbole
      , text

Paste the above example into Main.hs, and run:

$ cabal run

Visit http://localhost:3000 to view the application

Learn More

In the Wild

National Solar Observatory

The NSO uses Hyperbole to manage Level 2 Data pipelines for the DKIST telescope. It uses complex user interfaces, workers, databases, and more. The entire codebase is open source.

Contributors