projects
/
advent_of_code_2017.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5609366
)
Simplification
author
Ummon
<greg.burri@gmail.com>
Mon, 4 Dec 2017 07:06:24 +0000
(08:06 +0100)
committer
Ummon
<greg.burri@gmail.com>
Mon, 4 Dec 2017 07:06:24 +0000
(08:06 +0100)
AdventOfCode2017/Day4.fs
patch
|
blob
|
history
diff --git
a/AdventOfCode2017/Day4.fs
b/AdventOfCode2017/Day4.fs
index
995715f
..
0d2f6f8
100644
(file)
--- 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