040: Phantom Builder Pattern

September 27, 2021 1:05:51 63.25 MB Downloads: 0

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