python (12.9k questions)
javascript (9.2k questions)
reactjs (4.7k questions)
java (4.2k questions)
java (4.2k questions)
c# (3.5k questions)
c# (3.5k questions)
html (3.3k questions)
Functional Programming in Kotlin: Counting elements in list by using fold
I've got the task to write a function using fold (functional programming) to count the number of elements in a list that fulfill the predicate. I was given the function signature fun <A> count(l...

Pythagorion
Votes: 0
Answers: 4
Question about the Foldable Maybe instance
Source: Hutton, Graham. "Programming in Haskell" (p. 267)
Show how the Maybe type can be made foldable and traversable, by giving explicit definitions for fold, foldMap, foldr, foldl and t...

F. Zer
Votes: 0
Answers: 1
Processing successors in dfs with Haskell
Consider the following Python function, which, given the successors of a node, visits them and collects the results. (In practice this logic would form a part of the recursive visit function.)
from ty...

Eric Auld
Votes: 0
Answers: 1