Answered step by step
Verified Expert Solution
Question
1 Approved Answer
1.1) The function app, defined by: app f [x, y] = [fx, fy], gives eg: app (* 2) [3,4] = [6,8] .Define note that does
1.1) The function app, defined by: app f [x, y] = [fx, fy], gives eg: app (* 2) [3,4] = [6,8] .Define note that does it same as app on any list. 1.2) Use foldr to define what meets the equation: fapp f xs = lapp f xs. 1.3) Use foldr to define function smsq n = 1 ^ 2 + 2 ^ 2 + ... + n ^ 2. 1.4) Define tail recursive function longest :: [[a]] -> [[a]] which picks all longest lists from the list of lists, eg longest ["abcd", "ab", "1234", "asd" ] = ["abcd", "1234"].
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started