Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions PointFreeExtra.Tests/PointFreeExtra.Tests.fsproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>

<IsPackable>false</IsPackable>
<GenerateProgramFile>true</GenerateProgramFile>
<IsTestProject>true</IsTestProject>
</PropertyGroup>

<ItemGroup>
<Compile Include="PointFreeTest.fs" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
<PackageReference Include="NUnit" Version="4.2.2" />
<PackageReference Include="NUnit3TestAdapter" Version="4.6.0" />
<PackageReference Include="NUnit.Analyzers" Version="4.4.0"><IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="coverlet.collector" Version="6.0.2"><IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="FsCheck" Version="2.16.6">
<GeneratePathProperty></GeneratePathProperty>
</PackageReference>
<PackageReference Include="FSharp.Core" Version="9.0.100">
<GeneratePathProperty></GeneratePathProperty>
</PackageReference>
<PackageReference Include="FsUnit" Version="6.0.1">
<GeneratePathProperty></GeneratePathProperty>
</PackageReference>
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\PointFreeExtra\PointFreeExtra.fsproj" />
</ItemGroup>
</Project>
19 changes: 19 additions & 0 deletions PointFreeExtra.Tests/PointFreeTest.fs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
module PointFreeExtra.Tests

open NUnit.Framework
open FsCheck
open PointFree

[<Test>]
let ``Functions are equal test`` () =
let equalityChecker (g: ('a -> 'b)) (l: 'a list) =
if (l.IsEmpty) then
true
else
f'1 g l = f'2 g l
&& f'3 g l = f'4 g l
&& f'5 g l = (f'6<'a, 'b> g l)
&& f'1 g l = f'4 g l
&& f'1 g l = f'5 g l

Check.QuickThrowOnFailure equalityChecker
14 changes: 14 additions & 0 deletions PointFreeExtra/PointFree.fs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
namespace PointFreeExtra

module PointFree =
let f'1 g l = List.map g (List.tail l)

let f'2 g l = l |> List.tail |> List.map g

let f'3 g = List.tail >> List.map g

let f'4 g = (>>) List.tail (List.map g)

let f'5 g = g |> List.map |> (>>) List.tail

let f'6<'a, 'b> : (('a -> 'b) -> 'a list -> 'b list) = List.map >> (>>) List.tail
12 changes: 12 additions & 0 deletions PointFreeExtra/PointFreeExtra.fsproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
</PropertyGroup>

<ItemGroup>
<Compile Include="PointFree.fs" />
</ItemGroup>

</Project>
31 changes: 31 additions & 0 deletions PointFreeExtra/PointFreeExtra.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 25.0.1706.14
MinimumVisualStudioVersion = 10.0.40219.1
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "PointFreeExtra", "PointFreeExtra.fsproj", "{CA55CD04-B297-440E-AD76-8EBE85FBD1E6}"
EndProject
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "PointFreeExtra.Tests", "..\PointFreeExtra.Tests\PointFreeExtra.Tests.fsproj", "{75E4B1DE-7366-43DD-A017-ADF62D96A1D5}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{CA55CD04-B297-440E-AD76-8EBE85FBD1E6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{CA55CD04-B297-440E-AD76-8EBE85FBD1E6}.Debug|Any CPU.Build.0 = Debug|Any CPU
{CA55CD04-B297-440E-AD76-8EBE85FBD1E6}.Release|Any CPU.ActiveCfg = Release|Any CPU
{CA55CD04-B297-440E-AD76-8EBE85FBD1E6}.Release|Any CPU.Build.0 = Release|Any CPU
{75E4B1DE-7366-43DD-A017-ADF62D96A1D5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{75E4B1DE-7366-43DD-A017-ADF62D96A1D5}.Debug|Any CPU.Build.0 = Debug|Any CPU
{75E4B1DE-7366-43DD-A017-ADF62D96A1D5}.Release|Any CPU.ActiveCfg = Release|Any CPU
{75E4B1DE-7366-43DD-A017-ADF62D96A1D5}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {B6F62D6F-BCC7-4F29-9AF5-9C8318F753F8}
EndGlobalSection
EndGlobal