Quantcast
Channel: Programming Forums
Viewing all articles
Browse latest Browse all 51036

SML/NJ higher order function?

$
0
0
I'm trying to implement a function

ziprev : 'a list -> 'b list -> ('a * 'b)list
- ziprev [1,2,3,4] [10,20,30,40];
val it = [(1,40),(2,30),(3,20),(4,10)] : (int * int) list



Using zipWith and the List.rev from the library.

Attempt:
fun ziprev xs ys = List.rev(List.zipWith SOMETHING xs);



I'm confused as to what to put in something, i don't think it's a function, i tried ys but the type is not the same, everything else I tried gives me error.

Viewing all articles
Browse latest Browse all 51036

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>