Kernighans large earthquake problem: Difference between revisions

Content added Content deleted
Line 301: Line 301:
cs <- C.readFile "data.txt"
cs <- C.readFile "data.txt"
mapM_ print $
mapM_ print $
concatMap
C.lines cs >>=
(\x ->
(\x ->
[ x
[ x
| 6 < (read (last (C.unpack <$> C.words x)) :: Float) ]) $
| 6 < (read (last (C.unpack <$> C.words x)) :: Float) ])</lang>
C.lines cs</lang>
{{Out}}
{{Out}}
<pre>"8/27/1883 Krakatoa 8.8"
<pre>"8/27/1883 Krakatoa 8.8"