[commit: packages/hpc] master: `M-x untabify` & `M-x delete-trailing-whitespaces` (12c369b)
git at git.haskell.org
git at git.haskell.org
Thu Oct 24 08:51:36 UTC 2013
Repository : ssh://git@git.haskell.org/hpc
On branch : master
Link : http://git.haskell.org/packages/hpc.git/commitdiff/12c369b391e49037cf727228a2c8a81acc83afbd
>---------------------------------------------------------------
commit 12c369b391e49037cf727228a2c8a81acc83afbd
Author: Herbert Valerio Riedel <hvr at gnu.org>
Date: Thu Oct 24 10:31:09 2013 +0200
`M-x untabify` & `M-x delete-trailing-whitespaces`
Signed-off-by: Herbert Valerio Riedel <hvr at gnu.org>
>---------------------------------------------------------------
12c369b391e49037cf727228a2c8a81acc83afbd
Trace/Hpc/Tix.hs | 27 +++++++++++++--------------
Trace/Hpc/Util.hs | 23 +++++++++++------------
2 files changed, 24 insertions(+), 26 deletions(-)
diff --git a/Trace/Hpc/Tix.hs b/Trace/Hpc/Tix.hs
index 257941c..579d263 100644
--- a/Trace/Hpc/Tix.hs
+++ b/Trace/Hpc/Tix.hs
@@ -9,8 +9,8 @@
-- | Datatypes and file-access routines for the tick data file
-- used by HPC. (.tix)
module Trace.Hpc.Tix(Tix(..), TixModule(..),
- tixModuleName, tixModuleHash, tixModuleTixs,
- readTix, writeTix, getTixFileName) where
+ tixModuleName, tixModuleHash, tixModuleTixs,
+ readTix, writeTix, getTixFileName) where
import Data.List (isSuffixOf)
import Trace.Hpc.Util (Hash, catchIO)
@@ -18,14 +18,14 @@ import Trace.Hpc.Util (Hash, catchIO)
-- 'Tix ' is the storage format for our dynamic imformation about what
-- boxes are ticked.
data Tix = Tix [TixModule]
- deriving (Read, Show, Eq)
+ deriving (Read, Show, Eq)
data TixModule = TixModule
- String -- module name
- Hash -- hash number
- Int -- length of tix list (allows pre-allocation at parse time).
- [Integer] -- actual ticks
- deriving (Read, Show, Eq)
+ String -- module name
+ Hash -- hash number
+ Int -- length of tix list (allows pre-allocation at parse time).
+ [Integer] -- actual ticks
+ deriving (Read, Show, Eq)
tixModuleName :: TixModule -> String
tixModuleName (TixModule nm _ _ _) = nm
@@ -46,8 +46,8 @@ readTix tix_filename =
-- write a Tix File.
writeTix :: String
- -> Tix
- -> IO ()
+ -> Tix
+ -> IO ()
writeTix name tix =
writeFile name (show tix)
@@ -60,7 +60,6 @@ tixName name = name ++ ".tix"
-- and normalizes it into a .tix-file name.
getTixFileName :: String -> String
getTixFileName str | ".tix" `isSuffixOf` str
- = str
- | otherwise
- = str ++ ".tix"
-
+ = str
+ | otherwise
+ = str ++ ".tix"
diff --git a/Trace/Hpc/Util.hs b/Trace/Hpc/Util.hs
index 7ede8b6..019f1c7 100644
--- a/Trace/Hpc/Util.hs
+++ b/Trace/Hpc/Util.hs
@@ -38,10 +38,10 @@ toHpcPos (l1,c1,l2,c2) = P l1 c1 l2 c2
-- | asks the question, is the first argument inside the second argument.
insideHpcPos :: HpcPos -> HpcPos -> Bool
insideHpcPos small big =
- sl1 >= bl1 &&
- (sl1 /= bl1 || sc1 >= bc1) &&
- sl2 <= bl2 &&
- (sl2 /= bl2 || sc2 <= bc2)
+ sl1 >= bl1 &&
+ (sl1 /= bl1 || sc1 >= bc1) &&
+ sl2 <= bl2 &&
+ (sl2 /= bl2 || sc2 <= bc2)
where (sl1,sc1,sl2,sc2) = fromHpcPos small
(bl1,bc1,bl2,bc2) = fromHpcPos big
@@ -53,11 +53,11 @@ instance Read HpcPos where
where
(before,after) = span (/= ',') pos
(lhs0,rhs0) = case span (/= '-') before of
- (lhs,'-':rhs) -> (lhs,rhs)
- (lhs,"") -> (lhs,lhs)
- _ -> error "bad parse"
- (l1,':':c1) = span (/= ':') lhs0
- (l2,':':c2) = span (/= ':') rhs0
+ (lhs,'-':rhs) -> (lhs,rhs)
+ (lhs,"") -> (lhs,lhs)
+ _ -> error "bad parse"
+ (l1,':':c1) = span (/= ':') lhs0
+ (l2,':':c2) = span (/= ':') rhs0
------------------------------------------------------------------------------
@@ -70,8 +70,8 @@ newtype Hash = Hash Word32 deriving (Eq)
instance Read Hash where
readsPrec p n = [ (Hash v,rest)
- | (v,rest) <- readsPrec p n
- ]
+ | (v,rest) <- readsPrec p n
+ ]
instance Show Hash where
showsPrec p (Hash n) = showsPrec p n
@@ -112,4 +112,3 @@ hxor (Hash x) (Hash y) = Hash $ x `xor` y
catchIO :: IO a -> (Exception.IOException -> IO a) -> IO a
catchIO = Exception.catch
-
More information about the ghc-commits
mailing list