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
29 changes: 29 additions & 0 deletions Point-free/Point-free.Test/Point-free.Test.fsproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<RootNamespace>Point_free.Test</RootNamespace>

<IsPackable>false</IsPackable>
<GenerateProgramFile>false</GenerateProgramFile>
</PropertyGroup>

<ItemGroup>
<Compile Include="Point-freeTest.fs" />
<Compile Include="Program.fs" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="FsCheck" Version="3.0.0-beta2" />
<PackageReference Include="FsUnit" Version="4.2.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.11.0" />
<PackageReference Include="NUnit" Version="3.13.2" />
<PackageReference Include="NUnit3TestAdapter" Version="4.0.0" />
<PackageReference Include="coverlet.collector" Version="3.1.0" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Point-free\Point-free.fsproj" />
</ItemGroup>

</Project>
12 changes: 12 additions & 0 deletions Point-free/Point-free.Test/Point-freeTest.fs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
module Point_free.Test

open NUnit.Framework
open FsCheck
open PointFree

[<Test>]
let checkEqualTest () =
let check x list =
funcToList x list = funcToList3 x list

Check.QuickThrowOnFailure check
4 changes: 4 additions & 0 deletions Point-free/Point-free.Test/Program.fs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module Program =

[<EntryPoint>]
let main _ = 0
22 changes: 22 additions & 0 deletions Point-free/Point-free.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@

Microsoft Visual Studio Solution File, Format Version 12.00
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "Point-free", "Point-free\Point-free.fsproj", "{5F3A9B01-2E6F-435A-988E-D3E4E3046478}"
EndProject
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "Point-free.Test", "Point-free.Test\Point-free.Test.fsproj", "{AEBF63D5-AB31-416B-9E94-2B90E22D1A67}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{5F3A9B01-2E6F-435A-988E-D3E4E3046478}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5F3A9B01-2E6F-435A-988E-D3E4E3046478}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5F3A9B01-2E6F-435A-988E-D3E4E3046478}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5F3A9B01-2E6F-435A-988E-D3E4E3046478}.Release|Any CPU.Build.0 = Release|Any CPU
{AEBF63D5-AB31-416B-9E94-2B90E22D1A67}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{AEBF63D5-AB31-416B-9E94-2B90E22D1A67}.Debug|Any CPU.Build.0 = Debug|Any CPU
{AEBF63D5-AB31-416B-9E94-2B90E22D1A67}.Release|Any CPU.ActiveCfg = Release|Any CPU
{AEBF63D5-AB31-416B-9E94-2B90E22D1A67}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
EndGlobal
13 changes: 13 additions & 0 deletions Point-free/Point-free/Point-free.fsproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<RootNamespace>Point_free</RootNamespace>
<DockerDefaultTargetOS>Windows</DockerDefaultTargetOS>
</PropertyGroup>

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

</Project>
12 changes: 12 additions & 0 deletions Point-free/Point-free/Program.fs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
module PointFree
// изначальная функция
let funcToList x l = List.map (fun y -> y * x) l

// убрали список
let funcToList1 x : int list -> int list = List.map (fun y -> y * x)

// убрали функцию
let funcToList2 x : int list -> int list = List.map ((*)x)

// убрали переменную
let funcToList3 = (*) >> List.map