Skip to content

Commit

Permalink
Rename Seq back to Seq1
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul Louth committed Oct 21, 2021
1 parent f3a30f0 commit e904c1d
Show file tree
Hide file tree
Showing 58 changed files with 158 additions and 185 deletions.
2 changes: 1 addition & 1 deletion LanguageExt.Core/Class Instances/Monad/MEnumerable.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public struct MEnumerable<A> :
EnumerableOptimal.BindFast(ma, f);

static Seq<B> BindLazy<B>(Seq<A> ma, Func<A, Seq<B>> f) =>
Seq(EnumerableOptimal.BindFast(ma, a => f(a).AsEnumerable()));
toSeq(EnumerableOptimal.BindFast(ma, a => f(a).AsEnumerable()));

[Pure]
public MB BindAsync<MONADB, MB, B>(IEnumerable<A> ma, Func<A, MB> f) where MONADB : struct, MonadAsync<Unit, Unit, MB, B>
Expand Down
4 changes: 2 additions & 2 deletions LanguageExt.Core/Class Instances/Monad/MSeq.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public struct MSeq<A> :

[Pure]
public Seq<A> Subtract(Seq<A> x, Seq<A> y) =>
Seq(Enumerable.Except(x, y));
toSeq(Enumerable.Except(x, y));

[Pure]
public Seq<A> Empty() =>
Expand Down Expand Up @@ -70,7 +70,7 @@ IEnumerable<A> Yield()
foreach (var a in ma) yield return a;
foreach (var b in mb) yield return b;
}
return Seq(Yield());
return toSeq(Yield());
}

[Pure]
Expand Down
4 changes: 2 additions & 2 deletions LanguageExt.Core/Class Instances/Monad/MValidationSeq.cs
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,11 @@ err switch
{
// Messy, but we're doing our best to recover an error rather than return Bottom

FAIL fail => Validation<FAIL, SUCCESS>.Fail(Seq(fail)),
FAIL fail => Validation<FAIL, SUCCESS>.Fail(Seq1(fail)),
Seq<FAIL> fails => Validation<FAIL, SUCCESS>.Fail(fails),
_ => Common.Error
.Convert<FAIL>(err)
.Map(f => Validation<FAIL, SUCCESS>.Fail(Seq(f)))
.Map(f => Validation<FAIL, SUCCESS>.Fail(Seq1(f)))
.IfNone(Validation<FAIL, SUCCESS>.Fail(Seq<FAIL>.Empty))
};

