[Haskell-cafe] Re: Laws and partial values
conal at conal.net
Sat Jan 24 18:48:21 EST 2009
Hm. Isn't _|_ simply, by definition, the bottom (least) element in an
ordering? I see merit in Haskell's choice that () /= _|_, but so far I'm
not persuaded that it's the only possible choice.
On Sat, Jan 24, 2009 at 1:47 PM, Lennart Augustsson
<lennart at augustsson.net>wrote:
> You can dream up any semantics you like about bottom, like it has to
> be () for the unit type.
> But it's simply not true. I suggest you do some cursory study of
> denotational semantics and domain theory.
> Ordinary programming languages include non-termination, so that has to
> be captured somehow in the semantics.
> And that's what bottom does.
> -- Lennart
> On Sat, Jan 24, 2009 at 9:31 PM, Thomas Davie <tom.davie at gmail.com> wrote:
> > On 24 Jan 2009, at 22:19, Henning Thielemann wrote:
> >> On Sat, 24 Jan 2009, Thomas Davie wrote:
> >>> On 24 Jan 2009, at 21:31, Dan Doel wrote:
> >>>> For integers, is _|_ equal to 0? 1? 2? ...
> >>> Hypothetically (as it's already been pointed out that this is not the
> >>> case in Haskell), _|_ in the integers would not be known, until it
> >>> more defined. I'm coming at this from the point of view that bottom
> >>> contain all the information we could possibly know about a value while
> >>> still being the least value in the set.
> >>> In such a scheme, bottom for Unit would be (), as we always know that
> >>> value in that type is (); bottom for pairs would be (_|_, _|_), as all
> >>> look like that (this incidentally would allow fmap and second to be
> equal on
> >>> pairs); bottom for integers would contain no information, etc.
> >> Zero- and one-constructor data types would then significantly differ
> >> two- and more-constructor data types, wouldn't they?
> > Yes, they would, but not in any way that's defined, or written in, the
> > that they have a nice property of being able to tell something about what
> > bottom looks like is rather nice actually.
> > Bob
> > _______________________________________________
> > Haskell-Cafe mailing list
> > Haskell-Cafe at haskell.org
> > http://www.haskell.org/mailman/listinfo/haskell-cafe
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Haskell-Cafe