summaryrefslogtreecommitdiff
path: root/2020/6.hs
diff options
context:
space:
mode:
authorTom Smeding <tom.smeding@gmail.com>2020-12-16 21:26:58 +0100
committerTom Smeding <tom.smeding@gmail.com>2020-12-16 21:26:58 +0100
commit2d324ad69e72e56ff99ce53c55e248661a363b82 (patch)
tree64fc33f35393703a066a6dd37b08292722a45937 /2020/6.hs
parentac45449f8882a76612dcca699f84f54f08edcff4 (diff)
Day 13
Diffstat (limited to '2020/6.hs')
-rw-r--r--2020/6.hs8
1 files changed, 1 insertions, 7 deletions
diff --git a/2020/6.hs b/2020/6.hs
index 14aa44a..be45715 100644
--- a/2020/6.hs
+++ b/2020/6.hs
@@ -1,18 +1,12 @@
module Main (main) where
import qualified Data.List.NonEmpty as NE
-import Data.List.NonEmpty (NonEmpty(..), (<|))
import qualified Data.Set as Set
import Input
+import Util
-splitOn :: (a -> Bool) -> [a] -> NonEmpty [a]
-splitOn _ [] = [] :| []
-splitOn f (x:xs) | f x = [] <| splitOn f xs
- | otherwise = let l :| ls = splitOn f xs
- in (x : l) :| ls
-
main :: IO ()
main = do
input <- getInput 6