Is there a function to determine if a date is a business day?

You will need to write it, as it depends upon your definition of what a business day is. This tends to be country-specific (at least). -- Colin Adams Preston Lancashire

Colin Paul Adams wrote:
You will need to write it, as it depends upon your definition of what a business day is. This tends to be country-specific (at least).
Agreed. I'm a Haskell-newbie so I can't give the Haskell code for this, but in "pseudo-code" it would be something like this - holidays_list = ["09JAN", "06FEB", ..... ] ( This will vary depending on country ) if myday not in holidays_list and day(myday) in ["Mon", "Tue", "Wed", "Thu", "Fri"] then business_day(myday) = "Yes" else business_day(myday) = "No" Some countries have a "Holidays Act" or similar legislation which specifies the holidays for the current year and the next few years. Hope this helps.... :) - Andy

2009/12/11 Hong Yang
_______________________________________________ Beginners mailing list Beginners@haskell.org http://www.haskell.org/mailman/listinfo/beginners
I don't know, but wouldn't it be nice if there was some package dealing with "cultures"? Something along the lines of: data Culture = Culture { country :: Country, language :: Language, isHoliday :: (Day -> Bool), firstDayOfWeek :: Day, ... } -- Deniz Dogan
participants (4)
-
Andy Elvey
-
Colin Paul Adams
-
Deniz Dogan
-
Hong Yang