From 604d1c6d477b757ecc4bee17bf9ec57082710d67 Mon Sep 17 00:00:00 2001 From: IgnatSergeev Date: Fri, 31 May 2024 17:39:16 +0300 Subject: [PATCH 1/2] Finished --- F#/PointFree/PointFree.fs | 7 +++++++ F#/PointFree/PointFree.fsproj | 12 ++++++++++++ 2 files changed, 19 insertions(+) create mode 100644 F#/PointFree/PointFree.fs create mode 100644 F#/PointFree/PointFree.fsproj diff --git a/F#/PointFree/PointFree.fs b/F#/PointFree/PointFree.fs new file mode 100644 index 0000000..b0ee3f7 --- /dev/null +++ b/F#/PointFree/PointFree.fs @@ -0,0 +1,7 @@ +module PointFree + +let func x l = List.map (fun y -> y * x) l +// let func2 x = List.map (fun y -> y * x) +// let func3 x = List.map (fun y -> x * y) +// let func4 x = List.map ((*) x) +let func5 = List.map << (*) diff --git a/F#/PointFree/PointFree.fsproj b/F#/PointFree/PointFree.fsproj new file mode 100644 index 0000000..ddf2f42 --- /dev/null +++ b/F#/PointFree/PointFree.fsproj @@ -0,0 +1,12 @@ + + + + net8.0 + true + + + + + + + From 616f50730c2df2de9b225f62f361551008dbe02c Mon Sep 17 00:00:00 2001 From: IgnatSergeev Date: Fri, 31 May 2024 17:39:56 +0300 Subject: [PATCH 2/2] Finished --- F#/PointFree.Test/PointFree.Test.fsproj | 30 +++++++++++++++++++++++++ F#/PointFree.Test/PointFreeTest.fs | 11 +++++++++ F#/forSpbu.sln | 12 ++++++++++ 3 files changed, 53 insertions(+) create mode 100644 F#/PointFree.Test/PointFree.Test.fsproj create mode 100644 F#/PointFree.Test/PointFreeTest.fs diff --git a/F#/PointFree.Test/PointFree.Test.fsproj b/F#/PointFree.Test/PointFree.Test.fsproj new file mode 100644 index 0000000..22f9266 --- /dev/null +++ b/F#/PointFree.Test/PointFree.Test.fsproj @@ -0,0 +1,30 @@ + + + + net8.0 + + false + true + true + + + + + + + + + + + + + + + + + + + + + + diff --git a/F#/PointFree.Test/PointFreeTest.fs b/F#/PointFree.Test/PointFreeTest.fs new file mode 100644 index 0000000..3d238cc --- /dev/null +++ b/F#/PointFree.Test/PointFreeTest.fs @@ -0,0 +1,11 @@ +module PointFree.Test + +open NUnit.Framework +open FsCheck + +let functionsEqual x l = + func x l = func5 x l + +[] +let equaltyTest () = + Check.QuickThrowOnFailure functionsEqual diff --git a/F#/forSpbu.sln b/F#/forSpbu.sln index 9d54d03..4d172d1 100644 --- a/F#/forSpbu.sln +++ b/F#/forSpbu.sln @@ -21,6 +21,10 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "07.03", "07.03", "{5CA9053B EndProject Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "Homework1", "Homework1\Homework1.fsproj", "{04B15EE4-079A-42ED-ACC8-E2DCD25281C6}" EndProject +Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "PointFree", "PointFree\PointFree.fsproj", "{410AC086-0A51-4171-B346-060126F1437D}" +EndProject +Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "PointFree.Test", "PointFree.Test\PointFree.Test.fsproj", "{304F1B3F-191F-45BF-A62D-5ABD5DFE5E9A}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -58,6 +62,14 @@ Global {89A935E8-B5F3-435D-ACC3-A99DD7C66178}.Debug|Any CPU.Build.0 = Debug|Any CPU {89A935E8-B5F3-435D-ACC3-A99DD7C66178}.Release|Any CPU.ActiveCfg = Release|Any CPU {89A935E8-B5F3-435D-ACC3-A99DD7C66178}.Release|Any CPU.Build.0 = Release|Any CPU + {410AC086-0A51-4171-B346-060126F1437D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {410AC086-0A51-4171-B346-060126F1437D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {410AC086-0A51-4171-B346-060126F1437D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {410AC086-0A51-4171-B346-060126F1437D}.Release|Any CPU.Build.0 = Release|Any CPU + {304F1B3F-191F-45BF-A62D-5ABD5DFE5E9A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {304F1B3F-191F-45BF-A62D-5ABD5DFE5E9A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {304F1B3F-191F-45BF-A62D-5ABD5DFE5E9A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {304F1B3F-191F-45BF-A62D-5ABD5DFE5E9A}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(NestedProjects) = preSolution {7937CDA8-8285-4E23-AD1A-FC0F04FEEFE6} = {91E3BDA2-0836-46C2-95F0-02513FD7F13F}