
19 Sep
2011
19 Sep
'11
9:26 a.m.
I'm trying to sort a list of Text values using a collator obtained from the Text.Data.ICU.Collate module in the text-icu package on Hackage. Unfortunately, I can't use the normal Data.List.sortBy function with one of these collators, because the collators return (IO Ordering), not Ordering. It's easy to write sortWithCollator :: [Text] -> IO [Text], but I'd rather not have to. I haven't been able to find library support for this anywhere -- am I overlooking it, or do I need to write the sort function myself? Thanks, Richard