- Define the function mostlyTrue that takes as
input three values of type Bool and returns
True if at least two them are True.
For instance:
mostlyTrue True True False = True
mostlyTrue False True False = False
- Define the function bestTwo that takes as
input three Int values and returns the sum of
the largest two of the three. For instance:
bestTwo 3 1 2 = 5
bestTwo 3 4 3 = 7
- Define the function find that takes as input
x (an Int) and ys (a list
of Int) and returns True if
x appears in ys. For instance:
find 7 [8,9] = False
find 7 [8,7,9] = True
- Define the function findboth that takes as
input x, y (both Int) and
zs (a list of Int) and returns
True if both x and y appear
in zs. For instance:
findboth 7 8 [8,9] = False
findboth 7 8 [8,7,9] = True
- Define the function findall that takes as
input xs and ys (both lists of
Int) and returns True if every
Int in xs appears in ys.
For instance:
findall [] [1,3] = True
findall [3,4] [1,3] = False
findall [3,4] [1,3,4,1] = True