[darcs-users] urgent: will you be claiming back hackathon travel costs?

Ganesh Sittampalam ganesh at earth.li
Thu Mar 19 21:49:06 UTC 2009

On Wed, 18 Mar 2009, Eric Kow wrote:

> Also, I'll attach a crude calculator that I'll be using to compute the
> reimbursements (warning, it may have bugs), the core of which can be
> described by the following Haskell function:
> reimbursements pot []     = []
> reimbursements pot (x:xs) = payment : reimbursements leftover xs
> where
>  payment  = min share x
>  leftover = pot - payment
>  share    = pot / fromIntegral l
>  l        = 1 + length xs

I think this is indeed buggy, or at least underspecified, btw: suppose one 
person needs $990 and the other needs $10, then if the list is [10,990] 
they'll both get what they need, but if it's [990, 10] then the first 
person will only get $500. However if we require the input list to be 
sorted first, I think it's ok.


More information about the darcs-users mailing list