elixir - How do I pipe a single number to get a list? -


i have single element/number piping enum.into([]) elixir throws ** (protocol.undefinederror) protocol enumerable not implemented 90

90 |> enum.into([])  v = 65 v |> enum.into([]) enumerable not implemented 65 

enum.into/2 expects enumerable first argument, hence error.

to pipe single element list, use list.wrap

65 |> list.wrap 

Comments