jhickner / smtp-mail

Making it easy to send SMTP email from Haskell
BSD 3-Clause "New" or "Revised" License
75 stars 32 forks source link

Unified port, w/o port function naming #5

Closed dubiousdavid closed 11 years ago

dubiousdavid commented 11 years ago

I'm wondering if the following convention would be helpful for differentiating with and without a port function variations. I'm assuming most users will not need to specify a port, so I made those names easier to write/remember.

--This one uses the default port (25)
connectSMTP :: Hostname -> IO SMTPConnection

connectSMTP' :: Hostname -> PortNumber -> IO SMTPConnection

--This one uses the default port (25)
sendMail :: Hostname -> Mail -> IO ()

sendMail' :: Hostname -> PortNumber -> Mail -> IO ()

--This one uses the default port (25)
sendMailWithLogin :: Hostname -> UserName -> Password -> Mail -> IO ()

sendMailWithLogin' :: Hostname -> PortNumber -> UserName -> Password -> Mail -> IO ()

Notice also the Hostname type alias for increased clarity. Let me know what you think.

David

jhickner commented 11 years ago

Sure, I think this looks fine. Do you want to put together a pull request?

dubiousdavid commented 11 years ago

Sure thing.

On Dec 17, 2012, at 3:40 PM, Jason Hickner notifications@github.com wrote:

Sure, I think this looks fine. Do you want to put together a pull request?

— Reply to this email directly or view it on GitHub.