[Haskell-cafe] Learn You a Haskell for Great Good - a few doubts

Alexander Solla alex.solla at gmail.com
Fri Mar 4 22:33:20 CET 2011

On Thu, Mar 3, 2011 at 10:14 PM, wren ng thornton <wren at freegeek.org> wrote:

> On 3/3/11 2:58 AM, Antti-Juhani Kaijanaho wrote:
>> On Thu, Mar 03, 2011 at 12:29:44PM +0530, Karthick Gururaj wrote:
>>> Thanks - is this the same "unit" that accompanies IO in "IO ()" ? In
>>> any case, my question is answered since it is not a tuple.
>> It can be viewed as the trivial 0-tuple.
> Except that this is problematic since Haskell doesn't have 1-tuples (which
> would be distinct from plain values in that they have an extra bottom).
I don't get this line of thought.  I understand what you're saying, but why
even bother trying to distinguish between bottoms when they can't be
compared by equality, or even computed? The type (forall a . a) doesn't
contain any values!   It is empty, and so is a subset of any other type.  If
you choose to interpret all bottoms as being the same non-existent,
unquantifiable (in the language of Haskell) "proto-value", you get the
isomorphism between types a and (a), as types.  Indeed, those are the
semantics in use by the language.  A value written (a) is interpreted as a.
 A type written (a) is interpreted as a.

In an idealized world, yes, unit can be thought of as the nullary product
> which serves as left- and right-identity for the product bifunctor.
> Unfortunately, Haskell's tuples aren't quite products.[1]

I'm not seeing this either.  (A,B) is certainly the Cartesian product of A
and B.  In what sense are you using "product" here? Is your complaint a
continuation of your previous (implicit) line of thought regarding distinct
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20110304/2f5a6296/attachment.htm>

More information about the Haskell-Cafe mailing list