Quantcast
Channel: Active questions tagged ocaml - Stack Overflow
Viewing all articles
Browse latest Browse all 660

Sorting by alphabetical order

$
0
0

I would like to create a function which will add a registration number plus a certain negative time. Here is an example :

# enter_car "DEF456" (−4) [("ABC13", −2); ("GHI789", −3)];;− : (string∗int) list = [("ABC13", −2); ("DEF456" , −4); ("GHI789", −3)]

I am pretty sure I am able to add ("DEF456", -4) to the list. The problem is the list has to be sorted by alphabetical order. How can I sort the list in alphabetical order according to the registration number?


Viewing all articles
Browse latest Browse all 660

Trending Articles



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