letlikesnames=matchnameswith|[]->"no one likes this"|[a]->sprintf"%s likes this"a|[a;b]->sprintf"%s and %s like this"ab|[a;b;c]->sprintf"%s, %s and %s like this"abc|a::b::rest->sprintf"%s, %s and %d others like this"abrest.Length
Alternatively a point-free version without explicit argument, though it's considered bad style for exported functions:
letlikes=function|[]->"no one likes this"|[a]->sprintf"%s likes this"a|[a;b]->sprintf"%s and %s like this"ab|[a;b;c]->sprintf"%s, %s and %s like this"abc|a::b::rest->sprintf"%s, %s and %d others like this"abrest.Length
We're a place where coders share, stay up-to-date and grow their careers.
F#:
Alternatively a point-free version without explicit argument, though it's considered bad style for exported functions: