
adam vogt [2010.05.07 1158 -0400]:
Hello Norbert,
I have a couple suggestions to improve the API (which is sort of orthogonal to Brent's idea to merge with CycleWS):
+ nextMatch + , prevMatch + , nextMatchOrDo + , prevMatchOrDo + , nextMatchWithThis + , prevMatchWithThis + , historyHook + , recent + , recentMatch + , recentMatchOrDo
The number of functions here could be reduced by about half if you have instead:
] data MatchDir = Next | Prev | Recent ] match :: MatchDir -> X () ] matchOrDo :: MatchDir -> X () -> X () ] ...
Then people may use `match Next', instead of `nextMatch' which isn't much longer.
I'm not sure about substituting the _OrDo, and _WithThis functions with a single function that takes more parameters.
The reason those `rotate' functions are missing from the standard library is because they are inefficient. This shouldn't matter for this module, but if we had 100s of windows, it would be important to use Data.Sequence instead of lists.
Lastly, documentation and examples should be improved: the type signature of nextMatchWithThis doesn't suggest that you can use nextMatchWithThis className etc.
Lots of nice suggestions, and I don't see anything to object to. So I'll see about incorporating them soon and sending a new patch. The efficiency of the rotate stuff is something I worried about, too, but then decided that I normally don't have 100s of windows. Still, it would be nice to do this better. Cheers, Norbert