summaryrefslogtreecommitdiff
path: root/Biz/Log.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Biz/Log.hs')
-rw-r--r--Biz/Log.hs15
1 files changed, 15 insertions, 0 deletions
diff --git a/Biz/Log.hs b/Biz/Log.hs
index a4d6253..8c7b043 100644
--- a/Biz/Log.hs
+++ b/Biz/Log.hs
@@ -11,6 +11,9 @@ module Biz.Log
fail,
-- Debugging
mark,
+ -- Operators
+ (~&),
+ (~?),
-- | Low-level
msg,
br,
@@ -56,3 +59,15 @@ mark label val =
unsafePerformIO <| do
msg Mark [label, tshow val]
pure val
+
+-- | Pipelined version of 'mark'.
+--
+-- @
+-- mark label val = val ~| label
+-- @
+(~&) :: Show a => a -> Text -> a
+(~&) val label = mark label val
+
+-- | Conditional mark.
+(~?) :: Show a => a -> (a -> Bool) -> Text -> a
+(~?) val test label = if test val then mark label val else val