Behaviour for various number of parameters

I want to write behaviour for with one function data. As input it can take various number of parameter (3, 4, 5) and types (tuples, integers, lists). As output each implementation should give me map with following structure:
%{ current_result: {1, 2, 3}, prev_result: {4, 5, 6}}. I tried this:
@callback data(any) :: %{current_result: tuple(), prev_result: tuple()} but it seems not working. Can you correct me?

Variadic functions are not possible in elixir. Often they are simulated by accepting a list instead.

1 Like

Yeah, I just remembered that it’s not possible here, but what about return type? is it correct?

It looks correct on a first glance, what makes you think it’s not working?

1 Like