Includes a Livebook.
Like a
Lens, aPrismis composable. In Elixir, it can also help manage missing keys or expected nils, but that is incidental. APrismmodels conditional existence: a focus that exists only on certain branches of a sum type.Let’s say we are building a system to process transactions. A transaction can be a purchase or a refund, and it can be paid by check or credit card.
The tricky part is not extracting fields. It is deciding which payment operations apply.






















