Open dnesteryuk opened 5 years ago
We'll need to generalize some internals for that. Maybe we could do it in 1.3
Are there any ideas about this feat ? I guess it can be very useful
@Alexxfrolov this is as simple as:
[4] pry(main)> Types::Set = Types.Constructor(Set, Set.method(:new))
=> #<Dry::Types[Constructor<Nominal<Set> fn=Set.new>]>
[5] pry(main)> Types::Set[["a", "a", "b", "c"]]
=> #<Set: {"a", "b", "c"}>
I'm not 100% sure we should have it in the lib though but we'll think about it.
Is there a plan to support Set?
I am trying to use dry-types in place of Virtus in Grape. Currently, Set is supported because Virtus supports it.
I am think of the same interface as Array has: