[Haskell-cafe] If you'd design a Haskell-like language, what would you do different?
Gregory Crosswhite
gcrosswhite at gmail.com
Wed Dec 21 07:30:50 CET 2011
On Dec 21, 2011, at 2:24 PM, Alexander Solla wrote:
> I would rather have an incomplete semantic, and have all the incomplete parts collapsed into something we call "bottom". We can then be smart and stay within a total fragment of the language (where bottom is guaranteed to not occur).
But part of the whole point of including bottom in our semantics in the first place is *exactly* to *enable* us to be smart enough to know when we are staying within a total fragment of the language. For example, including bottom in our semantics allows us to make and prove statements like
fst (42,_|_) = 42
and
fst _|_ = _|_
That is, as long a you know that the pair is total and that the first element is total, calling fst on it is also total regardless of whether the second value is total.
Refusing to use bottom in our semantics doesn't make life better by forcing us to stay within a total fragment of the language, it actually makes life harder by removing from us a useful tool for knowing *how* to stay within a total fragment of the language.
Cheers,
Greg
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20111221/b010186e/attachment.htm>
More information about the Haskell-Cafe
mailing list