Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Please help import this function in Haskell, use the spec and sample run below. Please note the output also has a Just before the output
Please help import this function in Haskell, use the spec and sample run below. Please note the output also has a "Just" before the output Int and "Nothing" if there is no Max value
Thanks!
maxNew maxNew:: [Int] -> [Int] -> Maybe Int Given a list of integers (xs), and a list of old integers (olds), find and return Just the largest integer in xs that isn't also in olds. When there is no such number, return Nothing Homework3> maxNew [1,2,3,4,5,6] [5,6] Just 4 Homework3> maxNew [1,5,3,4,6,2,4,4] 5,61 Just 4 *Homework3> maxNew [-5,-4,-3] -4 Just (-3) Homework3> maxNew [1,2,3] [1,2,3] Nothing Homework3> maxNew [1,1,1,1,3,3,3,3] 11,3 Nothing maxNew maxNew:: [Int] -> [Int] -> Maybe Int Given a list of integers (xs), and a list of old integers (olds), find and return Just the largest integer in xs that isn't also in olds. When there is no such number, return Nothing Homework3> maxNew [1,2,3,4,5,6] [5,6] Just 4 Homework3> maxNew [1,5,3,4,6,2,4,4] 5,61 Just 4 *Homework3> maxNew [-5,-4,-3] -4 Just (-3) Homework3> maxNew [1,2,3] [1,2,3] Nothing Homework3> maxNew [1,1,1,1,3,3,3,3] 11,3 Nothing
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