diff --git a/Point-free/Point-free.Test/Point-free.Test.fsproj b/Point-free/Point-free.Test/Point-free.Test.fsproj new file mode 100644 index 0000000..a477fbc --- /dev/null +++ b/Point-free/Point-free.Test/Point-free.Test.fsproj @@ -0,0 +1,29 @@ + + + + net6.0 + Point_free.Test + + false + false + + + + + + + + + + + + + + + + + + + + + diff --git a/Point-free/Point-free.Test/Point-freeTest.fs b/Point-free/Point-free.Test/Point-freeTest.fs new file mode 100644 index 0000000..16ff981 --- /dev/null +++ b/Point-free/Point-free.Test/Point-freeTest.fs @@ -0,0 +1,12 @@ +module Point_free.Test + +open NUnit.Framework +open FsCheck +open PointFree + +[] +let checkEqualTest () = + let check x list = + funcToList x list = funcToList3 x list + + Check.QuickThrowOnFailure check \ No newline at end of file diff --git a/Point-free/Point-free.Test/Program.fs b/Point-free/Point-free.Test/Program.fs new file mode 100644 index 0000000..176a7b6 --- /dev/null +++ b/Point-free/Point-free.Test/Program.fs @@ -0,0 +1,4 @@ +module Program = + + [] + let main _ = 0 diff --git a/Point-free/Point-free.sln b/Point-free/Point-free.sln new file mode 100644 index 0000000..5c50ef4 --- /dev/null +++ b/Point-free/Point-free.sln @@ -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 diff --git a/Point-free/Point-free/Point-free.fsproj b/Point-free/Point-free/Point-free.fsproj new file mode 100644 index 0000000..6643d0f --- /dev/null +++ b/Point-free/Point-free/Point-free.fsproj @@ -0,0 +1,13 @@ + + + + net6.0 + Point_free + Windows + + + + + + + diff --git a/Point-free/Point-free/Program.fs b/Point-free/Point-free/Program.fs new file mode 100644 index 0000000..f0845a6 --- /dev/null +++ b/Point-free/Point-free/Program.fs @@ -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