Re: [Haskell-cafe] algebra/grammar/language for expressing time intervals

2009-09-17 Thread Magnus Therning

Iain Alexander wrote:

You might want to take a look at
RFC 2445
Internet Calendaring and Scheduling Core Object Specification
Section 4.8.5.4 Recurrence Rule


Another source of inspiration might be the syntax used in remind[1].

/M

[1]: http://www.roaringpenguin.com/products/remind

--
Magnus Therning(OpenPGP: 0xAB4DFBA4)
magnus@therning.org  Jabber: magnus@therning.org
http://therning.org/magnus identi.ca|twitter: magthe



signature.asc
Description: OpenPGP digital signature
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] algebra/grammar/language for expressing time intervals

2009-09-15 Thread Iain Alexander
You might want to take a look at
RFC 2445
Internet Calendaring and Scheduling Core Object Specification
Section 4.8.5.4 Recurrence Rule
-- 
Iain Alexander  i...@stryx.demon.co.uk

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] algebra/grammar/language for expressing time intervals

2009-09-14 Thread Jeremy Shaw

Hello,

I need some cron-like functionality for long running daemon written in  
Haskell.


I want to be able to schedule an event to be run:

  1. once, at a specific time
  2. some regularly scheduled time

I don't see an existing library to do this, so I am starting work on  
my own.


The first issue I am looking at is how to specify time intervals. The  
primary example I have looked at is cron. Cron is pretty good, but I  
don't see a way to do something like, run a job every other Wednesday.


I also want to be able to display the interval schedule to the user,  
allow them to modify it, and also save the schedule to disk and reload  
it. So this essentially means that the type for describing the  
intervals can not contain any functions.


Does anyone know of a good language for describing intervals? I want  
to be able to express things like:


 - run every other wednesday
 - run at 15 minutes past the hour
 - run at 15 minutes past the hour every wednesday
 - run at 15 and 25 minutes past the hour between the hours of 2 and  
6 AM.
 - run every weekday at 8AM unless it is a holiday (the list of  
holidays would be supplied).


Basically, everything you can express with cron, and a bit more.

Is there any existing languages/grammars/algebras for this that I  
should look at?


thanks!
- jeremy
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe