Re: [Haskell-cafe] On the purity of Haskell

2011-12-30 Thread Gregg Reynolds
On Dec 30, 2011, at 11:21 AM, Conal Elliott wrote: > > And I also raised a more fundamental question than whether this claim of > sameness is true, namely what is equality on IO? Without a precise & > consistent definition of equality, the claims like "f 42 == f (43 - 1)" are > even defined,

Re: [Haskell-cafe] On the purity of Haskell

2011-12-30 Thread Gregg Reynolds
On Dec 30, 2011, at 11:43 AM, Conal Elliott wrote: >> roof: f is a function, and it is taking the same argument each time. >> Therefore the result is the same each time. > > That's called begging the question. f is not a function, so I guess your > proof is flawed. > > It seems pretty clear t

Re: [Haskell-cafe] On the purity of Haskell

2011-12-30 Thread Gregg Reynolds
On Dec 30, 2011, at 11:19 AM, Heinrich Apfelmus wrote: > Conal Elliott wrote: >> Heinrich Apfelmus wrote: >>> The function >>> >>> f :: Int -> IO Int >>> f x = getAnIntFromTheUser >>= \i -> return (i+x) >>> >>> is pure according to the common definition of "pure" in the context of >>> purely fu

Re: [Haskell-cafe] On the purity of Haskell

2011-12-30 Thread Gregg Reynolds
On Dec 30, 2011, at 11:11 AM, Chris Smith wrote: > >> time t: f 42 (computational process implementing func application >> begins…) >> t+1:= 1 >> t+2: 43 (… and ends) >> >> >> time t+3: f 42 >> t+4: = 2 >> t+5: 44 >> >> >> Conclusion: f 42 != f 42 > > That conclusion would on

Re: [Haskell-cafe] On the purity of Haskell

2011-12-30 Thread Gregg Reynolds
On Dec 30, 2011, at 11:20 AM, Colin Adams wrote: > > On 30 December 2011 17:17, Gregg Reynolds wrote: > > On Dec 30, 2011, at 11:04 AM, Colin Adams wrote: > >> >> >> On 30 December 2011 16:59, Gregg Reynolds wrote: >> >>> On Fri, Dec 30,

Re: [Haskell-cafe] On the purity of Haskell

2011-12-30 Thread Gregg Reynolds
On Dec 30, 2011, at 11:04 AM, Colin Adams wrote: > > > On 30 December 2011 16:59, Gregg Reynolds wrote: > >> On Fri, Dec 30, 2011 at 12:49 AM, Heinrich Apfelmus >> wrote: >> >> The function >> >> f :: Int -> IO Int >> f x =

Re: [Haskell-cafe] On the purity of Haskell

2011-12-30 Thread Gregg Reynolds
On Dec 30, 2011, at 10:19 AM, Conal Elliott wrote: > > > On Fri, Dec 30, 2011 at 12:49 AM, Heinrich Apfelmus > wrote: > > The function > > f :: Int -> IO Int > f x = getAnIntFromTheUser >>= \i -> return (i+x) > > is pure according to the common definition of "pure" in the context of pure

Re: [Haskell-cafe] On the purity of Haskell

2011-12-30 Thread Gregg Reynolds
On Dec 30, 2011, at 10:34 AM, Artyom Kazak wrote: > Gregg Reynolds писал(а) в своём письме Fri, 30 Dec 2011 > 17:23:20 +0200: > >> Regarding side-effects, they can be (informally) defined pretty simply: any >> non-computational effect caused by a computation is a side-

Re: [Haskell-cafe] On the purity of Haskell

2011-12-30 Thread Gregg Reynolds
On Dec 29, 2011, at 2:16 PM, Steve Horne wrote: > > Of course you can extract values out of IO actions to work with them - the > bind operator does this for you nicely, providing the value as an argument to > the function you pass to the right-hand argument of the bind. But that > function ret

Re: [Haskell-cafe] On the purity of Haskell

2011-12-29 Thread Gregg Reynolds
On Dec 29, 2011, at 1:21 PM, Heinrich Apfelmus wrote: > Why would IO Int be something special or mysterious? I don't know if it is special or mysterious, but I'm pretty sure IO is non-deterministic, non-computable, etc. In other words not the same as computation. > It's an ordinary value l

Re: [Haskell-cafe] On the purity of Haskell

2011-12-29 Thread Gregg Reynolds
On Dec 29, 2011, at 12:33 PM, Donn Cave wrote: > Quoth Gregg Reynolds , > .. >> A minor point maybe, but germane to the original post (I hope). > > It isn't - I mean, I'm not really sure what your point is, but > the example really returns the same IO value,

Re: [Haskell-cafe] On the purity of Haskell

2011-12-29 Thread Gregg Reynolds
On Dec 29, 2011, at 11:29 AM, Antoine Latter wrote: > On Thu, Dec 29, 2011 at 11:14 AM, Gregg Reynolds wrote: >> >> On Dec 29, 2011, at 11:01 AM, Iustin Pop wrote: >> >>> And to clarify better my original email: yes, (bar x) always gives you >>> back th

