From 021b5f06d3900fe2b10d5d3ccf6ac286a779ef16 Mon Sep 17 00:00:00 2001 From: hallgren Date: Thu, 19 Sep 2013 20:48:10 +0000 Subject: Introduce type RawIdent; only 9 imports of Data.ByteString.Char8 remain The fact that identifiers are represented as ByteStrings is now an internal implentation detail in module GF.Infra.Ident. Conversion between ByteString and identifiers is only needed in the lexer and the Binary instances. --- src/compiler/GF/Grammar/Lockfield.hs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'src/compiler/GF/Grammar/Lockfield.hs') diff --git a/src/compiler/GF/Grammar/Lockfield.hs b/src/compiler/GF/Grammar/Lockfield.hs index 8b0798527..5c2f5d0f0 100644 --- a/src/compiler/GF/Grammar/Lockfield.hs +++ b/src/compiler/GF/Grammar/Lockfield.hs @@ -16,8 +16,6 @@ module GF.Grammar.Lockfield (lockRecType, unlockRecord, lockLabel, isLockLabel) where -import qualified Data.ByteString.Char8 as BS - import GF.Infra.Ident import GF.Grammar.Grammar import GF.Grammar.Macros @@ -41,12 +39,12 @@ unlockRecord c ft = do _ -> return $ mkAbs xs (ExtR t lock) lockLabel :: Ident -> Label -lockLabel c = LIdent $! BS.append lockPrefix (ident2bs c) +lockLabel c = LIdent $! prefixRawIdent lockPrefix (ident2raw c) isLockLabel :: Label -> Bool isLockLabel l = case l of - LIdent c -> BS.isPrefixOf lockPrefix c + LIdent c -> isPrefixOf lockPrefix c _ -> False -lockPrefix = BS.pack "lock_" +lockPrefix = rawIdentS "lock_" -- cgit v1.2.3