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

I've done this sort of thing to satisfy DRY in general (this kind of nesting problem is quite repetitive), and to generally make the intention more obvious. It's not so pretty in certain other languages, but still worth it.

(Edit: I posted before you edited.)




F# always gets me in the editing mode because after I write it the first time I realize there is some built in function that makes the whole thing so much easier. I realized my match statement inside of a recursive function was just reimplementing List.pick


(I thought it was OCaml at first... then I realized you had `null` in there which isn't what you'd want.)

OCaml/F# are too convenient that way. There's a lot of library stuff that you won't always think to look for.




Join us for AI Startup School this June 16-17 in San Francisco!

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

Search: