
On Sat, Apr 4, 2009 at 5:20 AM, Zachary Turner
With Conal's semantic editor combinators
http://conal.net/blog/posts/semantic-editor-combinators/
it would be written as
trueIndices = (result . result) (map fst . filter snd . zip [0..]) (zipWith (&&))
That was a pretty interesting blog post, and easily understandable which is always nice. Thanks for the link. I also had never even used the zipWith function, so thanks for pointing out that equivalence.
I'm not sure you really want to write this pointfree... Generally I tend to avoid it when there's two arguments of identical standing. Also the (map fst . filter snd...) is a Data.List function (findIndices) : trueIndices xs ys = findindices id $ zipWith (&&) xs ys I love the pointfree style and it might be a good exercise to try and transcribe any function to pointfree, but sometimes pointful is just clearer. -- Jedaï