Re: [Haskell-cafe] On the purity of Haskell

2011-12-29 Thread Gregg Reynolds
On Dec 29, 2011, at 11:01 AM, Iustin Pop wrote: > On Thu, Dec 29, 2011 at 05:55:24PM +0100, Iustin Pop wrote: >> On Thu, Dec 29, 2011 at 05:51:57PM +0100, Jerzy Karczmarczuk wrote: >>> Iustin Pop:: In practice too: bar _ = do s<- readFile "/tmp/x.txt" return (read s)

Re: [Haskell-cafe] On the purity of Haskell

2011-12-29 Thread Gregg Reynolds
On Dec 29, 2011, at 9:16 AM, Donn Cave wrote: > Quoth Gregg Reynolds , >> On Wed, Dec 28, 2011 at 2:44 PM, Heinrich Apfelmus >> wrote: >>> >>> The beauty of the IO monad is that it doesn't change anything about purity. >>> Applying the function

Re: [Haskell-cafe] On the purity of Haskell

2011-12-29 Thread Gregg Reynolds
On Wed, Dec 28, 2011 at 2:44 PM, Heinrich Apfelmus wrote: > > The beauty of the IO monad is that it doesn't change anything about purity. > Applying the function > >   bar :: Int -> IO Int > > to the value 2 will always give the same result: > >   bar 2 = bar (1+1) = bar (5-3) Strictly speaking,

Re: [Haskell-cafe] Category theory as a design tool

2011-06-22 Thread Gregg Reynolds
On Wed, Jun 22, 2011 at 2:59 PM, Arnaud Bailly wrote: > Hello Greg and Alexander, > Thanks for your replies. Funnily, I happen to own the 3 books you > mentionned :-) My interest in category theory is a long standing affair... > > Note that owning a book, having read (most of) it and knowing a the

Re: [Haskell-cafe] Category theory as a design tool

2011-06-22 Thread Gregg Reynolds
On Tue, Jun 21, 2011 at 11:30 PM, Arnaud Bailly wrote: > (2nd try, took my gloves off...) > Hello Café, > I have been fascinated by Cat. theory for quite a few years now, as > most people who get close to it I think. > > I am a developer, working mostly in Java for my living and dabbling > with ha

Re: [Haskell-cafe] Python is lazier than Haskell

2011-04-28 Thread Gregg Reynolds
On Thu, Apr 28, 2011 at 11:38 PM, Ben Lippmeier wrote: > > On 27/04/2011, at 7:30 PM, Henning Thielemann wrote: > > > "If Haskell is great because of its laziness, > > then Python must be even greater, > > since it is lazy at the type level." > > Laziness at the value level causes space leak

Re: [Haskell-cafe] A question about monad based on http://en.wikipedia.org/wiki/Monad_(category_theory)

2011-01-20 Thread Gregg Reynolds
On Mon, Jan 17, 2011 at 9:46 PM, C K Kashyap wrote: > > I am not able to fully understand how those diagrams translate to haskell - > I can guess that T^2 -> T referes to things like concat operation but not > able to relate it to bind. > > I found it useful to work out the correspondence between

Re: [Haskell-cafe] Denotational semantics for the lay man.

2011-01-17 Thread Gregg Reynolds
ion is about extensionality to the exclusion of intensional meanings. Going beyond extensionality is where Category Theory enters the picture. HTH -Gregg Reynolds ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Lambda Calculus: Bound and Free formal definitions

2010-12-29 Thread Gregg Reynolds
On Wed, Dec 29, 2010 at 9:22 PM, Mark Spezzano wrote: > Duh, Sorry. Yes, there was a typo > > the second one should read > > If E is a combination E1 E2 then X is bound in E if and only if X is bound > in E1 or is bound in E2. > Seems odd. I recommend you always work from at least three differe

[Haskell-cafe] OT: Monad co-tutorial: the Compilation Monad

2010-12-16 Thread Gregg Reynolds
This is a little off-topic, since it isn't specifically about Haskell, but since Haskell is the home of the monad tutorial it isn't completely irrelevant. The monad tutorial genre is well-known; it's often written somebody who has just learned the concept trying to explain it, often in highly imag

Re: [Haskell-cafe] "Haskell is a scripting language inspired by Python."

2010-11-08 Thread Gregg Reynolds
On Thu, Nov 4, 2010 at 4:48 PM, Richard O'Keefe wrote: > > On 4/11/2010, at 9:08 PM, Stephen Tetley wrote: > > > > > > Did Haskell get significant whitespace from Python - doubtful as > > Python possibly wasn't visible enough at the time, but you never know. > > Python did not originate indentati

Re: [Haskell-cafe] Category Theory woes

2010-02-18 Thread Gregg Reynolds
On Thu, Feb 18, 2010 at 1:31 PM, Daniel Fischer wrote: > Am Donnerstag 18 Februar 2010 19:55:31 schrieb Nick Rudnick: > > Gregg Reynolds wrote: > > > -- you agree with me it's far away from every day's common sense, even > > for a hobby coder?? I mean, this is

Re: [Haskell-cafe] Category Theory woes

2010-02-18 Thread Gregg Reynolds
On Thu, Feb 18, 2010 at 7:48 AM, Nick Rudnick wrote: > IM(H??)O, a really introductive book on category theory still is to be > written -- if category theory is really that fundamental (what I believe, > due to its lifting of restrictions usually implicit at 'orthodox maths'), > than it should fi

Re: [Haskell-cafe] Category Theory woes

2010-02-16 Thread Gregg Reynolds
On Tue, Feb 2, 2010 at 5:26 AM, Mark Spezzano wrote: > Hi all, > > Has anyone else found it frustratingly difficult to find details on > easy-to-diget material on Category theory. The Chapter that I'm stuck on is > actually labeled Preliminaries and so I reason that if I can't > I've looked throu

Re: [Haskell-cafe] Linguistic hair-splitting

2010-02-16 Thread Gregg Reynolds
On Sat, Jan 30, 2010 at 1:24 AM, Conal Elliott wrote: > I call it "an m" or (more specifically) "an Int m" or "a list of Int". For > instance, "a list" or "an Int list" or "a list of Int". - Conal > > > On Wed, Jan 27, 2010 at 12:14 PM, Luke Palmer wrote: > >> On Wed, Jan 27, 2010 at 11:39 AM,

Re: [Haskell-cafe] consulting and contracting

2009-12-15 Thread Gregg Reynolds
On Tue, Dec 15, 2009 at 3:19 PM, Anton van Straaten wrote: > > Without that advocacy, this client would have used Java by default. As it > was, the first of > > I'd be interested in how you pulled that off. Enlightened client, or slick sales pitch? Where I work I would consider it a minor miracl

Re: [Haskell-cafe] Re: Why?

2009-12-10 Thread Gregg Reynolds
On Thu, Dec 10, 2009 at 11:16 AM, John D. Earle wrote: > Dear Gregg, > > You wrote, "Just think about how one reads a mathematical text - you need > not actually compute subformulae or even analyze them logically in order to > work with them." I hate to have to say this, but do you realize that

Re: [Haskell-cafe] Re: Why?

2009-12-10 Thread Gregg Reynolds
On Thu, Dec 10, 2009 at 9:13 AM, John D. Earle wrote: > Most of the discussion centers on the benefits of functional programming > and laziness. Haskell is not merely a lazy functional language. It is a pure > lazy functional language. I may need to explain what laziness is. Laziness > is where y

Re: [Haskell-cafe] seems like I'm on the wrong track

2009-12-02 Thread Gregg Reynolds
On Tue, Dec 1, 2009 at 7:55 PM, Michael Mossey wrote: > Thanks for the reply. Was there something specific you were referring to, or Maybe http://plucky.cs.yale.edu/cs431/reading.htm Chapter 9 "An Algebra of Music." ___ Haskell-Cafe mailing list Haskell

Re: [Haskell-cafe] seems like I'm on the wrong track

2009-12-02 Thread Gregg Reynolds
On Tue, Dec 1, 2009 at 7:01 PM, Michael P Mossey wrote: > Perhaps someone could either (1) help me do what I'm trying to do, or (2) > show me a better way. >> > In this one example, in a OO way of thinking, I have data called > AssignedNumbers that assigns integers to unique strings and keeps tra

Re: [Haskell-cafe] I miss OO

2009-11-26 Thread Gregg Reynolds
On Thu, Nov 26, 2009 at 6:44 AM, Stephen Tetley wrote: > 2009/11/26 Gregg Reynolds : > >> Modeling musical stuff could provide an excellent illustration of the >> difference between OO and the Haskell way; it's the difference between >> metaphysical engineering

Re: [Haskell-cafe] I miss OO

2009-11-26 Thread Gregg Reynolds
On Wed, Nov 25, 2009 at 2:51 PM, Michael Mossey wrote: > > So if I have objects/data note1, cursor1, and staff1, > > Python: >  note1.time() >  cursor1.time() >  staff1.time() > > Haskell needs something like >  note_time note1 >  cursor_time cursor1 >  staff_time staff1 Modeling musical stuff co

Re: [Haskell-cafe] I miss OO

2009-11-26 Thread Gregg Reynolds
On Thu, Nov 26, 2009 at 1:50 AM, Eugene Kirpichov wrote: > > I argue that in the situation you provided, the pitch, duration, > timbre and instrument are "essential" attributes of the dot, whereas > time is the position of the dot on paper and should be separated from > its essence. `Timing', may

Re: [Haskell-cafe] What *is* a DSL?

2009-10-09 Thread Gregg Reynolds
On Thu, Oct 8, 2009 at 6:08 AM, Colin Paul Adams wrote: > > "George" == George Pollard writes: > >George> I'd also like to note that the canonical pronunciation of >George> DSL ends in "-izzle". > > Whose canon? > > Interestingly, I have always assumed the canonical pronunciation of >

Re: [Haskell-cafe] commending "Design concepts in programming languages"

2009-05-14 Thread Gregg Reynolds
On Tue, May 12, 2009 at 1:04 PM, Max Rabkin wrote: > On Tue, May 12, 2009 at 1:41 PM, Wolfgang Jeltsch > wrote: >> At least, I cannot >> remember seeing the other notation (first morphism on the left) in category >> theory literature so far. It’s just that my above-mentioned professor told me >>

Re: [Haskell-cafe] Re: Referential Transparency and Monads

2009-04-10 Thread Gregg Reynolds
On Thu, Apr 9, 2009 at 11:46 PM, Brandon S. Allbery KF8NH wrote: > > I still don't understand this; we are passing a World and getting a World > back, *conceptually* the returned World is modified by putStr.  It's not in > reality, but we get the same effects if we write to a buffer and observe >

Re: [Haskell-cafe] [SoC] XML Schema Implementation

2009-03-31 Thread Gregg Reynolds
On Mon, Mar 30, 2009 at 5:16 PM, Vlad Dogaru wrote: > Hello everyone, > > I am writing to judge interest in a Summer of Code proposition: an XML > Schema[1] implementation, described as a possbile application here[2]. > As both a tool and an inspiration, I intend to use HaXML[3]. > > More specific

Re: [Haskell-cafe] about Haskell code written to be "too smart"

2009-03-25 Thread Gregg Reynolds
2009/3/25 Zachary Turner : > > On the other hand, -certain- languages are more expressive than others.  As > an example, I personally find English far more expressive than both > Vietnamese and Japanese, yet English is far more complicated.  Japanese, for Way off topic, but for what it's worth, yo

Re: [Haskell-cafe] about Haskell code written to be "too smart"

2009-03-24 Thread Gregg Reynolds
On Tue, Mar 24, 2009 at 12:41 PM, Manlio Perillo wrote: > I too have this feeling, from time to time. > So do I, because I haven't had the time to learn what I need to learn in order to read the code smoothly. I find that when I do work out the meaning, most often the style reflects conciseness

Re: [Haskell-cafe] about Haskell code written to be "too smart"

2009-03-24 Thread Gregg Reynolds
On Tue, Mar 24, 2009 at 1:42 PM, Manlio Perillo wrote: > > But, as an example, when you read a function like: > > buildPartitions xs ns = zipWith take ns . init $ scanl (flip drop) xs ns > > that can be rewritten (argument reversed) as: > > takeList :: [Int] -> [a] -> [[a]] > takeList [] _        

Re: [Haskell-cafe] Re: categories and monoids

2009-03-19 Thread Gregg Reynolds
On Thu, Mar 19, 2009 at 5:43 AM, Wolfgang Jeltsch wrote: > Am Mittwoch, 18. März 2009 15:17 schrieben Sie: >> Wolfgang Jeltsch schrieb: >> > Okay. Well, a monoid with many objects isn’t a monoid anymore since a >> > monoid has only one object. It’s the same as with: “A ring is a field >> > whose m

Re: [Haskell-cafe] Design Patterns by Gamma or equivalent

2009-03-17 Thread Gregg Reynolds
2009/3/11 Mark Spezzano : > I’m very familiar with the concept of Design Patterns for OOP in Java and > C++. They’re basically a way of fitting components of a program so that > objects/classes fit together nicely like Lego blocks and it’s useful because > it also provides a common “language” to ta

Re: [Haskell-cafe] Re: Against cuteness

2009-03-13 Thread Gregg Reynolds
On Thu, Mar 12, 2009 at 9:17 PM, Benjamin L. Russell wrote: > On Thu, 12 Mar 2009 09:11:15 -0500, Gregg Reynolds > wrote: > >>I don't think so.  Bad design will lose them (and many others), but >>good design and cuteness are two different things. > > It's

Re: [Haskell-cafe] Re: Against cuteness

2009-03-12 Thread Gregg Reynolds
On Thu, Mar 12, 2009 at 7:07 AM, Benjamin L. Russell wrote: > > Here, there are a lot of Japanese Haskell fans who love the beauty of > Haskell, and you will risk losing a lot of them if you choose a mascot > without any cuteness factor.  A lot of my friends meet together every I don't think so.

[Haskell-cafe] monadic logo

2009-03-12 Thread Gregg Reynolds
At risk of becoming the most hated man in all Haskelldom, I'd like to suggest that the Haskell logo not use lambda symbols. Or at least not as the central element. Sorry, I know I'm late to the party, but the thing is there is nothing distinctive about lambda; it's common to all FPLs. Besides, Li

Re: [Haskell-cafe] Against cuteness

2009-03-11 Thread Gregg Reynolds
On Wed, Mar 11, 2009 at 5:25 AM, Bulat Ziganshin wrote: > Hello Gregg, > > Wednesday, March 11, 2009, 1:17:41 PM, you wrote: > > > are not O'Reilly. Of all the billions of images from all the > > cultures in the world available to us we can surely find something > > that is witty or charming with

[Haskell-cafe] Against cuteness

2009-03-11 Thread Gregg Reynolds
Regarding logos/mascots: nothing personal folks, but I would like to cast a loud firm vote against all forms of cuteness, especially small furry animal cuteness. It's been done half to death, and we are not O'Reilly. Of all the billions of images from all the cultures in the world available to u

Re: [Haskell-cafe] Re: [Haskell] Lazy IO breaks purity

2009-03-05 Thread Gregg Reynolds
On Thu, Mar 5, 2009 at 7:08 AM, Simon Marlow wrote: > > So the argument is something like: we can think of the result of a call to > unsafeInterleaveIO as having been chosen at the time we called > unsafeInterleaveIO, rather than when its result is actually evaluated. This > is on dodgy ground, I

Re: [Haskell-cafe] Re: Paper draft: "Denotational design with type class morphisms"

2009-02-20 Thread Gregg Reynolds
On Fri, Feb 20, 2009 at 9:12 AM, Achim Schneider wrote: > Robin Green wrote: > > > On Fri, 20 Feb 2009 15:17:14 +0100 > > Achim Schneider wrote: > > > > > Conal Elliott wrote: > > > > > > > DRAFT version ___ comments please > > > > > > > Conal, please, PLEASE, never, EVER again use the word "m

Re: [Haskell-cafe] How to create an online poll

2009-02-19 Thread Gregg Reynolds
2009/2/19 Luke Palmer > 2009/2/19 Rick R > >> I think the capabilities community including E and Coyotos/BitC have >> extensively addressed this topic. Coyotos is taking the correct approach for >> trusted voting platform. Since, even if your software is trustworthy, it >> can't be trusted if th

Re: [Haskell-cafe] How to create an online poll

2009-02-18 Thread gregg reynolds
comment on any quantitative side effects, but the some >> intangible side effects include Distrustful Populace and >> MaliciousDissenters. However, if ghc is run with the - >> XUnscrupulousPolitics flag, those can be suppressed. >> >> On Wed, Feb 18, 2009 at 4:33

Re: [Haskell-cafe] How to create an online poll

2009-02-18 Thread gregg reynolds
Ok, that might protect us against the 7 plagues, so I'm not so worried about locusts. But what about Java, PHP etc. Is the monad sufficient protection against ultra-supernatural evil? Andrew Wagner wrote: >Just wrap it in a ReallySafeWePromiseMonad > >2009/2/18 gregg reynolds

Re: [Haskell-cafe] How to create an online poll

2009-02-18 Thread gregg reynolds
I.e. war, plague.famine. etc. gregg reynolds wrote: >But what about the side effects? > >Rick R wrote: > >>I'm sure Premier Election Solutions (formerly Diebold) can provide us with >>an online voting solution. >>Their value-add services allows us to set the

Re: [Haskell-cafe] How to create an online poll

2009-02-18 Thread gregg reynolds
But what about the side effects? Rick R wrote: >I'm sure Premier Election Solutions (formerly Diebold) can provide us with >an online voting solution. >Their value-add services allows us to set the outcome beforehand, so, in >effect, the the voting process will be determinate. Which is certainly

Re: [Haskell-cafe] How to create an online poll

2009-02-18 Thread gregg reynolds
See also www.surveymonkey.com Bulat Ziganshin wrote: >Hello haskell-cafe, > >http://zohopolls.com/ > >-- >Best regards, > Bulat mailto:bulat.zigans...@gmail.com > >___ >Haskell-Cafe mailing list >Haskell-Cafe@haskell.org >http

Re: [Haskell-cafe] Intergalactic Telefunctors

2009-02-15 Thread Gregg Reynolds
On Sun, Feb 15, 2009 at 12:45 PM, Anton van Straaten wrote: > Gregg Reynolds wrote: > >> Action-at-a-distance is a metaphor meant to enliven the concept. >> > > Kind of like the container metaphor? > Yes, only,

Re: [Haskell-cafe] Intergalactic Telefunctors

2009-02-15 Thread Gregg Reynolds
On Sun, Feb 15, 2009 at 11:53 AM, Tillmann Rendel wrote: > Gregg Reynolds wrote: > >> BTW, I'm not talking about Haskell's Functor class, I guess I should >> have made that clear. I'm talking about category theory, as the >> semantic framework for think

Re: [Haskell-cafe] Intergalactic Telefunctors

2009-02-15 Thread Gregg Reynolds
On Sun, Feb 15, 2009 at 11:09 AM, Tillmann Rendel wrote: > Gregg Reynolds wrote: > >> Came up with an alternative to the container metaphor for functors that >> you >> might find amusing: http://syntax.wikidot.com/blog:9 >> > > You seem to describe Bifunctor

[Haskell-cafe] Intergalactic Telefunctors

2009-02-15 Thread Gregg Reynolds
Came up with an alternative to the container metaphor for functors that you might find amusing: http://syntax.wikidot.com/blog:9 ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] IO semantics and evaluation - summary

2009-02-14 Thread Gregg Reynolds
On Sat, Feb 14, 2009 at 9:15 AM, Stuart Cook wrote: > From "Fixing Haskell IO": > > We can summarize the SDIOH (Standard Definition of IO in Haskell) > > as "a value of type IO a is a value, that performs, then delivers > > a value of type a". > > I think you've already made a critical mistake he

Re: [Haskell-cafe] IO semantics and evaluation - summary

2009-02-13 Thread Gregg Reynolds
Hi Daryoush, 2009/2/13 Daryoush Mehrtash > I have been trying to figure out the distinction between value, function > and computation. You raised a few points that I am not sure about. > > > In " "Computation" considered harmful. "Value" not so hot either." you > said: > > I still don't like

[Haskell-cafe] IO semantics and evaluation - summary

2009-02-13 Thread Gregg Reynolds
Many thanks to everybody who tried to set me straight on the thread about IO monad and evaluation semantics. I've begun summarizing the info, and I believe I've come up with a much better way of explaining IO; just flip the semantic perspective, and think in terms of interpretations instead of act

Re: [Haskell-cafe] The Haskell re-branding exercise

2009-02-12 Thread Gregg Reynolds
On Sat, Feb 7, 2009 at 11:18 AM, Paul Johnson wrote: > Paul Johnson wrote: > >> A call has gone out < >> http://www.haskell.org/pipermail/haskell-cafe/2008-December/051836.html> >> for a new logo for Haskell. Candidates (including a couple < >> http://www.haskell.org/haskellwiki/Image:Haskell-lo

Re: [Haskell-cafe] evaluation semantics of bind

2009-02-10 Thread Gregg Reynolds
On Mon, Feb 9, 2009 at 10:17 PM, Richard O'Keefe wrote: > > On 10 Feb 2009, at 5:07 pm, Gregg Reynolds wrote: > >> Thanks. I see the error of my ways. So, IO expressions must be evaluated >> if they are in the chain leading to main. >> > > > We need

Re: [Haskell-cafe] Haskell Fest

2009-02-10 Thread Gregg Reynolds
Just be careful. The judge uses lazy evaluation, so if you get arrested you might spend 20 years in the holding pen. On the bright side, you can pay for stuff whenever you feel like it. 2009/2/9 Lyle Kopnicky > Looks like a lot of fun! > > http://www.haskellchamber.com/page6.html > > _

Re: [Haskell-cafe] evaluation semantics of bind

2009-02-09 Thread Gregg Reynolds
On Mon, Feb 9, 2009 at 8:37 PM, Richard O'Keefe wrote: > > There isn't any "application f e". > Any human reader who does that is simply WRONG to do so. > Sorry, should have written f* > > In your fragmentary example, may be discarded > EVEN IF it contains IO expressions, it's only if they are

Re: [Haskell-cafe] evaluation semantics of bind

2009-02-09 Thread Gregg Reynolds
On Mon, Feb 9, 2009 at 11:06 AM, Tillmann Rendel wrote: > Gregg Reynolds wrote:: > >> My original question was motivated by the observation that a human reader >> of >> an expression of the form "e >>= f" , on seeing that f is constant, may >> pull &

Re: [Haskell-cafe] Formal semantics for Haskell?

2009-02-09 Thread gregg reynolds
Is that () or _|_? ;) Tim Newsham wrote: >null___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] Formal semantics for Haskell?

2009-02-09 Thread Gregg Reynolds
ML has a formal definition[1]; why not Haskell? Would this be a Good Thing, or a Waste Of Time? The Report strikes me as a hybrid of formal and informal. I guess that's not a problem so far, but there aren't that many implementations; if we had dozens, how could we verify conformance? A formal

Re: [Haskell-cafe] evaluation semantics of bind

2009-02-09 Thread Gregg Reynolds
On Mon, Feb 9, 2009 at 7:17 AM, Lennart Augustsson wrote: > Just to clarify a little. > If you implement the IO monad in a sane way (as some kind of state > monad or continuation monad) then the compiler can optimize e>>=f even > for the IO monad. The implementation of >>= will ensure the > seque

Re: [Haskell-cafe] Monad explanation

2009-02-09 Thread Gregg Reynolds
On Mon, Feb 9, 2009 at 5:32 AM, Sittampalam, Ganesh < ganesh.sittampa...@credit-suisse.com> wrote: > > > My bad, I restate: a value cannot be both static and dynamic. Or an > > object and a morphism. Or an element and a function. Sure, you can > > treat a morphism as an object, but only by mov

Re: [Haskell-cafe] evaluation semantics of bind

2009-02-09 Thread Gregg Reynolds
On Sun, Feb 8, 2009 at 6:25 PM, Richard O'Keefe wrote: > > On 6 Feb 2009, at 4:20 am, Gregg Reynolds wrote: > >> However, consider: >> >>getChar >>= \x -> getChar >> >> An optimizer can see that the result of the first getChar is di

Re: [Haskell-cafe] Monad explanation

2009-02-09 Thread Gregg Reynolds
On Mon, Feb 9, 2009 at 4:38 AM, Tony Morris wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > I also agree it is a value. > The original post was attempting to make a distinction that does not > exist. I deliberately avoided that topic. > > "A thing cannot be both a value and a functio

Re: [Haskell-cafe] Monad explanation

2009-02-09 Thread Gregg Reynolds
On Sun, Feb 8, 2009 at 6:39 PM, Richard O'Keefe wrote: > > is a good one. If you want to say that "a mathematical value with > a non-mathematical effect" is nonsensical, more power to you. I said > I don't want to get far into White Knight territory. As long as you > can agree "A mathematical

Re: [Haskell-cafe] Moggi :: CT -> Hask

2009-02-07 Thread Gregg Reynolds
Hi Dan, On Sat, Feb 7, 2009 at 12:00 PM, Dan Doel wrote: > On Saturday 07 February 2009 12:11:29 pm Gregg Reynolds wrote: > > As far as I know, Moggi didn't really have anything directly to do with > Haskell. He pioneered the idea of monads being useful in denotational > s

[Haskell-cafe] Semantic web

2009-02-07 Thread gregg reynolds
Anybody implementing rdf or owl stuff in haskell? Seems like a natural fit. G___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] Re: Moggi :: CT -> Hask

2009-02-07 Thread Gregg Reynolds
Correction: the correct response is: "Nothing." On Sat, Feb 7, 2009 at 11:11 AM, Gregg Reynolds wrote: > Hi, > > I had a monadic revelation at about 3 am. The answer to the question > "what is an IO value, really?" is "who cares?" I just posted a blo

[Haskell-cafe] Moggi :: CT -> Hask

2009-02-07 Thread Gregg Reynolds
Hi, I had a monadic revelation at about 3 am. The answer to the question "what is an IO value, really?" is "who cares?" I just posted a blog entry discussing how CT found it's way from Moggi into Haskell at http://syntax.wikidot.com/blog (hence the title; Moggi as functor). It addresses the ques

Re: [Haskell-cafe] morphisms in IO

2009-02-05 Thread Gregg Reynolds
On Thu, Feb 5, 2009 at 10:32 PM, Dan Weston wrote: > I truly have no idea what you are saying (and probably not even what I am > saying), but I suspect: > > a) You are calling IO the target category of applying the functor IO [taking > a to IO a and (a->b) to (IO a -> IO b)] to Hask. > > b) This c

[Haskell-cafe] morphisms in IO

2009-02-05 Thread Gregg Reynolds
I'm working on a radically different way of looking at IO. Before I post it and make a fool of myself, I'd appreciate a reality check on the following points: a) Can IO be thought of as a category? I think the answer is yes. b) If it is a category, what are its morphisms? I think the answer

Re: [Haskell-cafe] Re: evaluation semantics of bind

2009-02-05 Thread Gregg Reynolds
On Thu, Feb 5, 2009 at 7:19 PM, wren ng thornton wrote: > Gregg Reynolds wrote: >> as the formal semantics of the language are concerned, there's no >> essential difference between "getChar >>= \x -> getChar" and " Foo 3 >>>> >>>

Re: [Haskell-cafe] Monad explanation

2009-02-05 Thread Gregg Reynolds
On Thu, Feb 5, 2009 at 1:46 PM, Lennart Augustsson wrote: > You are absolutely right. The statement > "The values of the IO monad are programs that do IO. " > is somewhat nonsensical. Values don't do anything, they just are. Whew! So I'm not crazy. I was starting to wonder. > But values of t

Re: [Haskell-cafe] Re: evaluation semantics of bind

2009-02-05 Thread Gregg Reynolds
On Thu, Feb 5, 2009 at 11:22 AM, Gleb Alexeyev wrote: > Gregg Reynolds wrote: > >> Are you saying that using equations to add a level of indirection >> prevents optimization? I still don't see it - discarding x doesn't >> change the semantics, so a good compiler

Re: [Haskell-cafe] Re: evaluation semantics of bind

2009-02-05 Thread Gregg Reynolds
On Thu, Feb 5, 2009 at 11:12 AM, Andrew Wagner wrote: > > >> Are you saying that using equations to add a level of indirection >> prevents optimization? I still don't see it - discarding x doesn't >> change the semantics, so a good compiler /should/ do this. How is >> this different from optimiz

Re: [Haskell-cafe] Re: evaluation semantics of bind

2009-02-05 Thread Gregg Reynolds
On Thu, Feb 5, 2009 at 10:49 AM, Gleb Alexeyev wrote: > Gregg Reynolds wrote: > > I must be misunderstanding something. I don't know if it would be >> >> optimized out, but I see no reason why it couldn't be. There's no data >> dependency, right? >

Re: [Haskell-cafe] Re: evaluation semantics of bind

2009-02-05 Thread Gregg Reynolds
On Thu, Feb 5, 2009 at 10:26 AM, wrote: > > x >>= f does not mean "apply f to x", it means "do x, and then do f with > the result of x". Bind is a sequencing operator rather than an > application operator. Sequencing is a side effect of data dependency. What I should have said is x >>= f means

Re: [Haskell-cafe] evaluation semantics of bind

2009-02-05 Thread Gregg Reynolds
On Thu, Feb 5, 2009 at 10:00 AM, Lennart Augustsson wrote: > > There's nothing magic about IO when it comes to monad semantics. > If you take ghc's implementation of IO, it's a state monad. Doesn't that mean the semantics are defined by the implementation? My problem is that I'm not seeing how c

Re: [Haskell-cafe] Re: evaluation semantics of bind

2009-02-05 Thread Gregg Reynolds
On Thu, Feb 5, 2009 at 9:53 AM, Gleb Alexeyev wrote: > Let's imagine that IO datatype is defined thus: > > >{-# LANGUAGE GADTs #-} > >{-# LANGUAGE NoImplicitPrelude #-} > > >import Prelude(Monad, Char) > >data IO a where > >GetChar :: IO Char > >Bind :: IO a -> (a -> IO b) -> IO b > > >get

Re: [Haskell-cafe] Monad explanation

2009-02-05 Thread Gregg Reynolds
On Wed, Feb 4, 2009 at 8:18 PM, Richard O'Keefe wrote: > > On 5 Feb 2009, at 10:20 am, Gregg Reynolds wrote: > >> That's a fairly common representation, seems to work for lots of people, >> but it caused me no end of trouble. Values are mathematical objects; h

Re: [Haskell-cafe] evaluation semantics of bind

2009-02-05 Thread Gregg Reynolds
On Thu, Feb 5, 2009 at 9:27 AM, Bulat Ziganshin wrote: > Hello Gregg, > > Thursday, February 5, 2009, 6:20:06 PM, you wrote: > > > An optimizer can see that the result of the first getChar is > > discarded and replace the entire expression with one getChar without > > changing the formal semantics

[Haskell-cafe] evaluation semantics of bind

2009-02-05 Thread Gregg Reynolds
I think I've just about got monads figured out, but there's one detail that still escapes me. As I understand it, a monad is a kind of programming trick the uses data dependency to force evaluation order. x >>= f means apply f to x; since the value of f x depends on the value of x, the evaluator

Re: [Haskell-cafe] Monad explanation

2009-02-04 Thread Gregg Reynolds
On Wed, Feb 4, 2009 at 11:41 AM, Tim Newsham wrote: > I put up a small Monad explanation (I wouldn't quite call it > a tutorial): > > http://www.thenewsh.com/~newsham/haskell/monad.html > "The values of the IO monad are programs that do IO

Re: [Haskell-cafe] type and data constructors in CT

2009-02-03 Thread Gregg Reynolds
On Mon, Feb 2, 2009 at 3:27 PM, David Menendez wrote: > Does that help at all? > I think it does. But ... it gives me crazy ideas. Like: a functor is a kind of magic non-computing function! That's why they didn't call it a function? We know it maps A to FA, but we don't know how (maybe we

Re: [Haskell-cafe] type metaphysics

2009-02-02 Thread Gregg Reynolds
On Mon, Feb 2, 2009 at 2:25 PM, Ketil Malde wrote: > Gregg Reynolds writes: > > > Just shorthand for something like "data Tcon a = Dcon a", applied to Int. > > Any data constructor expression using an Int will yield a value of type > Tcon > > Int. >

[Haskell-cafe] Re: type metaphysics

2009-02-02 Thread Gregg Reynolds
On Mon, Feb 2, 2009 at 11:14 PM, wrote: > > I believe the original notion of type by Russell is most insightful, > bridging the semantic notion of type (type as a set of values) and the > syntactic notion (type system as a syntactic discipline, a statically > decidable restriction on terms). > >

Re: [Haskell-cafe] type metaphysics

2009-02-02 Thread Gregg Reynolds
On Mon, Feb 2, 2009 at 12:39 PM, Ketil Malde wrote: > Gregg Reynolds writes: > > > This gives a very interesting way of looking at Haskell type > > constructors: a value of (say) Tcon Int is anything that satisfies > > "isA Tcon Int". > > Reminiscent

Re: [Haskell-cafe] type metaphysics

2009-02-02 Thread Gregg Reynolds
On Mon, Feb 2, 2009 at 11:51 AM, Lennart Augustsson wrote: > If we're talking Haskell types here I think it's reasonable to talk > about the values of a type as those that we can actually express in > the Haskell program, any other values are really besides the point. > Well, if you have a more ph

Re: [Haskell-cafe] type metaphysics

2009-02-02 Thread Gregg Reynolds
Hi and thanks for the response, On Mon, Feb 2, 2009 at 10:32 AM, Lennart Augustsson wrote: > Thinking of types as sets is not a bad approximation. You need to add > _|_ to your set of values, though. > > So, Bool={_|_, False, True}, Nat={_|_,Zero,Succ _|_, Succ Zero, ...} > I'm afraid I haven't

  1   2   >