query
On this page

count

lib.count

Docs pulled from | This Revision | about 12 hours ago


Count how many elements of list match the supplied predicate function.

Inputs

pred

Predicate

Type

count :: (a -> bool) -> [a] -> int

Examples

lib.lists.count usage example

count (x: x == 3) [ 3 2 3 4 6 ]
=> 2
(lib.lists.count)

Noogle also knows

Aliases