Define a haskell function sum my nested that takes a list of mynested values and it returns the sum of all parameter values of myitem and myarray values. Since the parameter of myarray is a list of mynested values, it should recursively add all parameter values in that list. The function should return the overall sum as an int value

Respuesta :

The program of haskell function will be:

sumMyNested :: [MyNested] -> Int

sumMyNested [] = 0

sumMyNested (MyItem x:xs) = x + sumMyNested xs

sumMyNested (MyArray x:xs) = sum (map sumMyNested x) + sumMyNested xs

What is haskell function?

Haskell is a purely programming language of functional. This means that Haskell functions act more like mathematical functions. A function performs an operation on the input parameters and returns the result. Functions do not change the state of the system. In this section, we will introduce Haskell functions using examples from the code snippet below. The Haskell concept is based on pure functions and immutable data.

To learn more about haskell function

https://brainly.com/question/15055291

#SPJ4