Currently its impossible to define a tuple type with dry-types.
It has been brought up before How to declare schema with tuples of [:string, :integer]? .
The smartest way to implement this would probably be to define a predicate in dry-logic that called nth_element or something, which takes an index as the first arg, and then the predicate to apply to that specific element as the second, aka
def nth_element(input, n, predicate, *args)
send(predicate, [input[n], *args])
end
for the actual dry-types implementation i’m thinking a small helper function like Types.Tuple(Types::String, Types::Integer) which specifies the nth_element predicate aswell as setting the size predicate to whatever the amount of arguments is
I’m very happy to work on this of no one else has the time.