{"categories":["Haskell"],"published":"2012-08-28 22:52:31","width":"100%","provider_name":"Hatena Blog","image_url":null,"url":"https://www.shigemk2.com/entry/20120828/1346161951","description":"\u6a19\u6e96 import Data.List import Data.Char -- import qualified Data.Map as M wordNums :: String -> [(String,Int)] wordNums = map (\\ws -> (head ws, length ws)) . group. sort . words isIn :: (Eq a) => [a] -> [a] -> Bool needle `isIn` haystack = any (needle `isPrefixOf`) (tails haystack) encode :: Int -> Str\u2026","type":"rich","title":"\u6a19\u6e96\u30e2\u30b8\u30e5\u30fc\u30eb\u306e\u95a2\u6570\u3067\u554f\u984c\u3092\u89e3\u304f","provider_url":"https://hatena.blog","height":"190","blog_title":"by shigemk2","author_url":"https://blog.hatena.ne.jp/shigemk2/","blog_url":"https://www.shigemk2.com/","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fwww.shigemk2.com%2Fentry%2F20120828%2F1346161951\" title=\"\u6a19\u6e96\u30e2\u30b8\u30e5\u30fc\u30eb\u306e\u95a2\u6570\u3067\u554f\u984c\u3092\u89e3\u304f - by shigemk2\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","version":"1.0","author_name":"shigemk2"}