Fwd: Fwd: [Haskell-cafe] Haskell as a religion
Alberto G. Corona
agocorona at gmail.com
Fri Dec 19 06:05:55 EST 2008
---------- Forwarded message ----------
From: Alberto G. Corona <agocorona at gmail.com>
Date: 2008/12/19
Subject: Re: Fwd: [Haskell-cafe] Haskell as a religion
To: Dan Piponi <dpiponi at gmail.com>
As far as I know, const only protect from updates that the compiler can
detect at compilation time. Moreover, the C/C++ code does not make use of
true referential transparency properties, for example const a=1; const b=a
perform a copy of content of a to b . In haskell a=1; b=a make b to point
to a directly.
2008/12/19 Dan Piponi <dpiponi at gmail.com>
On Thu, Dec 18, 2008 at 4:15 PM, Henning Thielemann
> <schlepptop at henning-thielemann.de> wrote:
>
> > In C/C++ referential transparent functions code can be declared by
> > appending a 'const' to the prototype, right?
>
> For one thing, some fields in a const C++ object can be explicitly set
> mutable. mutable is sometimes used in C++ a similar way to
> unsafePerformIO in Haskell. You have something that uses mutability in
> its internals but that mutability shouldn't be observable to the
> caller. In both cases you have no means of actually ensuring that the
> mutability is actually unobservable.
> --
> Dan
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20081219/aabb58e7/attachment.htm
More information about the Haskell-Cafe
mailing list