News for hackers. Stuff that matters.
Re:On F# code readability by flaie on Monday March 04, 2013 @03:21PM (#5320616)
You're right about the fact that on the left on `::` can never be anything other than the head of a list.

But I'd like to add that throughout almost all OCaml code I've written and used to read, that type of matching was written:

    match list with 
        | h::t -> 
Wich reads easily `h` for `head` and `t` for `tail`. I'm surprised it hasn't been reproduced in the F# world.

`h::t` seems even better to me than `head`/`tail` or `x`/`xs` which for the second one, means nothing really to me.

Re:On F# code readability by mich41 on Monday March 04, 2013 @03:48PM (#5320804)
Maybe your code isn't famous enough. I've seen lots of x::xs's everywhere, but never a single h::t.

Personally, I always use x::xs in one-liners and something meaningful (no, neither head nor h is meaningful) in longer matches.

Re:On F# code readability by flaie on Monday March 04, 2013 @04:20PM (#5321050)
I've never mentioned my code as being famous. I've always used h and t in one-liners, maybe because of the person who taught me OCaml.

H and t can also be found in the official Caml and batteries source code, along with hd/tl, a/l and probably x/xs if it pleases you.

I can't agree more about naming variables correctly where it makes sense though.