Question: The following problem needs to be done in SML All exercises should all have one-line solutions using map, foldr, or foldl. You can also use

The following problem needs to be done in SML

All exercises should all have one-line solutions using map, foldr, or foldl. You can also use other predefined functions, of course, but do not write any additional named functions and do not use explicit recursion. . If you need helper functions, use anonymous ones. For example, if the problem says write a function add2 that takes an int list and returns the same list with 2 added to every element, your answer should be fun add2 x = map (fn a => a + 2) x;

Write a function truecount of type bool list -> int that takes a list of boolean values and returns the number of trues in the list.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!