View Category

Check your language appears on the langref.org site

Your language name should appear within the HTML found at the http://langreg.org main page.
haskell
{-# LANGUAGE OverloadedStrings #-}
import Control.Lens ((^.))
import Control.Monad (liftM)
import qualified Data.Text.Lazy as T
import qualified Data.Text.Lazy.Encoding as TL
import Network.Wreq (get, responseBody)

main = do
hasHaskell <- liftM
(\r -> (T.isInfixOf "haskell") . TL.decodeUtf8 $ r ^. responseBody)
(get "http://langref.org")

if hasHaskell then do
putStrLn "Haskell found"
else do
putStrLn "Haskell not found"
{-# LANGUAGE OverloadedStrings #-}
import Control.Monad (liftM)
import Data.Char (toLower)
import Data.List (isInfixOf)
import Network.HTTP (getRequest, getResponseBody, simpleHTTP)

main = do
hasHaskell <- liftM
(\body -> "haskell" `isInfixOf` (map toLower body))
(getResponseBody =<< simpleHTTP (getRequest "http://langref.org"))

if hasHaskell then do
putStrLn "Haskell found"
else do
putStrLn "Haskell not found"

Send an email

Use library functions, classes or objects to create a short email addressed to your own email address. The subject should be, "Greetings from langref.org", and the user should be prompted for the message body, and whether to cancel or proceed with sending the email.
haskell
-- cabal install smtp-mail

host = "gmail.google.com"

from = Address Nothing "email@domain.com"
to = [Address (Just "John Doe") "email@domain.com"]
cc = []
bcc = []
subject = "Greetings from langref.org"

mail body = simpleMail from to cc bcc subject [body]

main = getContents >>= sendMail host mail
-- cabal install smtp-mail

import Network.Mail.SMTP
import qualified Data.Text as T
import qualified Data.Text.Lazy as L

host = "smtp.example.com"

from = Address Nothing (T.pack "toto@example.com")
to = [Address Nothing (T.pack "jdoe@domain.com")]
cc = []
bcc = []
subject = T.pack "Greetings from langref.org"

mail body = simpleMail from to cc bcc subject [plainTextPart (L.pack body)]

main = getContents >>= (sendMail host . mail)