Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tagging untagged union to a Variant #5

Open
paluh opened this issue Jul 30, 2022 · 0 comments
Open

Tagging untagged union to a Variant #5

paluh opened this issue Jul 30, 2022 · 0 comments

Comments

@paluh
Copy link
Member

paluh commented Jul 30, 2022

Explore idea of concrete helpers to do lifting of untagged union values into a Variant. I mean through directly passed decoders. Not sure if this makes any sens - it is first dump:

foreign import data :: Row Type -> Untagged

foreign import data tag :: Untagged r -> { | typeGuards? } -> Variant r

By typeGuards I mean row of functions like these: https://www.typescriptlang.org/docs/handbook/advanced-types.html#user-defined-type-guards

@paluh paluh changed the title Lifting untagged union to a Variant Tagging untagged union to a Variant Jul 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant