Re: [Haskell-cafe] Monads

2012-10-01 Thread Albert Y. C. Lai
On 12-10-01 05:34 AM, Jon Fairbairn wrote: "Albert Y. C. Lai" writes: On 12-09-30 06:33 PM, Jake McArthur wrote: When discussing monads, at least, a side effect is an effect that is triggered by merely evaluating an expression. A monad is an interface that decouples effects from evaluation.

Re: [Haskell-cafe] Monads

2012-10-01 Thread Jon Fairbairn
"Albert Y. C. Lai" writes: > On 12-09-30 06:33 PM, Jake McArthur wrote: >> When discussing monads, at least, a side effect is an effect that is >> triggered by merely evaluating an expression. A monad is an interface >> that decouples effects from evaluation. > > I don't understand that definitio

Re: [Haskell-cafe] Monads

2012-09-30 Thread Albert Y. C. Lai
On 12-09-30 06:33 PM, Jake McArthur wrote: When discussing monads, at least, a side effect is an effect that is triggered by merely evaluating an expression. A monad is an interface that decouples effects from evaluation. I don't understand that definition. Or maybe I do subconsciously. I have

Re: [Haskell-cafe] Monads

2012-09-30 Thread Kristopher Micinski
On Sun, Sep 30, 2012 at 6:33 PM, Jake McArthur wrote: > > On Sep 30, 2012 10:56 AM, "Albert Y. C. Lai" wrote: >> >> On 12-09-29 09:57 PM, Vasili I. Galchin wrote: >>> >>> I would an examples of monads that are pure, i.e. no >>> side-effects. >> >> >> What does "side effect" mean, to you?

Re: [Haskell-cafe] Monads

2012-09-30 Thread Jake McArthur
On Sep 30, 2012 10:56 AM, "Albert Y. C. Lai" wrote: > > On 12-09-29 09:57 PM, Vasili I. Galchin wrote: >> >> I would an examples of monads that are pure, i.e. no side-effects. > > > What does "side effect" mean, to you? Definition? When discussing monads, at least, a side effect is an ef

Re: [Haskell-cafe] Monads

2012-09-30 Thread wren ng thornton
On 9/30/12 7:00 AM, Tillmann Rendel wrote: Vasili I. Galchin wrote: I would an examples of monads that are pure, i.e. no side-effects. One view of programming in monadic style is: You call return and >>= all the time. (Either you call it directly, or do notation calls it for you). So if you wa

Re: [Haskell-cafe] Monads

2012-09-30 Thread Albert Y. C. Lai
On 12-09-29 09:57 PM, Vasili I. Galchin wrote: I would an examples of monads that are pure, i.e. no side-effects. What does "side effect" mean, to you? Definition? Because some people say "State has no side effect", and some other people say "State has side effects". The two groups u

Re: [Haskell-cafe] Monads

2012-09-30 Thread Tillmann Rendel
Vasili I. Galchin wrote: I would an examples of monads that are pure, i.e. no side-effects. One view of programming in monadic style is: You call return and >>= all the time. (Either you call it directly, or do notation calls it for you). So if you want to understand whether a monad "has side

Re: [Haskell-cafe] Monads

2012-09-29 Thread KC
From: http://www.haskell.org/haskellwiki/Monad "The computation doesn't have to be impure and can be pure itself as well. Then monads serve to provide the benefits of separation of concerns, and automatic creation of a computational "pipeline"." On Sat, Sep 29, 2012 at 6:57 PM, Vasili I. Galch

Re: [Haskell-cafe] Monads

2012-09-29 Thread Kristopher Micinski
You have fallen into the misconception that monads are impure, they are not. Many monad tutorials begin (erroneously) with the lines "monads allow you to do impure programming in Haskell." This is false, monads are pure, it's IO that's impure, not the monadic programming style. Monads let you *e

[Haskell-cafe] Monads

2012-09-29 Thread Vasili I. Galchin
Hello, I would an examples of monads that are pure, i.e. no side-effects. Thank you, Vasili ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Monads with "The" contexts?

2012-07-21 Thread Takayuki Muranushi
Dear Oleg, You're right. The points boil down to > That assumption (that the deviations are small) is not stated in types and it > is hard to see how can we enforce it. and even if it's small, there's corner cases at df/dx = 0 or df/dx = infinity (as you have mentioned.) Thanks to your advices,

Re: [Haskell-cafe] Monads with "The" contexts?

2012-07-19 Thread oleg
> http://en.pk.paraiso-lang.org/Haskell/Monad-Gaussian > What do you think? Will this be a good approach or bad? I don't think it is a Monad (or even restricted monad, see below). Suppose G a is a `Gaussian' monad and n :: G Double is a random number with the Gaussian (Normal distribution). Then

Re: [Haskell-cafe] Monads with "The" contexts?

