Anonymous user
Determine if a string is collapsible: Difference between revisions
m
→{{header|Haskell}}
m (→{{header|Haskell}}: improved) |
|||
Line 662:
collapse :: String -> String
collapse s = catMaybes $ zipWith(\a b -> if a /= b then a else Nothing) (Nothing : ms) (
where ms = map Just s
|