Menu

(Solved) : 7 11 Pts Let G List Defined Rot X Last X Init X G 1 3 5 Rot X X Q43963148 . . .

Haskell Programming – Code

Do it in Haskell GHCI

7. [11 pts). Let g be the list defined below. > rot x = last x : init x > g = [1,3,5] : [rot x | X <- g] Use referential tran

7. [11 pts). Let g be the list defined below. > rot x = last x : init x > g = [1,3,5] : [rot x | X <- g] Use referential transparency to calculate/show the pattern of the values for take n g for n = 0, 1, 2, …. Don’t just show the results of the expressions: The point of the problem is to explain how the calculations work/are related. If you want, you can use a couple of properties: take (m+1) g=head g: take m(tail g) and take (m+1) = take mg ++ [e] where e is the expression for the last element of take (m+1) g. Show transcribed image text 7. [11 pts). Let g be the list defined below. > rot x = last x : init x > g = [1,3,5] : [rot x | X

Expert Answer


Answer to Haskell Programming – Code Do it in Haskell GHCI …

OR