diff options
author | Tom Smeding <tom.smeding@gmail.com> | 2020-12-16 21:26:58 +0100 |
---|---|---|
committer | Tom Smeding <tom.smeding@gmail.com> | 2020-12-16 21:26:58 +0100 |
commit | 2d324ad69e72e56ff99ce53c55e248661a363b82 (patch) | |
tree | 64fc33f35393703a066a6dd37b08292722a45937 /2020/6.hs | |
parent | ac45449f8882a76612dcca699f84f54f08edcff4 (diff) |
Day 13
Diffstat (limited to '2020/6.hs')
-rw-r--r-- | 2020/6.hs | 8 |
1 files changed, 1 insertions, 7 deletions
@@ -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 |