Is it possible to parameterize the type Enumerable.t in elixir?
so I currently have a function that accepts a list of foo s:
@spec the_awesome([foo]) :: any def the awesome(foos) do Enum.reduce(foos, &(bar(&2, &1))) end
and indeed, this does not have to be a list! since the function call is only from the Enum module, I would like to change typepec to take any Enumerable, but keep the requirement that Enumerable consist entirely of foo s
Something like
@spec the_awesome(Enumerable.t(foo)) :: any
Is it possible?
types elixir
jisaacstone
source share