Skip to content

Commit

Permalink
Merge pull request #95 from messerli-informatik-ag/release-2.0.0
Browse files Browse the repository at this point in the history
Release 2.0.0
  • Loading branch information
FreeApophis authored Jul 14, 2020
2 parents 6c08044 + efc9a62 commit b37cc45
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 17 deletions.
13 changes: 1 addition & 12 deletions Funcky/Funcky.csproj
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netstandard2.0;netstandard2.1</TargetFrameworks>
<LangVersion>8.0</LangVersion>
Expand All @@ -16,18 +15,8 @@
<PackageProjectUrl>https://github.com/messerli-informatik-ag/funcky</PackageProjectUrl>
<RepositoryUrl>https://github.com/messerli-informatik-ag/funcky</RepositoryUrl>
<PackageTags>Functional Monad</PackageTags>
<Version>2.0.0-rc.2</Version>
<FileVersion>2.0.0.0</FileVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<Version>2.0.0</Version>
<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
</PropertyGroup>

<PropertyGroup>
<NoWarn>$(NoWarn);1591</NoWarn>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<NoWarn>$(NoWarn);1701;1702</NoWarn>
</PropertyGroup>
</Project>
36 changes: 31 additions & 5 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,19 +41,45 @@
* Fix incorrect implementation on `Result.SelectMany` which called the `selectedResultSelector` even when the
result was an error. As a result (pun intended) of the fix, `ResultCombinationException` is no longer needed and also removed.

## Unreleased
* Add extension method for `HttpHeaders.TryGetValues`, which returns an `Option`.
## 2.0.0

### Breaking Changes
* Remove `Reader` monad based on `await`.
* Remove `IToString`.
* Remove overload for `Option.From` that flattens passed `Option`s.
* Add extension methods for getting `Stream` properties that are not always available, as `Option`:
`GetLengthOrNone`, `GetPositionOrNone`, `GetReadTimeoutOrNone`, `GetWriteTimeoutOrNone`.
* Move `ToEnumerable` extension method to its own class.
This is only a breaking change if you've used the extension method as normal method.
In that case you need to change `EnumerableExtensions.ToEnumerable` to `ObjectExtensions.ToEnumerable`.
* Implement `IEquatable` on `Option`, `Result` and `Either`.
* Rename `Option.From` to `Option.FromNullable` and remove overload that takes non-nullable value types.
* Unify `Option<T>.ToEnumerable` and `Yield` to `ToEnumerable`
* Rename `OrElse` overloads that return the item to `GetOrElse` which improves overload resolution.
* The `Each` extension method on `IEnumerable<T>` has been renamed to `ForEach`.
* Move the `Ok` constructor of `Result<T>` to a non-generic class. This allows for the compiler to infer the generic type.
Old: `Result<int>.Ok(10)`. New: `Result.Ok(10)`.
* Use `Func<T, bool>` instead of `Predicate<T>` in predicate composition functions (`Functional.All`, `Functional.Any`, `Functional.Not`),
because most APIs in `System` use `Func`.
* `Functional.Any` now returns `false` when the given list of predicates is empty.

### Fixes
* Fix incorrect `Equals` implementation on `Option`.
`Equals` previously returned `true` when comparing a `None` value with a `Some` value containing the default value of the type.
* `Exception` created by `Result` monad contains valid stack trace
* Fix incorrect implementation on `Result.SelectMany` which called the `selectedResultSelector` even when the
result was an error. As a result (pun intended) of the fix, `ResultCombinationException` is no longer needed and also removed.

### Additions
* Add `IndexOfOrNone`, `LastIndexOfOrNone`, `IndexOfAnyOrNone` and `LastIndexOfAnyOrNone` extension methods to `string`.
* Added `Curry`, `Uncurry` and `Flip` to the `Functional` Class
* Add extension method for `HttpHeaders.TryGetValues`, which returns an `Option`.
* Add extension methods for getting `Stream` properties that are not always available, as `Option`:
`GetLengthOrNone`, `GetPositionOrNone`, `GetReadTimeoutOrNone`, `GetWriteTimeoutOrNone`.
* Add `None` extension method to `IEnumerable`.
* `Option<Task<T>>`, `Option<Task>` and their `ValueTask` equivalents are now awaitable:
```csharp
var answer = await Option.Some(Task.FromResult(42));
```

### Improvements
* Full nullable support introduced with C# 8.
* Mark our functions as `[Pure]`.
* Implement `IEquatable` on `Option`, `Result` and `Either`.

0 comments on commit b37cc45

Please sign in to comment.