arrays - Get count of true in bool[,] F# -


I have a bool in F # [,] and I want to count the presence of truth. How can I do this without getting into compulsory programming?

This is my current solution, which is actually written in C #

  For unstable x = 0 cells in cells, if cell = true then x  

Here's a way:

  let x = cell | & Gt; Seq.cast | & Gt; Seq.filter ID | & Gt; Seq.length  

What does this false value filter out (see), and then guesses what is omitted after that


Comments

Popular posts from this blog

Member with no value in F# -

java - Joda Time Interval Not returning what I expect -

c# - Showing a SelectedItem's Property -