8 do text <- readFile "data/advent05.txt"
9 let passes = lines text
13 part1 = maximum . map convert
15 part2 passes = head $ expecteds \\ ns
16 where ns = map convert passes
19 expecteds = [lowest..highest]
21 directionToInt :: Char -> Int
22 directionToInt dir = if dir `elem` "BR" then 1 else 0
24 convert :: String -> Int
25 convert = fst . head . readInt 2 (`elem` "FBLR") directionToInt