-
Notifications
You must be signed in to change notification settings - Fork 13
Open
Labels
new functionRequest to add a new function to the libraryRequest to add a new function to the library
Description
combineFoldl
combineFoldl :
(a -> acc -> Result err acc)
-> acc
-> List a
-> Result err acc
combineFoldl f acc list =
case list of
[] ->
Ok acc
head :: tail ->
case f head acc of
Err e ->
Err e
Ok v ->
resultFoldl f v tailMotivating use case
It's common to fold over a list while keeping track of some state. Doing Result.andThen / Result.map is a List.foldl does not short circuit, whereas this function does.
gampleman
Metadata
Metadata
Assignees
Labels
new functionRequest to add a new function to the libraryRequest to add a new function to the library