Skip to content

Instantly share code, notes, and snippets.

@bkyrlach
Created October 24, 2020 19:00
Show Gist options
  • Save bkyrlach/6496b69d36fbce28a43e58038349a570 to your computer and use it in GitHub Desktop.
Save bkyrlach/6496b69d36fbce28a43e58038349a570 to your computer and use it in GitHub Desktop.
module Pangram where
import Data.Set (Set)
import Data.Set as Set
import Data.Char (toLower, isLetter)
import Data.List as List
isPangram :: [Char] -> Bool
isPangram s = 26 == (Set.size $ Set.fromList $ fmap toLower (List.filter isLetter s))
@bkyrlach
Copy link
Author

combinePredicates :: (a -> Bool) -> (a -> Bool) -> (a -> Bool)
combinePredicates f g = \a -> (f a) && (g a)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment