f 3 [1,11,111,1111,...]gives
>>> toListOf (every 1) [0..4] [0,1,2,3,4] >>> toListOf (every 2) [0..4] [0,2,4] >>> toListOf (every 3) [0..4] [0,3]
>>> itoListOf (every 2) "Hello" [(0,'H'),(2,'l'),(4,'o')]
>>> [0..4] ^.. every 1 [0,1,2,3,4] >>> [0..4] ^.. every 2 [0,2,4] >>> [0..4] ^.. every 3 [0,3]
traversed) you are focusing on every element
Hi there ,
i want to run a simple email sender with smtp from the Module :
The Modul is already installed. cabal list --installed tells this !!!
However, there is a compilation error that is asking for the Module :
But cabal cannot FIND this module ! ANY IDEA WOULD HELP !
Here is the example code of the session :
import qualified Data.Text.Lazy as T
main = doSMTP "your.smtp.server.com" $ \conn ->
authSucceed <- authenticate PLAIN "username" "password" conn
then sendPlainTextMail "firstname.lastname@example.org" "email@example.com" "subject" (T.pack "Hello! This is the mail body!") conn
else print "Authentication failed."
Here is the result of compilation with the right smtp data.
$ ghc -o sendmail_4 sendmail_4.hs
Could not find module `Network.HaskellNet.Auth'
Use -v to see a list of the files searched for.
cabal has listed the following Network Module :
network installed version 126.96.36.199 , 188.8.131.52
isVowel :: Char -> Bool isVowel x = x `elem` ['a', 'e', 'i', 'o', 'u', 'A', 'E', 'I', 'O', 'U'] isNotVowel :: Char -> Bool isNotVowel x = not (isVowel x) recursiveAlternateVowels :: String -> Bool -> Bool recursiveAlternateVowels xs v = go xs v where go  _ = True go (x:xs) True = isVowel x && go xs False go (x:xs) False = isNotVowel x && go xs True wordContainsAlternateVowels :: String -> Bool wordContainsAlternateVowels  = True wordContainsAlternateVowels (x:xs) | isVowel x = recursiveAlternateVowels ([x]++xs) True | isNotVowel x = recursiveAlternateVowels ([x]++xs) False
isVowel :: Char -> Bool isVowel = flip elem "aeiouAEIOU" checkAlternate :: (a -> Bool) -> [a] -> Bool checkAlternate p0 l = all id $ reverse bools where bools = snd $ foldl (\(p, acc) c -> (not . p, p c : acc)) (p0, ) l checkAlternateVowels :: String -> Bool checkAlternateVowels = checkAlternate isVowel