[commit: ghc] wip/nfs-locking: Use splitOn to parse the Way (9ae96f4)

git at git.haskell.org git at git.haskell.org
Fri Oct 27 00:35:41 UTC 2017


Repository : ssh://git@git.haskell.org/ghc

On branch  : wip/nfs-locking
Link       : http://ghc.haskell.org/trac/ghc/changeset/9ae96f4017f3d11da5684a15b0a6b4e10c182dd9/ghc

>---------------------------------------------------------------

commit 9ae96f4017f3d11da5684a15b0a6b4e10c182dd9
Author: Neil Mitchell <ndmitchell at gmail.com>
Date:   Sat Jan 9 21:47:47 2016 +0000

    Use splitOn to parse the Way


>---------------------------------------------------------------

9ae96f4017f3d11da5684a15b0a6b4e10c182dd9
 src/Way.hs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/Way.hs b/src/Way.hs
index 94a3bcc..5b24662 100644
--- a/src/Way.hs
+++ b/src/Way.hs
@@ -72,7 +72,7 @@ instance Read Way where
         uniqueReads token = case reads token of
             [(unit, "")] -> Just unit
             _            -> Nothing
-        units  = map uniqueReads . words . replaceEq '_' ' ' $ s
+        units  = map uniqueReads . splitOn "_" $ s
         result = if Nothing `elem` units
                  then []
                  else [(wayFromUnits . map fromJust $ units, "")]



More information about the ghc-commits mailing list