Expand Down
2 changes: 1 addition & 1 deletion LanguageExt.Core/Class Instances/Monoid/MCompositions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public Compositions<A> Append(Compositions<A> compx, Compositions<A> compy)
Seq<Compositions<A>.Node> go(Seq<Compositions<A>.Node> mx, Seq<Compositions<A>.Node> my)
{
if (mx.IsEmpty) return my;
if (my.IsEmpty) return go(mx.Tail, Seq(mx.Head));
if (my.IsEmpty) return go(mx.Tail, Seq1(mx.Head));

var x = mx.Head;
var sx = mx.Head.Size;
Expand Down
38 changes: 19 additions & 19 deletions LanguageExt.Core/Concurrency/AtomHashMap/AtomHashMap.Eq.cs
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,7 @@ public Unit AddOrUpdate(K key, Func<V, V> Some, V None)
public Unit AddRange(IEnumerable<(K Key, V Value)> range)
{
SpinWait sw = default;
var srange = Seq(range);
var srange = toSeq(range);
if (srange.IsEmpty) return default;
while (true)
{
Expand All @@ -512,7 +512,7 @@ public Unit AddRange(IEnumerable<(K Key, V Value)> range)
public Unit TryAddRange(IEnumerable<(K Key, V Value)> range)
{
SpinWait sw = default;
var srange = Seq(range);
var srange = toSeq(range);
if (srange.IsEmpty) return default;
while (true)
{
Expand Down Expand Up @@ -543,7 +543,7 @@ public Unit TryAddRange(IEnumerable<(K Key, V Value)> range)
public Unit TryAddRange(IEnumerable<KeyValuePair<K, V>> range)
{
SpinWait sw = default;
var srange = Seq(range);
var srange = toSeq(range);
while (true)
{
var oitems = Items;
Expand Down Expand Up @@ -574,7 +574,7 @@ public Unit TryAddRange(IEnumerable<KeyValuePair<K, V>> range)
public Unit AddOrUpdateRange(IEnumerable<(K Key, V Value)> range)
{
SpinWait sw = default;
var srange = Seq(range);
var srange = toSeq(range);
if (srange.IsEmpty) return default;
while (true)
{
Expand All @@ -601,7 +601,7 @@ public Unit AddOrUpdateRange(IEnumerable<(K Key, V Value)> range)
public Unit AddOrUpdateRange(IEnumerable<KeyValuePair<K, V>> range)
{
SpinWait sw = default;
var srange = Seq(range);
var srange = toSeq(range);
if (srange.IsEmpty) return default;
while (true)
{
Expand Down Expand Up @@ -985,7 +985,7 @@ public Unit Clear()
public Unit AddRange(IEnumerable<KeyValuePair<K, V>> pairs)
{
SpinWait sw = default;
var spairs = Seq(pairs);
var spairs = toSeq(pairs);
if (spairs.IsEmpty) return default;
while (true)
{
Expand All @@ -1010,7 +1010,7 @@ public Unit AddRange(IEnumerable<KeyValuePair<K, V>> pairs)
public Unit SetItems(IEnumerable<KeyValuePair<K, V>> items)
{
SpinWait sw = default;
var sitems = Seq(items);
var sitems = toSeq(items);
if (sitems.IsEmpty) return default;
while (true)
{
Expand All @@ -1035,7 +1035,7 @@ public Unit SetItems(IEnumerable<KeyValuePair<K, V>> items)
public Unit SetItems(IEnumerable<(K Key, V Value)> items)
{
SpinWait sw = default;
var sitems = Seq(items);
var sitems = toSeq(items);
if (sitems.IsEmpty) return default;
while (true)
{
Expand All @@ -1060,7 +1060,7 @@ public Unit SetItems(IEnumerable<(K Key, V Value)> items)
public Unit TrySetItems(IEnumerable<KeyValuePair<K, V>> items)
{
SpinWait sw = default;
var sitems = Seq(items);
var sitems = toSeq(items);
if (sitems.IsEmpty) return default;
while (true)
{
Expand Down Expand Up @@ -1089,7 +1089,7 @@ public Unit TrySetItems(IEnumerable<KeyValuePair<K, V>> items)
public Unit TrySetItems(IEnumerable<(K Key, V Value)> items)
{
SpinWait sw = default;
var sitems = Seq(items);
var sitems = toSeq(items);
if (sitems.IsEmpty) return default;
while (true)
{
Expand Down Expand Up @@ -1123,7 +1123,7 @@ public Unit TrySetItems(IEnumerable<(K Key, V Value)> items)
public Unit TrySetItems(IEnumerable<K> keys, Func<V, V> Some)
{
SpinWait sw = default;
var skeys = Seq(keys);
var skeys = toSeq(keys);
if (skeys.IsEmpty) return default;
while (true)
{
Expand Down Expand Up @@ -1151,7 +1151,7 @@ public Unit TrySetItems(IEnumerable<K> keys, Func<V, V> Some)
public Unit RemoveRange(IEnumerable<K> keys)
{
SpinWait sw = default;
var skeys = Seq(keys);
var skeys = toSeq(keys);
if (skeys.IsEmpty) return default;
while (true)
{
Expand Down Expand Up @@ -1232,7 +1232,7 @@ public Unit RemoveRange(IEnumerable<K> keys)

[Pure]
public Seq<(K Key, V Value)> ToSeq() =>
Seq(AsEnumerable());
toSeq(AsEnumerable());

/// <summary>
/// Format the collection as `[(key: value), (key: value), (key: value), ...]`
Expand Down Expand Up @@ -1466,7 +1466,7 @@ public Unit Subtract(HashMap<EqK, K, V> rhs)
public Unit Intersect(IEnumerable<K> rhs)
{
SpinWait sw = default;
var srhs = Seq(rhs);
var srhs = toSeq(rhs);
while (true)
{
var oitems = this.Items;
Expand All @@ -1488,7 +1488,7 @@ public Unit Intersect(IEnumerable<K> rhs)
public Unit Intersect(IEnumerable<(K Key, V Value)> rhs)
{
SpinWait sw = default;
var srhs = Seq(rhs);
var srhs = toSeq(rhs);
while (true)
{
var oitems = this.Items;
Expand Down Expand Up @@ -1525,7 +1525,7 @@ public Unit Intersect(IEnumerable<(K Key, V Value)> rhs)
public Unit Except(IEnumerable<K> rhs)
{
SpinWait sw = default;
var srhs = Seq(rhs);
var srhs = toSeq(rhs);
while (true)
{
var oitems = this.Items;
Expand All @@ -1548,7 +1548,7 @@ public Unit Except(IEnumerable<K> rhs)
public Unit Except(IEnumerable<(K Key, V Value)> rhs)
{
SpinWait sw = default;
var srhs = Seq(rhs);
var srhs = toSeq(rhs);
while (true)
{
var oitems = this.Items;
Expand Down Expand Up @@ -1593,7 +1593,7 @@ public Unit SymmetricExcept(HashMap<K, V> rhs)
public Unit SymmetricExcept(IEnumerable<(K Key, V Value)> rhs)
{
SpinWait sw = default;
var srhs = Seq(rhs);
var srhs = toSeq(rhs);
while (true)
{
var oitems = this.Items;
Expand All @@ -1618,7 +1618,7 @@ public Unit SymmetricExcept(IEnumerable<(K Key, V Value)> rhs)
public Unit Union(IEnumerable<(K, V)> rhs)
{
SpinWait sw = default;
var srhs = Seq(rhs);
var srhs = toSeq(rhs);
while (true)
{
var oitems = this.Items;
Expand Down
38 changes: 19 additions & 19 deletions LanguageExt.Core/Concurrency/AtomHashMap/AtomHashMap.cs
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,7 @@ public Unit AddOrUpdate(K key, Func<V, V> Some, V None)
public Unit AddRange(IEnumerable<(K Key, V Value)> range)
{
SpinWait sw = default;
var srange = Seq(range);
var srange = toSeq(range);
if (srange.IsEmpty) return default;
while (true)
{
Expand All @@ -481,7 +481,7 @@ public Unit AddRange(IEnumerable<(K Key, V Value)> range)
public Unit TryAddRange(IEnumerable<(K Key, V Value)> range)
{
SpinWait sw = default;
var srange = Seq(range);
var srange = toSeq(range);
if (srange.IsEmpty) return default;
while (true)
{
Expand Down Expand Up @@ -512,7 +512,7 @@ public Unit TryAddRange(IEnumerable<(K Key, V Value)> range)
public Unit TryAddRange(IEnumerable<KeyValuePair<K, V>> range)
{
SpinWait sw = default;
var srange = Seq(range);
var srange = toSeq(range);
if (srange.IsEmpty) return default;
while (true)
{
Expand Down Expand Up @@ -544,7 +544,7 @@ public Unit TryAddRange(IEnumerable<KeyValuePair<K, V>> range)
public Unit AddOrUpdateRange(IEnumerable<(K Key, V Value)> range)
{
SpinWait sw = default;
var srange = Seq(range);
var srange = toSeq(range);
if (srange.IsEmpty) return default;
while (true)
{
Expand All @@ -571,7 +571,7 @@ public Unit AddOrUpdateRange(IEnumerable<(K Key, V Value)> range)
public Unit AddOrUpdateRange(IEnumerable<KeyValuePair<K, V>> range)
{
SpinWait sw = default;
var srange = Seq(range);
var srange = toSeq(range);
if (srange.IsEmpty) return default;
while (true)
{
Expand Down Expand Up @@ -955,7 +955,7 @@ public Unit Clear()
public Unit AddRange(IEnumerable<KeyValuePair<K, V>> pairs)
{
SpinWait sw = default;
var spairs = Seq(pairs);
var spairs = toSeq(pairs);
if (spairs.IsEmpty) return default;
while (true)
{
Expand All @@ -980,7 +980,7 @@ public Unit AddRange(IEnumerable<KeyValuePair<K, V>> pairs)
public Unit SetItems(IEnumerable<KeyValuePair<K, V>> items)
{
SpinWait sw = default;
var sitems = Seq(items);
var sitems = toSeq(items);
if (sitems.IsEmpty) return default;
while (true)
{
Expand All @@ -1005,7 +1005,7 @@ public Unit SetItems(IEnumerable<KeyValuePair<K, V>> items)
public Unit SetItems(IEnumerable<(K Key, V Value)> items)
{
SpinWait sw = default;
var sitems = Seq(items);
var sitems = toSeq(items);
if (sitems.IsEmpty) return default;
while (true)
{
Expand All @@ -1030,7 +1030,7 @@ public Unit SetItems(IEnumerable<(K Key, V Value)> items)
public Unit TrySetItems(IEnumerable<KeyValuePair<K, V>> items)
{
SpinWait sw = default;
var sitems = Seq(items);
var sitems = toSeq(items);
if (sitems.IsEmpty) return default;
while (true)
{
Expand Down Expand Up @@ -1059,7 +1059,7 @@ public Unit TrySetItems(IEnumerable<KeyValuePair<K, V>> items)
public Unit TrySetItems(IEnumerable<(K Key, V Value)> items)
{
SpinWait sw = default;
var sitems = Seq(items);
var sitems = toSeq(items);
if (sitems.IsEmpty) return default;
while (true)
{
Expand Down Expand Up @@ -1093,7 +1093,7 @@ public Unit TrySetItems(IEnumerable<(K Key, V Value)> items)
public Unit TrySetItems(IEnumerable<K> keys, Func<V, V> Some)
{
SpinWait sw = default;
var skeys = Seq(keys);
var skeys = toSeq(keys);
if (skeys.IsEmpty) return default;
while (true)
{
Expand Down Expand Up @@ -1121,7 +1121,7 @@ public Unit TrySetItems(IEnumerable<K> keys, Func<V, V> Some)
public Unit RemoveRange(IEnumerable<K> keys)
{
SpinWait sw = default;
var skeys = Seq(keys);
var skeys = toSeq(keys);
if (skeys.IsEmpty) return default;
while (true)
{
Expand Down Expand Up @@ -1202,7 +1202,7 @@ public Unit RemoveRange(IEnumerable<K> keys)

[Pure]
public Seq<(K Key, V Value)> ToSeq() =>
Seq(AsEnumerable());
toSeq(AsEnumerable());

/// <summary>
/// Format the collection as `[(key: value), (key: value), (key: value), ...]`
Expand Down Expand Up @@ -1436,7 +1436,7 @@ public Unit Subtract(HashMap<K, V> rhs)
public Unit Intersect(IEnumerable<K> rhs)
{
SpinWait sw = default;
var srhs = Seq(rhs);
var srhs = toSeq(rhs);
while (true)
{
var oitems = this.Items;
Expand All @@ -1458,7 +1458,7 @@ public Unit Intersect(IEnumerable<K> rhs)
public Unit Intersect(IEnumerable<(K Key, V Value)> rhs)
{
SpinWait sw = default;
var srhs = Seq(rhs);
var srhs = toSeq(rhs);
while (true)
{
var oitems = this.Items;
Expand Down Expand Up @@ -1495,7 +1495,7 @@ public Unit Intersect(IEnumerable<(K Key, V Value)> rhs)
public Unit Except(IEnumerable<K> rhs)
{
SpinWait sw = default;
var srhs = Seq(rhs);
var srhs = toSeq(rhs);
while (true)
{
var oitems = this.Items;
Expand All @@ -1518,7 +1518,7 @@ public Unit Except(IEnumerable<K> rhs)
public Unit Except(IEnumerable<(K Key, V Value)> rhs)
{
SpinWait sw = default;
var srhs = Seq(rhs);
var srhs = toSeq(rhs);
while (true)
{
var oitems = this.Items;
Expand Down Expand Up @@ -1563,7 +1563,7 @@ public Unit SymmetricExcept(HashMap<K, V> rhs)
public Unit SymmetricExcept(IEnumerable<(K Key, V Value)> rhs)
{
SpinWait sw = default;
var srhs = Seq(rhs);
var srhs = toSeq(rhs);
while (true)
{
var oitems = this.Items;
Expand All @@ -1588,7 +1588,7 @@ public Unit SymmetricExcept(IEnumerable<(K Key, V Value)> rhs)
public Unit Union(IEnumerable<(K, V)> rhs)
{
SpinWait sw = default;
var srhs = Seq(rhs);
var srhs = toSeq(rhs);
while (true)
{
var oitems = this.Items;
Expand Down
Loading

0 comments on commit e904c1d

Please sign in to comment.