- Perform exponentiation of two integers.
*Main> pow 5 3
125
- Create a list of multiples of
x
.
*Main> multiplesOf 3 5
[3,6,9,12,15]
- Given a list of numbers, return a list with each number multiplied by a constant:
*Main> multBy 4 [5,2,3,8]
[20,8,12,32]
- Given a list, return a list of even numbers only.
*Main> evenOnly [1..6]
[2,4,6]
- Given a list of numbers, return the product.
*Main> productOf [5,7,10]
350
- Given a list of numbers, return the smallest value.
*Main> smallest [5,2,20,-1,6]
-1
- Given a list of numbers, return the reciprocals. Skip zero if present.
*Main> reciprocals [4,5,1,0,8]
[0.25,0.2,1.0,0.125]
- Given an integral value, return its factorial.
*Main> factorial 6
720
- Given two sorted lists, return a list containing all of the values from both lists, also sorted.
*Main> merge [1,3,6] [2,4,9,10]
[1,2,3,4,6,9,10]
- Given a list, return a sorted list.
*Main> mergeSort [1,3,6,2,4,9,10]
[1,2,3,4,6,9,10]