You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Semantic indenting can greatly increase readability and maintainability of code. It can even increase the quality of code! (eg by making excessive dependencies more obvious etc)
Longer version
How many times have you come across code indented like this (ignore the code, it's just gibberish, focus on the indenting itself)
Interactive demo of the drawLayer composable function. (screencap in comments)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Use a Git commit message template to write better commit messages
Using Git Commit Message Templates to Write Better Commit Messages
The always enthusiastic and knowledgeable mr. @jasaltvik shared with our team
an article on writing (good) Git commit messages:
How to Write a Git Commit Message.
This excellent article explains why good Git commit messages are important,
and explains what constitutes a good commit message. I wholeheartedly agree
with what @cbeams writes in his article. (Have you read it yet? If not, go
read it now. I'll wait.)
It's sensible stuff. So I decided to start following the
A composable pattern for pure state machines with effects (draft v3)
A composable pattern for pure state machines with effects
State machines are everywhere in interactive systems, but they're rarely defined clearly and explicitly. Given some big blob of code including implicit state machines, which transitions are possible and under what conditions? What effects take place on what transitions?
There are existing design patterns for state machines, but all the patterns I've seen complect side effects with the structure of the state machine itself. Instances of these patterns are difficult to test without mocking, and they end up with more dependencies. Worse, the classic patterns compose poorly: hierarchical state machines are typically not straightforward extensions. The functional programming world has solutions, but they don't transpose neatly enough to be broadly usable in mainstream languages.
Here I present a composable pattern for pure state machiness with effects,
Ideas and guidelines for architecting larger applications in Elm to be modular and extensible
Architecture in Elm
This document is a collection of concepts and strategies to make large Elm projects modular and extensible.
We will start by thinking about the structure of signals in our program. Broadly speaking, your application state should live in one big foldp. You will probably merge a bunch of input signals into a single stream of updates. This sounds a bit crazy at first, but it is in the same ballpark as Om or Facebook's Flux. There are a couple major benefits to having a centralized home for your application state:
There is a single source of truth. Traditional approaches force you to write a decent amount of custom and error prone code to synchronize state between many different stateful components. (The state of this widget needs to be synced with the application state, which needs to be synced with some other widget, etc.) By placing all of your state in one location, you eliminate an entire class of bugs in which two components get into inconsistent states. We also think yo