Safe Haskell | None |
---|---|
Language | Haskell2010 |
- takeN1 :: Stream s m Char => Int -> ParsecT s st m a -> ParsecT s st m [a]
- number :: (Stream s m Char, Read a, Num a, Ord a) => Int -> a -> ParsecT s st m a
- pYear :: Stream s m Char => ParsecT s st m Int
- pYearNormal :: Stream s m Char => ParsecT s st m Int
- readNum :: (Num a, Stream s m Char) => ParsecT s st m a
- yearAbbreviations :: Stream s m Char => ParsecT s st m String
- makeAbbr :: String -> [String]
- pYearAny :: Stream s m Char => ParsecT s st m Int
- monthAssoc :: [(String, Month)]
- casings :: String -> [String]
- parseAs :: Stream s m Char => [String] -> String -> ParsecT s st m String
- pMonthName :: Stream s m Char => ParsecT s st m Month
- pMonth :: Stream s m Char => ParsecT s st m Month
- pDay :: Stream s m Char => ParsecT s st m Int
- uppercase :: String -> String
- isPrefixOfI :: String -> String -> Bool
- uniqFuzzyMatch :: (Bounded a, Enum a, Show a) => String -> Either [a] a
Documentation
takeN1 :: Stream s m Char => Int -> ParsecT s st m a -> ParsecT s st m [a] Source #
Parsers the parser at least once, but no more than n times.
:: (Stream s m Char, Read a, Num a, Ord a) | |
=> Int | Number of digits |
-> a | Maximum value |
-> ParsecT s st m a |
Parse natural number of N digits which is not greater than M
monthAssoc :: [(String, Month)] Source #
parseAs :: Stream s m Char => [String] -> String -> ParsecT s st m String Source #
Parse various capitalizations of the given string, but always return the same string on success.
isPrefixOfI :: String -> String -> Bool Source #
Case-insensitive version of isPrefixOf
:: (Bounded a, Enum a, Show a) | |
=> String | |
-> Either [a] a | Either collection of matches or the unique match |
Use a data type's Bounded, Enum and Show instances to determine if the given string uniquely matches a constructor. The comparison is case-insensitive and starts from the beginning of the strings (so a partial constructor name can still match if there are enough characters for a unique match)
For example:
data Things = Foo | Bar | Baz deriving (Bounded, Enum, Show) -- Right Foo uniqFuzzyMatch "f" :: Either [Things] Things -- Left [Bar, Baz] uniqFuzzyMatch "ba" :: Either [Things] Things