Run-length encoding: Difference between revisions

Line 2,152:
encode s = strcat $ map (sprintf "%d%s") $ encode $ chars s with
encode [] = [];
encode xs@(x:_) = (#takewhile (===x) xs,x) : encode (dropwhile (===x) xs);
end;
 
Anonymous user