Skip to content

Commit

Permalink
Reorganize the solution structure.
Browse files Browse the repository at this point in the history
  • Loading branch information
eminencegrs committed Feb 4, 2024
1 parent 29469f6 commit ad4f107
Show file tree
Hide file tree
Showing 55 changed files with 279 additions and 225 deletions.
40 changes: 27 additions & 13 deletions FPinFSharp.sln
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,15 @@ VisualStudioVersion = 17.0.31903.59
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{65D38C0C-ABFD-4864-840A-EBFCB0029E47}"
EndProject
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "FPinFSharp.Exercises", "src\FPinFSharp.Exercises\FPinFSharp.Exercises.fsproj", "{FA1E119E-E88E-40C4-B48C-E98A86D3320D}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{850A8FBE-A6C5-4DC3-B1A5-DF8B689765CA}"
EndProject
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "FPinFSharp.Exercises.UnitTests", "tests\FPinFSharp.Exercises.UnitTests\FPinFSharp.Exercises.UnitTests.fsproj", "{2327BD8E-3252-4B01-930D-6A76E9F2F5FF}"
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "FPinFSharp.Chapter_01", "src\FPinFSharp.Chapter_01\FPinFSharp.Chapter_01.fsproj", "{350551A5-9B67-46E7-871A-C5435E1E0A5C}"
EndProject
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "FPinFSharp.Chapter_02", "src\FPinFSharp.Chapter_02\FPinFSharp.Chapter_02.fsproj", "{5110106B-8410-43BF-94C8-415BB799A284}"
EndProject
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "FPinFSharp.Chapter_01.UnitTests", "tests\FPinFSharp.Chapter_01.UnitTests\FPinFSharp.Chapter_01.UnitTests.fsproj", "{6E322C64-EE93-45B9-BC53-33F08304E2DC}"
EndProject
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "FPinFSharp.Chapter_02.UnitTests", "tests\FPinFSharp.Chapter_02.UnitTests\FPinFSharp.Chapter_02.UnitTests.fsproj", "{41CD39C3-020F-4187-BEB0-855CB3A3BE44}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand All @@ -20,17 +24,27 @@ Global
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{FA1E119E-E88E-40C4-B48C-E98A86D3320D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{FA1E119E-E88E-40C4-B48C-E98A86D3320D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FA1E119E-E88E-40C4-B48C-E98A86D3320D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{FA1E119E-E88E-40C4-B48C-E98A86D3320D}.Release|Any CPU.Build.0 = Release|Any CPU
{2327BD8E-3252-4B01-930D-6A76E9F2F5FF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2327BD8E-3252-4B01-930D-6A76E9F2F5FF}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2327BD8E-3252-4B01-930D-6A76E9F2F5FF}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2327BD8E-3252-4B01-930D-6A76E9F2F5FF}.Release|Any CPU.Build.0 = Release|Any CPU
{350551A5-9B67-46E7-871A-C5435E1E0A5C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{350551A5-9B67-46E7-871A-C5435E1E0A5C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{350551A5-9B67-46E7-871A-C5435E1E0A5C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{350551A5-9B67-46E7-871A-C5435E1E0A5C}.Release|Any CPU.Build.0 = Release|Any CPU
{5110106B-8410-43BF-94C8-415BB799A284}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5110106B-8410-43BF-94C8-415BB799A284}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5110106B-8410-43BF-94C8-415BB799A284}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5110106B-8410-43BF-94C8-415BB799A284}.Release|Any CPU.Build.0 = Release|Any CPU
{6E322C64-EE93-45B9-BC53-33F08304E2DC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6E322C64-EE93-45B9-BC53-33F08304E2DC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6E322C64-EE93-45B9-BC53-33F08304E2DC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6E322C64-EE93-45B9-BC53-33F08304E2DC}.Release|Any CPU.Build.0 = Release|Any CPU
{41CD39C3-020F-4187-BEB0-855CB3A3BE44}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{41CD39C3-020F-4187-BEB0-855CB3A3BE44}.Debug|Any CPU.Build.0 = Debug|Any CPU
{41CD39C3-020F-4187-BEB0-855CB3A3BE44}.Release|Any CPU.ActiveCfg = Release|Any CPU
{41CD39C3-020F-4187-BEB0-855CB3A3BE44}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{FA1E119E-E88E-40C4-B48C-E98A86D3320D} = {65D38C0C-ABFD-4864-840A-EBFCB0029E47}
{2327BD8E-3252-4B01-930D-6A76E9F2F5FF} = {850A8FBE-A6C5-4DC3-B1A5-DF8B689765CA}
{350551A5-9B67-46E7-871A-C5435E1E0A5C} = {65D38C0C-ABFD-4864-840A-EBFCB0029E47}
{5110106B-8410-43BF-94C8-415BB799A284} = {65D38C0C-ABFD-4864-840A-EBFCB0029E47}
{6E322C64-EE93-45B9-BC53-33F08304E2DC} = {850A8FBE-A6C5-4DC3-B1A5-DF8B689765CA}
{41CD39C3-020F-4187-BEB0-855CB3A3BE44} = {850A8FBE-A6C5-4DC3-B1A5-DF8B689765CA}
EndGlobalSection
EndGlobal
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace FPinFSharp.Exercises.Chapter_01
namespace FPinFSharp.Chapter_01

open System;

Expand Down
22 changes: 22 additions & 0 deletions src/FPinFSharp.Chapter_01/FPinFSharp.Chapter_01.fsproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<RootNamespace>FPinFSharp.Chapter_01</RootNamespace>
</PropertyGroup>

<ItemGroup>
<Content Include="Description.md" />
<Compile Include="Section_01.fs" />
<Compile Include="Section_02.fs" />
<Compile Include="Section_03.fs" />
<Compile Include="Section_04.fs" />
<Compile Include="Section_05.fs" />
<Compile Include="Section_06.fs" />
<Content Include="Section_07.md" />
<Compile Include="Section_08.fs" />
<Compile Include="Exercises.fs" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
namespace FPinFSharp.Exercises.Chapter_01
namespace FPinFSharp.Chapter_01

// 1.1 Values, types, identifiers and declarations.
module Section_01_01 =
module Section_01 =

// The function name is `double`, the argument is `x`, which has type `int`, and the return value is of type `int`.
let double x =
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
namespace FPinFSharp.Exercises.Chapter_01
namespace FPinFSharp.Chapter_01

open FPinFSharp.Exercises.Chapter_01.Section_01_01
open FPinFSharp.Chapter_01.Section_01

// 1.2 Simple function declarations.
module Section_01_02 =
module Section_02 =
let calculateCircleArea (radius: int) =
System.Math.PI * float (radius * radius)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
namespace FPinFSharp.Exercises.Chapter_01
namespace FPinFSharp.Chapter_01

// 1.3 Anonymous functions. Function expressions.
module Section_01_03 =
module Section_03 =
let calculateCircleAreaUsingAnonymousFunction (radius: int) =
let anonymousFunction = fun r -> System.Math.PI * r * r
anonymousFunction radius
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
namespace FPinFSharp.Exercises.Chapter_01
namespace FPinFSharp.Chapter_01

// 1.4 Recursion.
module Section_01_04 =
module Section_04 =
let rec factorial x =
match x with
| 0 -> 1
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
namespace FPinFSharp.Exercises.Chapter_01
namespace FPinFSharp.Chapter_01

// 1.5 Pairs.
module Section_01_05 =
module Section_05 =

// Let's define a custom complex type that represent a point.
type Point = { X: int; Y: int }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
namespace FPinFSharp.Exercises.Chapter_01
namespace FPinFSharp.Chapter_01

open FPinFSharp.Exercises.Chapter_01.Section_01_01
open FPinFSharp.Chapter_01.Section_01

// 1.6 Types and type checking.
module Section_01_06 =
module Section_06 =

// F# will try to infer a type for each value, expression and declaration entered.
// If the system can infer a type for the input, then the input is accepted by the system.
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
namespace FPinFSharp.Exercises.Chapter_01
namespace FPinFSharp.Chapter_01

// 1.8 Euclid’s algorithm (for computing the greatest common divisor of two natural numbers).
module Section_01_08 =
module Section_08 =

// Euclid's algorithm is implemented by using pattern matching to handle the base case (when `m` is 0)
// and recursively updating the values of `m` and `n` until the base case is reached.
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace FPinFSharp.Exercises.Chapter_02
namespace FPinFSharp.Chapter_02

open System;

Expand Down
26 changes: 26 additions & 0 deletions src/FPinFSharp.Chapter_02/FPinFSharp.Chapter_02.fsproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<RootNamespace>FPinFSharp.Chapter_02</RootNamespace>
</PropertyGroup>

