• Frontend in Haskell
      • Haskell
        • Dev/
          • Tech

Reflex FRP

See reflex-frp.org. TODO: Introductory blurb.

The recommended way to get started with writing reflex apps is via Obelisk#, or reflex-stone if you do not want a backend server.

reflex/pattern
  • Ouroboros FRP pattern#
  • Widget taking Dynamic and returning Event#

reflex/tip
  • Autofocus an element in Reflex#

Backlinks

  • Neuron 1.0 released
    • If you enjoy using neuron and/or Cerveau, and would like to show your appreciation, you might be interested in the GitHub sponsor goal that will enable the eventual open-sourcing of Cerveau, a full-stack Reflex FRP# app.

    • See this blog post which details using Reflex FRP# as build engine in ghcide.

    • To achieve this, I’m working on a new (independent) core for neuron, called ka Project (named after the Egyptian concept) that eventually will supplant rib/shake used currently in neuron. ka uses Functional Reactive Programming to provide a reactive build pipeline1 specifically geared towards note-taking, as well as plugin mechanism to customize the behaviour of the application at various stages. In addition to being the new core of neuron, ka Project will be an independent app for use, both in the form of web app and GTK+ app; Neuron sponsors get early access to ka Project source code.

      1. See this blog post which details using Reflex FRP# as build engine in ghcide.

        ↩︎
  • Cerveau: a future-proof web app for notes
    • Cerveau’s frontend too is written in Haskell. Wait, how is that possible? The GHCJS compiler compiles Haskell code to low-level JavaScript for running in the browser. Cerveau uses the Reflex FRP# library, via the excellent Obelisk# framework, which takes care of all the plumbing required to produce such full-stack Haskell apps, so that I as a developer can focus on the FRP application logic. FRP, and similar models of UI programming, is simpler to write and extend than callback based code. Anybody who writes Elm1 can attest to that; however unlike Elm or PureScript, GHCJS code can be shared with the backend. This is what enables Cerveau to directly reuse much of the Neuron source code, thus enabling neuron’s core features to work directly on the browser–for example, live HTML preview while editing the note.

      1. Incidentally, the paper Explicitly Comprehensible Functional Reactive Programming compares The Elm Architecture and Reflex Ecosystem’s frameworks.

        ↩︎
  • Obelisk tutorial: Markdown preview with Reflex
    • We will not work directly with GHCJS, however, and instead will use the Reflex FRP# library, through the excellent Obelisk# full-stack framework.

  • Concur
    • Concur is an unusual Web UI framework based on an entirely new paradigm, one that does not follow FRP (Reflex FRP#) or Elm architecture, but aims to combine the best parts of the both. Concur initially started out as an architecture layer on top of Reflex, before the author decided that Reflex was too heavy and ditched it.

  • Sridhar Ratnakumar 🤨
    • Parent directory zettel

Uplinks

  • Frontend in Haskell#
    • I highly recommend Reflex FRP#, but there are other frameworks as well (notably Concur# and Miso).

logo