File tree 3 files changed +10
-17
lines changed
3 files changed +10
-17
lines changed Original file line number Diff line number Diff line change 1
1
import Data.Time
2
2
3
3
timeNow now =
4
- case
5
- (todHour (localTimeOfDay (zonedTimeToLocalTime now)) < 12 )
6
- of
7
- True -> putStrLn " It's before noon"
8
- False -> putStrLn " It's after noon"
9
-
4
+ case todHour (localTimeOfDay (zonedTimeToLocalTime now)) < 12 of
5
+ True -> putStrLn " It's before noon"
6
+ False -> putStrLn " It's after noon"
10
7
11
8
data ServicePlan = Free | Monthly | Annual
12
9
@@ -16,29 +13,21 @@ billAmount plan =
16
13
Monthly -> 5
17
14
Annual -> billAmount Monthly * 12
18
15
19
-
20
16
writeNumber i =
21
17
case i of
22
18
1 -> " one"
23
19
2 -> " two"
24
20
3 -> " three"
25
21
_ -> " unknown number."
26
22
27
-
28
23
main =
29
24
do
30
25
now <- getZonedTime
31
26
timeNow now
32
27
33
28
let plan = Free
34
- putStrLn
35
- ( " Customer owes " ++ ( show (billAmount plan)) ++ " dollars." )
29
+ putStrLn ( " Customer owes " ++ show (billAmount plan)
30
+ ++ " dollars." )
36
31
37
32
let i = 2
38
- putStrLn
39
- (" Write " ++ show i ++ " as " ++ (writeNumber i))
40
-
41
-
42
-
43
-
44
-
33
+ putStrLn (" Write " ++ show i ++ " as " ++ (writeNumber i))
Original file line number Diff line number Diff line change
1
+ It's ... noon
2
+ Customer owes 0 dollars.
3
+ Write 2 as two
Original file line number Diff line number Diff line change 21
21
in
22
22
23
23
linkFarm "haskell-phrasebook-outputs" [
24
+ ( run' "branching.txt" ../branching.hs { sed = [ "s!^It's .* noon$!It's ... noon!" ] ; } )
24
25
( run "common-types.txt" ../common-types.hs )
25
26
( run "for-loops.txt" ../for-loops.hs )
26
27
( run "hashing.txt" ../hashing.hs )
You can’t perform that action at this time.
0 commit comments