Simple reflex app - template repo - Haskell

Welcome to the Functional Programming Zulip Chat Archive. You can join the chat here.

Sridhar Ratnakumar

.. without backend (just for static sites). Comes with IDE support, and fast dev cycle. Make sure you use reflex-frp cache.

https://github.com/srid/reflex-stone

Let me know if anybody can get this working!

Template repository for writing GHCJS/Reflex targetting static sites without a backend. - srid/reflex-stone
Sridhar Ratnakumar

@TheMatten A reflex exercise for you: how would you rewrite this piece of code to push the dyn_ to as deep as possible? https://github.com/srid/reflex-stone/blob/0b3042ee31bcd077fdb0a609dc77fc53b49f519e/src/Main.hs#L13-L18 :nerd:

Template repository for writing GHCJS/Reflex targetting static sites without a backend. - srid/reflex-stone
TheMatten

Hmmm, can it be pushed deeper at all? :sweat_smile:

Sridhar Ratnakumar

Two levels. Outter dynamic that updates when 0 switches to 1. And for 1+, a separate inner dynamic that you pass straight ot dynTextso the heads! thing never refreshes.

See maybeDyn

Sridhar Ratnakumar

Now with GitHub Pages with build time under 5mins (not bad for GHCJS)

https://srid.github.io/reflex-stone/

Sridhar Ratnakumar

"Write Haskell. Push to GitHub. Compile to JS, and deploy .. all in 4 minutes. Use whatever (pure) Haskell library your heart desires"

--the sound of GHCJS beating its chest in front of PureScript

Sridhar Ratnakumar

Another illustration of 'pushing dynamic as deep as possible' pattern, this time using factorDyn which uses Compose to break GADTs (so you get a dynamic per constructor): https://github.com/srid/ka/commit/2cb621be8871bfa61ae39a7d739e11c0833474fd

Contribute to srid/ka development by creating an account on GitHub.
Sridhar Ratnakumar

https://twitter.com/sridca/status/1316531853000663041