Skip to content

Commit

Permalink
improved trace module doc
Browse files Browse the repository at this point in the history
  • Loading branch information
jlangch committed Mar 30, 2024
1 parent f2946b9 commit babea24
Showing 1 changed file with 22 additions and 14 deletions.
36 changes: 22 additions & 14 deletions src/main/resources/com/github/jlangch/venice/trace.venice
Original file line number Diff line number Diff line change
Expand Up @@ -145,21 +145,23 @@
:examples '(
"""
(do
(load-module :trace)
(load-module :trace ['trace :as 't])

(t/trace-var +)

(trace/trace-var +)
(+ 1 2))
"""
"""
(do
(load-module :trace)
(load-module :trace ['trace :as 't])

(defn foo [x] (+ x 2))
(defn bar [x] (foo x))
(defn zoo [x] (foo x))
(defn bar [x] (zoo x))

(trace/trace-var +)
(trace/trace-var foo)
(trace/trace-var bar)
(t/trace-var +)
(t/trace-var foo)
(t/trace-var bar)

(bar 5))
""" )
Expand Down Expand Up @@ -213,11 +215,13 @@
:examples '(
"""
(do
(load-module :trace ['trace :as 't])

(-> 5
(+ 3)
trace/tee
t/tee
(/ 2)
trace/tee
t/tee
(- 1)))
""")
:see-also '(
Expand All @@ -235,11 +239,13 @@
:examples '(
"""
(do
(load-module :trace ['trace :as 't])

(-> 5
(+ 3)
(trace/tee-> #(println "trace:" %))
(t/tee-> #(println "trace:" %))
(/ 2)
(trace/tee-> #(println "trace:" %))
(t/tee-> #(println "trace:" %))
(- 1)))
""")
:see-also '(
Expand All @@ -252,16 +258,18 @@


(defn
^{ :arglists '( "(tee->> x f!)" )
^{ :arglists '( "(tee->> f! x)" )
:doc "Allows to branch off values passed through the form of a `->>` macro"
:examples '(
"""
(do
(load-module :trace ['trace :as 't])

(->> 5
(+ 3)
(trace/tee->> #(println "trace:" %))
(t/tee->> #(println "trace:" %))
(/ 32)
(trace/tee->> #(println "trace:" %))
(t/tee->> #(println "trace:" %))
(- 1)))
""")
:see-also '(
Expand Down

0 comments on commit babea24

Please sign in to comment.