projects
/
advent-of-code-16.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
9e997c0
)
Tidyied linebreaks
author
Neil Smith
<neil.git@njae.me.uk>
Tue, 6 Dec 2016 08:55:03 +0000
(08:55 +0000)
committer
Neil Smith
<neil.git@njae.me.uk>
Tue, 6 Dec 2016 08:55:03 +0000
(08:55 +0000)
advent04.hs
patch
|
blob
|
history
diff --git
a/advent04.hs
b/advent04.hs
index e48c257ac812e1d1caa0ffd54288a44ce980c8ad..135ad379ee7ba1b3fa0bfb8c15e0370afb59a4d1 100644
(file)
--- a/
advent04.hs
+++ b/
advent04.hs
@@
-44,7
+44,8
@@
parseLine line = Room {name=name, sector=sector, checksum=checksum}
countedLetters :: String -> [(Char, Int)]
countedLetters name = sortBy sortCLetter $ unsortedCountedLetters name
countedLetters :: String -> [(Char, Int)]
countedLetters name = sortBy sortCLetter $ unsortedCountedLetters name
- where unsortedCountedLetters name = Map.toList $ Map.fromListWith (+) [(c, 1) | c <- filter (isLetter) name]
+ where unsortedCountedLetters name =
+ Map.toList $ Map.fromListWith (+) [(c, 1) | c <- filter (isLetter) name]
sortCLetter :: (Char, Int) -> (Char, Int) -> Ordering
sortCLetter (l1, n1) (l2, n2)
sortCLetter :: (Char, Int) -> (Char, Int) -> Ordering
sortCLetter (l1, n1) (l2, n2)