In Elixir, you can do the following:
iex> [1,2,3,4] -- [2,3]
[1,4]
Is there an analagous function for Stream types?
Trying to implement this, I have:
def stream_subtract(enum, []), do: Enum.to_list(enum)
def stream_subtract(enum1, enum2) do
head = Stream.take(enum2, 1)
new_enum1 = Stream.drop_while(enum1, &([&1] == head))
stream_subtract(new_enum1, Stream.drop(enum2, 1))
end
however this fails, as [&1] is a list, not a stream.