Helpers for debugging & inspecting code flow
Helpers for debugging & inspecting code flow
def deps do
[{:inspector_gadget, "~> 0.2.0"}]
end
import InspectorGadget
1
|> inspect_flow
|> fn x -> x + 1 end.()
|> fn y -> y * 100 end.()
|> inspect_flow
#=> 13:34:21.997 [info] inspect_flow: 1
#=> 13:34:21.997 [info] inspect_flow: 200
use InspectorGadget.Pipe
1
|> fn x -> x + b end.()
|> fn y -> y * 100 end.()
|> inspect
#=> 13:42:24.250 [info] 1 |> fn(x) = 2
#=> 13:42:24.250 [info] 2 |> fn(y) = 200
#=> 13:42:24.250 [info] 200 |> inspect = "200"
Note that this prints in the order of evaluation, so nested expressions are expected occur in a different sequence than the code
1
|> fn(x, y) -> x + y end.(
6 |> fn z -> z * 10 end.()
)
#=> 13:44:02.649 [info] 6 |> fn(z) = 60
#=> 13:44:02.649 [info] 1 |> fn(x, y) = 61