Thu, 21 Feb 2002 19:36:13 -0800, Ashley Yakeley [EMAIL PROTECTED] pisze:
data ContMonad p a = MkContMonad ((a - p) - p);
[...]
It's in GHC in module MonadCont, together with a monad transformer
providing continuations and some instances.
--
__( Marcin Kowalczyk * [EMAIL PROTECTED]
At 2002-02-23 07:55, Marcin 'Qrczak' Kowalczyk wrote:
It's in GHC in module MonadCont, together with a monad transformer
providing continuations and some instances.
Could this sort of thing _please_ be added to
http://www.haskell.org/ghc/docs/latest/set/book-hslibs.html
or somewhere? Is this
Ashley Yakeley writes:
Now here's the interesting thing. The usual way to represent real-world
functions (i.e. with side-effects, or changing the world) from a to b is
to define a special _type constructor_, 'IO', and define the function as
'a - IO b'. But an alternative, would have been to
At 2002-02-22 01:36, Richard Uhtenwoldt wrote:
Yeah, it's called continuation-passing style (CPS).
Good. I have a small collection of wheels I've reinvented in my ignorance.
So, congratulations, you've written call/cc in Haskell. I think.
So, what I said this afternoon, namely, that call/cc is
At 2002-02-22 01:36, Richard Uhtenwoldt wrote:
So, congratulations, you've written call/cc in Haskell. I think.
Yes.
test2 :: CPS (IO ()) ();
test2 = do
{
liftM (putStr aa\n);
ref - liftM (newIORef Nothing);
liftM (putStr bb\n);
flag - peirceM
At 2002-02-20 22:15, I wrote (on the Haskell list):
Haskell? Given this:
class (Monad m) = PeirceMonad m where
{
peirceM :: ((a - m b) - m a) - m a;
};
...which Monads can be made PeirceMonads?
This is untested, but...
instance PeirceMonad
Ashley Yakeley writes:
instance PeirceMonad IO where
{
peirceM foo = do
{
ref - newIORef Nothing;
catch (foo (\a - do
{
writeIORef ref (Just a);
ioError (userError break);
}))
Given this:
class (Monad m) = PeirceMonad m where
{
peirceM :: ((a - m b) - m a) - m a;
};
...which Monads can be made PeirceMonads?
Here's one:
data ContMonad p a = MkContMonad ((a - p) - p);
unContMonad (MkContMonad app) = app;
At 2002-02-21 19:36, I wrote:
And then your 'main' function has type 'Action'.
Sorry,
And then your 'main' function has type 'Action - Action'.
--
Ashley Yakeley, Seattle WA
___
Haskell-Cafe mailing list
[EMAIL PROTECTED]
Has anyone investigated monadic call-with-current-continuation in
Haskell? Given this:
class (Monad m) = PeirceMonad m where
{
peirceM :: ((a - m b) - m a) - m a;
};
...which Monads can be made PeirceMonads?
The corresponding non-monadic
10 matches
Mail list logo