#! /usr/bin/haskell
import Data.List
statementList :: [String]
statementList =
["I'm very much afraid I didn't mean anything but nonsense!"
,"Obama founded the IS"
,"Just the place for a Snark!"
,"Just the place for a Snark!"
,"6 * 7 = 42"
,"I'm very much afraid I didn't mean anything but nonsense!"
,"6 * 7 = 39"
,"6 * 7 = 39"
,"Obama founded the IS"
,"Just the place for a Snark!"
,"6 * 7 = 42"
,"I'm very much afraid I didn't mean anything but nonsense!"
,"6 * 7 = 39"
,"Obama founded the IS"
]
atLeastThrice :: [String] -> [String]
atLeastThrice sL = [head grp | grp <- group $ sort sL, length grp >= 3]
-- ========== result - if loaded and executed in GHCI ==========
-- ghci> atLeastThrice statementList
-- ["6 * 7 = 39","I'm very much afraid I didn't mean anything but nonsense!","Just the place for a Snark!","Obama founded the IS"]
ここには何もないようです