Haskell time library: Weekday and Month

Henning Thielemann lemming at henning-thielemann.de
Thu Apr 15 08:06:45 EDT 2010


I recently wanted to move from old-time to time in my bibtex package, but I was 
no longer so enthusiastic about it, when I became aware, that for instance 
weekdays and months are handled as plain numbers. Wouldn't it be better to make 
them enumerations or newtypes (if efficiency is important)? For a complex 
matter like coping with time it would be nice to have precise types in order to 
know, what can be converted to what given what context. In case of weekdays and 
months a custom type would also make it irrelevant for the user, whether you 
count days and months starting from zero or one.


More information about the Libraries mailing list