Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Homework 5 (7 pts) 1. How many library functions are available in Haskell for cr

ID: 3693560 • Letter: H

Question

Homework 5

(7 pts) 1.         How many library functions are available in Haskell for creating an array?

                        a.         Give an example for each one

                        b.         Where each one is used? Why?

(5 pts) 2.         What are differences between list and array in Haskell?

a.         Random access of elements, for modification, is available in case of list or array, or both? Give examples.

(3 pts) 3.         Explain element extraction in array; compare it element extraction in list. What are the similarities and differences?

(4 pts) 4.         Explain what library should be imported before using array? Why this library should be imported? Why it is not in the group of prelude library functions?

(5 pts) 2.         Explain how can an array be made into a list?

(6 pts) 4.         How fold can be used to write a function that takes a list of numbers and give their sum? Give example, in other words, use fold and write mySum.

Explanation / Answer

1)Answer:

Array
DiffArray     IOArray   STArray
UArray IOUArray
DiffUArray   StorableArry STUArray

2)

a)

3)   

4)

5)

6) program: