From 130e3bcd3036cdde857dc4221a858e65204f6db0 Mon Sep 17 00:00:00 2001 From: Simon Michael Date: Wed, 10 Dec 2008 07:08:50 +0000 Subject: [PATCH] utils tweaks --- Ledger/Utils.hs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Ledger/Utils.hs b/Ledger/Utils.hs index dcc26a04e..79cfb4f24 100644 --- a/Ledger/Utils.hs +++ b/Ledger/Utils.hs @@ -192,7 +192,9 @@ showforest = concatMap showtree -- debugging --- | trace a showable expression +-- | trace (print on stdout at runtime) a showable expression +-- (for easily tracing in the middle of a complex expression) +strace :: Show a => a -> a strace a = trace (show a) a p = putStr @@ -208,7 +210,7 @@ parsewith :: Parser a -> String -> Either ParseError a parsewith p ts = parse p "" ts fromparse :: Either ParseError a -> a -fromparse = either (\e -> error $ "ledger parse error at "++(show e)) id +fromparse = either (\e -> error $ "parse error at "++(show e)) id nonspace :: GenParser Char st Char nonspace = satisfy (not . isSpace)