[ANN] Hyperbole 0.6 - ViewState, server push, concurrency controls, fancy docs

Hello fellow Javascript-avoidant Haskellers! Hyperbole has a new release!

The examples site https://hyperbole.live is now the official documentation. It’s been painstakingly updated to include longer-form docs, including code snippets and live examples with source code links. I think it’s pretty.

Fun new stuff:

  • Server actions can use pushUpdate to update arbitrary HyperViews, enabling all sorts of shenanigans with long-running actions

  • Control overlapping updates with Concurrency = Replace (instead of the default Drop), useful for fast-fire user interactions like autocomplete

  • Long running actions can be interrupted

  • Optional built-in ViewState for folks who really miss Elm

Boring backwards-compatibility concerns:

  • A few functions now require ViewState to be passed in, such as trigger and target

  • It looks like breaking changes are slowing down. We are getting close to a 1.0 release!

Thanks to adithyaov, bsaul, anpin, and futu2 for contributing pull requests!

24 Likes

This is great, thanks for sharing! A friend just asked me : “what is a beginner-friendly way of making a website in haskell?“ and I thought of this from recent memory.

However, looking at the Hyperbole docs, even as someone who’s conversant in Haskell, I empathised more with my friend who might quickly run out of “innovation tokens“:

  • “effectful” ? “side effects“?

  • “HyperView“, `hyper` etc ?

  • “define a data type (a ViewId) that uniquely identifies some sections of the page [..] then make our ViewId an instance of HyperView" - this is took me a second read as ViewId is a typeclass, so it really means “make (your type) an instance of ViewId and HyperView “

  • etc.

4 Likes

While I think Hyperbole is intuitive and easy to use, it’s designed to bring joy to intermediate Haskell programmers who are forced to make web apps. Just relying on Effectful makes it unsuitable for beginners, but Hyperbole also uses type-level lists, associated data types, higher-kinded types for forms, etc. I would recommend beginners use Scotty. While I think one can enjoy using Hyperbole without deeply understanding all the nuts and bolts, it’s not a good way to learn Haskell.

Thanks for pointing out the difficultly in that doc page. I’ll reword it. Please let me know which other pages are confusing?

How do you think I ought to warn beginners about needing an intermediate skill level? Perhaps on the first page? I was thinking of adding a downsides section anyway.

4 Likes

I think instead it has a potential to attract a broader group than just intermediate haskellers who dislike web technology. The design is quite comprehensive, and it bypasses the need for terrible hacks like React. Someone who needs to “make a website“, and can make tech choices in a vacuum, might benefit from this. We just need to ease the onramp with some less daunting jargon, and a more gradual introduction to novel terms.

Edit: also, scotty is just a REST API framework, “anything that returns Text will do“.

2 Likes

I think instead it has a potential to attract a broader group than just intermediate haskellers who dislike web technology. The design is quite comprehensive, and it bypasses the need for terrible hacks like React. Someone who needs to “make a website“, and can make tech choices in a vacuum, might benefit from this.

I certainly agree that it could have a broad audience. It’s very fun to work in, can handle almost anything, and the mental model is light. I would love to make it more approachable

We just need to ease the onramp with some less daunting jargon, and a more gradual introduction to novel terms.

Would you be interested in drafting a better introduction? It could be a markdown file, or if you’d like to see it inline it isn’t hard to run the demo site locally.

The relevant files are: