Functional languages like PureScript, ReasonML, and Elm offer powerful features to manage complexity and reliably design, build, and refactor apps of any size.
The most popular single-page app framework in PureScript is the component-based
halogen, though many commercial users migrating from React code bases will use
react-basic instead, and fans of Elm might reach for
This guide will walk you through how to design and build a real world Halogen application in PureScript. I’ll describe the design principles I use as a professional PureScript developer to write industrial apps, and we’ll put them to work to build Conduit, a social blogging app similar to Medium. This repo also contains the highly-commented source code for the app so you can see exactly how these principles translate to code.
Table of Contents
- What Are We Building?
- Design Data & Pure Functions
- Push Effects To The Edges
- Using Halogen Components
- A Tour Of The Implementation
This is not a gentle introduction to PureScript or Halogen. It’s intended for advanced beginners and intermediate PureScript developers who know how to build Halogen components but may not yet know how to build real world applications in the language & framework. If you are not yet familiar with the language or with Halogen, I recommend working through resources like PureScript By Example and the Halogen guide first.
A word of caution
This walkthrough may not be completely in sync with the code. It covers higher-level topics and will only be updated when there are major changes to the underlying implementation. If you notice that something has fallen out of sync, please open an issue or pull request!