[Haskell-begin] For starters...

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[Haskell-begin] For starters...

Rafael Gustavo da Cunha Pereira Pinto
I am trying to write a toy function to sum all members of a list but the
biggest. This list is entirely composed by integers bigger than 0.

I have:

f::[Integer]->Integer
f a = x a - y a where
                 x=sum
                 y=foldr max 0

Is there any way to implement that using composition, so I have a point-free
implementation?


--
Rafael Gustavo da Cunha Pereira Pinto
Electronic Engineer, MSc.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/beginners/attachments/20080717/cbc4a7c8/attachment-0001.htm