
4 Feb
2005
4 Feb
'05
12:36 p.m.
Ashley Yakeley wrote:
The most basic or at least the most obvious function in a time library is one that gets the current time. What is its return type?
getCurrentTime :: IO ???
The only way to find out the current time is to ask the system for it, so, following the rule of avoid-unnecessary-conversions, I think it boils down to what the system provides. My impression is that it doesn't reliably provide us anything. Therefore we should omit getCurrentTime from the library. :-) Or, more pragmatically, have it return OSTime, and provide broken-by-design conversions from that to everything else. OSTime would presumably be struct timeval on Unix, and FILETIME or SYSTEMTIME on Win32. -- Ben