{-
-Copyright (C) 2009 Google Inc.
+Copyright (C) 2009, 2010 Google Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
module Ganeti.HTools.Utils
(
debug
+ , debugFn
+ , debugXy
, sepSplit
, varianceCoeff
, commaJoin
debug :: Show a => a -> a
debug x = trace (show x) x
+-- | Displays a modified form of the second parameter before returning it
+debugFn :: Show b => (a -> b) -> a -> a
+debugFn fn x = debug (fn x) `seq` x
+
+-- | Show the first parameter before returning the second one
+debugXy :: Show a => a -> b -> b
+debugXy a b = debug a `seq` b
+
-- * Miscelaneous
-- | Comma-join a string list.