Skip to content

Commit

Permalink
The extension methods for IEnumerable<T> were spread across two class…
Browse files Browse the repository at this point in the history
…es. Have amalgomated them into one.

Issue 15.
  • Loading branch information
DavidArno committed Jan 6, 2017
1 parent 28dce3b commit c5034b7
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 19 deletions.
18 changes: 0 additions & 18 deletions SuccincT/Functional/ConsExtensionsForIEnumerable.cs

This file was deleted.

11 changes: 11 additions & 0 deletions SuccincT/Functional/IEnumerableExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,17 @@ namespace SuccincT.Functional
{
public static class IEnumerableExtensions
{
public static IConsEnumerable<T> ToConsEnumerable<T>(this IEnumerable<T> collection) =>
new ConsEnumerable<T>(collection);

public static IConsEnumerable<T> Cons<T>(this IEnumerable<T> collection, T head) =>
collection.ToConsEnumerable().Cons(head);

public static IConsEnumerable<T> Cons<T>(this IEnumerable<T> collection, IEnumerable<T> head) =>
collection.ToConsEnumerable().Cons(head);

public static ConsResult<T> Cons<T>(this IEnumerable<T> collection) => collection.ToConsEnumerable().Cons();

public static IEnumerable<(int index, T item)> Indexed<T>(this IEnumerable<T> enumeration)
{
var index = 0;
Expand Down
1 change: 0 additions & 1 deletion SuccincT/SuccincT.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@
<Compile Include="Functional\ConsNodeEnumerator.cs" />
<Compile Include="Functional\ConsNodeState.cs" />
<Compile Include="Functional\ConsResult.cs" />
<Compile Include="Functional\ConsExtensionsForIEnumerable.cs" />
<Compile Include="Functional\IConsEnumerable.cs" />
<Compile Include="Functional\PartialFunctionApplications.cs" />
<Compile Include="Functional\PipeExtensions.cs" />
Expand Down

0 comments on commit c5034b7

Please sign in to comment.