From 219bb4553646190cdc08e2405de8dd38e4b6fedf Mon Sep 17 00:00:00 2001 From: Ummon Date: Mon, 4 Dec 2017 08:06:24 +0100 Subject: [PATCH] Simplification --- AdventOfCode2017/Day4.fs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/AdventOfCode2017/Day4.fs b/AdventOfCode2017/Day4.fs index 995715f..0d2f6f8 100644 --- a/AdventOfCode2017/Day4.fs +++ b/AdventOfCode2017/Day4.fs @@ -16,5 +16,5 @@ let isAnagram (w1 : string) (w2 : string) = let passphraseValidAnagram = forallDistinctPairs isAnagram -let nbPassphrasesValid (f : string -> bool) (pps : string seq) = - pps |> Seq.map f |> Seq.fold (fun sum valid -> if valid then sum + 1 else sum) 0 \ No newline at end of file +let nbPassphrasesValid (f : string -> bool) = + Seq.map f >> Seq.sumBy (fun v -> if v then 1 else 0) \ No newline at end of file -- 2.45.2