Selectively replace multiple instances of a character within a string: Difference between revisions

m
Line 197:
case M.lookup c a of
Nothing -> (a, c)
Just ds[] -> (a, c)
Just (d if null: ds) ->
( M.insert thenc ds (a, c)
elsefromMaybe c d
( M.adjust tail c a,)
fromMaybe c (head ds)
)
 
--------------------------- TEST -------------------------
9,655

edits