Skip to content

Instantly share code, notes, and snippets.

@josephcsible
Created December 9, 2024 06:16
Show Gist options
  • Save josephcsible/891b486e668cf4b9cd2c45ef6cab42e7 to your computer and use it in GitHub Desktop.
Save josephcsible/891b486e668cf4b9cd2c45ef6cab42e7 to your computer and use it in GitHub Desktop.
import Control.Monad (when)
import Data.Foldable (traverse_)
import Data.List (nub, uncons)
main :: IO ()
main = getContents >>= traverse_ (liftA2 when ((`all`
[ odd . length . filter (`notElem` "AEIOU")
, elem 'N'
, any (uncurry $ flip $ foldr ((.) . flip . ((||) .) . (. succ) . (==) <*> flip id) (const False)) . uncons
, (`elem` [6,7]) . length
, (/=) <*> nub <$> filter (`elem` "AEIOU")
]) . flip id) putStrLn) . lines
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment