Skip to content

Commit

Permalink
Merge pull request #131 from pfpack/release/v2.2.0-preview.7
Browse files Browse the repository at this point in the history
release/v2.2.0-preview.7
  • Loading branch information
andreise authored Sep 11, 2023
2 parents 7d9efb3 + fd66033 commit d588a54
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 17 deletions.
2 changes: 1 addition & 1 deletion src/core-taggeds-optional/Optional/Optional.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<Description>PrimeFuncPack Core.Optional is a core library for .NET consisting of Optional monad targeted for use in functional programming.</Description>
<RootNamespace>System</RootNamespace>
<AssemblyName>PrimeFuncPack.Core.Optional</AssemblyName>
<Version>2.2.0-preview.2</Version>
<Version>2.2.0-preview.3</Version>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,19 @@ private static Optional<TSource> InnerElementAtOrAbsent<TSource>(
this IEnumerable<TSource> source,
Index index)
=>
index.IsFromEnd switch
source switch
{
not true => source.InnerElementAtOrAbsent(index.Value),

_ => source switch
{
IReadOnlyList<TSource> list
=>
list.InnerElementAtOrAbsent_IReadOnlyList(list.Count - index.Value),
IReadOnlyList<TSource> list
=>
list.InnerElementAtOrAbsent_IReadOnlyList(index.GetOffset(list.Count)),

IList<TSource> list
=>
list.InnerElementAtOrAbsent_IList(list.Count - index.Value),
IList<TSource> list
=>
list.InnerElementAtOrAbsent_IList(index.GetOffset(list.Count)),

_ =>
source.InnerElementAtOrAbsent_IEnumerable_FromEnd(index.Value)
}
_ => index.IsFromEnd is false
? source.InnerElementAtOrAbsent_IEnumerable(index.Value)
: source.InnerElementAtOrAbsent_IEnumerable_FromEnd(index.Value)
};

private static Optional<TSource> InnerElementAtOrAbsent<TSource>(
Expand Down
4 changes: 2 additions & 2 deletions src/core-taggeds/Taggeds/Taggeds.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<Description>PrimeFuncPack Core.Taggeds is a core pack for .NET consisting of fundamental tagged types targeted for use in functional programming: Optional and Result monads, Tagged Union, as well as the convert extensions.</Description>
<RootNamespace>System</RootNamespace>
<AssemblyName>PrimeFuncPack.Core.Taggeds</AssemblyName>
<Version>2.2.0-preview.6</Version>
<Version>2.2.0-preview.7</Version>
</PropertyGroup>

<ItemGroup>
Expand All @@ -33,7 +33,7 @@

<ItemGroup>
<PackageReference Include="PrimeFuncPack.Core.Failure" Version="2.1.0" />
<PackageReference Include="PrimeFuncPack.Core.Optional" Version="2.2.0-preview.2" />
<PackageReference Include="PrimeFuncPack.Core.Optional" Version="2.2.0-preview.3" />
<PackageReference Include="PrimeFuncPack.Core.Result" Version="2.1.0-preview.3" />
<PackageReference Include="PrimeFuncPack.Core.TaggedUnion" Version="2.1.0-preview.2" />
<PackageReference Include="PrimeFuncPack.Core.Unit" Version="2.2.0" />
Expand Down

0 comments on commit d588a54

Please sign in to comment.