minimized text vs lazytext conversions between lib calls

This commit is contained in:
nerf van nerfingen 2022-11-18 11:58:49 +01:00
parent 3deede4516
commit 4bc23000bd
3 changed files with 28 additions and 26 deletions

View file

@ -22,7 +22,7 @@ getToday :: IO Day
getToday = utctDay <$> getCurrentTime
reportErrorLocal :: MonadIO m => String -> m ()
reportErrorLocal err = liftIO $ hPutStr stderr err
reportErrorLocal = liftIO . hPutStr stderr
reportErrorMail :: MonadIO m => Config -> String -> m ()
reportErrorMail config error' = send (mailDomain config) (mailUsername config) (mailPassword config) (mailErrorTo config) (mailFrom config) "choirMail Error" (LT.pack error')
@ -31,7 +31,7 @@ findChoirDay :: Day -> [MailRecord] -> Either String MailRecord
findChoirDay today table = maybe
(Left "Keine Probe :(")
(Right)
(L.find ((isChoirThisWeek today) .date) table)
(L.find ((isChoirThisWeek today) . date) table)
main' :: App ()
@ -63,7 +63,7 @@ main = do
Left error' -> reportErrorLocal error'
mailText :: MailRecord -> LT.Text
mailText record = LT.fromStrict $T.concat ["Guten Morgen,\n\n"
mailText record = LT.concat ["Guten Morgen,\n\n"
, announcement record
,"\n\ndiesen Donnerstag\n\nDurchsingen: "
,song1 record