-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
27 changed files
with
101 additions
and
98 deletions.
There are no files selected for viewing
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
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<packages> | ||
<package id="FSharp.Core" version="3.1.2.5" targetFramework="net40-client" /> | ||
<package id="FSharp.Core" version="4.0.0.1" targetFramework="net451" /> | ||
</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
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,7 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using Imms.Abstract; | ||
|
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,8 @@ | ||
using System; | ||
using System.Runtime.CompilerServices; | ||
|
||
|
||
|
||
namespace Imms.Abstract { | ||
|
||
} |
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
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 was deleted.
Oops, something went wrong.
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
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
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
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
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<packages> | ||
<package id="FSharp.Core" version="3.1.2.5" targetFramework="net40-client" /> | ||
<package id="FSharp.Core" version="4.0.0.1" targetFramework="net40-client" /> | ||
</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
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 |
---|---|---|
@@ -1,52 +1,75 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.CodeDom.Compiler; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using Imms; | ||
using Microsoft.FSharp.Core; | ||
using Imms.Abstract; | ||
|
||
namespace Imms.Messing.CSharp { | ||
|
||
public interface Mixin { | ||
} | ||
|
||
public interface IMixin { | ||
public interface HasMixins { | ||
|
||
} | ||
|
||
//instead of implementing IMixin, you implement IHas<Mixin> | ||
public interface Has<out TMixin> : HasMixins | ||
where TMixin : Mixin { | ||
TMixin Mixin { get; } | ||
} | ||
|
||
public interface MForEach<out T> : IMixin { | ||
void ForEach(Action<T> iterator); | ||
public static class MixinUtils { | ||
public static TMixin Mixout<TMixin>(this Has<TMixin> what) | ||
where TMixin : Mixin { | ||
return what.Mixin; | ||
} | ||
|
||
bool ForEachWhile(Func<T, bool> iterator); | ||
[Obsolete("The object does not have this mixin.", true)] | ||
public static TSome Mixout<TSome>(this HasMixins something) where TSome : Mixin { | ||
return default(TSome); | ||
} | ||
} | ||
|
||
interface MForEachBack<out T> : IMixin { | ||
void ForEachBack(Action<T> iterator); | ||
public abstract class Mixin1 : Mixin { | ||
} | ||
|
||
bool ForEachBackWhile(Func<T, bool> iterator); | ||
public abstract class Mixin2 : Mixin { | ||
} | ||
|
||
public interface Has<out TMixin> : IMixin { | ||
TMixin Implementation { | ||
get; | ||
public abstract class Mixin3 : Mixin { | ||
} | ||
|
||
public class Test : Has<Mixin1>, Has<Mixin2> { | ||
|
||
|
||
Mixin1 Has<Mixin1>.Mixin => Mixin1Impl.Instance; | ||
|
||
Mixin2 Has<Mixin2>.Mixin => Mixin2Impl.Instance; | ||
|
||
private class Mixin1Impl : Mixin1 { | ||
public static readonly Mixin1Impl Instance = new Mixin1Impl(); | ||
} | ||
|
||
private class Mixin2Impl : Mixin2 { | ||
public static readonly Mixin2Impl Instance = new Mixin2Impl(); | ||
} | ||
} | ||
|
||
public static class ForEachMixin { | ||
static class TestThis { | ||
public static void run() { | ||
var t = new Test(); | ||
var a = t.Mixout<Mixin1>(); | ||
var b = t.Mixout<Mixin2>(); | ||
|
||
} | ||
} | ||
|
||
|
||
class Program { | ||
|
||
|
||
static void Main(string[] args) { | ||
int? a = 5; | ||
object b = null; | ||
|
||
var x = a.AsOptional(); | ||
var y = 5.AsOptional(); | ||
FSharpOption<int>.Some() | ||
var list = ImmList.FromItems(1); | ||
list.Any() | ||
} | ||
|
||
} | ||
} | ||
} |
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<packages> | ||
<package id="FSharp.Core" version="3.1.2.5" targetFramework="net452" /> | ||
<package id="FSharp.Core" version="4.0.0.1" 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
Oops, something went wrong.