Specific denotations for pure types
Conal Elliott
conal at conal.net
Fri Mar 20 21:31:20 EDT 2009
On Fri, Mar 20, 2009 at 6:11 PM, John Meacham <john at repetae.net> wrote:
> On Fri, Mar 20, 2009 at 12:02:15PM -0700, Conal Elliott wrote:
> > I just learned on #haskell that Int has implementation/machine-dependent
> > semantics. I'd always assumed that pure (non-imperative) types have
> > specific denotational models, so that for instance the denotation of
> > something of type Int is either bottom or a (smallish) integer. Since
> > precise & simple denotation is at the heart of how I think about
> > programming, and Haskell is my favorite language, I'm startled and
> > disappointed. I knew we didn't have a denotational semantics for
> Haskell,
> > but I'd previously assumed it was just a matter of working out the
> details.
>
> in jhc and ghc at least, they are expressed directly in haskell as
> standard data types with a single unboxed component.
>
> > data Int = I Bits32_
>
> Where Bits32_ is a direct unboxed representation of a 32 bit quantity. The
> data
> declaration behaves just like any other haskell data declaration and
> hence follows the same lazy semantics. Of course, this may not help as you
> perhaps need to define the meaning of the unboxed value inside the Int
> box, but it at least seperates the 'lazy' aspect of Int from its
> underlying representation and primitives.
>
> John
Oh -- not one version of Int for 32-bit execution and another version for
64-bit execution? Seen on #haskell today:
<mux> > maxBound :: Int
> <lambdabot> 9223372036854775807
>
- Conal
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-prime/attachments/20090320/44ce7505/attachment.htm
More information about the Haskell-prime
mailing list