You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner. It is now read-only.
And this leads us to the problem. I want to log the state before and after toState call. Of cause I can write it directly, but what is FP for? :-) I want to do is as middleware and compose it. Maybe it's better to use Kleisli with OptionT here? It composes well.
The Second problem again with PartialFunction and toState. The signature of the function is PartialFunction[Router.Path, S => F[S]]. And if I want to make a decision about handling the path based on the old state, I just can't do it in the pattern matching. All I can do is to return the old state.
You offer is appropriate. Korolev will never depend on cats or scalaz directly beacuse of zero dependencies policy. However we can add your Kleisli-router to cats-effects-support module. New release is coming soon, so I waiting for pull request.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
The first problem is that
PartialFunction
doesn't compose well. Example:And this leads us to the problem. I want to log the state before and after
toState
call. Of cause I can write it directly, but what is FP for? :-) I want to do is as middleware and compose it. Maybe it's better to useKleisli
withOptionT
here? It composes well.The Second problem again with
PartialFunction
andtoState
. The signature of the function isPartialFunction[Router.Path, S => F[S]]
. And if I want to make a decision about handling the path based on the old state, I just can't do it in the pattern matching. All I can do is to return the old state.What if change
Router
definition like this?The text was updated successfully, but these errors were encountered: