deniok: (ухмыляюсь)
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)
Найдено тут.

Profile

deniok: (Default)
deniok

February 2022

S M T W T F S
  12345
6789101112
13141516171819
20212223 242526
2728     

Syndicate

RSS Atom

Style Credit

Expand Cut Tags

No cut tags
Page generated Jun. 20th, 2025 06:51 pm
Powered by Dreamwidth Studios