Determine if a string is collapsible: Difference between revisions

m
Line 646:
</pre>
=={{header|Haskell}}==
<lang haskell>import Text.Printf (printf)
import Text.Printf (printf)
import Data.Maybe (catMaybes)
import Control.Monad (guard)
Line 668 ⟶ 667:
main =
mapM_ (\(a, b) -> printf "old: %3d «««%s»»»\nnew: %3d «««%s»»»\n\n" (length a) a (length b) b)
$ ((,) <*> collapse) <$> input</lang>
</lang>
{{out}}
<pre>
Anonymous user