Advanced Types in Elm - Opaque Types
Charlie Koster
4273

Opaque types are great in all sorts of ways. Immutability isn’t a protection when it comes to invariants. Encapsulation — i.e., opaque types — is. Given the frequency with which records are used in Elm code, it’s too bad one has to wrap them to make them opaque. (Or if willing to put up with the extra source code, it’s too bad the compiler doesn’t optimize for the case of types with a single constructor.)

Show your support

Clapping shows how much you appreciated Mark Hamburg’s story.