by throway232lasdf · 4y ago · 0 comments
You obviously have no idea what a type is.
type VerifiedEmail = { email: string; is_verified: true; };
type UnverifiedEmail = { email: string; is_verified: false; };This is basically the runtime representation of `data Email = Verified { email :: string } | Unverified { email :: string }`, but promoting `Verified` and `Unverified` to type level requires an extension:
data Email (verified :: bool) where
Verified :: string -> Email true
Unverified :: string -> Email false