I want to make a custom map function that does the same thing as the predefined map function in sml, I wrote the following code:
fun mymap f = fn L => foldr f [] L;
Which is bascially a function f, that can then take a list and apply the function f to the list, since map function takes a list and function and return the another list, now what I'm getting is :
val mymap = fn : ('a * 'b list -> 'b list) -> 'a list -> 'b list
but the predefined map function has the following output:
val it = fn : ('a -> 'b) -> 'a list -> 'b list
what is the problem that I made here? Thanks
NOTE: I must use foldr or foldl function and use currying