darcs-2.18.5: a distributed, interactive, smart revision control system

Copyright | 2004 David Roundy
License | GPL
Maintainer | darcs-devel@darcs.net
Stability | experimental
Portability | portable
Safe Haskell | None
Language | Haskell2010

Darcs.Util.DateMatcher

Description

Synopsis

- parseDateMatcher :: String -> IO (CalendarTime -> Bool)
- data DateMatcher = Show d => DM String (Either ParseError d) (d -> CalendarTime -> Bool)
- getMatchers :: String -> IO [DateMatcher]
- testDate :: String -> IO ()
- testDateAt :: String -> String -> IO ()

# Documentation

parseDateMatcher :: String -> IO (CalendarTime -> Bool) #

`parseDateMatcher` `s` return the first matcher in `getMatchers` that can parse `s`

data DateMatcher #

A `DateMatcher` combines a potential parse for a date string with a "matcher" function that operates on a given date. We use an existential type on the matcher to allow the date string to either be interpreted as a point in time or as an interval.

Constructors

Show d => DM String (Either ParseError d) (d -> CalendarTime -> Bool) |

getMatchers :: String -> IO [DateMatcher] #

`getMatchers` `d` returns the list of matchers that will be applied on `d`. If you wish to extend the date parsing code, this will likely be the function that you modify to do so.

testDate :: String -> IO () #

`testDate` `d` shows the possible interpretations for the date string `d` and how they match against the current date

testDateAt :: String -> String -> IO () #

`testDate` `iso d` shows the possible interpretations for the date string `d` and how they match against the date represented by the ISO 8601 string `iso`