title: Higher-order functions in VHDL or Verilog
body: <p>I've been programming in more functional-style languages and have gotten to appreciate things like tuples, and higher-order functions such as maps, and folds/aggregates.  Do either VHDL or Verilog have any of these kinds of constructs?</p>
  <p>For example, is there any way to do even simple things like</p>
  <pre><code>divByThreeCount = count (\x -&gt; x `mod` 3 == 0) myArray
  </code></pre>
  <p>or</p>
  <pre><code>myArray2 = map (\x -&gt; x `mod` 3) myArray
  </code></pre>
  <p>or even better yet let me define my own higher-level constructs recursively, in either of these languages?</p>