refactor the rest of the term builders to use more concise code

This commit is contained in:
Kasey White
2023-03-20 22:33:27 -04:00
committed by Lucas
parent 7c3750bbb4
commit 6e5b24a937
10 changed files with 346 additions and 1142 deletions

View File

@@ -10,10 +10,8 @@ type DayOfTheWeek {
fn is_work(day: DayOfTheWeek) {
when day is {
Tuesday | Wednesday | Thursday | Friday | Saturday ->
True
_ ->
False
Tuesday | Wednesday | Thursday | Friday | Saturday -> True
_ -> False
}
}
@@ -27,12 +25,10 @@ test is_work_2() {
fn is_happy_hour(day: DayOfTheWeek, current_time: Int) {
when day is {
Monday | Sunday ->
True
Monday | Sunday -> True
Tuesday | Wednesday | Thursday | Friday | Saturday if current_time > 18 ->
True
_ ->
False
_ -> False
}
}