I have the following code:
findPerson name peeps = List.foldl
(\a b -> case b of
Just _ -> b
Nothing -> if a.name == name then
Just a
else Nothing
) Nothing peeps
I would like to log the values of a
and b
inside the foldl
. I've tried:
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
However, this throws an error
I am looking for one of the following things:
a closing paren ')'
whitespace`
What am I doing wrong, and how can I log the values inside foldl
?