From: Ummon Date: Thu, 7 Dec 2017 09:29:10 +0000 (+0100) Subject: Less verbose X-Git-Url: https://git.euphorik.ch/?a=commitdiff_plain;h=ded504b921af57a9e0efa35d7df037bb187a11b7;p=advent_of_code_2017.git Less verbose --- diff --git a/AdventOfCode2017/Day7.fs b/AdventOfCode2017/Day7.fs index 2d4c252..827fee1 100644 --- a/AdventOfCode2017/Day7.fs +++ b/AdventOfCode2017/Day7.fs @@ -46,4 +46,4 @@ let rec findUnbalanced (tower : Tower) : (Tower * int) option = match tower.Above |> List.ofSeq |> List.groupBy weight |> List.sortBy (snd >> List.length) with | [ w1, [ unbalanced ]; w2, _ ] -> findUnbalanced unbalanced |> Option.orElse (Some (unbalanced, unbalanced.Weight + w2 - w1)) - | _ -> tower.Above |> Seq.tryPick (fun t -> findUnbalanced t) + | _ -> tower.Above |> Seq.tryPick findUnbalanced