Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Define a function mymap2 that has the type &behavior as map. No map, foldr, or foldl can be used. HELP if you know ML or
Define a function mymap2 that has the type &behavior as map. No map, foldr, or foldl can be used.
HELP if you know ML or SML: example of results
val mymap! = fn : ( 'a-> 'b) -> 'a list 'b list val mymap2 = fn : ( 'a-> 'b) -> 'a list-> 'b list val ord list = fn char list-> int list val myLength = fn : 'a list-> int val maxList = fn : int list-> int val it = () : unit ord list [#"A", #"b", #"c"]; val it = [65,98,67] : int list - myLength [9, 1, 4, 2, 3, 8, 71: val it = 7 : int - maxList [8, 2, 5, 9, 4, 7, 1, 31 val it 9 : int val mymap! = fn : ( 'a-> 'b) -> 'a list 'b list val mymap2 = fn : ( 'a-> 'b) -> 'a list-> 'b list val ord list = fn char list-> int list val myLength = fn : 'a list-> int val maxList = fn : int list-> int val it = () : unit ord list [#"A", #"b", #"c"]; val it = [65,98,67] : int list - myLength [9, 1, 4, 2, 3, 8, 71: val it = 7 : int - maxList [8, 2, 5, 9, 4, 7, 1, 31 val it 9 : intStep 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