Write safer functions using Phantom Types
Question
How can I ensure that a user can only be created with a valid login form?
Answer
Use a so called Phantom Type:
Use LoginForm ()
for unvalidated forms and LoginForm Valid
for validated ones.
Further reading
📄Article: Advanced Types in Elm - Phantom Types by Charlie Koster
Last updated