[Haskell-beginners] Re: Function composition with more than
1 parameter
Glurk
streborg at hotmail.com
Sat Oct 25 06:34:23 EDT 2008
> 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 ! :)
More information about the Beginners
mailing list