-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Please see the README on GitHub at -- https://github.com/ReedOei/fuzzy-dates#readme @package fuzzy-dates @version 0.1.0.0 module Data.Dates.Parsing.Internal -- | Parsers the parser at least once, but no more than n times. takeN1 :: Stream s m Char => Int -> ParsecT s st m a -> ParsecT s st m [a] -- | Parse natural number of N digits which is not greater than M 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] -- | Parse various capitalizations of the given string, but always return -- the same string on success. 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 -- | Case-insensitive version of isPrefixOf isPrefixOfI :: String -> String -> Bool -- | 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
--   
uniqFuzzyMatch :: (Bounded a, Enum a, Show a) => String -> Either [a] a -- | Parse strings that aren't so precise module Data.Dates.Parsing data Config -- | Which day of the week to consider the start day Config :: DateTime -> WeekDay -> Config -- | Current date/time, to use as base for relative dates [_now] :: Config -> DateTime [_startOfWeekDay] :: Config -> WeekDay -- | Date and Time data DateTime :: * DateTime :: Date -> TimeOfDay -> DateTime [dtDate] :: DateTime -> Date [dtTime] :: DateTime -> TimeOfDay data DateInterval Days :: Int -> DateInterval Weeks :: Int -> DateInterval Months :: Int -> DateInterval Years :: Int -> DateInterval -- | Represent time types that can be created from other time types. -- -- Every conversion happens throught ElapsedP or Elapsed types. class Timeable t => Time t -- | convert from a number of elapsed seconds and nanoseconds to another -- time representation timeFromElapsedP :: Time t => ElapsedP -> t -- | convert from a number of elapsed seconds and nanoseconds to another -- time representation -- -- defaults to timeFromElapsedP unless defined explicitely by an -- instance. timeFromElapsed :: Time t => Elapsed -> t defaultConfig :: DateTime -> Config defaultConfigIO :: IO Config -- | Parse date/time parseDate :: Config -> String -> Either ParseError Date -- | Parse date/time parseDateTime :: Config -> String -> Either ParseError DateTime pAbsDateTime :: Stream s m Char => Int -> ParsecT s st m DateTime pAbsDate :: Stream s m Char => Int -> ParsecT s st m Date -- | Parsec parser for Date only. pDate :: Stream s m Char => Config -> ParsecT s st m Date -- | Parsec parser for DateTime. pDateTime :: Stream s m Char => Config -> ParsecT s st m DateTime pTime :: Stream s m Char => ParsecT s st m TimeOfDay pDateInterval :: Stream s m Char => ParsecT s st m DateInterval -- | Weekday as interval from the configure start of the week weekdayToInterval :: Config -> WeekDay -> DateInterval -- | Get weekday of given date. dateWeekDay :: DateTime -> WeekDay getStartOfThisWeek :: Config -> DateTime getStartOfNextWeek :: Config -> DateTime lastDate :: Stream s m Char => Config -> ParsecT s st m DateTime nextDate :: Stream s m Char => Config -> ParsecT s st m DateTime -- | Add date interval to DateTime addInterval :: DateTime -> DateInterval -> DateTime -- | Negate DateInterval value: Days 3 -> Days (-3). negateInterval :: DateInterval -> DateInterval -- | Subtract DateInterval from DateTime. minusInterval :: DateTime -> DateInterval -> DateTime dateInFormat :: Stream s m Char => Int -> DateFormat -> ParsecT s st m Date -- | Same as extractDatesY, but will get the current year from the system, -- so you don't have to provide it. extractDates :: String -> IO [Date] -- | Extract dates from a string, with the first argument being the current -- year (used for things like "Jan 18"). -- --
--   >>> extractDatesY 2018 "The party will be on 6/9"
--   [Date 2018 June 9]
--   
extractDatesY :: Int -> String -> [Date] extract :: Stream s m Char => ParsecT s st m a -> ParsecT s st m [a] instance Data.Data.Data Data.Dates.Parsing.DateInterval instance GHC.Show.Show Data.Dates.Parsing.DateInterval instance GHC.Classes.Eq Data.Dates.Parsing.DateInterval