I was wondering how to check whether a string is a pangram, as a beginner's exercise. I have two solutions, but I don't understand them at all.
Version 1
import Data.Char (toLower)
isPangram :: String -> Bool
isPangram str = all (`elem` map toLower str) ['a'..'z']
Version 2
import Data.Char (toLower)
isPangram :: String -> Bool
isPangram str = allPresent (map toLower str) ['a'..'z']
allPresent :: String -> String -> Bool
allPresent _ [] = True
allPresent [] _ = False
allPresent (x:xs) ys
| x `elem` ys = allPresent xs ys
| otherwise = False
Not sure if they're correct, but any help to simplify or modify this would be appreciated!