040: Phantom Builder Pattern - a podcast by Dillon Kearns, Jeroen Engels

from 2021-09-27T12:00

:: ::

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

Further episodes of Elm Radio

Further podcasts by Dillon Kearns, Jeroen Engels

Website of Dillon Kearns, Jeroen Engels