From: skaller <skaller@users.sourceforge.net>
To: Thomas Fischbacher <Thomas.Fischbacher@Physik.Uni-Muenchen.DE>
Cc: Jacques Garrigue <garrigue@math.nagoya-u.ac.jp>,
caml-list <caml-list@inria.fr>
Subject: Re: [Caml-list] environment idiom
Date: 14 Dec 2004 00:22:34 +1100 [thread overview]
Message-ID: <1102944153.2578.234.camel@pelican.wigram> (raw)
In-Reply-To: <Pine.LNX.4.58.0412131035150.13773@eiger.cip.physik.uni-muenchen.de>
On Mon, 2004-12-13 at 21:20, Thomas Fischbacher wrote:
> Referential transparency is about the substitution of definitions.
> Evidently, x <- ... is _not_ a definition.
But this is a bit circular. It is suspect to use the Haskell
definition of 'definition' and then say Haskell is referentially
transparent, a property depending on the definition of 'definition',
because you cannot apply that definition to any other language.
C also has 'definitions' but they're not at all the same
as Haskell ones.
When I first read the text of Barbara Liskov's Substitution
Principle I fell over laughing. The text makes so many
assumptions about the kind of language it is dealing
with it is useless. You could rewrite it for C++,
using *initialisation* instead of substitution, for example.
So when you're looking at monadic Haskell that contains
x <- ...
you can claim it isn't a definition.. but it surely
looks like one.. more precisely it looks like an assignment.
It's like me trying to argue -- repeatedly and heatedly --
that no matter what the C++ Standard says, there is no
such type as 'const int'. There really isn't <g> even though
the grammar has a production which makes that a valid type
specifier it doesn't denote a type distinct from int.
Of course people argued I was wrong -- the Standard said so.
> The notion of "substitution" of course only makes sense for this
> "official" form.
Right. But consider for a moment a meta-system with
enough well thought out sugar that it had a calculus
of its own. Just because the reduced form is transparent
doesn't mean the sugar calculus is.
I guess that's my point, badly stated. The sugar level *counts*.
Just as Haskell counts, even though GHC generates C which generates
assembler .. semantics and its relation to syntax -- such as
exhibited by the referential transparency property of purely
functional code appears to be a 'multilevel' phenomena.
> This is a bit like
> FORTRAN programmers asked to adjust themselves to C showing the attitude
> that "at least, they can forget all that for/while/etc. mumbo-jumbo and
> do everything with goto, as they are used to".
Good point.
> Coming back to the original question, which was whether one may "just
> stick in some monadic stuff to get a notion of an `environment'", I'm
> inclined to say that from the purely functional point of view, this
> perhaps is not a good idea, as this is not just "a minor change to the
> code" but changes pretty much anything of its original properties.
However clearly the ST monad is sometimes useful..
can you explain when that is?
--
John Skaller, mailto:skaller@users.sf.net
voice: 061-2-9660-0850,
snail: PO BOX 401 Glebe NSW 2037 Australia
Checkout the Felix programming language http://felix.sf.net
next prev parent reply other threads:[~2004-12-13 13:22 UTC|newest]
Thread overview: 57+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-12-09 2:07 HENRIKSON, JEFFREY
2004-12-09 4:47 ` [Caml-list] " Jacques Garrigue
2004-12-09 6:02 ` Michael Walter
2004-12-09 11:28 ` Jacques Garrigue
2004-12-09 20:02 ` pad
2004-12-09 23:11 ` Jacques Garrigue
2004-12-10 2:30 ` skaller
2004-12-09 9:09 ` Richard Jones
2004-12-09 13:12 ` [Caml-list] " Ville-Pertti Keinonen
2004-12-10 11:59 ` Richard Jones
2004-12-10 10:52 ` [Caml-list] " Andrej Bauer
2004-12-10 12:13 ` Richard Jones
2004-12-10 23:35 ` Jacques Garrigue
2004-12-11 2:30 ` skaller
2004-12-11 14:31 ` Andrej Bauer
2004-12-11 18:13 ` Markus Mottl
2004-12-11 23:56 ` skaller
2004-12-12 2:36 ` William Lovas
2004-12-12 5:33 ` skaller
2004-12-12 19:09 ` Michael Walter
2004-12-13 0:48 ` skaller
2004-12-13 2:03 ` Michael Walter
2004-12-13 2:05 ` Michael Walter
[not found] ` <877e9a170412121844b633bb8@mail.gmail.com>
2004-12-13 2:45 ` Michael Walter
2004-12-13 6:18 ` skaller
2004-12-13 7:08 ` skaller
2004-12-13 9:56 ` Michael Walter
2004-12-13 12:59 ` skaller
2004-12-13 8:56 ` Thomas Fischbacher
2004-12-13 9:21 ` Jacques Garrigue
2004-12-13 10:05 ` Michael Walter
2004-12-13 10:29 ` Thomas Fischbacher
2004-12-13 21:16 ` Michael Walter
2004-12-13 10:20 ` Thomas Fischbacher
2004-12-13 12:09 ` Jacques Garrigue
2004-12-13 12:48 ` Thomas Fischbacher
2004-12-13 14:09 ` skaller
2004-12-13 21:39 ` Michael Walter
2004-12-13 13:22 ` skaller [this message]
2004-12-13 16:54 ` Marcin 'Qrczak' Kowalczyk
2004-12-13 18:44 ` Thomas Fischbacher
2004-12-13 10:11 ` Michael Walter
2004-12-13 11:46 ` skaller
2004-12-13 5:41 ` skaller
2004-12-13 9:29 ` Michael Walter
2004-12-13 12:30 ` skaller
2004-12-13 13:49 ` Martin Berger
2004-12-12 23:03 ` Thomas Fischbacher
2004-12-13 1:26 ` skaller
2004-12-13 8:37 ` Thomas Fischbacher
2004-12-13 10:53 ` skaller
2004-12-13 11:38 ` Martin Berger
2004-12-13 13:33 ` skaller
2004-12-13 12:01 ` Thomas Fischbacher
2004-12-13 13:41 ` skaller
2004-12-11 23:29 ` skaller
2004-12-12 0:21 ` Jacques Carette
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1102944153.2578.234.camel@pelican.wigram \
--to=skaller@users.sourceforge.net \
--cc=Thomas.Fischbacher@Physik.Uni-Muenchen.DE \
--cc=caml-list@inria.fr \
--cc=garrigue@math.nagoya-u.ac.jp \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox