• Phantom types (happens at compile time, not runtime)
  • Helps avoid things like adding centimeters and inches
  • ianmackenzie/elm-units
  • Joël Quenneville's phantom types talk from Elm in the Spring A Number by Any Other Name
  • Extensible records
  • Builder pattern
  • Jeroen's Hierarchy of Constraints
  • elm-graphql SelectionSet scope type variable
  • Builder Pattern episode
  • Brian Hicks' builder pattern talk Robot Buttons from Mars
  • with functions
  • Phantom builder is a state machine for your types
  • elm-review Rule API uses phantom builder
  • Phantom types discourse post on time package Simon Herteby
  • Snapshot test in Elm review for expected error messages
  • Phantom Builder live stream episode

Possible operations with phantom extensible builders* Add a new field * Remove a field * Change the type of a field * Remove the previously existing phantom type and change it to an empty record (not extensible, just a hardcoded return type) i.e. Replace

What you can do with phantom builder* Require something to be always called * Forbid something being called more than once * Cause other constraints dynamically after calling something * Make function calls mutually exclusive * Enable a function only if another one has been called