You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<pre><code>> multiples = filter (\n -> mod n 3 == 0 || mod n 5 == 0) ns</code></pre>
125
125
<p>You can see the result by evaluating <code>multiples</code> if you like, or even check its type:</p>
126
126
<pre><code>> multiples
127
-
Cons 0 (Cons 3 (Cons 5 (Cons 6 (Cons ...
127
+
(0 : 3 : 5 : 6 : 9 : 10 : 12 : 15 : 18 : 20 :
128
128
> :type multiples
129
129
List Int</code></pre>
130
130
<p>Now we need to find the sum of the <code>multiples</code> array, to complete the solution. We can use the <code>sum</code> function from the <code>Data.Foldable</code> module.</p>
0 commit comments