Skip to content
Snippets Groups Projects
Commit 169bb495 authored by Ben Gamari's avatar Ben Gamari :turtle:
Browse files

Merge branch 'master' into 'master'

Fix a -Wincomplete-uni-patterns warning

See merge request ghc/packages/hpc!1
parents 75f898ba fe660ddf
No related branches found
No related tags found
No related merge requests found
...@@ -51,13 +51,18 @@ instance Show HpcPos where ...@@ -51,13 +51,18 @@ instance Show HpcPos where
instance Read HpcPos where instance Read HpcPos where
readsPrec _i pos = [(toHpcPos (read l1,read c1,read l2,read c2),after)] readsPrec _i pos = [(toHpcPos (read l1,read c1,read l2,read c2),after)]
where where
(before,after) = span (/= ',') pos (before,after) = span (/= ',') pos
parseError a = error $ "Read HpcPos: Could not parse: " ++ show a
(lhs0,rhs0) = case span (/= '-') before of (lhs0,rhs0) = case span (/= '-') before of
(lhs,'-':rhs) -> (lhs,rhs) (lhs,'-':rhs) -> (lhs,rhs)
(lhs,"") -> (lhs,lhs) (lhs,"") -> (lhs,lhs)
_ -> error "bad parse" _ -> parseError before
(l1,':':c1) = span (/= ':') lhs0 (l1,c1) = case span (/= ':') lhs0 of
(l2,':':c2) = span (/= ':') rhs0 (l,':':c) -> (l,c)
_ -> parseError lhs0
(l2,c2) = case span (/= ':') rhs0 of
(l,':':c) -> (l,c)
_ -> parseError rhs0
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment