Strange behavior

How come[{:ok, nil}], fn x -> x end)

returns [:ok nil] instead of [{:ok, nil}] I thought it might be that it was treating the input as keyword args so I tried:[{:ok, nil}], fn {x, y} -> {x, y} end)

but that returns [:ok, nil] too. Am I missing something?

And[{:ok, nil}, {:ok, nil}], fn x -> x end)

returns: [ok: nil, ok: nil]

I could work around this using Enum.chunk_every but I am not sure why it is needed.

[{:ok, nil}] == [ok: nil] - lists of tuples of two elements where the first is an atom are keyword lists, there’s no way to distinguish one from the other. The printer always prints something that might be a keyword list as a keyword list - the data underneath is always the same, just a different way of writing it.


Lol! You’re right. Wow, do I feel silly. :slight_smile: