Welcome to the Functional Programming Zulip Chat Archive. You can join the chat here.
.. 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!
@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:
Hmmm, can it be pushed deeper at all? :sweat_smile:
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.
dynText
heads!
See maybeDyn
maybeDyn
Oh, I see
Now with GitHub Pages with build time under 5mins (not bad for GHCJS)
https://srid.github.io/reflex-stone/
Takes ~4 mins to build.
"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
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
factorDyn
Compose
https://twitter.com/sridca/status/1316531853000663041
Just had to directly deal with the #Haskell `Compose` type for first time in real code. Wanted to "break" a reflex dynamic (for update performance), to get one dynamic per GADT constructor. `factorDyn` to rescue, which does exactly that. https://github.com/srid/ka/commit/2cb621be8871bfa61ae39a7d739e11c0833474fd https://twitter.com/sridca/status/1316531853000663041/photo/1
.. 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!
@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:
Hmmm, can it be pushed deeper at all? :sweat_smile:
Two levels. Outter dynamic that updates when 0 switches to 1. And for 1+, a separate inner dynamic that you pass straight ot
dynText
so theheads!
thing never refreshes.See
maybeDyn
Oh, I see
Now with GitHub Pages with build time under 5mins (not bad for GHCJS)
https://srid.github.io/reflex-stone/
Takes ~4 mins to build.
"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
Another illustration of 'pushing dynamic as deep as possible' pattern, this time using
factorDyn
which usesCompose
to break GADTs (so you get a dynamic per constructor): https://github.com/srid/ka/commit/2cb621be8871bfa61ae39a7d739e11c0833474fdhttps://twitter.com/sridca/status/1316531853000663041
Just had to directly deal with the #Haskell `Compose` type for first time in real code. Wanted to "break" a reflex dynamic (for update performance), to get one dynamic per GADT constructor. `factorDyn` to rescue, which does exactly that. https://github.com/srid/ka/commit/2cb621be8871bfa61ae39a7d739e11c0833474fd https://twitter.com/sridca/status/1316531853000663041/photo/1
- Kingdom of Night Owls (@sridca)