er.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map">Array.map</a> function.</p><p>Here's what it looks like in Ocaml:</p><pre><code class="ml"># Array.map (( * ) 2) [|1; 2; 3|];;
- : int array = [|2; 4; 6|]

# Array.map string_of_int [|1; 2; 3|];;
- : string array = [|&quot;1&quot;; &quot;2&quot;; &quot;3&quot;|]</code></pre><p>In order for a type to be a functor, it needs to have a <code>map</code> function that also satisfies two laws. The laws ensure that the <code>map</code> fun