diff options
author | Tom Smeding <tom@tomsmeding.com> | 2022-06-14 19:12:53 +0200 |
---|---|---|
committer | Tom Smeding <tom@tomsmeding.com> | 2022-06-14 19:12:53 +0200 |
commit | aa6327c3f630c9b7b7ceef8d07f3a57ca03cccf1 (patch) | |
tree | ac54f3f5d17e6c69b3d2ec894547bc767a269a0d /bwrap-files/workdir/Yahb2Defs.hs | |
parent | 181bdd640a5a605ed43cc14b295a6536541e428e (diff) |
Early-catch large show output with -interactive-print
Diffstat (limited to 'bwrap-files/workdir/Yahb2Defs.hs')
-rw-r--r-- | bwrap-files/workdir/Yahb2Defs.hs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/bwrap-files/workdir/Yahb2Defs.hs b/bwrap-files/workdir/Yahb2Defs.hs new file mode 100644 index 0000000..c0dfbfd --- /dev/null +++ b/bwrap-files/workdir/Yahb2Defs.hs @@ -0,0 +1,8 @@ +module Yahb2Defs where + + +limitedPrint :: Show a => a -> IO () +limitedPrint x = + case splitAt 200 (show x) of + (s, "") -> putStrLn s + (s, _) -> putStrLn (take 197 s ++ "...") |