foldl’ seems simpler to me but whatever

Reply to this note

Please Login to reply.

Discussion

nostr:nprofile1qy2hwumn8ghj7un9d3shjtnddaehgu3wwp6kyqpqxtscya34g58tk0z605fvr788k263gsu6cy9x0mhnm87echrgufzs9d84s8 nostr:nprofile1qy2hwumn8ghj7un9d3shjtnddaehgu3wwp6kyqpq8nexvs44uwvzhjlp3x3ua3f4n8npw45krta6nv9u5rkddecwnfqqramclj

How is

foldl' (\acc _ -> f acc) x [1 .. n]

simpler than

iterate f x !! n

?

!! is horrific imo