Improved: Record GetHashCode and RWS/Reader Code-Gen
release
-
Record
types now have an improved hash-code algorithm, based on the FNV 1a hashing algorithm -
Reader
andRWS
code-generators will now look for existing methods with the same name as the one they're going to generate. If existing methods exist then the methods won't be generated.- This allows for things like bespoke
Bind
implementations without having to build everything by hand.
- This allows for things like bespoke
-
Map
,Select
, andSelectMany
are now implemented withBind
. So they will also leverage any bespokeBind
methods. -
Where
is implemented withFilter
, which means providing a bespokeFilter
method will also update theWhere
-
Added
Match(Action<A> Succ, Action<Error> Fail)
for side-effecting matching toRWSResult
andReaderResult
-
Added
IfFailThrow()
toRWSResult
andReaderResult
-
Bug fix: for
RWS.Run
which was still returning a tuple after the refactor for better error handling. It now returnsRWSResult
. -
Bug fix:
Where
implementation typo forArr<A>
Thanks to: @alaendle and @EdruptCo for the fixes.
non-release notes
There is a new sample based on the famous Contoso app. @blakeSaucier has kindly converted it over to be more functional, using many of the features of language-ext. Going forward I will try and de-interface it and make it more pure and monadic, but this is a fantastic starting point to give developers guidance on how they can be more functional with their C# code.