On Tue, Aug 10, 2010 at 6:48 AM, Edward Z. Yang wrote:
> Excerpts from Luke Palmer's message of Tue Aug 10 01:04:04 -0400 2010:
>> Except, of course, you want the signature
>>
>> evalCont :: Cont r a -> a
>>
>> Which is not possible. But I am not sure where all this discussion is
>> coming from
Excerpts from Luke Palmer's message of Tue Aug 10 01:04:04 -0400 2010:
> Except, of course, you want the signature
>
> evalCont :: Cont r a -> a
>
> Which is not possible. But I am not sure where all this discussion is
> coming from, Maybe and (r ->) cannot be broken out of. Isn't that
> exam
On Mon, Aug 9, 2010 at 1:19 PM, John Lato wrote:
> I don't find purify2 particularly helpful because I almost never want
> to break out of any arbitrary monad; I want to be able to break out of
> a specific monad without knowing which monad it is, that is:
>
> purify3 :: Monad m => m a -> a
> puri
On Monday 09 August 2010 21:19:01, John Lato wrote:
>
> I don't find purify2 particularly helpful because I almost never want
> to break out of any arbitrary monad; I want to be able to break out of
> a specific monad without knowing which monad it is, that is:
>
> purify3 :: Monad m => m a -> a
>
> From: Alexey Khudyakov
>
> On Fri, 30 Jul 2010 09:29:59 +0200
> Stefan Holdermans wrote:
>
>>
> No I think here we breaking out from _arbitrary_ monad. If monadic
> function works for every monad then it must work for identity monad
> too. Here is simplest form of purify function:
>
>> purify2
Each monad implementation is different. In the case of the State monad your
'execState' call extracts a non-monadic value.
Of the basic monads I found the State monad the most confusing because of
the complicated way in which it threads state through the computation. In
the end, desugaring the do-
Alexey,
>>> There is one case where you can break out of a monad without knowing which
>>> monad it is. Well, kind of. It's cheating in a way because it does force
>>> the use of the Identity monad. Even if it's cheating, it's still very
>>> clever and interesting.
>>
>> How is this cheating?
Alex Rozenshteyn wrote:
I also found myself thinking about list as a monad in terms of this
discussion. I think it's an interesting case: it's pure, but it doesn't
really make sense to "come out of it". Head, indexing, and last all break
out of it, but none of them can be the default, and all
Martijn van Steenbergen wrote:
In fact, I would argue that a monad which you cannot escape from is not
very useful at all. IO is the only exception I know of.
You can escape IO just fine. Just compile your program, and then run it
in the real life monad. Results aren't guaranteed to be the sam
Tillmann Rendel wrote:
C K Kashyap wrote:
I am of the
understanding that once you into a monad, you cant get out of it?
That's not correct.
Indeed. The correct formulation of the statement is that it's not "safe"
to leave a monad. Where "safe" has the same connotation as in all the
unsafe
On Sat, Jul 31, 2010 at 01:49:43AM +0400, Alexey Khudyakov wrote:
> No I think here we breaking out from _arbitrary_ monad. If monadic
> function works for every monad then it must work for identity monad
> too. Here is simplest form of purify function:
>
> > purify2 :: (forall m . Monad m => m a)
On Fri, 30 Jul 2010 09:29:59 +0200
Stefan Holdermans wrote:
> Jason,
>
> > There is one case where you can break out of a monad without knowing which
> > monad it is. Well, kind of. It's cheating in a way because it does force
> > the use of the Identity monad. Even if it's cheating, it's sti
On Fri, Jul 30, 2010 at 12:29 AM, Stefan Holdermans <
ste...@vectorfabrics.com> wrote:
> Jason,
>
> > There is one case where you can break out of a monad without knowing
> which monad it is. Well, kind of. It's cheating in a way because it does
> force the use of the Identity monad. Even if it
Here is my understanding with respect to the question.
In the general case, you cannot come out of a monad, because the monad
typeclass does not include any functions without of the form (m a -> a).
Also, as a category theoretic construct, a monad does not have to have an
exit function. (caveat:
Martijn,
> In fact, I would argue that a monad which you cannot escape from is not very
> useful at all. IO is the only exception I know of.
And that's only because, at least the runtime system allows for execution of a
computation inside the IO monad at top-level.
Cheers,
Stefan
__
Martijn van Steenbergen writes:
> On 7/30/10 12:29, Tillmann Rendel wrote:
>> C K Kashyap wrote:
>>> I am of the
>>> understanding that once you into a monad, you cant get out of it?
>>
>> That's not correct.
>>
>> There are many monads, including Maybe, [], IO, ... All of these monads
>> provide
On 7/30/10 12:29, Tillmann Rendel wrote:
C K Kashyap wrote:
I am of the
understanding that once you into a monad, you cant get out of it?
That's not correct.
There are many monads, including Maybe, [], IO, ... All of these monads
provide operations (>>=), return and fail, and do notation impl
On 7/30/10 9:29, Stefan Holdermans wrote:
Jason,
There is one case where you can break out of a monad without knowing which
monad it is. Well, kind of. It's cheating in a way because it does force the
use of the Identity monad. Even if it's cheating, it's still very clever and
interesting
C K Kashyap wrote:
I am of the
understanding that once you into a monad, you cant get out of it?
That's not correct.
There are many monads, including Maybe, [], IO, ... All of these monads
provide operations (>>=), return and fail, and do notation implemented
in terms of these functions, as
C K Kashyap wrote:
In the code here -
http://hpaste.org/fastcgi/hpaste.fcgi/view?id=28393#a28393
If I look at the type of modifiedImage, its simply ByteString - but
isn't it actually getting into and back out of the state monad? I am of
the understanding that once you into a monad, you cant get
Jason,
> There is one case where you can break out of a monad without knowing which
> monad it is. Well, kind of. It's cheating in a way because it does force
> the use of the Identity monad. Even if it's cheating, it's still very clever
> and interesting.
How is this cheating? Or better,
On Thu, Jul 29, 2010 at 11:48 PM, Lyndon Maydwell wrote:
> You cannot break out of a monad if all you have available to use are
> the monad typeclass functions, however there is nothing preventing an
> instance from being created that allows escape. Many of these escape
> methods come in the form
You cannot break out of a monad if all you have available to use are
the monad typeclass functions, however there is nothing preventing an
instance from being created that allows escape. Many of these escape
methods come in the form of runX functions, but you can use
constructors to break out with
Hi,
In the code here -
http://hpaste.org/fastcgi/hpaste.fcgi/view?id=28393#a28393
If I look at the type of modifiedImage, its simply ByteString - but isn't it
actually getting into and back out of the state monad? I am of the
understanding that once you into a monad, you cant get out of it? Is this
24 matches
Mail list logo