
16 Jan
2004
16 Jan
'04
4:43 a.m.
Hello, and welcome me to the list I think it would often be useful if the list functions with class constraints had versions paramaterized on a function mapping your element type into an instance of the classes, in addition to the "By" forms that take an implementation for the required class method. Almost all of the times I use the "By" functions follow that pattern: e.g. sortFoos :: [Foo] -> [Foo] sortFoos = sortBy (\x y -> compare (f x) (f y)) I suggest "Under" as a modifier. "By" would be nice (as in "sortBy fst", "sortBy valueOf", etc) but it's already taken. We are using the image under some function to control the list munging, so it seems appropriate. How does this sound? Brandon Moore