blallo
DeepDive - a debugging tool for deeply nested data structures
Hi! This is my first public elixir library. I hope someone can benefit from it, as I ceased to work with this nice language at the moment.
DeepDive
Where
Github: GitHub - blallo/deep_dive: Debug utility to explore nested data structures in elixir · GitHub
Hex.pm: deep_dive | Hex
Hexdocs.pm: DeepDive — Deep Dive v1.0.0
What
DeepDive is an extremely simple library to explore a complex and possibly unknown data structures in search of keys that sound. I developed an early stub to explore a deeply nested Absinthe.Resolution struct I needed to get hold of. It treats everything as a map and every map as a tree. It offers two different strategies to explore the tree in search for nodes (the keys) that match some pattern:
DeepDive.FirstFoundlooks for the first match on each branch and returnsDeepDive.FullWalklooks for each match on the whole tree
The interface is a single function, find_key/2, that wants the data structure as first argument and a matcher as second argument. A matcher may be:
- an exact value to match
- a regex
- a function of kind
(term -> bool)
Peek into the documentation for more info.
How
I used to put an IEx.pry() near the code I needed to examine and, from there, call the function on the data. I suggest to install the library only in the :dev mix environment.
Have fun and use the github issues to signal any problem.
Popular in Announcing
Other popular 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
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #elixirconf-us
- #advent-of-code
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #security
- #hex









