samvv
Hi there, this is my first post ![]()
I wanted to let you all know of a new library I am creating, called toolbelt. You can find the source here and the docs here.
Toolbelt extends native Elixir modules with extra functionality. A simple
use Toolbeltwill make those extra functions accessible, while you can still use everything just as usual. Some of the functions it provides: Keyword.is_keyword, Keyword.is_keyword_element, Map.map_deep, Map.map_keys, Map.map_values, Enum.andmap, Enum.ormap, Enum.first, Enum.last, …
The basic aim of this library is to extend the standard Elixir library with some less common but still highly useful functions. The best example is an implementation of Map.map_deep, which allows you to transform all pairs in an arbitrarily-nested map.
It would be really great if you could help with this library, as I am fairly new to Elixir and don’t (yet) know all of the standard ways of doing things. Above that, I might forget of a few useful functions.
There’s still a lot of work on it so if you have any comments or feedback, please let me know.
Regards,
Sam
Trending in Announcing
Other Trending Topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #blog-post
- #phoenix_html
- #iex
- #graphql
- #ai
- #genstage
- #elixirconf-us
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #metaprogramming
- #security
- #hex











Showing Posts 1 to 3- Show Best Posts
- Show All Posts (oldest first)
- Show All Posts (newest first)
OvermindDL1
Looks cool, your extension style is interesting.
Few notes:
s/ormap/andmap/
There is no ‘first’ element in some enumerables, maybe this should be called
popto pop one off (since enumerables may not have a specified order, like a large map). Or perhaps calledoneor so?Really should document what a
classical ormapis, with examples, same with theandmap.Definitely not the
first, and like thefirstcall this wording makes no sense with many types of enumerables, such apopfunction should probably return a tuple of one random and whatever is left over. Or maybe call itafter_one?When documenting should probably take the opportunity to write examples, while also making them doctests.
kanis not a word. ^.^Also it does not detail what properties can make a value a keyword list element, examples would fix this too.
For note:
is wrong. ^.^ For an Elixir style keyword list the spec of a keyword element is
{atom(), any()}, for an Erlang style keyword list the spec is any tuple of size 1 or high filled withany()types.The extra functions on Map look useful, however they sorely need documentation, examples, and doctests. It’s likely possible to reduce the number of these functions to be a bit more generic as well.
MapLike.is_maplike/1andMapLike.put/3have no documentation at all. The rest have no examples or doctests.Good start though, still weary about the extension method done, but eh, need to futz with it to see. ^.^
samvv
Hi OvermindDL1,
Thank you so much for your reply
I didn’t notice the mistakes, will fix them immediately.
No 7 I just discovered myself while implementing some more functions
Regards,
Sam
samvv
Just for the record: I’ve dealt with most of the issues, and added some new niceties as well. When reaching
1.0.0, the code should become much more stable and it should be easier to fork