-
Notifications
You must be signed in to change notification settings - Fork 38
/
Exercise.hs
51 lines (31 loc) · 1.08 KB
/
Exercise.hs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
module Y2017.M05.D15.Exercise where
import Data.Time.Calendar
import Data.Time.Calendar.Julian
import Data.Time.Clock
{--
AHA!
So, we need to log application events like:
"Would you like to play a game of chess?"
and
"Self-destruct sequence commencing in 5..."
and stuff like that. You know: the usual application log stuff.
But this is how we time-stamp the logged messages:
YYJJJTTTTTT
where
YY is the last two digits of they year, because Y2K taught us ... NOTHING!
JJJ is the Julian day of the year; and,
TTTTTT is the hour-minute-second of the log entry.
(Now don't ask me if that zulu time or not, because I just don't care.)
Now, in some programming language that starts with a 'J' this is very
... 'simple' to do.
CHA! RIGHT!
http://www.rgagnon.com/javadetails/java-0506.html
So, let's do this in Haskell.
GIVEN a message to log, OUTPUT that message with the above time-stamp.
--}
info :: String -> IO String
info message = undefined
{-- e.g.:
>>> info "ZO RELAXEN UND WATSCHEN DER BLINKENLICHTEN."
"17135114823 ZO RELAXEN UND WATSCHEN DER BLINKENLICHTEN."
--}