Major Version Release Notes/Version 5/Migration War Stories/README.md
EffectsExamples from the Samples folderMenu.csstruct constraintHasCancel<RT> constraintHasFile<RT> constraint to Has<Eff<RT>, FileIO>HasTextRead<RT> constraint to Has<Eff<RT>, TextReadIO>HasTime<RT> constraint to Has<Eff<RT>, TimeIO>HasConsole<RT> constraint to Has<Eff<RT>, ConsoleIO>Aff<RT, with Eff<RT, Console<RT> with Console<Eff<RT>, RT>.Sequence with .Traverse (and put .As() a the end).As() to the end of the first from in clearConsoleToAff() to ToEff().As() to the end of the first from in logErrorTime<RT> to Time<Eff<RT>, RT>using static LanguageExt.UnitsOfMeasure;.As() to the end of the first from in showCompleteSeq(...) to [...]CancelExample.csHasCancel<RT> constraintHasConsole<RT> constraint to Has<Eff<RT>, ConsoleIO>Aff<RT, with Eff<RT, Console<RT> with Console<Eff<RT>, RT>k.Key == ConsoleKey.Enter ? cancel<RT>() : unitEff to k.Key == ConsoleKey.Enter ? cancel : unitIOErrorAndGuardExample.csHasCancel<RT> constraintHasConsole to Has<Eff<RT>, ConsoleIO>Console<RT> with Console<Eff<RT>, RT>using static LanguageExt.UnitsOfMeasure;@catch with @catchM when catching Effs (and changed predicate to use ex.Is())FoldTest.csstruct constraintHasCancel<RT> constraintHasConsole to Has<Eff<RT>, ConsoleIO>Aff<RT, with Eff<RT, ToAff() from guard, not needed any moreEffect<RT, Unit> to Effect<Eff<RT>, Unit>.As() to the end of the first RunEffect()ForkCancelExample.csAff<RT, with Eff<RT, struct constraintHasCancel<RT> constraintHasConsole<RT> constraint to Has<Eff<RT>, ConsoleIO>HasTime<RT> constraint to Has<Eff<RT>, TimeIO>using static LanguageExt.UnitsOfMeasure;Console<RT> with Console<Eff<RT>, RT>fork now returns ForkIO, so update to use ForkIO.CancelQueueExample.csHasCancel<RT> constraintHasConsole to Has<Eff<RT>, ConsoleIO>Console<RT> with Console<Eff<RT>, RT>EnqueueEff with EnqueueM and appended .As()Queue<RT, *> to Queue<Eff<RT>, *>Consumer<RT, *, *> to Consumer<*, Eff<RT>, *>Pipe<RT, *, *, *> to Pipe<*, *, Eff<RT>, *>Producer<RT, *, *> to Producer<*, Eff<RT>, *>FailEff<Unit>(Errors.Cancelled) with Fail(Errors.Cancelled).As() to forkRetryExample.csHasCancel<RT> constraintHasConsole to Has<Eff<RT>, ConsoleIO>Console<RT> with Console<Eff<RT>, RT>TextFileChunkStreamExample.csstruct constraintHasCancel<RT> constraintHasConsole to Has<Eff<RT>, ConsoleIO>HasFile<RT> to Has<Eff<RT>, FileIO>HasTextRead<RT> to Has<Eff<RT>, TextReadIO>Aff<RT, with Eff<RT, Console<RT> with Console<Eff<RT>, RT>Consumer<RT, *, *> to Consumer<*, Eff<RT>, *>Pipe<RT, *, *, *> to Pipe<*, *, Eff<RT>, *>Effect<RT, *> to Effect<Eff<RT>, *>TextFileLineStreamExample.csstruct constraintHasCancel<RT> constraintHasConsole to Has<Eff<RT>, ConsoleIO>HasFile<RT> to Has<Eff<RT>, FileIO>HasTextRead<RT> to Has<Eff<RT>, TextReadIO>Aff<RT, with Eff<RT, Console<RT> with Console<Eff<RT>, RT>Consumer<RT, *, *> to Consumer<*, Eff<RT>, *>Pipe<RT, *, *, *> to Pipe<*, *, Eff<RT>, *>Effect<RT, *> to Effect<Eff<RT>, *>TimeExample.csusing static LanguageExt.UnitsOfMeasure;struct constraintHasCancel<RT> constraintHasConsole<RT> constraint to Has<Eff<RT>, ConsoleIO>HasTime<RT> constraint to Has<Eff<RT>, TimeIO>Time<RT>.now to Time<Eff<RT>, RT>.nowConsole<RT> with Console<Eff<RT>, RT>TimeoutExample.csusing static LanguageExt.UnitsOfMeasure;struct constraintHasCancel<RT> constraintHasConsole<RT> constraint to Has<Eff<RT>, ConsoleIO>HasTime<RT> constraint to Has<Eff<RT>, TimeIO>Aff<RT, with Eff<RT, LanguageExt.Sys from the Samples folderThen changed:
use(startActivity(name, activityKind, activityTags, activityLinks, startTime),
act => localEff<RT, RT, TA>(rt => rt.SetActivity(act.Activity), operation));
to:
from a in startActivity(name, activityKind, activityTags, activityLinks, startTime)
from r in localEff<RT, RT, TA>(rt => rt.WithActivity(a), operation)
select r;
Changed Aff to Eff
Deleted duplicate methods (due to Aff being renamed to Eff)
Changed Eff<RT, ...>(rt => ... to lift((RT rt) => ...
Changed cancelToken<RT>() to cancelToken
Changed Producer<RT, OUT, A> to Producer<OUT, Eff.R<RT>, A>