ABC words: Difference between revisions

Content added Content deleted
(→‎{{header|Haskell}}: Added a solution in Haskell)
m (→‎{{header|Haskell}}: desugared do)
Line 525: Line 525:
| c == x = Just xs
| c == x = Just xs
| otherwise = go xs
| otherwise = go xs



--------------------------- TEST -------------------------
--------------------------- TEST -------------------------
main = do
main :: IO ()
main =
s <- readFile "unixdict.txt"
readFile "unixdict.txt" >>= \s ->
mapM_ print $ zip [1 ..] $ filter isABC (lines s)</lang>
mapM_ print $ zip [1 ..] $ filter isABC (lines s)</lang>
{{Out}}
{{Out}}
<pre>(1,"aback")
<pre>(1,"aback")