From 1a515e12547887ab238e7ac588afd9a4ec46da6a Mon Sep 17 00:00:00 2001 From: Jonathan Chan Date: Mon, 18 Dec 2017 02:02:10 -0800 Subject: [PATCH] Day 14 - minor refactoring --- 14.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/14.hs b/14.hs index b690ee4..d71727c 100644 --- a/14.hs +++ b/14.hs @@ -3,7 +3,7 @@ import Data.Char (ord) import Data.Bits (xor) import Text.Printf (printf) import Data.Graph (scc, graphFromEdges) -import Data.Tuple.Select (sel1, sel2) +import Data.Tuple.Select (sel1) import Data.Sequence (Seq, index, fromList) type Length = Int @@ -48,4 +48,4 @@ main :: IO () main = do let hashes = concat $ map (sparseHash . (++ [17, 31, 73, 47, 23]) . map ord . ("ffayrhll-" ++) . show) [0..127] print $ length . filter (== '1') $ hashes - print $ length . scc . sel1 . graphFromEdges . sel2 $ foldr getEdges (fromList hashes, []) [0..128 * 128 - 1] \ No newline at end of file + print $ length . scc . sel1 . graphFromEdges . snd $ foldr getEdges (fromList hashes, []) [0..128 * 128 - 1] \ No newline at end of file