module T::Utils

def self.unwrap_nilable(type)

If so, returns the T::Types::Base of the something else. Otherwise, returns nil.
Give a type which is a subclass of T::Types::Base, determines if the type is a simple nilable type (union of NilClass and something else).
def self.unwrap_nilable(type)
  case type
  when T::Types::Union
    type.unwrap_nilable
  else
    nil
  end
end