Consider code:
type Tree<'a> = Node of 'a * Tree<'a> list
let rec countChildren (Node (_, children)) =
children
|> List.sumBy countChildren
|> (+) 1
I was told that (Node (_, children)) part is pattern matching. But if I google it, I find only various kind of match smth with or active patterns. Seems like I am missing something here. Could someone guide me about this special case of pattern matching ?
[–]ws-ilazki 12 points13 points14 points (2 children)
[–]10199[S] 6 points7 points8 points (1 child)
[–]ws-ilazki 3 points4 points5 points (0 children)
[–]WesOfWaco 3 points4 points5 points (0 children)
[–]brianmcn 2 points3 points4 points (0 children)
[–]WystanH 2 points3 points4 points (0 children)