anchor.diff:                | (true, date) -> preturn(date)
                 | (false,_) -> fail "date not recognized")
   
  -  let previous datePart date =
  -    match datePart with
  -      | Day -> addDay -1 date
  -      | Week -> lastWeek date
  -      | Fortnight -> lastWeek (lastWeek date)
  -      | Month -> lastMonth date
  -      | Year -> lastYear date
  -  let next datePart date =
  -    match datePart with
  -      | Day -> addDay 1 date
  -      | Week -> nextOccurenceOf DayOfWeek.Monday date
  -      | Fortnight -> nextOccurenceOf DayOfWeek.Monday ((nextOccurenceOf DayOfWeek.Monday) date)
  -      | Month -> nextMonth date
  -      | Year -> nextYear date
  -
  -  let newprevious relativeShift date =
  -    match relativeShift with
  -      | PeriodShift Day -> addDay -1 date
  -      | PeriodShift Week -> lastWeek date
  -      | PeriodShift Fortnight -> lastWeek (lastWeek date)
  -      | PeriodShift Month -> lastMonth date
  -      | PeriodShift Year -> lastYear date
  -      | DayShift x -> previousOccurenceOf x date
  -
  -  let newnext datePart date =
  -    match datePart with
  -      | PeriodShift Day -> addDay 1 date
  -      | PeriodShift Week -> nextOccurenceOf DayOfWeek.Monday date
  -      | PeriodShift Fortnight -> nextOccurenceOf DayOfWeek.Monday ((nextOccurenceOf DayOfWeek.Monday) date)
  -      | PeriodShift Month -> nextMonth date
  -      | PeriodShift Year -> nextYear date
  -      | DayShift x -> nextOccurenceOf x date
  -
  -  let move size datePart date =
  -    match datePart with
  -      | Day -> addDay size date
  -      | Week -> addWeek size date
  -      | Fortnight -> addWeek (2*size) date
  -      | Month -> addMonth size date
  -      | Year -> addYear size date
  +  let previous  =
  +    function
  +      | PeriodShift Day -> addDay -1
  +      | PeriodShift Week -> lastWeek
  +      | PeriodShift Fortnight -> lastWeek >> lastWeek
  +      | PeriodShift Month -> lastMonth
  +      | PeriodShift Year -> lastYear
  +      | DayShift x -> previousOccurenceOf x
  +
  +  let next =
  +    function
  +      | PeriodShift Day -> addDay 1
  +      | PeriodShift Week -> nextOccurenceOf DayOfWeek.Monday
  +      | PeriodShift Fortnight -> nextOccurenceOf DayOfWeek.Monday >> nextOccurenceOf DayOfWeek.Monday
  +      | PeriodShift Month -> nextMonth
  +      | PeriodShift Year -> nextYear
  +      | DayShift x -> nextOccurenceOf x
  +
  +  let move size =
  +    function
  +      | Day -> addDay size
  +      | Week -> addWeek size
  +      | Fortnight -> addWeek (2*size)
  +      | Month -> addMonth size
  +      | Year -> addYear size
   
     let rec evaluate =
       function
           | Date(d) -> d.Apply
           | Weekday(day) -> nextOccurenceOf day
  -        | RelativeDay(offset, weekday) -> match offset with
  -                                            | Previous -> previousOccurenceOf weekday
  -                                            | Next -> nextOccurenceOf weekday
  -        | RelativeShift(offset,datePart) -> match offset with
  -                                                    | Previous -> (previous datePart) //>> (evaluate shift)
  -                                                    | Next -> (next datePart) //>> (evaluate shift)
  -        | AbsoluteForwardShift(size, datePart, shift) -> (move size datePart) >> evaluate shift
  -        | AbsoluteBackwardShift(size, datePart, shift) -> (move -size datePart) >> evaluate shift
  -        | Ago(size, datePart) -> (move -size datePart)
  -  let rec newEvaluate =
  -    function
  -        | NewShift.Date(d) -> d.Apply
  -        | NewShift.Weekday(day) -> nextOccurenceOf day
           | Relative(offset, shift) -> match offset with
  -                                            | Previous -> newprevious shift
  -                                            | Next -> newnext shift
  +                                            | Previous -> previous shift
  +                                            | Next -> next shift
           | Absolute(size, datePart, shift) -> match shift with
  -                                                  | Before sh -> (move -size datePart) >> newEvaluate sh
  -                                                  | After sh -> (move size datePart) >> newEvaluate sh
  +                                                  | Before sh -> (move -size datePart) >> evaluate sh
  +                                                  | After sh -> (move size datePart) >> evaluate sh
                                                     | AbsoluteShift.Ago -> (move -size datePart)
     let completeP =
       let pars, refPar = createParserForwardedToRef()
  
positive.code:     | DayShift of DayOfWeek
      | PeriodShift of DateParts
    type AbsoluteShift =
      | Before of NewShift
      | After of NewShift
      | Ago
    and NewShift =
      | Date of SpecificDate
      | Weekday of DayOfWeek
      | Relative of RelativeOffset * RelativeShift
      | Absolute of int * DateParts * AbsoluteShift
  
  
  
  
    type Shift =
      | Date of SpecificDate
      | Weekday of DayOfWeek
      | RelativeDay of RelativeOffset * DayOfWeek
      | RelativeShift of RelativeOffset * DateParts
      | AbsoluteForwardShift of int * DateParts * Shift
      | AbsoluteBackwardShift of int * DateParts * Shift
      | Ago of int * DateParts
  
  module NewParsers =
    open Types
  
negative.code:       choice [
          relativeDateP |>> Date
          weekdaysP |>> Weekday
          relativeP
          attempt (absoluteP pars)
          fallbackP |>> fun date -> Date(Specific(date))
        ]
      pars
      |>> evaluate
  
  
  type ParserConfig =
  