<ItemGroup>
<Content Include="Description.md" />
<Compile Include="Section_01.fs" />
<Compile Include="Section_02.fs" />
<Compile Include="Section_03.fs" />
<Compile Include="Section_04.fs" />
<Compile Include="Section_05.fs" />
<Compile Include="Section_06.fs" />
<Compile Include="Section_07.fs" />
<Compile Include="Section_08.fs" />
<Compile Include="Section_09.fs" />
<Compile Include="Section_10.fs" />
<Compile Include="Section_11.fs" />
<Compile Include="Section_12.fs" />
<Compile Include="Exercises.fs" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
namespace FPinFSharp.Exercises.Chapter_02
namespace FPinFSharp.Chapter_02

open System
open System.Globalization

// 2.1 Numbers. Truth values. The unit type
module Section_02_01 =
module Section_01 =

let tryParseInt (value: string) =
match Int32.TryParse(value) with
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
namespace FPinFSharp.Exercises.Chapter_02
namespace FPinFSharp.Chapter_02

// 2.2 Operator precedence and association
module Section_02_02 =
module Section_02 =

let add a b =
a + b
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
namespace FPinFSharp.Exercises.Chapter_02
namespace FPinFSharp.Chapter_02

open System

// 2.3 Characters and strings
module Section_02_03 =
module Section_03 =

// A string is a sequence of characters. Strings are values of the type string.
// A string is written inside enclosing quotes that are not part of the string.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
namespace FPinFSharp.Exercises.Chapter_02
namespace FPinFSharp.Chapter_02

// 2.4 If-then-else expressions
module Section_02_04 =
module Section_04 =

// Please see Chapter_01_08.fs for the additional information.
let rec gcd (m, n) =
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
namespace FPinFSharp.Exercises.Chapter_02
namespace FPinFSharp.Chapter_02

// 2.5 Overloaded functions and operators
module Section_02_05 =
module Section_05 =

// A name or symbol for a function or operator is overloaded if it has different meanings
// when applied to arguments or operands of different types.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
namespace FPinFSharp.Exercises.Chapter_02
namespace FPinFSharp.Chapter_02

// 2.5 Type inference
module Section_02_06 =
module Section_06 =

// Consider the function 'power'.
// Please note: there is already a power operator '**' in F#,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
namespace FPinFSharp.Exercises.Chapter_02
namespace FPinFSharp.Chapter_02

// 2.7 Functions are first-class citizens (higher-order functions)
module Section_02_07 =
module Section_07 =

// # The value of a function can be a function.
// Function application associates to the left.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
namespace FPinFSharp.Exercises.Chapter_02
namespace FPinFSharp.Chapter_02

// 2.7 Closures
module Section_02_08 =
module Section_08 =

// A closure gives the means of explaining a value that is a function. A closure is a triple: (x, exp, env).
// Where 'x' is an argument identifier,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
namespace FPinFSharp.Exercises.Chapter_02
namespace FPinFSharp.Chapter_02

// 2.9 Declaring prefix and infix operators
module Section_02_09 =
module Section_09 =

// Prefix operators are expected to be placed in front of an operand or operands, much like a function.
// Infix operators are expected to be placed between the two operands.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
namespace FPinFSharp.Exercises.Chapter_02
namespace FPinFSharp.Chapter_02

open System

// 2.10 Equality and ordering
module Section_02_10 =
module Section_10 =

// It is not defined on functions (closures):
// cos = sin;;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
namespace FPinFSharp.Exercises.Chapter_02
namespace FPinFSharp.Chapter_02

open System

// 2.11 Function application operators |> and <|
module Section_02_11 =
module Section_11 =

// `arg |> myFunction` means `myFunction arg`
// `myFunction <| arg` means `myFunction arg`
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
namespace FPinFSharp.Exercises.Chapter_02
namespace FPinFSharp.Chapter_02

// 2.12 Summary of the basic types
module Section_02_12 =
module Section_12 =

// Helpers.
let formatNumeric (values: 'T * 'T) : string * string =
Expand Down
3 changes: 0 additions & 3 deletions src/FPinFSharp.Exercises/Chapter_03/Description.md

This file was deleted.

41 changes: 0 additions & 41 deletions src/FPinFSharp.Exercises/FPinFSharp.Exercises.fsproj

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
namespace FPinFSharp.Exercises.UnitTests.Chapter_01
namespace FPinFSharp.Chapter_01.UnitTests

open FPinFSharp.Exercises.Chapter_01.Exercises
open FPinFSharp.Chapter_01.Exercises
open Xunit

module Exercises_Tests =
Expand Down
Loading

0 comments on commit ad4f107

Please sign in to comment.