Revision adc5c176 Ganeti/HTools/Utils.hs
b/Ganeti/HTools/Utils.hs | ||
---|---|---|
2 | 2 |
|
3 | 3 |
{- |
4 | 4 |
|
5 |
Copyright (C) 2009 Google Inc. |
|
5 |
Copyright (C) 2009, 2010 Google Inc.
|
|
6 | 6 |
|
7 | 7 |
This program is free software; you can redistribute it and/or modify |
8 | 8 |
it under the terms of the GNU General Public License as published by |
... | ... | |
24 | 24 |
module Ganeti.HTools.Utils |
25 | 25 |
( |
26 | 26 |
debug |
27 |
, debugFn |
|
28 |
, debugXy |
|
27 | 29 |
, sepSplit |
28 | 30 |
, varianceCoeff |
29 | 31 |
, commaJoin |
... | ... | |
56 | 58 |
debug :: Show a => a -> a |
57 | 59 |
debug x = trace (show x) x |
58 | 60 |
|
61 |
-- | Displays a modified form of the second parameter before returning it |
|
62 |
debugFn :: Show b => (a -> b) -> a -> a |
|
63 |
debugFn fn x = debug (fn x) `seq` x |
|
64 |
|
|
65 |
-- | Show the first parameter before returning the second one |
|
66 |
debugXy :: Show a => a -> b -> b |
|
67 |
debugXy a b = debug a `seq` b |
|
68 |
|
|
59 | 69 |
-- * Miscelaneous |
60 | 70 |
|
61 | 71 |
-- | Comma-join a string list. |
Also available in: Unified diff