Clean up documentation
This commit is contained in:
parent
df3adf5ca4
commit
10ee238886
1 changed files with 8 additions and 8 deletions
16
src/Cards.hs
16
src/Cards.hs
|
|
@ -19,6 +19,7 @@ module Cards
|
||||||
, Tier -- Tier stuff
|
, Tier -- Tier stuff
|
||||||
, tierDiff
|
, tierDiff
|
||||||
, tierName
|
, tierName
|
||||||
|
, Parser -- Other stuff
|
||||||
, testElements
|
, testElements
|
||||||
) where
|
) where
|
||||||
|
|
||||||
|
|
@ -233,7 +234,7 @@ cardToString Card{sides=s, tier=t, lastChecked=lc, offset=o} =
|
||||||
- Parsing
|
- Parsing
|
||||||
-}
|
-}
|
||||||
|
|
||||||
-- | Not yet implemented.
|
-- | Simple alias to clean up type signatures.
|
||||||
type Parser = Parsec Void String
|
type Parser = Parsec Void String
|
||||||
|
|
||||||
sc :: Parser ()
|
sc :: Parser ()
|
||||||
|
|
@ -264,8 +265,6 @@ infostring time = do
|
||||||
let card = createCard time []
|
let card = createCard time []
|
||||||
return $ foldr (.) id cardModifiers card
|
return $ foldr (.) id cardModifiers card
|
||||||
|
|
||||||
-- TODO: implement
|
|
||||||
-- Possible implementation: Compose (Card -> Card)s and apply to base Card
|
|
||||||
innerinfo :: Parser (Card -> Card)
|
innerinfo :: Parser (Card -> Card)
|
||||||
innerinfo = try tierInfo
|
innerinfo = try tierInfo
|
||||||
<|> try lastCheckedInfo
|
<|> try lastCheckedInfo
|
||||||
|
|
@ -336,14 +335,15 @@ element time = comment <|> (ECard <$> pCard time) <?> "element"
|
||||||
|
|
||||||
-- a bunch of elements
|
-- a bunch of elements
|
||||||
|
|
||||||
--line :: Parser Element
|
-- | A megaparsec parser parsing a list of elements in the format of the original python script.
|
||||||
--line = EComment <$> manyTill anyChar newline
|
--
|
||||||
|
-- Use this parser if you want nice error messages to display.
|
||||||
-- | TODO: Implement properly
|
|
||||||
parseElements :: UTCTime -> Parser [Element]
|
parseElements :: UTCTime -> Parser [Element]
|
||||||
parseElements time = sepEndBy (element time) (some newline) <* eof
|
parseElements time = sepEndBy (element time) (some newline) <* eof
|
||||||
|
|
||||||
-- | TODO: Implement properly
|
-- | The 'parseElements' parser, but simpler to use.
|
||||||
|
--
|
||||||
|
-- Use this when the user doesn't need to see any error messages.
|
||||||
parseElementsMaybe :: UTCTime -> String -> Maybe Elements
|
parseElementsMaybe :: UTCTime -> String -> Maybe Elements
|
||||||
parseElementsMaybe time str = do
|
parseElementsMaybe time str = do
|
||||||
elms <- parseMaybe (parseElements time) str
|
elms <- parseMaybe (parseElements time) str
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue