我有以下代码:
findPerson name peeps = List.foldl
(\a b -> case b of
Just _ -> b
Nothing -> if a.name == name then
Just a
else Nothing
) Nothing peeps
我想a记录b. foldl我试过了:
findPerson : String -> List Person -> Maybe Person
findPerson name peeps = List.foldl
(\a b ->
Debug.log(a)
Debug.log(b)
case b of
Just _ -> b
Nothing -> if a.name == name then
Just a
else Nothing
) Nothing peeps
但是,这会引发错误
I am looking for one of the following things:
a closing paren ')'
whitespace`
我做错了什么,如何记录里面的值foldl?