Skip to content

How to write own monad without runtime info in context ? #91

Answered by rssh
mio-19 asked this question in Q&A
Discussion options

You must be logged in to vote

About CpsMonadContext - look at this section: https://rssh.github.io/dotty-cps-async/MonadContexts.html
If you have no runtime infrastructure around context, then

final class CpsMonadTrying[State] extends CpsMonad[[X] =>> Trying[State, X]] 
                                                                 with CpsMonadInstanceContext[[X] =>> Trying[State, X]] {
...
   // note - CpsMonadInstanceContext is a type which should be mixed,  not CpsMonadContext
}

Full example can be found ...
https://github.com/rssh/dotty-cps-async/blob/master/shared/src/test/scala/cpstest/CpsContT.scala
(but it's too long, searching shorter ...

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@rssh
Comment options

rssh Aug 28, 2024
Maintainer

Answer selected by rssh
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #90 on August 28, 2024 10:29.