deniok: (ухмыляюсь)
deniok ([personal profile] deniok) wrote2008-02-13 12:32 am
Entry tags:

Какой грязный хак :)

suminit :: [Int] -> Int -> Int -> (Int,[Int]) 
suminit xs len acc | len `seq` acc `seq` False = undefined -- :)))
                   | len == 0  = (acc,xs) 
                   | otherwise = case xs of []   -> (acc,[]) 
                                            x:xs -> suminit xs (len-1) (acc+x)
Найдено тут.

Post a comment in response:

This account has disabled anonymous posting.
If you don't have an account you can create one now.
HTML doesn't work in the subject.
More info about formatting