Skip to content

Instantly share code, notes, and snippets.

View plaxdan's full-sized avatar

Daniel Walker plaxdan

  • Newman Lake, Washington
  • 06:51 (UTC -07:00)
View GitHub Profile

The Why and When of Choosing Elm

What is Elm?

  • Language (and "framework") for building web frontend applications
  • Can be used in place of HTML, CSS and JavaScript
  • Compiles into the above
@evancz
evancz / data-interchange.md
Last active December 31, 2024 01:04
Why do I have to write JSON decoders in Elm?

A vision for data interchange in Elm

How do you send information between clients and servers? What format should that information be in? What happens when the server changes the format, but the client has not been updated yet? What happens when the server changes the format, but the database cannot be updated?

These are difficult questions. It is not just about picking a format, but rather picking a format that can evolve as your application evolves.

Literature Review

By now there are many approaches to communicating between client and server. These approaches tend to be known within specific companies and language communities, but the techniques do not cross borders. I will outline JSON, ProtoBuf, and GraphQL here so we can learn from them all.

@rupertlssmith
rupertlssmith / GameState.elm
Last active October 9, 2024 09:35
Exploring State Machines with phantom types in Elm
module GameState
exposing
( Game(..)
, GameDefinition
, PlayState
, loading
, updateGameDefinition
, updatePlayState
, updateScore
, toReady
@sporto
sporto / how-to-use-react-inside-elm.md
Last active April 4, 2024 14:54
Using React inside Elm

Register Element

First you will need document-register-element

yarn add document-register-element

Add script to register elements

@perty
perty / Main.elm
Created February 17, 2019 06:59
Demonstrate a state machine in Elm that make impossible state TRANSITIONS impossible
module Main exposing (main)
{-
Can we make impossible state transtions impossible as impossible state can be impossible?
An order has this state machine: Initial -> { Processing, Cancelled }, Processing -> {Cancelled, Shipping},
Shipping -> {Shipped, Lost}. So end states are Cancelled, Shipped and Lost.
Let's see if can make the compiler catch when trying to cancel an order that is shipping.
@davidteren
davidteren / nerd_fonts.md
Last active May 10, 2025 11:30
Install Nerd Fonts via Homebrew [updated & fixed]