2012-07-18 Thread Takayuki Muranushi
Done with some exercises on Gaussian distribution as a monad! http://en.pk.paraiso-lang.org/Haskell/Monad-Gaussian What do you think? Will this be a good approach or bad? Also this is the first page in my attempt to create runnable, and even testable wiki pages. To run the tests, please use hacka

Re: [Haskell-cafe] Monads with "The" contexts?

2012-07-14 Thread oleg
The bad news is that indeed you don't seem to be able to do what you want. The good news: yes, you can. The enclosed code does exactly what you wanted: > sunPerMars :: NonDet Double > sunPerMars = (/) <$> sunMass <*> marsMass > > sunPerMars_run = runShare sunPerMars > sunPerMars_run_len = length

Re: [Haskell-cafe] Monads with "The" contexts?

2012-07-13 Thread Takayuki Muranushi
Thank you Tillman, and Oleg, for your advices! Since ICFP contest is starting in a few hours, I will make a quick response with gratefulness and will read the full paper later Let me guess a few things, please tell me am I right. The share :: m a -> m (m a) is almost the thing I am looking fo

[Haskell-cafe] Monads with "The" contexts?

2012-07-12 Thread oleg
Tillmann Rendel has correctly noted that the source of the problem is the correlation among the random variables. Specifically, our measurement of Sun's mass and of Mars mass used the same rather than independently drawn samples of the Earth mass. Sharing (which supports what Functional-Logic prog

Re: [Haskell-cafe] Monads with "The" contexts?

2012-07-12 Thread Ben Doyle
On Thu, Jul 12, 2012 at 11:01 AM, Takayuki Muranushi wrote: > > sunPerMars :: [Double] > > sunPerMars = (/) <$> sunMass <*> marsMass > > Sadly, this gives too many answers, and some of them are wrong because > they assume different Earth mass in calculating Sun and Mars masses, > which led to inco

Re: [Haskell-cafe] Monads with "The" contexts?

2012-07-12 Thread Tillmann Rendel
Hi, Takayuki Muranushi wrote: sunPerMars :: [Double] sunPerMars = (/) <$> sunMass <*> marsMass Sadly, this gives too many answers, and some of them are wrong because they assume different Earth mass in calculating Sun and Mars masses, which led to inconsistent calculation. This might be rela

[Haskell-cafe] Monads with "The" contexts?

2012-07-12 Thread Takayuki Muranushi
tl;dr: Is there any way to pass the Supercombinator level names (the names in haskell source codes with zero indent) as context to a Monad so that it will read from "The" context? Hello, everyone. I'm thinking of representing our knowledge about our life, the universe and everything as Haskell va

Re: [Haskell-cafe] Monads, do and strictness

2012-01-23 Thread David Barbour
Space leaks, time leaks, resource leaks, subtle divergence issues when filtering lists, etc. On Mon, Jan 23, 2012 at 11:57 AM, Jake McArthur wrote: > On Mon, Jan 23, 2012 at 10:45 AM, David Barbour > wrote: > > the repeated failures of attempting to model stream processing with > infinite > > li

Re: [Haskell-cafe] Monads, do and strictness

2012-01-23 Thread Jake McArthur
On Mon, Jan 23, 2012 at 10:45 AM, David Barbour wrote: > the repeated failures of attempting to model stream processing with infinite > lists, I'm curious about what failures you're talking about. - Jake ___ Haskell-Cafe mailing list Haskell-Cafe@hask

Re: [Haskell-cafe] Monads, do and strictness

2012-01-23 Thread David Barbour
Thanks for the reference. I base my opinion on my own observations - e.g. the repeated failures of attempting to model stream processing with infinite lists, the relative success of modeling exceptions explicitly with monads compared to use of `fail` or SomeException, etc.. On Mon, Jan 23, 2012 at

Re: [Haskell-cafe] Monads, do and strictness

2012-01-23 Thread Sebastian Fischer
On Sun, Jan 22, 2012 at 5:25 PM, David Barbour wrote: > The laws for monads only apply to actual values and combinators of the monad > algebra You seem to argue that, even in a lazy language like Haskell, equational laws should be considered only for values, as if they where stated for a total l

Re: [Haskell-cafe] Monads, do and strictness

2012-01-22 Thread David Barbour
2012/1/22 MigMit > > > Отправлено с iPad > > 22.01.2012, в 20:25, David Barbour написал(а): > > Attempting to shoehorn `undefined` into your reasoning about domain > algebras and models and monads is simply a mistake. > > No. Using the complete semantics — which includes bottoms aka undefined —

Re: [Haskell-cafe] Monads, do and strictness

2012-01-22 Thread MigMit
Отправлено с iPad 22.01.2012, в 20:25, David Barbour написал(а): > Attempting to shoehorn `undefined` into your reasoning about domain algebras > and models and monads is simply a mistake. No. Using the complete semantics — which includes bottoms aka undefined — is a pretty useful technique

Re: [Haskell-cafe] Monads, do and strictness

2012-01-22 Thread David Barbour
> observably different from `undefined` If we understand `undefined` as meaning a computation that never ends, then you cannot ever observe whether one `undefined` is or is not equivalent to another. In strict languages, this is especially obvious. In any case, I don't accept a concept of `monads

Re: [Haskell-cafe] Monads, do and strictness

2012-01-22 Thread Sebastian Fischer
On Sat, Jan 21, 2012 at 8:09 PM, David Barbour wrote: > In any case, I think the monad identity concept messed up. The property: >   return x >>= f = f x > > Logically only has meaning when `=` applies to values in the domain. > `undefined` is not a value in the domain. > > We can define monads -

Re: [Haskell-cafe] Monads, do and strictness

2012-01-21 Thread David Barbour
Evaluating the argument/result was my intention. Evaluating the computation itself might be useful in some cases, though. Regards, Dave On Sat, Jan 21, 2012 at 3:20 PM, Yves Parès wrote: > > (StrictT op) >>= f = StrictT (op >>= \ x -> x `seq` runStrictT (f x)) > > Are you sure? Here you evalua

Re: [Haskell-cafe] Monads, do and strictness

2012-01-21 Thread Yves Parès
> (StrictT op) >>= f = StrictT (op >>= \ x -> x `seq` runStrictT (f x)) Are you sure? Here you evaluate the result, and not the computation itself. Wouldn't it be: (StrictT op) >>= f = op ` seq` StrictT (op >>= \x -> runStrictT (f x)) ?? 2012/1/21 David Barbour > On Sat, Jan 21, 2012 at 10:0

Re: [Haskell-cafe] Monads, do and strictness

2012-01-21 Thread Roman Cheplyaka
* David Barbour [2012-01-21 11:09:43-0800] > Logically only has meaning when `=` applies to values in the domain. > `undefined` is not a value in the domain. > > We can define monads - which meet monad laws - even in strict languages. In strict languages 'undefined' is not a value in the domain

Re: [Haskell-cafe] Monads, do and strictness

2012-01-21 Thread David Barbour
On Sat, Jan 21, 2012 at 11:08 AM, Roman Cheplyaka wrote: > * David Barbour [2012-01-21 11:02:40-0800] > > On Sat, Jan 21, 2012 at 10:51 AM, David Menendez > wrote: > > > > > The Eval monad has the property: return undefined >>= const e = e. > > > > > > > You can't write `const e` in the Eval mo

Re: [Haskell-cafe] Monads, do and strictness

2012-01-21 Thread David Barbour
Oops, I was misreading. You have `e` here as the next monad. In any case, I think the monad identity concept messed up. The property: return x >>= f = f x Logically only has meaning when `=` applies to values in the domain. `undefined` is not a value in the domain. We can define monads - which

Re: [Haskell-cafe] Monads, do and strictness

2012-01-21 Thread Roman Cheplyaka
* David Barbour [2012-01-21 11:02:40-0800] > On Sat, Jan 21, 2012 at 10:51 AM, David Menendez wrote: > > > The Eval monad has the property: return undefined >>= const e = e. > > > > You can't write `const e` in the Eval monad. Why not? ghci> runEval $ return undefined >>= const (return ()) ()

Re: [Haskell-cafe] Monads, do and strictness

2012-01-21 Thread David Barbour
On Sat, Jan 21, 2012 at 10:51 AM, David Menendez wrote: > The Eval monad has the property: return undefined >>= const e = e. > You can't write `const e` in the Eval monad. >From what I can tell, your proposed monads do not. > You can't write `const e` as my proposed monad, either. Regards,

Re: [Haskell-cafe] Monads, do and strictness

2012-01-21 Thread David Menendez
On Sat, Jan 21, 2012 at 1:45 PM, David Barbour wrote: > On Sat, Jan 21, 2012 at 10:08 AM, Roman Cheplyaka wrote: >> >> * David Barbour [2012-01-21 10:01:00-0800] >> > As noted, IO is not strict in the value x, only in the operation that >> > generates x. However, should you desire strictness in

Re: [Haskell-cafe] Monads, do and strictness

2012-01-21 Thread David Barbour
On Sat, Jan 21, 2012 at 10:08 AM, Roman Cheplyaka wrote: > * David Barbour [2012-01-21 10:01:00-0800] > > As noted, IO is not strict in the value x, only in the operation that > > generates x. However, should you desire strictness in a generic way, it > > would be trivial to model a transformer

Re: [Haskell-cafe] Monads, do and strictness

2012-01-21 Thread Steve Horne
On 21/01/2012 18:08, Steve Horne wrote: Even so, to see that strictness isn't the issue, imagine that (>>=) were rewritten using a unary executeActionAndExtractResult function. You could easily rewrite your lamba to contain this expression in place of x, without actually evaluating that execut

