Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
idclip
on March 21, 2020
|
parent
|
context
|
favorite
| on:
It never makes sense to use foldl on lists in Hask...
If the list was a list of game states,
would foldl makes sense as a map that teats for winning or death conditions?
lmm
on March 21, 2020
[–]
No, you want foldr for that because you want the fold to finish as soon as you reach one of those conditions.
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search:
would foldl makes sense as a map that teats for winning or death conditions?