These are chat archives for dry-rb/chat
Types.Instance(Foo)basically saying that I want this value to be strictly instance of
Foo? If so, would it make sense to alias it to
Types.Instancecould also be named
module MyTypes include Dry::Types.module end MyTypes['strict.int'] # ?
dry-*awesomeness in one of our project)
option :foo, MyType.optional, optional: true, which seems to be past the point.
.optional, the type can't "swallow" the
nilit gets sent, if I leave out
optional: true, I need to pass
type = Types.Instance(String) type[nil] #=> nil violates constraints (type?(String, nil) failed) (Dry::Types::ConstraintError) Types::Strict::String[nil] #=> *** Dry::Types::ConstraintError Exception: nil violates constraints (type?(String, nil) failed)