diff options
Diffstat (limited to 'Biz/Log.hs')
-rw-r--r-- | Biz/Log.hs | 15 |
1 files changed, 15 insertions, 0 deletions
@@ -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 |