Rename AllFlags to RawFlags

I just like this new name better
This commit is contained in:
Joscha 2019-11-19 10:23:29 +00:00
parent 4707e929ef
commit 45ec7d1708
3 changed files with 6 additions and 6 deletions

View file

@ -18,7 +18,7 @@ module Mima.Flag
, flagChar
, Flags(..)
, rawFlags
, AllFlags
, RawFlags
, FlagSpec
, getFlagSpec
, interpretFlagSpec
@ -113,10 +113,10 @@ rawFlags = Flags
, flagReadOnly = ReadOnly
}
type AllFlags = Map.Map AddressRange (Set.Set Char)
type RawFlags = Map.Map AddressRange (Set.Set Char)
type FlagSpec = Flags AddressSpec
getFlagSpec :: AllFlags -> FlagSpec
getFlagSpec :: RawFlags -> FlagSpec
getFlagSpec af =
let isInSet :: Flag -> Set.Set Char -> Bool
isInSet f s = flagChar f `Set.member` s

View file

@ -29,5 +29,5 @@ fRange r
fLine :: (AddressRange, Set.Set Char) -> T.Text
fLine (r, s) = fRange r <> ": " <> fFlagSet s <> "\n"
formatFlagFile :: AllFlags -> T.Text
formatFlagFile :: RawFlags -> T.Text
formatFlagFile = mconcat . map fLine . Map.assocs

View file

@ -41,8 +41,8 @@ lLine = do
hidden lNewlines
pure (a, f)
parseFlagFile :: Parser AllFlags
parseFlagFile :: Parser RawFlags
parseFlagFile = space *> many lNewline *> (Map.fromList <$> many lLine) <* hidden eof
readFlagFile :: FilePath -> T.Text -> Either WeedErrorBundle AllFlags
readFlagFile :: FilePath -> T.Text -> Either WeedErrorBundle RawFlags
readFlagFile filename input = parse parseFlagFile filename input