EPISODE · Apr 3, 2020 · 40 MIN
002: Intro to Opaque Types
from Elm Radio · host Dillon Kearns
Opaque TypesSome patternsRuntime validations - conditionally return type, wrapped in Result or MaybeGuarantee constraints through the exposed API of the module (like PositiveInteger or AuthToken examples)Package-Opaque ModulesExample - the Element type in elm-ui.Definition of the Element type aliaselm-ui's elm.json file does not expose the internal module where the real Element type is defined.Example from elm-graphql codebase - CamelCaseName opaque type
What this episode covers
Opaque Types are a fancy way of saying "custom type with a private constructor." We talk about the basics, how to get started, and some patterns for using Opaque Types.
NOW PLAYING
002: Intro to Opaque Types
No transcript for this episode yet