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

sqlite3 - UPDATE a table from the SELECT of another one -

c# - Showing a SelectedItem's Property -

javascript - Render HTML after each iteration in loop -