-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from vkamiansky/vi-introduce-modules
Introduce base modules
- Loading branch information
Showing
19 changed files
with
409 additions
and
254 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
namespace Composite.Core.AssemblyInfo | ||
|
||
open System.Reflection | ||
open System.Runtime.CompilerServices | ||
open System.Runtime.InteropServices | ||
|
||
// General Information about an assembly is controlled through the following | ||
// set of attributes. Change these attribute values to modify the information | ||
// associated with an assembly. | ||
[<assembly: AssemblyTitle("Composite.Core")>] | ||
[<assembly: AssemblyDescription("")>] | ||
[<assembly: AssemblyConfiguration("")>] | ||
[<assembly: AssemblyCompany("")>] | ||
[<assembly: AssemblyProduct("Composite.Core")>] | ||
[<assembly: AssemblyCopyright("Copyright © 2017")>] | ||
[<assembly: AssemblyTrademark("")>] | ||
[<assembly: AssemblyCulture("")>] | ||
|
||
// Setting ComVisible to false makes the types in this assembly not visible | ||
// to COM components. If you need to access a type in this assembly from | ||
// COM, set the ComVisible attribute to true on that type. | ||
[<assembly: ComVisible(false)>] | ||
|
||
// The following GUID is for the ID of the typelib if this project is exposed to COM | ||
[<assembly: Guid("8163fd00-6eaa-48b8-93a5-ce10f35da2db")>] | ||
|
||
// Version information for an assembly consists of the following four values: | ||
// | ||
// Major Version | ||
// Minor Version | ||
// Build Number | ||
// Revision | ||
// | ||
// You can specify all the values or you can default the Build and Revision Numbers | ||
// by using the '*' as shown below: | ||
// [<assembly: AssemblyVersion("1.0.*")>] | ||
[<assembly: AssemblyVersion("1.0.0.0")>] | ||
[<assembly: AssemblyFileVersion("1.0.0.0")>] | ||
|
||
do | ||
() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /> | ||
<PropertyGroup> | ||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> | ||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> | ||
<SchemaVersion>2.0</SchemaVersion> | ||
<ProjectGuid>8163fd00-6eaa-48b8-93a5-ce10f35da2db</ProjectGuid> | ||
<OutputType>Library</OutputType> | ||
<RootNamespace>Composite.Core</RootNamespace> | ||
<AssemblyName>Composite.Core</AssemblyName> | ||
<TargetFrameworkVersion>v4.7</TargetFrameworkVersion> | ||
<TargetFSharpCoreVersion>4.4.1.0</TargetFSharpCoreVersion> | ||
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects> | ||
<Name>Composite.Core</Name> | ||
<TargetFrameworkProfile /> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> | ||
<DebugSymbols>true</DebugSymbols> | ||
<DebugType>full</DebugType> | ||
<Optimize>false</Optimize> | ||
<Tailcalls>false</Tailcalls> | ||
<OutputPath>bin\$(Configuration)\</OutputPath> | ||
<DefineConstants>DEBUG;TRACE</DefineConstants> | ||
<WarningLevel>3</WarningLevel> | ||
<DocumentationFile>bin\$(Configuration)\$(AssemblyName).XML</DocumentationFile> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> | ||
<DebugType>pdbonly</DebugType> | ||
<Optimize>true</Optimize> | ||
<Tailcalls>true</Tailcalls> | ||
<OutputPath>bin\$(Configuration)\</OutputPath> | ||
<DefineConstants>TRACE</DefineConstants> | ||
<WarningLevel>3</WarningLevel> | ||
<DocumentationFile>bin\$(Configuration)\$(AssemblyName).XML</DocumentationFile> | ||
</PropertyGroup> | ||
<PropertyGroup> | ||
<MinimumVisualStudioVersion Condition="'$(MinimumVisualStudioVersion)' == ''">11</MinimumVisualStudioVersion> | ||
</PropertyGroup> | ||
<Choose> | ||
<When Condition="'$(VisualStudioVersion)' == '11.0'"> | ||
<PropertyGroup Condition=" '$(FSharpTargetsPath)' == '' AND Exists('$(MSBuildExtensionsPath32)\..\Microsoft SDKs\F#\3.0\Framework\v4.0\Microsoft.FSharp.Targets') "> | ||
<FSharpTargetsPath>$(MSBuildExtensionsPath32)\..\Microsoft SDKs\F#\3.0\Framework\v4.0\Microsoft.FSharp.Targets</FSharpTargetsPath> | ||
</PropertyGroup> | ||
</When> | ||
<Otherwise> | ||
<PropertyGroup Condition=" '$(FSharpTargetsPath)' == '' AND Exists('$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\FSharp\Microsoft.FSharp.Targets') "> | ||
<FSharpTargetsPath>$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\FSharp\Microsoft.FSharp.Targets</FSharpTargetsPath> | ||
</PropertyGroup> | ||
</Otherwise> | ||
</Choose> | ||
<Import Project="$(FSharpTargetsPath)" /> | ||
<ItemGroup> | ||
<Compile Include="AssemblyInfo.fs" /> | ||
<Content Include="packages.config" /> | ||
<Compile Include="Composite.fs" /> | ||
<Compile Include="Processing.fs" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<Reference Include="ExtCore"> | ||
<HintPath>..\packages\ExtCore.0.8.46\lib\net45\ExtCore.dll</HintPath> | ||
</Reference> | ||
<Reference Include="mscorlib" /> | ||
<Reference Include="FSharp.Core"> | ||
<Name>FSharp.Core</Name> | ||
<AssemblyName>FSharp.Core.dll</AssemblyName> | ||
<HintPath>$(MSBuildProgramFiles32)\Reference Assemblies\Microsoft\FSharp\.NETFramework\v4.0\$(TargetFSharpCoreVersion)\FSharp.Core.dll</HintPath> | ||
</Reference> | ||
<Reference Include="System" /> | ||
<Reference Include="System.Core" /> | ||
<Reference Include="System.Numerics" /> | ||
<Reference Include="System.ValueTuple"> | ||
<HintPath>..\packages\System.ValueTuple.4.3.0\lib\netstandard1.0\System.ValueTuple.dll</HintPath> | ||
</Reference> | ||
</ItemGroup> | ||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. | ||
Other similar extension points exist, see Microsoft.Common.targets. | ||
<Target Name="BeforeBuild"> | ||
</Target> | ||
<Target Name="AfterBuild"> | ||
</Target> | ||
--> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
namespace Composite.Core | ||
|
||
open Composite.Core.Composite | ||
|
||
module Processing = | ||
|
||
let rec fold_2 acc f_update_acc lst = | ||
match acc with | ||
|(None, _) | (_, None) -> match lst with | ||
| Nil -> acc | ||
| Cons(h, tail) -> fold_2 (f_update_acc h acc) f_update_acc tail | ||
| _ -> acc | ||
|
||
let find_2_and_transform f_is_1 f_is_2 f_transform lst = | ||
let f h t = | ||
match f_is_1 h, f_is_2 h, t with | ||
| _, true, (a, None) -> (a, Some h) | ||
| true, _, (None, b) -> (Some h, b) | ||
| _ -> t | ||
match fold_2 (None, None) f lst with | ||
| x -> f_transform x | ||
|
||
let find_2_and_transform_strict f_is_1 f_is_2 f_transform lst = | ||
let f_transform_strict = function | (Some x1, Some x2) -> l(f_transform (x1, x2)) | _ -> LazyList.empty | ||
find_2_and_transform f_is_1 f_is_2 f_transform_strict lst |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<packages> | ||
<package id="ExtCore" version="0.8.46" targetFramework="net452" /> | ||
<package id="System.ValueTuple" version="4.3.0" targetFramework="net452" /> | ||
</packages> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
namespace FsComposite.Simple.AssemblyInfo | ||
|
||
open System.Reflection | ||
open System.Runtime.CompilerServices | ||
open System.Runtime.InteropServices | ||
|
||
// General Information about an assembly is controlled through the following | ||
// set of attributes. Change these attribute values to modify the information | ||
// associated with an assembly. | ||
[<assembly: AssemblyTitle("FsComposite.Simple")>] | ||
[<assembly: AssemblyDescription("")>] | ||
[<assembly: AssemblyConfiguration("")>] | ||
[<assembly: AssemblyCompany("")>] | ||
[<assembly: AssemblyProduct("FsComposite.Simple")>] | ||
[<assembly: AssemblyCopyright("Copyright © 2017")>] | ||
[<assembly: AssemblyTrademark("")>] | ||
[<assembly: AssemblyCulture("")>] | ||
|
||
// Setting ComVisible to false makes the types in this assembly not visible | ||
// to COM components. If you need to access a type in this assembly from | ||
// COM, set the ComVisible attribute to true on that type. | ||
[<assembly: ComVisible(false)>] | ||
|
||
// The following GUID is for the ID of the typelib if this project is exposed to COM | ||
[<assembly: Guid("d8aad155-ff6f-4957-82f7-dad5db8a606a")>] | ||
|
||
// Version information for an assembly consists of the following four values: | ||
// | ||
// Major Version | ||
// Minor Version | ||
// Build Number | ||
// Revision | ||
// | ||
// You can specify all the values or you can default the Build and Revision Numbers | ||
// by using the '*' as shown below: | ||
// [<assembly: AssemblyVersion("1.0.*")>] | ||
[<assembly: AssemblyVersion("1.0.0.0")>] | ||
[<assembly: AssemblyFileVersion("1.0.0.0")>] | ||
|
||
do | ||
() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /> | ||
<PropertyGroup> | ||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> | ||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> | ||
<SchemaVersion>2.0</SchemaVersion> | ||
<ProjectGuid>d8aad155-ff6f-4957-82f7-dad5db8a606a</ProjectGuid> | ||
<OutputType>Library</OutputType> | ||
<RootNamespace>FsComposite.Simple</RootNamespace> | ||
<AssemblyName>Composite.Simple</AssemblyName> | ||
<TargetFrameworkVersion>v4.7</TargetFrameworkVersion> | ||
<TargetFSharpCoreVersion>4.4.0.0</TargetFSharpCoreVersion> | ||
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects> | ||
<Name>Composite.Simple</Name> | ||
<TargetFrameworkProfile /> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> | ||
<DebugSymbols>true</DebugSymbols> | ||
<DebugType>full</DebugType> | ||
<Optimize>false</Optimize> | ||
<Tailcalls>false</Tailcalls> | ||
<OutputPath>bin\Debug\</OutputPath> | ||
<DefineConstants>DEBUG;TRACE</DefineConstants> | ||
<WarningLevel>3</WarningLevel> | ||
<DocumentationFile>bin\Debug\FsComposite.Simple.XML</DocumentationFile> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> | ||
<DebugType>pdbonly</DebugType> | ||
<Optimize>true</Optimize> | ||
<Tailcalls>true</Tailcalls> | ||
<OutputPath>bin\Release\</OutputPath> | ||
<DefineConstants>TRACE</DefineConstants> | ||
<WarningLevel>3</WarningLevel> | ||
<DocumentationFile>bin\Release\FsComposite.Simple.XML</DocumentationFile> | ||
</PropertyGroup> | ||
<PropertyGroup> | ||
<MinimumVisualStudioVersion Condition="'$(MinimumVisualStudioVersion)' == ''">11</MinimumVisualStudioVersion> | ||
</PropertyGroup> | ||
<Choose> | ||
<When Condition="'$(VisualStudioVersion)' == '11.0'"> | ||
<PropertyGroup Condition="Exists('$(MSBuildExtensionsPath32)\..\Microsoft SDKs\F#\3.0\Framework\v4.0\Microsoft.FSharp.Targets')"> | ||
<FSharpTargetsPath>$(MSBuildExtensionsPath32)\..\Microsoft SDKs\F#\3.0\Framework\v4.0\Microsoft.FSharp.Targets</FSharpTargetsPath> | ||
</PropertyGroup> | ||
</When> | ||
<Otherwise> | ||
<PropertyGroup Condition="Exists('$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\FSharp\Microsoft.FSharp.Targets')"> | ||
<FSharpTargetsPath>$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\FSharp\Microsoft.FSharp.Targets</FSharpTargetsPath> | ||
</PropertyGroup> | ||
</Otherwise> | ||
</Choose> | ||
<Import Project="$(FSharpTargetsPath)" /> | ||
<ItemGroup> | ||
<Compile Include="AssemblyInfo.fs" /> | ||
<Compile Include="Data.fs" /> | ||
<Content Include="packages.config" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<Reference Include="ExtCore"> | ||
<HintPath>..\packages\ExtCore.0.8.46\lib\net45\ExtCore.dll</HintPath> | ||
</Reference> | ||
<Reference Include="mscorlib" /> | ||
<Reference Include="FSharp.Core, Version=$(TargetFSharpCoreVersion), Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> | ||
<Private>True</Private> | ||
</Reference> | ||
<Reference Include="System" /> | ||
<Reference Include="System.Core" /> | ||
<Reference Include="System.Numerics" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<ProjectReference Include="..\Composite.Core\Composite.Core.fsproj"> | ||
<Name>Composite.Core</Name> | ||
<Project>{8163fd00-6eaa-48b8-93a5-ce10f35da2db}</Project> | ||
<Private>True</Private> | ||
</ProjectReference> | ||
</ItemGroup> | ||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. | ||
Other similar extension points exist, see Microsoft.Common.targets. | ||
<Target Name="BeforeBuild"> | ||
</Target> | ||
<Target Name="AfterBuild"> | ||
</Target> | ||
--> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
namespace Composite.Simple | ||
|
||
open Composite.Core.Composite | ||
open Composite.Core.Processing | ||
|
||
module Data = | ||
|
||
type Simple = | ||
| A | ||
| B | ||
| C | ||
|
||
//how to expand | ||
|
||
let expand obj = | ||
match obj with | ||
| A -> l B | ||
| x -> l x | ||
|
||
//how to fold | ||
|
||
let transformAB obj = | ||
let f1 = function | A -> true | _ -> false | ||
let f2 = function | B -> true | _ -> false | ||
let f = function | (Some a, Some b) -> l C | (None, Some b) -> l C | _ -> LazyList.empty | ||
find_2_and_transform f1 f2 f obj | ||
|
||
let transformABStrict obj = | ||
let f1 = function | A -> true | _ -> false | ||
let f2 = function | B -> true | _ -> false | ||
let f = fun (a, b) -> C | ||
find_2_and_transform_strict f1 f2 f obj |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<packages> | ||
<package id="ExtCore" version="0.8.46" targetFramework="net47" /> | ||
</packages> |
File renamed without changes.
File renamed without changes.
Oops, something went wrong.