From 625c0cfd9bc2c3b943878330974b5939c0b8555a Mon Sep 17 00:00:00 2001 From: Braden Walters Date: Thu, 21 Jan 2016 22:19:41 +0100 Subject: [PATCH] Resolved warnings in Handler/Common.hs --- Handler/Common.hs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Handler/Common.hs b/Handler/Common.hs index 228b650..f6239bf 100755 --- a/Handler/Common.hs +++ b/Handler/Common.hs @@ -19,6 +19,7 @@ module Handler.Common where import Data.FileEmbed (embedFile) import Yesod.Form.Bootstrap3 import qualified Data.Text as T +import qualified Data.Text.Lazy as TL import qualified Data.List as L import qualified Data.Text.Lazy.Encoding as E import qualified Data.Text.Read as R @@ -40,7 +41,7 @@ getRobotsR :: Handler TypedContent getRobotsR = return $ TypedContent typePlain $ toContent $(embedFile "config/robots.txt") --- msgToBSSubmit :: T.Text -> BootstrapSubmit T.Text +msgToBSSubmit :: AppMessage -> BootstrapSubmit AppMessage msgToBSSubmit t = BootstrapSubmit { bsValue = t , bsClasses = "btn-default" @@ -105,6 +106,7 @@ volumeField = Field showVal = either id (pack . showA) showA x = show ((fromIntegral x :: Double) / 1000) +barcodeField :: (RenderMessage (HandlerSite m) FormMessage, Monad m) => Field m [Text] barcodeField = Field { fieldParse = parseHelper $ Right . removeItem "" . L.nub . T.splitOn ", " , fieldView = \theId name attrs val isReq -> toWidget [hamlet|$newline never @@ -185,7 +187,7 @@ checkAlert bId = do if beverageAmount bev < beverageAlertAmount bev then do master <- getYesod - let to = appEmail $ appSettings master + let to = appEmail $ appSettings master liftIO $ sendMail to "Niedriger Bestand" [stext| Hallo, @@ -200,7 +202,7 @@ der Matemat else return () -- do nothing ---sendMail :: MonadIO m => Text -> Text -> Text -> m () +sendMail :: Text -> Text -> TL.Text -> IO () sendMail to subject body = renderSendMail Mail