[Haskell-beginners] Problem "grouping" a list
Ozgur Akgun
ozgurakgun at gmail.com
Tue Nov 23 15:36:53 EST 2010
2010/11/23 João Paulo Pizani Flor <joaopizani at gmail.com>
> "The sum of the first elements in the tuples comprising the list must be
> greater than or equal to 1.0". That is, given a list of tuples, the boolean
> predicate deciding whether this list is a PROPER group (True) or TOO SMALL
> (False) is:
> \g -> sum (map fst g) >= 1.0
>
Either I am missing something obvious or this is a weird criterion. The
following function satisfies the requirement, if it is satisfiable at all.
groupAtoms = return
This would be an interesting problem, if you said you were trying to
maximise the number of groups returned.
--
Ozgur Akgun
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/beginners/attachments/20101123/c8bac2a3/attachment.html
More information about the Beginners
mailing list