Fin, Try, and IO applicative behaviours + minor fixes #1365
louthy
announced in
Announcements
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
A question was asked about why
Findoesn't collect errors likeValidationwhen using applicativeApply, seeing asError(the alternative value forFin) is a monoid. This seems reasonable and has now been added for the following types:Fin<A>FinT<M, A>Try<A>TryT<M, A>IO<A>Eff<A>Eff<RT, A>I extended this for
Try,IO, andEffbecause their alternative value is alsoError, so it makes sense in applicative scenarios.The
IOmonad has also had itsApplyinternals updated to work with the new underlyingIOAsync,IOSync, ... types. It now uses regularTask.WhenAllinstead of forking to achieve concurrent execution. To achieve genuine parallel execution you can still callForkon the operands.IOhas also had itsZipfunctions updated to useApplyinstead of forking for the same reasons. That means forking of an IO operation is a choice by the programmer rather than something that is imposed in certain functions.Because
Eff<RT, A>andEff<A>are both based on the IO monad they're also updated to this new behaviour.Domain Type traits
Minor fixes to the Domain-Type interfaces:
In
Locus<SELF, SCALAR, DISTANCE>, I have reordered theSCALARandDISTANCEtypes and renamedSCALARtoSCALAR_DISTANCE; that means the new type is:Locus<SELF, DISTANCE, DISTANCE_SCALAR>-- so it's obvious that it's a scalar value for the distance rather thanSELF. Also, removedOriginand now rely on theAdditiveIdentityfromIAdditiveIdentity.Credit card validation sample
Added a new Credit Card Validation sample, this is the example built in my Higher Kinds in C# series with all of the data-types converted to use the Domain Type traits.
This discussion was created from the release Fin, Try, and IO applicative behaviours + minor fixes.
Beta Was this translation helpful? Give feedback.
All reactions