Answered step by step
Verified Expert Solution
Link Copied!

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!

image text in transcribed

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Object Oriented Databases Prentice Hall International Series In Computer Science

Authors: John G. Hughes

1st Edition

0136298745, 978-0136298748

More Books

Students also viewed these Databases questions