
5 Jul
2006
5 Jul
'06
6:58 a.m.
Hi, In MissingH, I have a bunch of little functions that operate on lists. Some, like uniq (which eliminates duplicate elements in a list), operate on (Eq a => [a]) lists. Others, like strip (which eliminates whitespace at the start and end), operate on Strings only. Most functions of both types would be useful on ByteStrings and lazy ByteStrings. Most of these functions are written in terms of Data.List functions or list primitives that have equivolents in Data.ByteString. So, my question is: is there a clever hack available to me so that I could have 1 version of each function, and have it work on all three different types of input? I'd rather avoid having 3 versions, that are exactly the same except for imports. Thanks, -- John