Anonymous user
Determine if a string is squeezable: Difference between revisions
m
→{{header|Haskell}}
No edit summary |
|||
Line 716:
</pre>
=={{header|Haskell}}==
<lang haskell>import Text.Printf (printf)
input :: [(String, Char)]
Line 742 ⟶ 741:
main =
mapM_ (\(a, b, c) -> printf "squeeze: '%c'\nold: %3d «««%s»»»\nnew: %3d «««%s»»»\n\n" c (length a) a (length b) b)
$ (\(s, c) -> (s, collapse s c, c)) <$> input</lang>
{{out}}
<pre>
|