Hacker News new | past | comments | ask | show | jobs | submit login

It's amusing to mention clarity, given the topic. Because the cargo-cult of this kind of function having return type 'int' is lack of clear thinking manifest. Int has 4-billion distinct values and all they want is three.

Here's clarity:

datatype order https://smlfamily.github.io/Basis/general.html#SIG:GENERAL.o...

function compare https://smlfamily.github.io/Basis/string.html#SIG:STRING.com...

    case String.compare(a, b) of
    | LESS    => ...
    | EQUAL   => ...
    | GREATER => ...



Consider applying for YC's Summer 2025 batch! Applications are open till May 13

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: