Skip to content
David Arno edited this page Feb 17, 2020 · 14 revisions

Succinc<T>

Version history


Details of previous releases of Succinc<T>: v3.2.0 This release includes:

v3.0.1 This release includes:

  • Direct support for .NET Framework 4.5+, to prevent this package pulling in multiple dependencies needed for netstandard libraries to work with the .NET framework.

v3.0.0 This release includes:

  • Both Succinc<T> and SuccincT.JSON are now .NET standard 1.0 libraries, thus are compatible with .NET 4.5+, dotnetcore and a host of other frameworks.
  • Support for C# 7:
    • Cons now works via a deconstructor,
    • Pattern matching of value tuples is now supported,
    • Indexed enumerations using (int index, T item) values.
  • Complete redesign of the nuget packages, which now target .NET Standard version 1.0. This means it can be used with .NET Framework 4.5+, Mono 4.6+, Xamarin.iOS 10.0+, Xamarin.Android 7.0+, UWP 10.0+, Windows 8 apps and Windows Phone 8.1 apps.
  • A bug fix: comparing Option<T> to null now works as expected (see Comparing Option to null doesn't work as expected for details).
  • A few breaking changes:

v2.3.0 This release includes:

  • Significant contributions from @megafinz:
    • TryGetValue is now supported for all IDictionary<,> implementations, not just Dictionary<,>
    • Option<T>.None optimization: none for each T is now cached, so only one instance need be created.
    • ToOption, TryCast, AsNullable, Map, Or, Flatten and Choose extensions to Option<T>
  • CaseOf<T> support for arbitrary types
  • New Success<T> and Either<T1,T2> types
  • Tuple pattern matching now supports wildcards for items in the tuple

v2.2.0 This release includes:

  • SuccincT.Json - Provides support for serializing the following Succinc data types using JSON.Net: Maybe None Option Union<T1,T2> Union<T1,T2,T3> Union<T1,T2,T3,T4> ValueOrError Unit
  • Previously, the Succinc nuget package was incorrectly using the .NET Core version of the dll for framework projects, which could cause runtime failures as it tried to link to v4.1 of System.Runtime. Experiments with .NET Core suggest it didn't work reliably with that technology either. So with v2.2, support for .NET Core has been temporarily dropped while I work out how to properly support it.

v2.1.0 This release includes:

  • "cons" support for IEnumerable<T>. This allows items to be added to the head of an enumeration and for enumerations to be split into the head item and the "tail" enumeration.
  • Cycle() methods that can endlessly repeat an enumeration without repeatedly enumerating it.
  • A new experimental feature of forward piping parameters into method calls.
  • Support for .NET Core.

v2.0.0

Please be warned that this release includes a number of breaking changes. Please consult the documentation before installing.

This release includes:

  • A completely rewritten implementation of pattern matching (keeping the same semantics, so this shouldn't break and existing uses),
  • A new Unit type and associated methods for converting Action<T..> delegates to Func<T...,Unit> ones,
  • New Lambda, Transform, Func and Action methods to simplify the declaration and typing of lambdas.
  • A new Maybe type, which is a struct version of Option. This type is largely interchangable with Option and is provided for those that (a) prefer the semantics associated with "maybe" versus "option" and (b) those that prefer the idea of such a type being a struct (and those not able to be null.

v1.6.0 This release implements a new way of pattern matching unions, using CaseOf<type>. Please see the union pattern matching page for more details.

v1.5.1

This release addresses a small bug, whereby previously the exception message from accessing the wrong case in a Union<T1,T2>was misleading.

v1.5.0

  1. Added new extension methods for IEnumerable<T>: FirstOrNone, LastOrNone, SingleOrNone and ElementAtOrNone. These are equivalent to the XxxOrDefault methods, except they return Option<T> with a value or, if no match, None rather than a default value.
  2. Added an IgnoreElse() method, that does the same as Else((params...) => { }), for all Exec matchers. This can be used in situations where no action need be performed when there's no match.

v1.4.1

  1. Changed Succinc<T> to be a portable class library (PCL). This then allows other PCL's to use Succinc<T>. It should have had no other effect.

v1.4.0

  1. Yet another small breaking change. Please note that if you have previously used pattern matching on "normal" types (ie, not Options, Unions or ValueOrError types), then you'll have to add using SuccincT.PatternMatchers.GeneralMatcher; alongside using SuccincT.PatternMatchers; to each class using this functionality. The reason for this is that the generic type pattern matcher had to move to a new namespace to ensure proper use of the tuple matchers, whereas the types generated by the matcher fluent syntax remain in the old namespace. Please see this Stack Overflow question and answer for details on why this had to happen.

  2. Support added for pattern matching Tuple<T>, Tuple<T1,T2>, Tuple<T1,T2,T3> and Tuple<T1,T2,T3,T4>. See the Pattern matching tuples page for more details.

  3. A new interface, ITupleMatchable has been introduced, with the specific aim of allowing the tuple matching features to be applied to other "value types"/"DTO's"/"POCOs"/entities etc (call them what you like [caveat that all the previous things are technically different accepted]). The idea being that a type containing up to four items of data can implement ITupleMatchable in order to expose that data as a tuple, which is then matched using normal tuple matching rules. See the ITupleMatchable page for more details. v1.3.2

  4. Fix for bug Union<T1, T2> comparisons are broken

  5. Fix for bug value equality for Union<T1, T2, T3> and Union<T1, T2, T3> hasn't been implemented

v1.3.0

  1. Union<T1,T2,T3,T4> now supports pattern matching.
  2. For patterns that return a value (and thus invoke a Func<> on match) now support both lambdas/methods and simple expressions for both Do and Else. See the new Pattern Matching Section of the wiki for more details.
  3. Simple union creator factories have been implemented that require the type parameters for multiple unions of the same type to be specified just once. Please see the Union Creator wiki page for more info (don't worry, no singletons or service locators were used in creating this feature!).
  4. Various code improvements, including trying to consistently using TResult instead of TReturn and better comments.
  5. The wiki has been significantly expanded. This isn't strictly part of the release, but is published at the same time.
  6. Finally, I have remembered to tag the git repos for both the code and the wiki with 1.3.0, so in future I'll know what changed after the release.

v1.2.0

  1. Breaking change: Previously, the partial application functionality was incorrectly referred to as functional composition. The code and docs have been updated to use the correct term. This has involved a change of namespace and method name for partial applications. Whilst Succinc<T> aims to adopt semantic versioning, those rules have been broken here. The user base is still small as is assumed to be composed of early adopters who are prepared to fix code broken by this change. To fix affected code:

    a. Change SuccincT.FunctionalComposition namespace imports to SuccincT.PartialApplications. b. Change all xx.Compose(...) occurances to xx.Apply(...) c. Change all xx.TailCompose(...) occurances to xx.TailApply(...)

  2. Tail-application functionality has been expanded to support methods with optional tail parameters (which do not match the Action delegates).

The Succinc<T> pattern matching guide now contains an overview on how to use partial applications. The API docs are still to do.

v1.1.0

  1. Improved behaviour for Do() and Else() in patterns. Previously, these had to be lambdas, even if the value wasn't required. Now, simple expressions are supported too.
  2. The functional composition aspects of Succinc<T> have been expanded to support tail composition. This whole area needs proper documentation, which will appear soon.

v1.0.0 This was the initial release.