Re: [Haskell-cafe] Monads, do and strictness

2012-01-21 Thread Roman Cheplyaka
* David Barbour [2012-01-21 10:01:00-0800] > As noted, IO is not strict in the value x, only in the operation that > generates x. However, should you desire strictness in a generic way, it > would be trivial to model a transformer monad to provide it. Again, that wouldn't be a monad transformer,

Re: [Haskell-cafe] Monads, do and strictness

2012-01-21 Thread Steve Horne
On 21/01/2012 17:29, Victor S. Miller wrote: The "do" notation translates do {x<- a;f} into a>>=(\x -> f) However when we're working in the IO monad the semantics we want requires that the lambda expression be strict in its argument. So is this a special case for IO? If I wanted this beh

Re: [Haskell-cafe] Monads, do and strictness

2012-01-21 Thread David Barbour
As noted, IO is not strict in the value x, only in the operation that generates x. However, should you desire strictness in a generic way, it would be trivial to model a transformer monad to provide it. E.g. data StrictT m a = StrictT (m a) runStrictT :: StrictT m a -> m a runStrictT (StrictT op

Re: [Haskell-cafe] Monads, do and strictness

2012-01-21 Thread Roman Cheplyaka
* Victor S. Miller [2012-01-21 12:29:32-0500] > The "do" notation translates > > do {x <- a;f} into > > a>>=(\x -> f) > > However when we're working in the IO monad the semantics we want > requires that the lambda expression be strict in its argument. I'm not aware of any semantics that would

Re: [Haskell-cafe] Monads, do and strictness

2012-01-21 Thread MigMit
On 21 Jan 2012, at 21:29, Victor S. Miller wrote: > The "do" notation translates > > do {x <- a;f} into > > a>>=(\x -> f) > > However when we're working in the IO monad the semantics we want requires > that the lambda expression be strict in its argument. So is this a special > case for IO

[Haskell-cafe] Monads, do and strictness

2012-01-21 Thread Victor S. Miller
The "do" notation translates do {x <- a;f} into a>>=(\x -> f) However when we're working in the IO monad the semantics we want requires that the lambda expression be strict in its argument. So is this a special case for IO? If I wanted this behavior in other monads is there a way to specify

[Haskell-cafe] Monads in the 'hood

2010-12-09 Thread Greg Meredith
Dear Haskellians, Keepin' it light. For your amusement this weekend: monads in the hood . Best wishes, --greg -- L.G. Meredith Managing Partner Biosimilarity LLC 1219 NW 83rd St Seattle, WA 98117 +1 206.650.3740 http://biosimilarity.blogspot.com __

Re: [Haskell-cafe] Monads and Functions sequence and sequence_

2010-10-30 Thread Roman Cheplyaka
* Mark Spezzano [2010-10-30 15:37:30+1030] > Can somebody please explain exactly how the monad functions "sequence" > and "sequence_" are meant to work? The others in this thread have already explained how these functions work, so I'll just give an example how they are used. Consider the followi

Re: [Haskell-cafe] Monads and Functions sequence and sequence_

2010-10-29 Thread Gregory Crosswhite
The expression sequence [a,b,c,...] is roughly equivalent to do r_a <- a r_b <- b r_c <- c ... return [r_a,r_b,r_c,...] The expression sequence_ [a,b,c,...] is roughly equivalent to do a b c ...

[Haskell-cafe] Monads and Functions sequence and sequence_

2010-10-29 Thread Mark Spezzano
Hi, Can somebody please explain exactly how the monad functions "sequence" and "sequence_" are meant to work? I have almost every Haskell textbook, but there's surprisingly little information in them about the two functions. From what I can gather, "sequence" and "sequence_" behave differently

Re: [Haskell-cafe] Monads from Functors

2009-04-14 Thread Sebastian Fischer
Edward Kmett wrote: I think there is another way to view the ContT/Codensity/Monad generated by a functor, in terms of an accumulating parameter that may be informative. [...] Now what I find interesting is that Yoneda is basically carrying around an accumulator for 'fmap' applications. [..

Re: [Haskell-cafe] Monads from Functors

2009-04-09 Thread Edward Kmett
I think there is another way to view the ContT/Codensity/Monad generated by a functor, in terms of an accumulating parameter that may be informative. I kind of alluded to it in the post on Kan extensions. Take for a moment, Yoneda f given in: http://comonad.com/haskell/category-extras/src/Control

Re: [Haskell-cafe] Monads from Functors

2009-04-09 Thread Ryan Ingram
On Thu, Apr 9, 2009 at 2:22 AM, Sebastian Fischer wrote: > Let's see whether I got your point here. If we have a computation > >    a :: Monad m => m a > > and we have a pointed functor `f`, then we can get the result of the > computation `a` in our functor `f` because `runContT a :: f a`. Sure,

Re: [Haskell-cafe] Monads from Functors

2009-04-09 Thread Sebastian Fischer
Hi all, thanks for pointing me at the Codensity monad and for mentioning the lift operation! I'll try to sum up what I learned from this thread. In short: What I find interesting is 1. you can express the results of monadic computations using functors that do not themselves support the

Re: [Haskell-cafe] Monads from Functors

2009-04-08 Thread Ryan Ingram
On Wed, Apr 8, 2009 at 11:22 AM, Sebastian Fischer wrote: >> newtype ContT t a = ContT { unContT :: forall r . (a -> t r) -> t r } >> >> instance Monad (ContT t) >>  where >>   return x = ContT ($x) >>   m >>= f  = ContT (\k -> unContT m (\x -> unContT (f x) k)) > Both the `mtl` package and the `

Re: [Haskell-cafe] Monads from Functors

2009-04-08 Thread Edward Kmett
I discovered them and bundled them up a year or so back in category-extras. http://comonad.com/haskell/category-extras/dist/doc/html/category-extras/Control-Monad-Codensity.html I also wrote a series of blog posts including the derivation of these and their dual in the form of right- and left- Ka

[Haskell-cafe] Monads from Functors

2009-04-08 Thread Sebastian Fischer
> {-# LANGUAGE Rank2Types #-} Dear Haskellers, I just realized that we get instances of `Monad` from pointed functors and instances of `MonadPlus` from alternative functors. Is this folklore? > import Control.Monad > import Control.Applicative In fact, every unary type constructor gives rise

Re: [Haskell-cafe] Monads aren't evil? I think they are.

2009-01-14 Thread Alberto G. Corona
The question of imperative versus pure declarative coding has brought to my mind some may be off-topic speculations. (so please don´t read it if you have no time to waste): I´m interested in the misterious relation bentween mathematics, algoritms and reality (see this

Re: [Haskell-cafe] Monads aren't evil? I think they are.

2009-01-12 Thread Philippa Cowderoy
On Sun, 2009-01-11 at 10:44 +0100, Apfelmus, Heinrich wrote: > Ertugrul Soeylemez wrote: > > Let me tell you that usually 90% of my code is > > monadic and there is really nothing wrong with that. I use especially > > State monads and StateT transformers very often, because they are > > convenient

Re: [Haskell-cafe] Monads aren't evil? I think they are.

2009-01-12 Thread Henning Thielemann
Apfelmus, Heinrich schrieb: > Ertugrul Soeylemez wrote: >> Let me tell you that usually 90% of my code is >> monadic and there is really nothing wrong with that. I use especially >> State monads and StateT transformers very often, because they are >> convenient and are just a clean combinator fron

[Haskell-cafe] Monads aren't evil? I think they are.

2009-01-11 Thread Apfelmus, Heinrich
Ertugrul Soeylemez wrote: > Let me tell you that usually 90% of my code is > monadic and there is really nothing wrong with that. I use especially > State monads and StateT transformers very often, because they are > convenient and are just a clean combinator frontend to what you would do > manual

[Haskell-cafe] Monads aren't evil

2009-01-08 Thread Ertugrul Soeylemez
Hello fellow Haskellers, When I read questions from Haskell beginners, it somehow seems like they try to avoid monads and view them as a last resort, if there is no easy non-monadic way. I'm really sure that the cause for this is that most tutorials deal with monads very sparingly and mostly in t

Re: [Haskell-cafe] monads with take-out options

2008-11-26 Thread Jonathan Cast
On Wed, 2008-11-26 at 19:09 +, Jules Bean wrote: > Greg Meredith wrote: > > Haskellians, > > > > Some monads come with take-out options, e.g. > > > > * List > > * Set > > > > In the sense that if unit : A -> List A is given by unit a = [a], then > > taking the head of a list can be

Re: [Haskell-cafe] monads with take-out options

2008-11-26 Thread Jules Bean
Greg Meredith wrote: Haskellians, Some monads come with take-out options, e.g. * List * Set In the sense that if unit : A -> List A is given by unit a = [a], then taking the head of a list can be used to retrieve values from inside the monad. Some monads do not come with take-out o

Re: [Haskell-cafe] monads with take-out options

2008-11-25 Thread Jonathan Cast
On Mon, 2008-11-24 at 15:06 -0800, Greg Meredith wrote: > Jonathan, > Nice! Thanks. In addition to implementations, do we have more > mathematical accounts? Let me expose more of my motives. > * i am interested in a first-principles notion of data. Hunh. I have to say I'm not. The differe

Re: [Haskell-cafe] monads with take-out options

2008-11-24 Thread Greg Meredith
Claus, Thanks for your thoughtful response. Let me note that fully abstract semantics for PCF -- a total toy, mind you, just lambda + bools + naturals -- took some 25 years from characterization of the problem to a solution. That would seem to indicate shoe-horning, in my book ;-). Moreover, when i

Re: [Haskell-cafe] monads with take-out options

2008-11-24 Thread Greg Meredith
Brandon, i see your point, but how do we sharpen that intuition to a formal characterization? Best wishes, --greg On Mon, Nov 24, 2008 at 10:45 PM, Brandon S. Allbery KF8NH < [EMAIL PROTECTED]> wrote: > On 2008 Nov 24, at 17:06, Greg Meredith wrote: > > Now, are there references for a theory of

Re: [Haskell-cafe] monads with take-out options

2008-11-24 Thread Brandon S. Allbery KF8NH
On 2008 Nov 24, at 17:06, Greg Meredith wrote: Now, are there references for a theory of monads and take-out options? For example, it seems that all sensible notions of containers have take-out. Can we make the leap and define a container as a monad with a notion of take-out? Has this been d

Re: [Haskell-cafe] monads with take-out options

2008-11-24 Thread Claus Reinke
- i am interested in a first-principles notion of data. Neither lambda nor π-calculus come with a criterion for determining which terms represent data and which programs. You can shoe-horn in such notions -- and it is clear that practical programming relies on such a separation -- but alon

Re: [Haskell-cafe] monads with take-out options

2008-11-24 Thread John Meacham
On Mon, Nov 24, 2008 at 02:06:33PM -0800, Greg Meredith wrote: > Now, are there references for a theory of monads and take-out options? For > example, it seems that all sensible notions of containers have take-out. Can > we make the leap and define a container as a monad with a notion of > take-out

Re: [Haskell-cafe] monads with take-out options

2008-11-24 Thread Greg Meredith
Jonathan, Nice! Thanks. In addition to implementations, do we have more mathematical accounts? Let me expose more of my motives. - i am interested in a first-principles notion of data. Neither lambda nor π-calculus come with a criterion for determining which terms represent data and which

Re: [Haskell-cafe] monads with take-out options

2008-11-24 Thread Jonathan Cast
On Mon, 2008-11-24 at 14:06 -0800, Greg Meredith wrote: > Haskellians, > Some monads come with take-out options, e.g. > * List > * Set > In the sense that if unit : A -> List A is given by unit a = [a], then > taking the head of a list can be used to retrieve values from inside > the m

Re: [Haskell-cafe] monads with take-out options

2008-11-24 Thread Jason Dagit
2008/11/24 Greg Meredith <[EMAIL PROTECTED]> > Haskellians, > Some monads come with take-out options, e.g. > >- List >- Set > > In the sense that if unit : A -> List A is given by unit a = [a], then > taking the head of a list can be used to retrieve values from inside the > monad. > > Som

[Haskell-cafe] monads with take-out options

2008-11-24 Thread Greg Meredith
Haskellians, Some monads come with take-out options, e.g. - List - Set In the sense that if unit : A -> List A is given by unit a = [a], then taking the head of a list can be used to retrieve values from inside the monad. Some monads do not come with take-out options, IO being a notorious

Re: [EMAIL PROTECTED]: Re: [Haskell-cafe] Monads for Incremental computing]

2008-11-14 Thread Ryan Ingram
2008/11/13 Conal Elliott <[EMAIL PROTECTED]>: > As Magnus pointed out in his (very clever) paper, the Applicative interface > allows for more precise/efficient tracking of dependencies, in that it > eliminates accidental sequentiality imposed by the Monad interface. (Magnus > didn't mention Applic

Re: [EMAIL PROTECTED]: Re: [Haskell-cafe] Monads for Incremental computing]

2008-11-13 Thread Conal Elliott
As Magnus pointed out in his (very clever) paper, the Applicative interface allows for more precise/efficient tracking of dependencies, in that it eliminates accidental sequentiality imposed by the Monad interface. (Magnus didn't mention Applicative by name, as his paper preceded Idiom/Applicative

[EMAIL PROTECTED]: Re: [Haskell-cafe] Monads for Incremental computing]

2008-11-13 Thread Don Stewart
Magnus writes: Thanks to Peter Jonsson, the source is now on hackage: http://hackage.haskell.org/cgi-bin/hackage-scripts/package/Adaptive Cheers, Magnus Donnie Jones wrote: > Hello sanzhiyan, > > I believe this is the same paper, the pdf is available here: > http://citeseerx

Re: [Haskell-cafe] Monads for Incremental computing

2008-11-13 Thread Donnie Jones
Hello sanzhiyan, I believe this is the same paper, the pdf is available here: http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.8.3014 Cheers. __ Donnie On Thu, Nov 13, 2008 at 9:02 PM, Don Stewart <[EMAIL PROTECTED]> wrote: > I sit next to the author, CC'd. > > -- Don > > sanzhiyan: >

Re: [Haskell-cafe] Monads for Incremental computing

2008-11-13 Thread Don Stewart
I sit next to the author, CC'd. -- Don sanzhiyan: >I'm looking for the source code of the library for adaptive computations >exposed in Magnus Carlsson's "Monads for Incremental Computing"[1], but >the link in the paper is broken. >So, does anyone have the sources or knows how to

[Haskell-cafe] Monads for Incremental computing

2008-11-13 Thread sanzhiyan
I'm looking for the source code of the library for adaptive computations exposed in Magnus Carlsson's "Monads for Incremental Computing"[1], but the link in the paper is broken. So, does anyone have the sources or knows how to contact the author? [1] http://portal.acm.org/citation.cfm?id=581

Re: [Haskell-cafe] Monads that are Comonads and the role of Adjunction

2007-12-14 Thread David Menendez
On Dec 14, 2007 5:14 AM, Jules Bean <[EMAIL PROTECTED]> wrote: > There are two standard ways to decompose a monad into two adjoint > functors: the Kleisli decomposition and the Eilenberg-Moore decomposition. > > However, neither of these categories is a subcategory of Hask in an > obvious way, so

Re: [Haskell-cafe] Monads that are Comonads and the role of Adjunction

2007-12-14 Thread Jules Bean
Dan Weston wrote: apfelmus wrote: Luke Palmer wrote: Isn't a type which is both a Monad and a Comonad just Identity? (I'm actually not sure, I'm just conjecting) Good idea, but it's not the case. data L a = One a | Cons a (L a) -- non-empty list Maybe I can entice you to elaborate sli

[Haskell-cafe] Monads that are Comonads and the role of Adjunction

2007-12-13 Thread Dan Weston
apfelmus wrote: Luke Palmer wrote: Isn't a type which is both a Monad and a Comonad just Identity? (I'm actually not sure, I'm just conjecting) Good idea, but it's not the case. data L a = One a | Cons a (L a) -- non-empty list Maybe I can entice you to elaborate slightly. From http://

Re: [Haskell-cafe] Monads

2007-12-03 Thread Radosław Grzanka
Hi, 2007/12/3, PR Stanley <[EMAIL PROTECTED]>: > Hi > Does the list consider > http://en.wikibooks.org/w/index.php?title=Haskell/Understanding_monads&oldid=933545 > a reliable tutorial on monads and, if not, could you recommend an > onlien alternative please? I really enjoyed "All about Monads" b

[Haskell-cafe] Monads

2007-12-03 Thread PR Stanley
Hi Does the list consider http://en.wikibooks.org/w/index.php?title=Haskell/Understanding_monads&oldid=933545 a reliable tutorial on monads and, if not, could you recommend an onlien alternative please? Thanks, Paul ___ Haskell-Cafe mailing list Haske

Re: [Haskell-cafe] monads and groups -- instead of loops

2007-08-01 Thread Cale Gibbard
On 01/08/07, Greg Meredith <[EMAIL PROTECTED]> wrote: > Haskellians, > > Though the actual metaphor in the monads-via-loops doesn't seem to fly with > this audience, i like the spirit of the communication and the implicit > challenge: find a pithy slogan that -- for a particular audience, like > im

Re: [Haskell-cafe] monads and groups -- instead of loops

2007-08-01 Thread Greg Meredith
Andrew, ;-) Agreed! As i said in my previous post, i can't address the imperative programmer. i really don't think that way and have a hard time understanding people who do! (-; Best wishes, --greg On 8/1/07, Andrew Wagner <[EMAIL PROTECTED]> wrote: > > That's great, unless the imperative progr

Re: [Haskell-cafe] monads and groups -- instead of loops

2007-08-01 Thread Andrew Wagner
That's great, unless the imperative programmer happens to be one of the 90% of programmers that isn't particularly familiar with group theory... On 8/1/07, Greg Meredith <[EMAIL PROTECTED]> wrote: > Haskellians, > > Though the actual metaphor in the monads-via-loops doesn't seem to fly with > this

[Haskell-cafe] monads and groups -- instead of loops

2007-08-01 Thread Greg Meredith
Haskellians, Though the actual metaphor in the monads-via-loops doesn't seem to fly with this audience, i like the spirit of the communication and the implicit challenge: find a pithy slogan that -- for a particular audience, like imperative programmers -- serves to uncover the essence of the noti

Re: [Haskell-cafe] Monads and constraint satisfaction problems (CSP)

2007-05-31 Thread Jeremy Shaw
At Thu, 31 May 2007 11:36:55 -0700, Jeremy Shaw wrote: > This paper describes a non-monadic, compositional method for solving CSPs: > > http://www.cse.ogi.edu/PacSoft/publications/2001/modular_lazy_search_jfp.pdf btw, there are multiple versions of this paper. This version includes a section on

Re: [Haskell-cafe] Monads and constraint satisfaction problems (CSP)

2007-05-31 Thread Jeremy Shaw
At Thu, 31 May 2007 10:42:57 -0700, Greg Meredith wrote: > BTW, i think this could have a lot of bang-for-buck because the literature i > read exhibited two basic features: > >- the "standard" treatments (even by CS-types) are decidedly not >compositional >- the people in the field wh

Re: [Haskell-cafe] Monads and constraint satisfaction problems (CSP)

2007-05-31 Thread Brandon Michael Moore
On Thu, May 31, 2007 at 10:42:57AM -0700, Greg Meredith wrote: > All, > > All this talk about Mathematica and a reference to monadic treatments of > backtracking reminded me that a year ago i was involved in work on a > Mathematica-like widget. At the time i noticed that a good deal of the > struc

[Haskell-cafe] Monads and constraint satisfaction problems (CSP)

2007-05-31 Thread Greg Meredith
All, All this talk about Mathematica and a reference to monadic treatments of backtracking reminded me that a year ago i was involved in work on a Mathematica-like widget. At the time i noticed that a good deal of the structure underlying LP, SAT and other solvers was terribly reminiscent of comp

Re: [Haskell-cafe] monads once again: a newbie perspective

2006-08-31 Thread Andrea Rossato
Il Thu, Aug 31, 2006 at 02:39:59PM +0100, Simon Peyton-Jones ebbe a scrivere: > Andrea > > Don't forget to link to it from here! > http://haskell.org/haskellwiki/Books_and_tutorials#Using_monads Simon, I'll do. But now the text is far from being complete: there's only the code... (the most

Re: [Haskell-cafe] monads once again: a newbie perspective

2006-08-26 Thread Lennart Augustsson
I like sigfpe's introduction to monads: http://sigfpe.blogspot.com/2006/08/you-could-have-invented-monads- and.html -- Lennart On Aug 26, 2006, at 14:04 , Andrea Rossato wrote: Il Fri, Aug 25, 2006 at 01:13:58PM -0400, Cale Gibbard ebbe a scrivere: Hey cool, a new monad tutorial!

Re: [Haskell-cafe] monads once again: a newbie perspective

2006-08-26 Thread Andrea Rossato
Il Fri, Aug 25, 2006 at 01:13:58PM -0400, Cale Gibbard ebbe a scrivere: > Hey cool, a new monad tutorial! :) > > Just out of interest, have you seen my Monads as Containers article? > http://www.haskell.org/haskellwiki/Monads_as_Containers > > Let me know what you think of it. I find that often n

Re: [Haskell-cafe] monads once again: a newbie perspective

2006-08-25 Thread Andrea Rossato
Il Thu, Aug 24, 2006 at 08:02:38PM +0100, Neil Mitchell ebbe a scrivere: > Just shove it on the wiki regardless. If its useless then no one will > read it. If its a bit unreadable, then people will fix it. If its > useful the world will benefit. Any outcome is a good outcome! Ok: I've put it on th

Re: [Haskell-cafe] monads once again: a newbie perspective

2006-08-25 Thread Andy Elvey
On Thu, 2006-08-24 at 20:53 +0200, Andrea Rossato wrote: > Hello! > > I' m new to Haskell and try to find my way through types and monads. > I tried the yet Another Haskell Tutorial, very useful for types, but > almost unreadable for monads (that's my perspective!). > Then I discovered that wonder

Re: [Haskell-cafe] monads once again: a newbie perspective

2006-08-24 Thread Neil Mitchell
Hi, It could become a page on the wiki. But before posting there I would like to have your opinion. Perhaps this is just something unreadable. Just shove it on the wiki regardless. If its useless then no one will read it. If its a bit unreadable, then people will fix it. If its useful the worl

[Haskell-cafe] monads once again: a newbie perspective

2006-08-24 Thread Andrea Rossato
Hello! I' m new to Haskell and try to find my way through types and monads. I tried the yet Another Haskell Tutorial, very useful for types, but almost unreadable for monads (that's my perspective!). Then I discovered that wonderful paper by Wadler (Monads for functional programming). So I started

[Haskell-cafe] Monads (was "how to write an interactive program ? gui library to use ?")

2006-02-25 Thread Jared Updike
(Note, moved to haskell-cafe.) > Essentially, the answer is "yes", the state needs to be passed around > (neglecting hackery to simulate global variables that is better > avoided). However, this can be made convenient by using a monad. BTW, Minh, If you don't know what monads are, then read this

Re: Re[2]: [Haskell-cafe] Monads in Scala, XSLT, Unix shell pipes was Re: Monads in ...

2005-11-28 Thread Gregory Woodhouse
On Nov 27, 2005, at 2:36 PM, Bill Wood wrote: (I'm going to do a lazy permute on your stream of consciousness; hope it terminates :-). I think the Rubicon here is the step from one to many -- one function/procedure to many, one thread to many, one processor to many, ... . Our favorite pure

  1   2   >