Using `Ash.Type.String` like `Ash.Type.Enum`
What I'm imagining:
lib/bookstore/types/isbn.ex
:
lib/bookstore/resources/book.ex
:
Seems like it would be good to be able to reuse and narrow many of the core types this way. Thoughts?6 Replies
I think that makes sense, but also keep in mind you can effectively do that with a custom type currently.
However, I see the value for what you're getting at up there. What I'd actually like to see is the ability to create a generic
NewType
(this is the term in most type systems).
The NewType
would simply package up some constraints on another type
Actually I really want that to exist, because that will help with many types.
For example:
That's right along my line of thought. This stuff can be accomplished using
Ash.Type
, but it would be great to have a more concise way to express a large portion of common cases.Honestly, its an easy change to make so I'm going to have a go at it 😄
Awesome!
This has been released as
Ash.Type.NewType
Great! Using it right now.
It's a pleasure to work with a project that has responsive maintainers 👍