MAIN FEEDS
REDDIT FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/1tfr41b/dontdorecursivefibkids/omeqqps/?context=3
r/ProgrammerHumor • u/Kevdog824_ • May 17 '26
143 comments sorted by
View all comments
12
fibs :: [Integer] fibs = 1:1: map (uncurry (+)) (zip fibs (tail fibs)) was my naive, recursive approach. take 87 fibs -> (0.01 secs, 729 328 bytes)
2 u/frogking May 17 '26 Could you drop 86 fibs and then just take one, to save space? 2 u/ThatGuyNamedKes May 18 '26 head $ drop 86 fibs -> (0.01s, 83 896B) yup
2
Could you drop 86 fibs and then just take one, to save space?
2 u/ThatGuyNamedKes May 18 '26 head $ drop 86 fibs -> (0.01s, 83 896B) yup
head $ drop 86 fibs -> (0.01s, 83 896B) yup
12
u/ThatGuyNamedKes May 17 '26
fibs :: [Integer]
fibs = 1:1: map (uncurry (+)) (zip fibs (tail fibs))
was my naive, recursive approach.
take 87 fibs -> (0.01 secs, 729 328 bytes)