Great job! Thanks for writing up and creating the book to share with the community. Is it alright if I post some feedback here?
Tip #7
On Tip #7 you may want to include some other common "type checking" guards related to strings like is_binary and is_bitstring?
The Kernel section of the Elixir docs should have a more complete list of guards: hexdocs.pm/elixir/Kernel.html
Tip #11
You may want to consider including List.first() in addition to hd()? The key difference is how they handle an empty list.
List.first([]) will return nil
hd([]) will raise an ArgumentError
Tip #56
Another great tip. Have you considering including Enum.into/2 as well? It's handy to convert things between lists of tuples, keyword lists, and maps:
[{:a, "Jane"}, {:b, "John"}, {:z, "Peter"}] |> Enum.into(%{})
It also works the for converting maps into keyword lists using |> Enum.into([])
Tip 87
Appears to be a minor typo, scape should probably be escape?
Tip Suggestions
Two of my favorite standard library functions are Kernel.get_in/2 and Kernel.put_in/2.
When I was new to Elixir I remember writing my own recursive get and put functions until someone pointed out these built-ins.
Summary
Great work and a great read! Thanks for putting this together. I definitely learned some new things along the way. Hope the feedback I posted above comes across as intended - supportive with positive intent. You and this work is appreciated 🎉
Great job! Thanks for writing up and creating the book to share with the community. Is it alright if I post some feedback here?
Tip #7
On Tip #7 you may want to include some other common "type checking" guards related to strings like
is_binaryandis_bitstring?The
Kernelsection of the Elixir docs should have a more complete list of guards: hexdocs.pm/elixir/Kernel.htmlTip #11
You may want to consider including
List.first()in addition tohd()? The key difference is how they handle an empty list.List.first([])will returnnilhd([])will raise anArgumentErrorTip #56
Another great tip. Have you considering including
Enum.into/2as well? It's handy to convert things between lists of tuples, keyword lists, and maps:[{:a, "Jane"}, {:b, "John"}, {:z, "Peter"}] |> Enum.into(%{})It also works the for converting maps into keyword lists using
|> Enum.into([])Tip 87
Appears to be a minor typo,
scapeshould probably beescape?Tip Suggestions
Two of my favorite standard library functions are
Kernel.get_in/2andKernel.put_in/2.When I was new to Elixir I remember writing my own recursive get and put functions until someone pointed out these built-ins.
Summary
Great work and a great read! Thanks for putting this together. I definitely learned some new things along the way. Hope the feedback I posted above comes across as intended - supportive with positive intent. You and this work is appreciated 🎉