Activity assignment 1
Activity assignments
Implement following functions. There will be 5 points for each of these functions.
- Create a function that gets a list of tuples (Int, Char). This function takes these pair and for each of these pairs (n, a) generates a string where
the charactera
is multipliedn
times. The function result is a concatenation of these sub-strings.
create :: [(Int, Char)] -> String
create [(2,'a'), (3,'B')] = "aaBBB"
- Create a function that gets a list of tuples (Int, Char). This function tkaes these pair and for each of these pairs (n, a) generates a string where the character
a
is multiplied n
times. The function result is a concatenation of these sub-strings.
create :: [(Int, Char)] -> String
create [(2,'a'), (3,'B')] = "aaBBB"