3 ms·
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'
by smosher 15y ago
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.)
- fleitz 15y agoF# 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
- smosher 15y ago(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.