View Source Drops.Types.Sum (drops v0.1.0)
Drops.Types.Sum is a struct that represents a sum type with left and right types.
Examples
iex> Drops.Types.from_spec([{:type, {:string, []}}, {:type, {:integer, []}}], [])
%Drops.Types.Sum{
left: %Drops.Types.Type{
primitive: :string,
constraints: [predicate: {:type?, :string}]
},
right: %Drops.Types.Type{
primitive: :integer,
constraints: [predicate: {:type?, :integer}]
},
opts: []
}