diff --git a/day-08-haskell/src/Common.hs b/day-08-haskell/src/Common.hs index f7c1d10..bd8cbc3 100644 --- a/day-08-haskell/src/Common.hs +++ b/day-08-haskell/src/Common.hs @@ -1,3 +1,4 @@ +{-# LANGUAGE TupleSections #-} module Common where import Data.Foldable (toList) @@ -11,7 +12,7 @@ pairPermutations :: [a] -> [(a, a)] pairPermutations [] = [] pairPermutations [_] = [] pairPermutations [x, y] = pure (x, y) -pairPermutations (x:xs) = map (\y -> (x, y)) xs ++ pairPermutations xs +pairPermutations (x:xs) = map (x,) xs ++ pairPermutations xs type Position = (Int, Int) type Antenna = (Char, Position)