
25 Oct
2008
25 Oct
'08
6:34 a.m.
The lambdabot on #haskell has a plugin named "pointless" that can transform this into a definition that doesn't mention x and xs anymore. I think it will propose
howMany = (length .) . matches
And with
matches x xs = filter (x==) xs
matches x = filter (x==)
matches = filter . (==)
we have
howMany = (length .) . filter . (==)
howMany = curry (length . uncurry matches)
Thanks apfelmus, unfortunately, none of those suggested changes seem to work ! I get errors like :- Unresolved top-level overloading *** Binding : howMany2 *** Outstanding context : Eq b I'm using WinHugs - do you get them to work in some other environment ? Thanks ! :)