-
Notifications
You must be signed in to change notification settings - Fork 15
VersionHistory
Details of previous releases of Succinc<T>: v3.2.0 This release includes:
- A bug fix: The wiki claimed that implicit conversion from
T
toMaybe<T>
was supported. But this hadn't been implemented. This is now fixed. (see Add implicit conversion from value to Maybe for details). -
HasValueOf<T>
has been added to all three union types. See Adds HasValue method to unions for details.
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>
tonull
now works as expected (see Comparing Option to null doesn't work as expected for details). - A few breaking changes:
-
Union<,>.Creator
,Union<,,>.Creator
andUnion<,,,>.Creator
methods now return an instance ofIUnionCreator<...>
, rather thanUnionCreator<...>
. The latter types have been made internal classes. See Fix need to expose UnionCreator<..> classes as public by using interfaces for details. - The
ITupleMatchable
types have been changed to return a value tuple, rather than the older style tuples used previously. See Restructure pattern matchers to use/support new ValueTuples for details. -
public static ConsResult<T> Cons<T>(this IEnumerable<T> collection)
has been removed and replaced with a deconstructor. See Make use of C# 7 deconstruct feature to "super charge" IEnumerable cons support for details.
-
v2.3.0 This release includes:
- Significant contributions from @megafinz:
-
TryGetValue
is now supported for allIDictionary<,>
implementations, not justDictionary<,>
-
Option<T>.None
optimization:none
for eachT
is now cached, so only one instance need be created. -
ToOption
,TryCast
,AsNullable
,Map
,Or
,Flatten
andChoose
extensions toOption<T>
-
-
CaseOf<T>
support for arbitrary types - New
Success<T>
andEither<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 convertingAction<T..>
delegates toFunc<T...,Unit>
ones, - New
Lambda
,Transform
,Func
andAction
methods to simplify the declaration and typing of lambdas. - A new
Maybe
type, which is astruct
version ofOption
. This type is largely interchangable withOption
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 astruct
(and those not able to benull
.
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
- Added new extension methods for
IEnumerable<T>
:FirstOrNone
,LastOrNone
,SingleOrNone
andElementAtOrNone
. These are equivalent to the XxxOrDefault methods, except they returnOption<T>
with a value or, if no match,None
rather than a default value. - Added an
IgnoreElse()
method, that does the same asElse((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
- 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
-
Yet another small breaking change. Please note that if you have previously used pattern matching on "normal" types (ie, not
Options
,Unions
orValueOrError
types), then you'll have to addusing SuccincT.PatternMatchers.GeneralMatcher;
alongsideusing 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. -
Support added for pattern matching
Tuple<T>
,Tuple<T1,T2>
,Tuple<T1,T2,T3>
andTuple<T1,T2,T3,T4>
. See the Pattern matching tuples page for more details. -
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 implementITupleMatchable
in order to expose that data as a tuple, which is then matched using normal tuple matching rules. See theITupleMatchable
page for more details. v1.3.2 -
Fix for bug Union<T1, T2> comparisons are broken
-
Fix for bug value equality for Union<T1, T2, T3> and Union<T1, T2, T3> hasn't been implemented
v1.3.0
-
Union<T1,T2,T3,T4>
now supports pattern matching. - For patterns that return a value (and thus invoke a
Func<>
on match) now support both lambdas/methods and simple expressions for bothDo
andElse
. See the new Pattern Matching Section of the wiki for more details. - 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!).
- Various code improvements, including trying to consistently using
TResult
instead ofTReturn
and better comments. - The wiki has been significantly expanded. This isn't strictly part of the release, but is published at the same time.
- 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
-
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 toSuccincT.PartialApplications
. b. Change allxx.Compose(...)
occurances toxx.Apply(...)
c. Change allxx.TailCompose(...)
occurances toxx.TailApply(...)
-
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
- Improved behaviour for
Do()
andElse()
in patterns. Previously, these had to be lambdas, even if the value wasn't required. Now, simple expressions are supported too. - 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.
Action
/Func
conversionsCycle
methods- Converting between
Action
andFunc
- Extension methods for existing types that use
Option<T>
- Indexed enumerations
IEnumerable<T>
cons- Option-based parsers
- Partial function applications
- Pattern matching
- Pipe Operators
- Typed lambdas
Any
Either<TLeft,TRight>
None
Option<T>
Success<T>
Union<T1,T2>
Union<T1,T2,T3>
Union<T1,T2,T3,T4>
Unit
ValueOrError