language-ext v3.3.51 Release Notes

Release Date: 2020-01-31 // about 4 years ago
  • The attributes:

    • NonEq - to opt out of equality
    • NonOrd - to opt out of ordering
    • NonShow - to opt out of ToString
    • NonHash - to opt out of GetHashCode
    • NonSerializable, NonSerialized - to opt out of serialisation
    • NonStructural == NonEq | NonOrd | NonHash
    • NonRecord == NonStructural | NonShow | NonSerializable

    Can now be used with the [Record] and [Union] code-gen.

    For [Union] types you must put the attributes with the arguments:

    [Union]public abstract partial class Shape\<NumA, A\> where NumA : struct, Num\<A\> { public abstract Shape\<NumA, A\> Rectangle(A width, A length, [NonRecord] A area); public abstract Shape\<NumA, A\> Circle(A radius); public abstract Shape\<NumA, A\> Prism(A width, A height); }
    

    On the [Record] types you put them above the fields/properties as normal:

    [Record]public partial struct Person{ [NonOrd] public readonly string Forename; public readonly string Surname; }
    

    ๐Ÿ†“ Both the [Union] case-types and the [Record] types now have a New static function which can be used to construct a new object of the respective type. This can be useful when trying to construct types point-free.

    ๐Ÿ“œ Some minor bug fixes to Try.Filter and manyn in Parsec. Thanks to @bender2k14 and @StefanBertels