HaskellNet 0.6 → 0.6.0.1
raw patch · 4 files changed
+12/−41 lines, 4 filesdep ~basedep ~base64PVP ok
version bump matches the API change (PVP)
Dependency ranges changed: base, base64
API changes (from Hackage documentation)
Files
- CHANGELOG +3/−0
- HaskellNet.cabal +5/−3
- example/smtp2.hs +0/−34
- src/Text/Packrat/Parse.hs +4/−4
CHANGELOG view
@@ -1,3 +1,6 @@+0.6.0.1 (2022-05-17)+ - GHC 9.0+ support+ 0.6 (2020-12-27) ---------------- - sendMail API was simplified (see Updating.md for details)
HaskellNet.cabal view
@@ -6,7 +6,7 @@ Full examples can be found in the <https://github.com/qnikst/HaskellNet/tree/master/example repository>. Additional documentation on the major updates can be found in the <https://github.com/qnikst/HaskellNet/blob/master/Updating.md Updating.md> file-Version: 0.6+Version: 0.6.0.1 Copyright: (c) 2006 Jun Mukai Author: Jun Mukai Maintainer: Alexander Vershilov <alexander.vershilov@sirius.online>,@@ -22,7 +22,9 @@ GHC ==8.4.4 || ==8.6.5 || ==8.8.4- || ==8.10.2+ || ==8.10.7+ || ==9.0.2+ || ==9.2.2 Extra-Source-Files: CHANGELOG@@ -66,7 +68,7 @@ Network.Mail.Mime Build-Depends:- base >= 4.3 && < 4.15,+ base >= 4.3 && < 4.17, network >= 2.6.3.1 && < 3.2, mtl, bytestring >=0.10.2,
− example/smtp2.hs
@@ -1,34 +0,0 @@-{-# OPTIONS -fno-warn-missing-signatures #-}-{-# LANGUAGE OverloadedStrings #-}--import Network.HaskellNet.Auth-import Network.HaskellNet.SMTP-import Network.HaskellNet.SMTP.SSL-import Network.Mail.Mime-import Network.HaskellNet.Debug-import Control.Monad-import qualified Data.Text as T-import qualified Data.ByteString as S-import qualified Data.ByteString.Lazy as B---- | Your settings-server = "smtp.yandex.ru"-username = "no-reply@cheops.olimpiada.ru"-password = "Voo3gahm"-authType = PLAIN-from = Address (Just "A V") "no-reply@cheops.olimpiada.ru"-to = Address (Just "V A") "alexander.vershilov@gmail.com"-subject = "Network.HaskellNet.SMTP Test :)"-plainBody = "Hello world!\r\n.\r\nsomething else"-htmlBody = "<html><head></head><body><h1>Hello <i>world!</i></h1></body></html>"-attachments = [] -- example [("application/octet-stream", "/path/to/file1.tar.gz), ("application/pdf", "/path/to/file2.pdf")]--main = do- conn <- connectSMTPSSLWithSettings server defaultSettingsSMTPSSL{sslLogToConsole=True}- authSucceed <- authenticate PLAIN (T.unpack username) (T.unpack password) conn- when authSucceed $ do- let newMail = Mail from [to] [] [] [("Subject", T.pack subject)] [[htmlPart htmlBody, plainPart plainBody]]- newMail' <- addAttachments attachments newMail- sendMail newMail' conn- Network.HaskellNet.SMTP.SSL.closeSMTP conn-
src/Text/Packrat/Parse.hs view
@@ -84,7 +84,7 @@ (<|>) :: Derivs d => Parser d v -> Parser d v -> Parser d v (Parser p1) <|> (Parser p2) = Parser parse where parse dvs = first dvs (p1 dvs)- first _ (result @ (Parsed {})) = result+ first _ (result@(Parsed {})) = result first dvs (NoParse err) = second err (p2 dvs) second err1 (Parsed val rem err) = Parsed val rem (joinErrors err1 err)@@ -94,7 +94,7 @@ satisfy :: Derivs d => Parser d v -> (v -> Bool) -> Parser d v satisfy (Parser p) test = Parser parse where parse dvs = check dvs (p dvs)- check dvs (result @ (Parsed val _ _)) =+ check dvs (result@(Parsed val _ _)) = if test val then result else NoParse (nullError dvs)@@ -204,7 +204,7 @@ Parsed v rem (fix dvs err) munge dvs (NoParse err) = NoParse (fix dvs err)- fix dvs (err @ (ParseError ep _)) =+ fix dvs (err@(ParseError ep _)) = if ep > dvPos dvs then err else expError (dvPos dvs) desc@@ -224,7 +224,7 @@ -- but only if the position didn't change from the first to the second. -- If it did, just return the "new" (second) set of errors. joinErrors :: ParseError -> ParseError -> ParseError-joinErrors (e @ (ParseError p m)) (e' @ (ParseError p' m'))+joinErrors (e@(ParseError p m)) (e'@(ParseError p' m')) | p' > p || null m = e' | p > p' || null m' = e | otherwise = ParseError p (m `union` m')