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 returns
On Dec 30, 2011, at 10:34 AM, Artyom Kazak wrote:
Gregg Reynolds d...@mobileink.com писал(а) в своём письме 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-effect
On Dec 30, 2011, at 10:19 AM, Conal Elliott wrote:
On Fri, Dec 30, 2011 at 12:49 AM, Heinrich Apfelmus
apfel...@quantentunnel.de 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
On Dec 30, 2011, at 11:04 AM, Colin Adams wrote:
On 30 December 2011 16:59, Gregg Reynolds d...@mobileink.com wrote:
On Fri, Dec 30, 2011 at 12:49 AM, Heinrich Apfelmus
apfel...@quantentunnel.de wrote:
The function
f :: Int - IO Int
f x = getAnIntFromTheUser = \i - return (i+x
On Dec 30, 2011, at 11:20 AM, Colin Adams wrote:
On 30 December 2011 17:17, Gregg Reynolds d...@mobileink.com wrote:
On Dec 30, 2011, at 11:04 AM, Colin Adams wrote:
On 30 December 2011 16:59, Gregg Reynolds d...@mobileink.com wrote:
On Fri, Dec 30, 2011 at 12:49 AM, Heinrich
On Dec 30, 2011, at 11:11 AM, Chris Smith wrote:
time t: f 42 (computational process implementing func application
begins…)
t+1: keystroke = 1
t+2: 43 (… and ends)
time t+3: f 42
t+4: keystroke = 2
t+5: 44
Conclusion: f 42 != f 42
That conclusion would only
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 functional programming. That's
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 that
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, let
On Dec 29, 2011, at 9:16 AM, Donn Cave wrote:
Quoth Gregg Reynolds d...@mobileink.com,
On Wed, Dec 28, 2011 at 2:44 PM, Heinrich Apfelmus
apfel...@quantentunnel.de wrote:
The beauty of the IO monad is that it doesn't change anything about purity.
Applying the function
bar :: Int - IO
On Wed, Dec 28, 2011 at 2:44 PM, Heinrich Apfelmus
apfel...@quantentunnel.de 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)
On Dec 29, 2011, at 11:29 AM, Antoine Latter wrote:
On Thu, Dec 29, 2011 at 11:14 AM, Gregg Reynolds d...@mobileink.com 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 the same IO action;
More precisely
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)
Once you're in a monad
On Dec 29, 2011, at 12:33 PM, Donn Cave wrote:
Quoth Gregg Reynolds d...@mobileink.com,
..
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, not just one of
the same
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
On Tue, Jun 21, 2011 at 11:30 PM, Arnaud Bailly arnaud.oq...@gmail.com
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
On Wed, Jun 22, 2011 at 2:59 PM, Arnaud Bailly arnaud.oq...@gmail.comwrote:
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
On Thu, Apr 28, 2011 at 11:38 PM, Ben Lippmeier b...@ouroborus.net 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
On Mon, Jan 17, 2011 at 9:46 PM, C K Kashyap ckkash...@gmail.com 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
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
On Wed, Dec 29, 2010 at 9:22 PM, Mark Spezzano mark.spezz...@chariot.net.au
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
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
On Thu, Nov 4, 2010 at 4:48 PM, Richard O'Keefe o...@cs.otago.ac.nz 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
On Thu, Feb 18, 2010 at 7:48 AM, Nick Rudnick joerg.rudn...@t-online.dewrote:
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
On Thu, Feb 18, 2010 at 1:31 PM, Daniel Fischer daniel.is.fisc...@web.dewrote:
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 not «Head first
On Sat, Jan 30, 2010 at 1:24 AM, Conal Elliott co...@conal.net 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 lrpal...@gmail.com wrote:
On Wed, Jan 27,
On Tue, Feb 2, 2010 at 5:26 AM, Mark Spezzano
mark.spezz...@chariot.net.auwrote:
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
On Tue, Dec 15, 2009 at 3:19 PM, Anton van Straaten
an...@appsolutions.comwrote:
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
On Thu, Dec 10, 2009 at 9:13 AM, John D. Earle johndea...@cox.net 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.
On Thu, Dec 10, 2009 at 11:16 AM, John D. Earle johndea...@cox.net 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
On Tue, Dec 1, 2009 at 7:01 PM, Michael P Mossey m...@alumni.caltech.edu
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
On Tue, Dec 1, 2009 at 7:55 PM, Michael Mossey m...@alumni.caltech.edu
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
On Thu, Nov 26, 2009 at 1:50 AM, Eugene Kirpichov ekirpic...@gmail.com 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.
On Wed, Nov 25, 2009 at 2:51 PM, Michael Mossey m...@alumni.caltech.edu 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
On Thu, Nov 26, 2009 at 6:44 AM, Stephen Tetley
stephen.tet...@gmail.com wrote:
2009/11/26 Gregg Reynolds d...@mobileink.com:
Modeling musical stuff could provide an excellent illustration of the
difference between OO and the Haskell way; it's the difference between
metaphysical engineering
On Thu, Oct 8, 2009 at 6:08 AM, Colin Paul Adams
co...@colina.demon.co.ukwrote:
George == George Pollard por...@porg.es 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
On Tue, May 12, 2009 at 1:04 PM, Max Rabkin max.rab...@gmail.com wrote:
On Tue, May 12, 2009 at 1:41 PM, Wolfgang Jeltsch
g9ks1...@acme.softbase.org 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
On Mon, Mar 30, 2009 at 5:16 PM, Vlad Dogaru ddv...@anaconda.cs.pub.ro 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
2009/3/25 Zachary Turner divisorthe...@gmail.com:
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
On Tue, Mar 24, 2009 at 1:42 PM, Manlio Perillo
manlio_peri...@libero.it 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]]
On Tue, Mar 24, 2009 at 12:41 PM, Manlio Perillo
manlio_peri...@libero.it 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
On Thu, Mar 19, 2009 at 5:43 AM, Wolfgang Jeltsch
g9ks1...@acme.softbase.org 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
2009/3/11 Mark Spezzano mark.spezz...@chariot.net.au:
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
On Thu, Mar 12, 2009 at 9:17 PM, Benjamin L. Russell
dekudekup...@yahoo.com wrote:
On Thu, 12 Mar 2009 09:11:15 -0500, Gregg Reynolds d...@mobileink.com
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 also
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,
On Thu, Mar 12, 2009 at 7:07 AM, Benjamin L. Russell
dekudekup...@yahoo.com 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
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
On Wed, Mar 11, 2009 at 5:25 AM, Bulat Ziganshin
bulat.zigans...@gmail.comwrote:
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
On Thu, Mar 5, 2009 at 7:08 AM, Simon Marlow marlo...@gmail.com 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
On Fri, Feb 20, 2009 at 9:12 AM, Achim Schneider bars...@web.de wrote:
Robin Green gree...@greenrd.org wrote:
On Fri, 20 Feb 2009 15:17:14 +0100
Achim Schneider bars...@web.de wrote:
Conal Elliott co...@conal.net wrote:
DRAFT version ___ comments please
Conal, please,
2009/2/19 Luke Palmer lrpal...@gmail.com
2009/2/19 Rick R rick.richard...@gmail.com
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
See also www.surveymonkey.com
Bulat Ziganshin bulat.zigans...@gmail.com wrote:
Hello haskell-cafe,
http://zohopolls.com/
--
Best regards,
Bulat mailto:bulat.zigans...@gmail.com
___
Haskell-Cafe mailing list
But what about the side effects?
Rick R rick.richard...@gmail.com 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
I.e. war, plague.famine. etc.
gregg reynolds d...@mobileink.com wrote:
But what about the side effects?
Rick R rick.richard...@gmail.com 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
reynolds d...@mobileink.com
I.e. war, plague.famine. etc.
gregg reynolds d...@mobileink.com wrote:
But what about the side effects?
Rick R rick.richard...@gmail.com wrote:
I'm sure Premier Election Solutions (formerly Diebold) can provide us
with
an online voting solution.
Their value
:
I can't 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 PM, gregg reynolds d
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
On Sun, Feb 15, 2009 at 11:09 AM, Tillmann Rendel ren...@cs.au.dk 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 Bifunctors (two objects from one category
On Sun, Feb 15, 2009 at 11:53 AM, Tillmann Rendel ren...@cs.au.dk 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 thinking about Haskell.
Don't forget
On Sun, Feb 15, 2009 at 12:45 PM, Anton van Straaten an...@appsolutions.com
wrote:
Gregg Reynolds wrote:
Action-at-a-distance is a metaphor meant to enliven the concept.
Kind of like the container metaphor?
Yes, only, different. Non-pernicious
On Sat, Feb 14, 2009 at 9:15 AM, Stuart Cook sco...@gmail.com 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
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
Hi Daryoush,
2009/2/13 Daryoush Mehrtash dmehrt...@gmail.com
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
On Sat, Feb 7, 2009 at 11:18 AM, Paul Johnson p...@cogito.org.uk 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
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 li...@qseep.net
Looks like a lot of fun!
http://www.haskellchamber.com/page6.html
On Mon, Feb 9, 2009 at 10:17 PM, Richard O'Keefe o...@cs.otago.ac.nz 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 some standard terminology
On Sun, Feb 8, 2009 at 6:39 PM, Richard O'Keefe o...@cs.otago.ac.nz 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
On Mon, Feb 9, 2009 at 4:38 AM, Tony Morris tmor...@tmorris.net 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
On Sun, Feb 8, 2009 at 6:25 PM, Richard O'Keefe o...@cs.otago.ac.nz 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 discarded and
replace the entire expression with one
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 moving to a
On Mon, Feb 9, 2009 at 7:17 AM, Lennart Augustsson
lenn...@augustsson.netwrote:
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
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
Is that () or _|_? ;)
Tim Newsham news...@lava.net wrote:
null___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
On Mon, Feb 9, 2009 at 11:06 AM, Tillmann Rendel ren...@cs.au.dk 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
the constant value out of f, disregard e
On Mon, Feb 9, 2009 at 8:37 PM, Richard O'Keefe o...@cs.otago.ac.nz 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, monster computation may be discarded
EVEN IF it contains IO
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
Correction: the correct response is: Nothing.
On Sat, Feb 7, 2009 at 11:11 AM, Gregg Reynolds d...@mobileink.com 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 blog
entry discussing how CT found
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
Hi Dan,
On Sat, Feb 7, 2009 at 12:00 PM, Dan Doel dan.d...@gmail.com 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
semantics
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
On Thu, Feb 5, 2009 at 9:27 AM, Bulat Ziganshin
bulat.zigans...@gmail.comwrote:
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
On Wed, Feb 4, 2009 at 8:18 PM, Richard O'Keefe o...@cs.otago.ac.nz 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; how, I
asked myself
On Thu, Feb 5, 2009 at 9:53 AM, Gleb Alexeyev gleb.alex...@gmail.comwrote:
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
On Thu, Feb 5, 2009 at 10:00 AM, Lennart Augustsson
lenn...@augustsson.net 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
On Thu, Feb 5, 2009 at 10:26 AM, m...@justinbogner.com 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
On Thu, Feb 5, 2009 at 10:49 AM, Gleb Alexeyev gleb.alex...@gmail.com 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?
Of course there is data
On Thu, Feb 5, 2009 at 11:12 AM, Andrew Wagner wagner.and...@gmail.com 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
On Thu, Feb 5, 2009 at 11:22 AM, Gleb Alexeyev gleb.alex...@gmail.com 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 /should/ do
On Thu, Feb 5, 2009 at 1:46 PM, Lennart Augustsson
lenn...@augustsson.net 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.
On Thu, Feb 5, 2009 at 7:19 PM, wren ng thornton w...@freegeek.org 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
= \x - Foo 7 for some data constructor Foo. I should think
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
On Thu, Feb 5, 2009 at 10:32 PM, Dan Weston weston...@imageworks.com 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
On Wed, Feb 4, 2009 at 11:41 AM, Tim Newsham news...@lava.net wrote:
I put up a small Monad explanation (I wouldn't quite call it
a tutorial):
http://www.thenewsh.com/~newsham/haskell/monad.htmlhttp://www.thenewsh.com/%7Enewsham/haskell/monad.html
The values of the IO monad are programs
On Mon, Feb 2, 2009 at 3:27 PM, David Menendez d...@zednenem.com 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
Hi,
The concept of type seems to be a little like porno: I know it when
I see it, but I can't define it (apologies to Justice Stewart). I've
picked through lots of documents that discuss types in various ways,
but I have yet to find one that actually says what a type really is.
For example,
Hi Martijn,
On Mon, Feb 2, 2009 at 9:49 AM, Martijn van Steenbergen
mart...@van.steenbergen.nl wrote:
There are many answers to the question what is a type?, depending on
one's
view.
One that has been helpful to me when learning Haskell is a type is a set
of
values.
That's the way I've
Hi and thanks for the response,
On Mon, Feb 2, 2009 at 10:32 AM, Lennart Augustsson
lenn...@augustsson.netwrote:
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, ...}
On Mon, Feb 2, 2009 at 11:51 AM, Lennart Augustsson
lenn...@augustsson.netwrote:
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
On Mon, Feb 2, 2009 at 12:39 PM, Ketil Malde ke...@malde.org wrote:
Gregg Reynolds d...@mobileink.com 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 of arguments between
On Mon, Feb 2, 2009 at 10:05 AM, Andrew Butterfield
andrew.butterfi...@cs.tcd.ie wrote:
Martijn van Steenbergen wrote:
To my naive mind this sounds
suspiciously like the set of all sets, so it's too big to be a set.
Here you're probably thinking about the distinction between countable and
1 - 100 of 108 matches
Mail list logo