From 8d9513e9df67c5ec0abc2d94152f350274233643 Mon Sep 17 00:00:00 2001 From: Tomasz Chojnacki Date: Wed, 7 Dec 2022 14:23:47 +0100 Subject: Refactor earlier solutions --- aoc-2022-dotnet/Day07/Day07.fsproj | 4 ++++ aoc-2022-dotnet/Day07/Program.fs | 8 ++++---- 2 files changed, 8 insertions(+), 4 deletions(-) (limited to 'aoc-2022-dotnet/Day07') diff --git a/aoc-2022-dotnet/Day07/Day07.fsproj b/aoc-2022-dotnet/Day07/Day07.fsproj index 44c3fba..358ef88 100644 --- a/aoc-2022-dotnet/Day07/Day07.fsproj +++ b/aoc-2022-dotnet/Day07/Day07.fsproj @@ -19,4 +19,8 @@ + + + + diff --git a/aoc-2022-dotnet/Day07/Program.fs b/aoc-2022-dotnet/Day07/Program.fs index 89cd728..7e16cb6 100644 --- a/aoc-2022-dotnet/Day07/Program.fs +++ b/aoc-2022-dotnet/Day07/Program.fs @@ -1,4 +1,6 @@ -open System.IO +module Day07 + +open System.IO open FParsec let fileSizeThreshold = 100_000 @@ -26,9 +28,7 @@ let parseCommands input = let pcmd = pcd <|> pls let pinput = many pcmd - match run pinput input with - | Success (result, _, _) -> result - | _ -> failwith "Invalid input format!" + Common.parse pinput input let combine = function -- cgit v1.2.3