aboutsummaryrefslogtreecommitdiff
path: root/src/Model
diff options
context:
space:
mode:
authorJoris2015-11-22 12:32:52 +0100
committerJoris2015-11-22 12:32:52 +0100
commitf96d239772f1bea5a483acd2dea973de3535e2da (patch)
tree47af74bd077593df4430b6f977a1adb423310ab7 /src/Model
parent82a16e953fcb9a692f3a5129085d95339c2988fb (diff)
downloadevents-f96d239772f1bea5a483acd2dea973de3535e2da.tar.gz
events-f96d239772f1bea5a483acd2dea973de3535e2da.tar.bz2
events-f96d239772f1bea5a483acd2dea973de3535e2da.zip
Check for list emptyness with null instead of length
Diffstat (limited to 'src/Model')
-rw-r--r--src/Model/Mail.hs12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/Model/Mail.hs b/src/Model/Mail.hs
index 2ae8df4..2af2159 100644
--- a/src/Model/Mail.hs
+++ b/src/Model/Mail.hs
@@ -20,13 +20,13 @@ mailSubject :: [Birthdate] -> [Birthdate] -> Text
mailSubject birthdaysToday birthdaysNextWeek =
T.concat
[ "Hey, "
- , if length birthdaysToday > 0
+ , if not . null $ birthdaysToday
then mailSubjectSentence Today birthdaysToday
else ""
- , if length birthdaysNextWeek > 0
+ , if not . null $ birthdaysNextWeek
then
T.concat
- [ if length birthdaysToday > 0 then " and " else ""
+ [ if not . null $ birthdaysToday then " and " else ""
, mailSubjectSentence NextWeek birthdaysNextWeek
]
else
@@ -52,13 +52,13 @@ mailSubjectSentence event birthdates =
mailBody :: Date -> [Birthdate] -> [Birthdate] -> Text
mailBody currentDate birthdaysToday birthdaysNextWeek =
T.concat
- [ if length birthdaysToday > 0
+ [ if not . null $ birthdaysToday
then mailBodySentence Today currentDate birthdaysToday
else ""
- , if length birthdaysNextWeek > 0
+ , if not . null $ birthdaysNextWeek
then
T.concat
- [ if length birthdaysToday > 0 then " " else ""
+ [ if not . null $ birthdaysToday then " " else ""
, mailBodySentence NextWeek currentDate birthdaysNextWeek
]
else ""