diff --git a/Imms/ExtraFunctional/ExtraFunctional/Option.fs b/Imms/ExtraFunctional/ExtraFunctional/Option.fs index d35a701..fe4b22a 100644 --- a/Imms/ExtraFunctional/ExtraFunctional/Option.fs +++ b/Imms/ExtraFunctional/ExtraFunctional/Option.fs @@ -1,8 +1,9 @@ namespace ExtraFunctional module Option = let orValue (v : 'v) = function Some u -> u | None -> v + let orMaybe (v : 'v option) = function Some u -> Some u | None -> v + let asNull = Option.toObj let cast<'a,'b> (opt : 'a option) : 'b option = opt |> Option.map (fun a -> a :> obj :?> 'b) - let asNull (opt : 'a option) = if opt.IsSome then opt.Value else null [] module OptionExt = diff --git a/Imms/ExtraFunctional/ExtraFunctional/Seq.fs b/Imms/ExtraFunctional/ExtraFunctional/Seq.fs index 9613180..9955c97 100644 --- a/Imms/ExtraFunctional/ExtraFunctional/Seq.fs +++ b/Imms/ExtraFunctional/ExtraFunctional/Seq.fs @@ -7,6 +7,7 @@ type IterationControl<'v> = | Stop | Yield of 'v | Ignore + let getEnumerator (a :_ seq) = a.GetEnumerator() let rev (s :_ seq) = diff --git a/Imms/Imms.Abstract/Abstractions/Operators/AbstractSet.cs b/Imms/Imms.Abstract/Abstractions/Operators/AbstractSet.cs index 16ae699..0abda62 100644 --- a/Imms/Imms.Abstract/Abstractions/Operators/AbstractSet.cs +++ b/Imms/Imms.Abstract/Abstractions/Operators/AbstractSet.cs @@ -74,7 +74,7 @@ partial class AbstractSet partial class AbstractMap { /// - /// Adds the key-value pair to the map, overwriting any existing pair. Identical to . + /// Adds the key-value pair to the map, overwriting any existing pair. Identical to . /// /// The map. /// The key-value pair. @@ -114,7 +114,7 @@ partial class AbstractMap { } /// - /// Takes a sequence of key-value pairs and removes all keys present in the sequence from the map. Identical to . + /// Takes a sequence of key-value pairs and removes all keys present in the sequence from the map. Identical to . /// /// The map. /// The key-value pairs. diff --git a/Imms/Imms.Collections/Imms.nuspec b/Imms/Imms.Collections/Imms.nuspec index d61f309..ab7db80 100644 --- a/Imms/Imms.Collections/Imms.nuspec +++ b/Imms/Imms.Collections/Imms.nuspec @@ -6,10 +6,10 @@ $title$ $author$ $author$ - https://raw.githubusercontent.com/GregRos/Imms/master/license.md + https://raw.githubusercontent.com/Imms/Imms/master/license.md http://imms.github.io/ false - https://raw.githubusercontent.com/GregRos/Imms/master/Icon.png + https://raw.githubusercontent.com/Imms/Imms/master/Icon.png High-performance immutable collections for .NET. $description$ A number of API changes and bug fixes. diff --git a/Imms/Imms.Collections/Implementation/TrieVector/ImplementationHooks.cs b/Imms/Imms.Collections/Implementation/TrieVector/ImplementationHooks.cs index ebb8244..2fe1d99 100644 --- a/Imms/Imms.Collections/Implementation/TrieVector/ImplementationHooks.cs +++ b/Imms/Imms.Collections/Implementation/TrieVector/ImplementationHooks.cs @@ -1,4 +1,5 @@ namespace Imms.Implementation { +#pragma warning disable 618 static partial class TrieVector { internal abstract partial class Node { public static implicit operator ImmVector(Node node) { diff --git a/Imms/Imms.Collections/Wrappers/Immutable/Common/Convertion.cs b/Imms/Imms.Collections/Wrappers/Immutable/Common/Convertion.cs index 596740a..d56c4e9 100644 --- a/Imms/Imms.Collections/Wrappers/Immutable/Common/Convertion.cs +++ b/Imms/Imms.Collections/Wrappers/Immutable/Common/Convertion.cs @@ -1,6 +1,6 @@ using System.Collections.Generic; using Imms.Implementation; -#pragma warning disable 44 +#pragma warning disable 618 namespace Imms { /// /// Provides extension methods for converting between, to, and from Imm data structures. diff --git a/Imms/Imms.Collections/Wrappers/Immutable/List/Boilerplate.cs b/Imms/Imms.Collections/Wrappers/Immutable/List/Boilerplate.cs index 1882d80..c544eaa 100644 --- a/Imms/Imms.Collections/Wrappers/Immutable/List/Boilerplate.cs +++ b/Imms/Imms.Collections/Wrappers/Immutable/List/Boilerplate.cs @@ -8,10 +8,12 @@ namespace Imms using Imms; using Imms.Abstract; - partial class ImmList : AbstractSequential> { + partial class ImmList : AbstractSequential> + { private static readonly ImmList Instance = new ImmList(); - private ImmList() { + private ImmList() + { } @@ -21,7 +23,8 @@ private ImmList() { /// The type of the result element. /// The selector. /// - public ImmList Select(Func selector) { + public ImmList Select(Func selector) + { return base._Select(GetPrototype(), selector); } @@ -32,7 +35,8 @@ public ImmList Select(Func selector) { /// The type of the output collection element. /// The selector. /// - public ImmList Select(Func> selector) { + public ImmList Select(Func> selector) + { return base._Choose(GetPrototype(), selector); } @@ -43,7 +47,8 @@ public ImmList Select(Func> selector) { /// The type of the output collection element. /// The selector. /// - public ImmList Choose(Func> selector) { + public ImmList Choose(Func> selector) + { return base._Choose(GetPrototype(), selector); } @@ -54,15 +59,30 @@ public ImmList Choose(Func> selector) { /// The type of the ouput collection elem. /// The selector. /// - public ImmList SelectMany(Func> selector) { + public ImmList SelectMany(Func> selector) + { return base._SelectMany(GetPrototype(), selector); } - public ImmList GroupJoin(IEnumerable inner, Func outerKeySelector, Func innerKeySelector, Func, TResult> resultSelector, IEqualityComparer eq = null) { - return base._GroupJoin(GetPrototype(), inner, outerKeySelector, innerKeySelector, resultSelector, eq); - } + /// + /// Groups the elements of this collection and a sequence based on equality of keys, and groups the results. The specified equality comparer is used to compare keys, if provided. + /// + /// The type of the input sequence. + /// The type of the key used to join the results. + /// The type of the result element. + /// The input sequence. + /// The key selector for the current collection. + /// The key selector for the input sequence. + /// The result selector that aggregates all the results. + /// An optional equality comparer. If null, the default is used. + /// + public ImmList GroupJoin(IEnumerable inner, Func outerKeySelector, Func innerKeySelector, Func, TResult> resultSelector, IEqualityComparer eq = null) + { + + return base._GroupJoin(GetPrototype(), inner, outerKeySelector, innerKeySelector, resultSelector, eq); + } /// /// Applies an element selector on every element of the collection, yielding a sequence. @@ -75,7 +95,8 @@ public ImmList GroupJoin(IEnumerable inn /// The result selector. /// public ImmList SelectMany(Func> selector, - Func rSelector) { + Func rSelector) + { return base._SelectMany(GetPrototype(), selector, rSelector); } @@ -94,7 +115,8 @@ public ImmList SelectMany(Func> s /// public ImmList Join(IEnumerable inner, Func oKeySelector, Func iKeySelector, Func rSelector, - IEqualityComparer eq = null) { + IEqualityComparer eq = null) + { return base._Join(GetPrototype(), inner, oKeySelector, iKeySelector, rSelector, eq ?? EqualityComparer.Default); } @@ -111,7 +133,8 @@ public ImmList Join(IEnumerable inner, Fun /// /// public ImmList> Join(IEnumerable inner, Func oKeySelector, - Func iKeySelector, IEqualityComparer eq = null) { + Func iKeySelector, IEqualityComparer eq = null) + { return Join(inner, oKeySelector, iKeySelector, Kvp.Of, eq); } @@ -129,7 +152,8 @@ public ImmList> Join(IEnumerable i /// The equality comparer. /// public ImmList GroupBy(Func keySelector, Func valueSelector, - Func, TRElem> rSelector, IEqualityComparer eq = null) { + Func, TRElem> rSelector, IEqualityComparer eq = null) + { return base._GroupBy(GetPrototype(), keySelector, valueSelector, rSelector, eq ?? EqualityComparer.Default); } @@ -150,7 +174,8 @@ public ImmList GroupBy(Func keySelector, /// The equality comparer. /// public ImmList>> GroupBy(Func keySelector, Func elementSelector, - IEqualityComparer eq = null) { + IEqualityComparer eq = null) + { return GroupBy(keySelector, elementSelector, Kvp.Of, eq ?? EqualityComparer.Default); } @@ -167,7 +192,8 @@ public ImmList>> GroupBy(Fu /// The equality comparer. /// public ImmList>> GroupBy(Func keySelector, - IEqualityComparer eq = null) { + IEqualityComparer eq = null) + { return GroupBy(keySelector, x => x, Kvp.Of, eq ?? EqualityComparer.Default); } @@ -176,7 +202,8 @@ public ImmList>> GroupBy(Func k /// /// The return element type. /// - public ImmList Cast() { + public ImmList Cast() + { return base._Cast>(GetPrototype()); } @@ -188,7 +215,8 @@ public ImmList Cast() { /// The initial value for the accumulator. /// The accumulator. /// - public ImmList Scan(TRElem initial, Func accumulator) { + public ImmList Scan(TRElem initial, Func accumulator) + { return base._Scan(GetPrototype(), initial, accumulator); } @@ -200,7 +228,8 @@ public ImmList Scan(TRElem initial, Func accu /// The initial value for the accumulator. /// The accumulator. /// - public ImmList ScanBack(TRElem initial, Func accumulator) { + public ImmList ScanBack(TRElem initial, Func accumulator) + { return base._ScanBack(GetPrototype(), initial, accumulator); } @@ -212,21 +241,24 @@ public ImmList ScanBack(TRElem initial, Func /// The other collection. The right-hand parameter of the selector. /// The selector used to select the result. /// - public ImmList Zip(IEnumerable other, Func selector) { + public ImmList Zip(IEnumerable other, Func selector) + { return base._Zip(GetPrototype(), other, selector); } - /// + /// /// Zips this collection with another one, returning a collection of pairs. /// /// The type of element of the 2nd collection. /// The other collection. The right-hand parameter of the selector. /// - public ImmList> Zip(IEnumerable other) { + public ImmList> Zip(IEnumerable other) + { return Zip(other, Tuple.Create); } - private ImmList GetPrototype() { + private ImmList GetPrototype() + { return ImmList.Instance; } } diff --git a/Imms/Imms.Collections/Wrappers/Immutable/Templates/ListLikeClass.cs b/Imms/Imms.Collections/Wrappers/Immutable/Templates/ListLikeClass.cs index 69b02a6..c3cbcf4 100644 --- a/Imms/Imms.Collections/Wrappers/Immutable/Templates/ListLikeClass.cs +++ b/Imms/Imms.Collections/Wrappers/Immutable/Templates/ListLikeClass.cs @@ -4,10 +4,12 @@ using Imms; using Imms.Abstract; -partial class __ListLikeClass__ : AbstractSequential> { +partial class __ListLikeClass__ : AbstractSequential> +{ private static readonly __ListLikeClass__ Instance = new __ListLikeClass__(); - private __ListLikeClass__() { + private __ListLikeClass__() + { } @@ -17,7 +19,8 @@ private __ListLikeClass__() { /// The type of the result element. /// The selector. /// - public __ListLikeClass__ Select(Func selector) { + public __ListLikeClass__ Select(Func selector) + { return base._Select(GetPrototype(), selector); } @@ -28,7 +31,8 @@ public __ListLikeClass__ Select(Func selector) { /// The type of the output collection element. /// The selector. /// - public __ListLikeClass__ Select(Func> selector) { + public __ListLikeClass__ Select(Func> selector) + { return base._Choose(GetPrototype(), selector); } @@ -39,7 +43,8 @@ public __ListLikeClass__ Select(Func> select /// The type of the output collection element. /// The selector. /// - public __ListLikeClass__ Choose(Func> selector) { + public __ListLikeClass__ Choose(Func> selector) + { return base._Choose(GetPrototype(), selector); } @@ -50,15 +55,30 @@ public __ListLikeClass__ Choose(Func> select /// The type of the ouput collection elem. /// The selector. /// - public __ListLikeClass__ SelectMany(Func> selector) { + public __ListLikeClass__ SelectMany(Func> selector) + { return base._SelectMany(GetPrototype(), selector); } - public __ListLikeClass__ GroupJoin(IEnumerable inner, Func outerKeySelector, Func innerKeySelector, Func, TResult> resultSelector, IEqualityComparer eq = null) { - return base._GroupJoin(GetPrototype(), inner, outerKeySelector, innerKeySelector, resultSelector, eq); - } + /// + /// Groups the elements of this collection and a sequence based on equality of keys, and groups the results. The specified equality comparer is used to compare keys, if provided. + /// + /// The type of the input sequence. + /// The type of the key used to join the results. + /// The type of the result element. + /// The input sequence. + /// The key selector for the current collection. + /// The key selector for the input sequence. + /// The result selector that aggregates all the results. + /// An optional equality comparer. If null, the default is used. + /// + public __ListLikeClass__ GroupJoin(IEnumerable inner, Func outerKeySelector, Func innerKeySelector, Func, TResult> resultSelector, IEqualityComparer eq = null) + { + + return base._GroupJoin(GetPrototype(), inner, outerKeySelector, innerKeySelector, resultSelector, eq); + } /// /// Applies an element selector on every element of the collection, yielding a sequence. @@ -71,7 +91,8 @@ public __ListLikeClass__ GroupJoin(IEnumerableThe result selector. /// public __ListLikeClass__ SelectMany(Func> selector, - Func rSelector) { + Func rSelector) + { return base._SelectMany(GetPrototype(), selector, rSelector); } @@ -90,7 +111,8 @@ public __ListLikeClass__ SelectMany(Func public __ListLikeClass__ Join(IEnumerable inner, Func oKeySelector, Func iKeySelector, Func rSelector, - IEqualityComparer eq = null) { + IEqualityComparer eq = null) + { return base._Join(GetPrototype(), inner, oKeySelector, iKeySelector, rSelector, eq ?? EqualityComparer.Default); } @@ -107,7 +129,8 @@ public __ListLikeClass__ Join(IEnumerable /// /// public __ListLikeClass__> Join(IEnumerable inner, Func oKeySelector, - Func iKeySelector, IEqualityComparer eq = null) { + Func iKeySelector, IEqualityComparer eq = null) + { return Join(inner, oKeySelector, iKeySelector, Kvp.Of, eq); } @@ -125,7 +148,8 @@ public __ListLikeClass__> Join(IEnumerable /// The equality comparer. /// public __ListLikeClass__ GroupBy(Func keySelector, Func valueSelector, - Func, TRElem> rSelector, IEqualityComparer eq = null) { + Func, TRElem> rSelector, IEqualityComparer eq = null) + { return base._GroupBy(GetPrototype(), keySelector, valueSelector, rSelector, eq ?? EqualityComparer.Default); } @@ -146,7 +170,8 @@ public __ListLikeClass__ GroupBy(Func key /// The equality comparer. /// public __ListLikeClass__>> GroupBy(Func keySelector, Func elementSelector, - IEqualityComparer eq = null) { + IEqualityComparer eq = null) + { return GroupBy(keySelector, elementSelector, Kvp.Of, eq ?? EqualityComparer.Default); } @@ -163,7 +188,8 @@ public __ListLikeClass__>> GroupByThe equality comparer. /// public __ListLikeClass__>> GroupBy(Func keySelector, - IEqualityComparer eq = null) { + IEqualityComparer eq = null) + { return GroupBy(keySelector, x => x, Kvp.Of, eq ?? EqualityComparer.Default); } @@ -172,7 +198,8 @@ public __ListLikeClass__>> GroupBy(Func< /// /// The return element type. /// - public __ListLikeClass__ Cast() { + public __ListLikeClass__ Cast() + { return base._Cast>(GetPrototype()); } @@ -184,7 +211,8 @@ public __ListLikeClass__ Cast() { /// The initial value for the accumulator. /// The accumulator. /// - public __ListLikeClass__ Scan(TRElem initial, Func accumulator) { + public __ListLikeClass__ Scan(TRElem initial, Func accumulator) + { return base._Scan(GetPrototype(), initial, accumulator); } @@ -196,7 +224,8 @@ public __ListLikeClass__ Scan(TRElem initial, FuncThe initial value for the accumulator. /// The accumulator. /// - public __ListLikeClass__ ScanBack(TRElem initial, Func accumulator) { + public __ListLikeClass__ ScanBack(TRElem initial, Func accumulator) + { return base._ScanBack(GetPrototype(), initial, accumulator); } @@ -208,21 +237,24 @@ public __ListLikeClass__ ScanBack(TRElem initial, FuncThe other collection. The right-hand parameter of the selector. /// The selector used to select the result. /// - public __ListLikeClass__ Zip(IEnumerable other, Func selector) { + public __ListLikeClass__ Zip(IEnumerable other, Func selector) + { return base._Zip(GetPrototype(), other, selector); } - /// + /// /// Zips this collection with another one, returning a collection of pairs. /// /// The type of element of the 2nd collection. /// The other collection. The right-hand parameter of the selector. /// - public __ListLikeClass__> Zip(IEnumerable other) { + public __ListLikeClass__> Zip(IEnumerable other) + { return Zip(other, Tuple.Create); } - private __ListLikeClass__ GetPrototype() { + private __ListLikeClass__ GetPrototype() + { return __ListLikeClass__.Instance; } } \ No newline at end of file diff --git a/Imms/Imms.Collections/Wrappers/Immutable/Vector/Boilerplate.cs b/Imms/Imms.Collections/Wrappers/Immutable/Vector/Boilerplate.cs index 68c4d05..e5bed0c 100644 --- a/Imms/Imms.Collections/Wrappers/Immutable/Vector/Boilerplate.cs +++ b/Imms/Imms.Collections/Wrappers/Immutable/Vector/Boilerplate.cs @@ -8,10 +8,12 @@ namespace Imms using Imms; using Imms.Abstract; - partial class ImmVector : AbstractSequential> { + partial class ImmVector : AbstractSequential> + { private static readonly ImmVector Instance = new ImmVector(); - private ImmVector() { + private ImmVector() + { } @@ -21,7 +23,8 @@ private ImmVector() { /// The type of the result element. /// The selector. /// - public ImmVector Select(Func selector) { + public ImmVector Select(Func selector) + { return base._Select(GetPrototype(), selector); } @@ -32,7 +35,8 @@ public ImmVector Select(Func selector) { /// The type of the output collection element. /// The selector. /// - public ImmVector Select(Func> selector) { + public ImmVector Select(Func> selector) + { return base._Choose(GetPrototype(), selector); } @@ -43,7 +47,8 @@ public ImmVector Select(Func> selector) { /// The type of the output collection element. /// The selector. /// - public ImmVector Choose(Func> selector) { + public ImmVector Choose(Func> selector) + { return base._Choose(GetPrototype(), selector); } @@ -54,15 +59,30 @@ public ImmVector Choose(Func> selector) { /// The type of the ouput collection elem. /// The selector. /// - public ImmVector SelectMany(Func> selector) { + public ImmVector SelectMany(Func> selector) + { return base._SelectMany(GetPrototype(), selector); } - public ImmVector GroupJoin(IEnumerable inner, Func outerKeySelector, Func innerKeySelector, Func, TResult> resultSelector, IEqualityComparer eq = null) { - return base._GroupJoin(GetPrototype(), inner, outerKeySelector, innerKeySelector, resultSelector, eq); - } + /// + /// Groups the elements of this collection and a sequence based on equality of keys, and groups the results. The specified equality comparer is used to compare keys, if provided. + /// + /// The type of the input sequence. + /// The type of the key used to join the results. + /// The type of the result element. + /// The input sequence. + /// The key selector for the current collection. + /// The key selector for the input sequence. + /// The result selector that aggregates all the results. + /// An optional equality comparer. If null, the default is used. + /// + public ImmVector GroupJoin(IEnumerable inner, Func outerKeySelector, Func innerKeySelector, Func, TResult> resultSelector, IEqualityComparer eq = null) + { + + return base._GroupJoin(GetPrototype(), inner, outerKeySelector, innerKeySelector, resultSelector, eq); + } /// /// Applies an element selector on every element of the collection, yielding a sequence. @@ -75,7 +95,8 @@ public ImmVector GroupJoin(IEnumerable i /// The result selector. /// public ImmVector SelectMany(Func> selector, - Func rSelector) { + Func rSelector) + { return base._SelectMany(GetPrototype(), selector, rSelector); } @@ -94,7 +115,8 @@ public ImmVector SelectMany(Func> /// public ImmVector Join(IEnumerable inner, Func oKeySelector, Func iKeySelector, Func rSelector, - IEqualityComparer eq = null) { + IEqualityComparer eq = null) + { return base._Join(GetPrototype(), inner, oKeySelector, iKeySelector, rSelector, eq ?? EqualityComparer.Default); } @@ -111,7 +133,8 @@ public ImmVector Join(IEnumerable inner, F /// /// public ImmVector> Join(IEnumerable inner, Func oKeySelector, - Func iKeySelector, IEqualityComparer eq = null) { + Func iKeySelector, IEqualityComparer eq = null) + { return Join(inner, oKeySelector, iKeySelector, Kvp.Of, eq); } @@ -129,7 +152,8 @@ public ImmVector> Join(IEnumerable /// The equality comparer. /// public ImmVector GroupBy(Func keySelector, Func valueSelector, - Func, TRElem> rSelector, IEqualityComparer eq = null) { + Func, TRElem> rSelector, IEqualityComparer eq = null) + { return base._GroupBy(GetPrototype(), keySelector, valueSelector, rSelector, eq ?? EqualityComparer.Default); } @@ -150,7 +174,8 @@ public ImmVector GroupBy(Func keySelector /// The equality comparer. /// public ImmVector>> GroupBy(Func keySelector, Func elementSelector, - IEqualityComparer eq = null) { + IEqualityComparer eq = null) + { return GroupBy(keySelector, elementSelector, Kvp.Of, eq ?? EqualityComparer.Default); } @@ -167,7 +192,8 @@ public ImmVector>> GroupBy( /// The equality comparer. /// public ImmVector>> GroupBy(Func keySelector, - IEqualityComparer eq = null) { + IEqualityComparer eq = null) + { return GroupBy(keySelector, x => x, Kvp.Of, eq ?? EqualityComparer.Default); } @@ -176,7 +202,8 @@ public ImmVector>> GroupBy(Func /// /// The return element type. /// - public ImmVector Cast() { + public ImmVector Cast() + { return base._Cast>(GetPrototype()); } @@ -188,7 +215,8 @@ public ImmVector Cast() { /// The initial value for the accumulator. /// The accumulator. /// - public ImmVector Scan(TRElem initial, Func accumulator) { + public ImmVector Scan(TRElem initial, Func accumulator) + { return base._Scan(GetPrototype(), initial, accumulator); } @@ -200,7 +228,8 @@ public ImmVector Scan(TRElem initial, Func ac /// The initial value for the accumulator. /// The accumulator. /// - public ImmVector ScanBack(TRElem initial, Func accumulator) { + public ImmVector ScanBack(TRElem initial, Func accumulator) + { return base._ScanBack(GetPrototype(), initial, accumulator); } @@ -212,21 +241,24 @@ public ImmVector ScanBack(TRElem initial, FuncThe other collection. The right-hand parameter of the selector. /// The selector used to select the result. /// - public ImmVector Zip(IEnumerable other, Func selector) { + public ImmVector Zip(IEnumerable other, Func selector) + { return base._Zip(GetPrototype(), other, selector); } - /// + /// /// Zips this collection with another one, returning a collection of pairs. /// /// The type of element of the 2nd collection. /// The other collection. The right-hand parameter of the selector. /// - public ImmVector> Zip(IEnumerable other) { + public ImmVector> Zip(IEnumerable other) + { return Zip(other, Tuple.Create); } - private ImmVector GetPrototype() { + private ImmVector GetPrototype() + { return ImmVector.Instance; } } diff --git a/Imms/Imms.Collections/Wrappers/Immutable/Vector/Debugging.cs b/Imms/Imms.Collections/Wrappers/Immutable/Vector/Debugging.cs index f78ee24..bdf00ee 100644 --- a/Imms/Imms.Collections/Wrappers/Immutable/Vector/Debugging.cs +++ b/Imms/Imms.Collections/Wrappers/Immutable/Vector/Debugging.cs @@ -4,7 +4,7 @@ using System.Diagnostics; using System.Runtime.CompilerServices; using Imms.Abstract; - +#pragma warning disable 618 namespace Imms { [DebuggerDisplay("{DebuggerDisplay,nq}")] [DebuggerTypeProxy(typeof (VectorDebugView<>))] diff --git a/Imms/Imms.FSharp/Builders.fs b/Imms/Imms.FSharp/Builders.fs index ceaa6c0..f2001ac 100644 --- a/Imms/Imms.FSharp/Builders.fs +++ b/Imms/Imms.FSharp/Builders.fs @@ -7,7 +7,7 @@ open System open Imms.FSharp.Implementation open Imms.FSharp.Implementation.BuilderTypes - +#nowarn"0044" let private array_ops<'elem> : collection_ops<'elem, 'elem ImmList, 'elem ImmVector> = seq_build (fun list -> list.ToImmVector()) let private list_ops<'elem> : collection_ops<'elem, 'elem ImmList, 'elem ImmList> = seq_build id diff --git a/Imms/Imms.FSharp/Imms.FSharp.nuspec b/Imms/Imms.FSharp/Imms.FSharp.nuspec index 130c708..43a26d7 100644 --- a/Imms/Imms.FSharp/Imms.FSharp.nuspec +++ b/Imms/Imms.FSharp/Imms.FSharp.nuspec @@ -6,10 +6,10 @@ Imms.FSharp Gregory Rosenbaum Gregory Rosenbaum - https://raw.githubusercontent.com/GregRos/Imms/master/license.md + https://raw.githubusercontent.com/Imms/Imms/master/license.md http://imms.github.io/ false - https://raw.githubusercontent.com/GregRos/Imms/master/Icon.png + https://raw.githubusercontent.com/Imms/Imms/master/Icon.png Provides F# integration for Imms collections. This library provides F# integration for the Imms immutable collections library. diff --git a/Imms/Imms.FSharp/Patterns.fs b/Imms/Imms.FSharp/Patterns.fs index f25129d..715af2f 100644 --- a/Imms/Imms.FSharp/Patterns.fs +++ b/Imms/Imms.FSharp/Patterns.fs @@ -3,6 +3,7 @@ module Imms.FSharp.Patterns open Imms open Imms.FSharp.Implementation + ///Compatibility active pattern for matching Imms's Optional type. let (|ImmSome|ImmNone|) (optional : Imms.Optional<'T>) = if optional.IsSome then @@ -29,11 +30,13 @@ let inline (|Last2|_|) o = let last2 = rest1 |> Ops.last let rest2 = rest1 |>Ops.removeLast Some(rest2, last2, last1) + ///Decomposes a collection by 3 elements, from the end. let inline (|Last3|_|) o = match o with | Last1(Last2(tail, item1,item2),item3) -> Some(tail, item1,item2,item3) | _ -> None + ///Decomposes a collection by 4 elements, from the end. let inline (|Last4|_|) o = match o with diff --git a/Imms/Imms.Messing.CSharp/Program.cs b/Imms/Imms.Messing.CSharp/Program.cs index 2aa0c21..0e1b02e 100644 --- a/Imms/Imms.Messing.CSharp/Program.cs +++ b/Imms/Imms.Messing.CSharp/Program.cs @@ -33,7 +33,6 @@ join name2 in names2 on name equals name2 orderby name select name; - diff --git a/Imms/Imms.Tests.Performance/App.config b/Imms/Imms.Tests.Performance/App.config index 236ca06..c0b1dfc 100644 --- a/Imms/Imms.Tests.Performance/App.config +++ b/Imms/Imms.Tests.Performance/App.config @@ -7,7 +7,7 @@ - + diff --git a/Imms/Imms.Tests.Performance/Data.Targets.fs b/Imms/Imms.Tests.Performance/Data.Targets.fs index c5b5f28..d58fcf7 100644 --- a/Imms/Imms.Tests.Performance/Data.Targets.fs +++ b/Imms/Imms.Tests.Performance/Data.Targets.fs @@ -4,6 +4,7 @@ open System.Collections.Immutable open Imms.Tests.Performance.Wrappers open System.Linq open Imms +#nowarn"0044" [] module internal Shorthand = let data ctor kind library name size gen = DataStructure.Create(name,kind, size, library, gen, ctor) diff --git a/Imms/Imms.Tests.Performance/Imms.Tests.Performance.fsproj b/Imms/Imms.Tests.Performance/Imms.Tests.Performance.fsproj index 391c7e9..4abde9c 100644 --- a/Imms/Imms.Tests.Performance/Imms.Tests.Performance.fsproj +++ b/Imms/Imms.Tests.Performance/Imms.Tests.Performance.fsproj @@ -78,26 +78,18 @@ - - ..\..\..\packages\CsvHelper.2.13.5.0\lib\net40-client\CsvHelper.dll - True - ..\..\..\packages\FSharp.Core.4.0.0.1\lib\net40\FSharp.Core.dll True - ..\..\..\packages\FSharpx.Collections.1.14.0\lib\net40\FSharpx.Collections.dll + ..\..\..\packages\FSharpx.Collections.1.15.1\lib\net40\FSharpx.Collections.dll True ..\..\..\packages\FSharpx.Core.1.8.32\lib\40\FSharpx.Core.dll True - - ..\..\..\packages\LINQtoCSV.1.5.0.0\lib\net35\LINQtoCSV.dll - True - @@ -111,17 +103,6 @@ - - - False - - - - - - ..\..\..\packages\YamlDotNet.3.8.0\lib\net35\YamlDotNet.dll - True - diff --git a/Imms/Imms.Tests.Performance/Program.fs b/Imms/Imms.Tests.Performance/Program.fs index 41af936..c0269d8 100644 --- a/Imms/Imms.Tests.Performance/Program.fs +++ b/Imms/Imms.Tests.Performance/Program.fs @@ -6,13 +6,9 @@ open Imms open System open ExtraFunctional open System.Diagnostics -open LINQtoCSV open System.Collections.Immutable open System.IO open System.Linq -open System.Windows.Forms -open System.Drawing -open System.Drawing.Imaging open System.CodeDom.Compiler open Imms.Tests open Imms.FSharp.Implementation diff --git a/Imms/Imms.Tests.Performance/Report.fs b/Imms/Imms.Tests.Performance/Report.fs index 471970b..05e0605 100644 --- a/Imms/Imms.Tests.Performance/Report.fs +++ b/Imms/Imms.Tests.Performance/Report.fs @@ -1,10 +1,7 @@ module Imms.Tests.Performance.Report open System.IO open Imms.FSharp.Implementation -open LINQtoCSV -open CsvHelper open ExtraFunctional -open YamlDotNet.Serialization type FullRecord = { Test : string @@ -40,41 +37,10 @@ let private toFullRecord (entry : TestInstanceMeta) = Ratio = entry.Test |> Meta.tryGet "Ratio" } - -let toTable (entries : TestInstanceMeta list) = - use stringw = new StringWriter() - use csv = new CsvWriter(stringw) - let missingText = "X" - for kind, tests in entries |> Seq.groupBy(fun x -> x.Target.Kind) do - csv.WriteField("Tests For:") - csv.WriteField(sprintf "%A" kind) - csv.NextRecord() - csv.WriteField("Collection/Test") - let byName = tests |> Seq.map (fun x -> x.Test.Name) |> Seq.distinct |> Seq.sort |> Seq.toArray - byName |> Seq.iter (csv.WriteField) - csv.NextRecord() - let byTarget = - tests - |> Seq.groupBy (fun x -> x.Target.Name) - |> Seq.sortBy (snd >> Seq.head >> (fun x -> x.Target.Library)) - - for name,group in byTarget do - csv.WriteField name - for testName in byName do - let myTest = group |> Seq.tryFind (fun x -> x.Test.Name = testName) - match myTest with - | Some test -> csv.WriteField(test.Time.ToString()) - | None -> csv.WriteField(missingText) - csv.NextRecord() - csv.NextRecord() - stringw.Flush() - stringw.ToString() - open Newtonsoft.Json let toJSON (entries : TestInstanceMeta list) = - let context = CsvContext() let ys = JsonSerializer() - ys.Formatting <- Formatting.Indented + ys.Formatting <- Formatting.Indented use stream = new StringWriter() let entries = entries |> Seq.map (toFullRecord) ys.Serialize(stream, entries) diff --git a/Imms/Imms.Tests.Performance/packages.config b/Imms/Imms.Tests.Performance/packages.config index efbb50d..2e11433 100644 --- a/Imms/Imms.Tests.Performance/packages.config +++ b/Imms/Imms.Tests.Performance/packages.config @@ -1,11 +1,8 @@  - - + - - \ No newline at end of file