Consider the following code:
defmodule T do def does_not_contain?(s, t) do s |> not(String.contains?(t)) end end
This gives the following compilation error:
** (CompileError) iex:3: undefined function not/2
I also tried this construct:
defmodule T do def does_not_contain?(s, t) do s |> String.contains?(t) |> not end end
This gives me this error:
** (SyntaxError) iex:4: unexpected token: end
I can do something like this that works:
defmodule T do def does_not_contain?(s, t) do does_contain = s |> String.contains?(t) not(does_contain) end end
But it is quite attractive to try to keep all this in the pipeline. Is there a way to nullify a boolean value in a pipeline?
source share