diff options
author | Tomasz Chojnacki <tomaszchojnacki2001@gmail.com> | 2022-12-07 14:23:47 +0100 |
---|---|---|
committer | Tomasz Chojnacki <tomaszchojnacki2001@gmail.com> | 2022-12-07 14:23:47 +0100 |
commit | 8d9513e9df67c5ec0abc2d94152f350274233643 (patch) | |
tree | 926d8e378c7534baddf76800971762b1a2c2cea0 /aoc-2022-dotnet/Common | |
parent | bea11616e6b3c26b14534feb87317619009236d1 (diff) | |
download | gleam_aoc2020-8d9513e9df67c5ec0abc2d94152f350274233643.tar.gz gleam_aoc2020-8d9513e9df67c5ec0abc2d94152f350274233643.zip |
Refactor earlier solutions
Diffstat (limited to 'aoc-2022-dotnet/Common')
-rw-r--r-- | aoc-2022-dotnet/Common/Common.fsproj | 16 | ||||
-rw-r--r-- | aoc-2022-dotnet/Common/Library.fs | 8 |
2 files changed, 24 insertions, 0 deletions
diff --git a/aoc-2022-dotnet/Common/Common.fsproj b/aoc-2022-dotnet/Common/Common.fsproj new file mode 100644 index 0000000..c8a185a --- /dev/null +++ b/aoc-2022-dotnet/Common/Common.fsproj @@ -0,0 +1,16 @@ +<Project Sdk="Microsoft.NET.Sdk"> + + <PropertyGroup> + <TargetFramework>net7.0</TargetFramework> + <GenerateDocumentationFile>true</GenerateDocumentationFile> + </PropertyGroup> + + <ItemGroup> + <Compile Include="Library.fs" /> + </ItemGroup> + + <ItemGroup> + <PackageReference Include="FParsec" Version="1.1.1" /> + </ItemGroup> + +</Project> diff --git a/aoc-2022-dotnet/Common/Library.fs b/aoc-2022-dotnet/Common/Library.fs new file mode 100644 index 0000000..7354509 --- /dev/null +++ b/aoc-2022-dotnet/Common/Library.fs @@ -0,0 +1,8 @@ +module Common + +open FParsec + +let parse parser input = + match run parser input with + | Success (result, _, _) -> result + | _ -> failwith "Invalid input format!" |