Variants and Protocols

from blog jimmyhmiller.github.io, | ↗ original
↗ original
Jimmy MillerVariants and ProtocolsIn our last post, we explored variants and the way in which they allow us to express choice. We saw that variants are much more powerful than enums because they allow you to pass values. Pattern matching on variants allows code to be explicit yet concise. However, there is still a way to make variants even more...