> ContT {runContT :: forall r1 . (forall r2 . a-> m r2) -> m r1}
> callCC can be defined, however, you can not run it, and reset couldn't
> type check
Indeed you cannot. As the articles
http://okmij.org/ftp/continuations/undelimited.html
explain, the answer of _undelimited_ continuation
Thank you, there is also a nice link here :-)
http://stackoverflow.com/questions/7178919/how-to-make-callcc-more-dynamic
and for this type,
ContT {runContT :: forall r1 . (forall r2 . a-> m r2) -> m r1}
callCC can be defined, however, you can not run it, and reset couldn't
type check
于 11-8-25 上午1:
bob zhang wrote:
> I was curious that we could bring really continuations into haskell,
> the traditional callCC brings a lot of unnecessary type restrictions
That's where the misconception lies. The type parameter /is/ necessary
for delimited continuations in Haskell. By the way, I don't se
bob zhang wrote:
> I thought the right type for ContT should be
> newtype ContT m a = ContT {runContT :: forall r. (a-> m r) -> m r}
> and
> other control operators
> shift :: Monad m => (forall r . (a-> ContT m r) -> ContT m r) -> ContT m a
> reset :: Monad m => ContT m a -> ContT m a
> callCC ::
Hi Jason, thanks for your reply.
I was curious that we could bring really continuations into haskell, the
traditional callCC brings a lot of unnecessary
type restrictions
On Wed, Aug 24, 2011 at 12:45 PM, Jason Dagit wrote:
> On Wed, Aug 24, 2011 at 9:19 AM, bob zhang wrote:
> > Hi, all
> > I
bob zhang wrote:
> I thought the right type for ContT should be
> newtype ContT m a = ContT {runContT :: forall r. (a-> m r) -> m r}
No, that will effectively make it impossible to make use of CPS effects,
hence turning your ContT into an IdentityT-like monad transformer, which
can only change t
On Wed, Aug 24, 2011 at 9:19 AM, bob zhang wrote:
> Hi, all
> I thought the right type for ContT should be
> newtype ContT m a = ContT {runContT :: forall r. (a-> m r) -> m r}
> and
> other control operators
> shift :: Monad m => (forall r . (a-> ContT m r) -> ContT m r) -> ContT m a
> reset :: Mo
Hi, all
I thought the right type for ContT should be
newtype ContT m a = ContT {runContT :: forall r. (a-> m r) -> m r}
and
other control operators
shift :: Monad m => (forall r . (a-> ContT m r) -> ContT m r) -> ContT m a
reset :: Monad m => ContT m a -> ContT m a
callCC :: ((a-> (forall r . ContT