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

Custom union types #40

Merged
merged 2 commits into from
Jan 26, 2024
Merged

Custom union types #40

merged 2 commits into from
Jan 26, 2024

Conversation

solnic
Copy link
Owner

@solnic solnic commented Jan 26, 2024

This adds support for defining custom union types, like this:

defmodule PositiveNumber do
  use Drops.Type, union([integer(), float()], gt?: 0)
end

Closes #37

@solnic solnic merged commit 5bccce0 into main Jan 26, 2024
9 checks passed
@solnic solnic deleted the custom-union-types branch January 26, 2024 07:08
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

Successfully merging this pull request may close these issues.

Union data type
1 participant