On Sun, Nov 8, 2009 at 9:52 AM, Ketil Malde <ke...@malde.org> wrote:
> Eugene Kirpichov <ekirpic...@gmail.com> writes:
>
>>> In JavaScript there is a "null" value, that is the only value of the null 
>>> type.
>>> Isn't () the same thing?  The only value of the unary type?
>
>> No, () has two values: () and undefined (t.i., _|_).
>
How should I put it..?
undefined is bottom, but bottom is not undefined?

There are plenty of other constructions that are bottom. Infinite
loops, throws, errors.. common for all of them, of course, is that you
can't pattern-match on them or otherwise use them in pure code, and
they generally don't act like values.

So, can't we just say that () has a single value, namely ()? It'd make
this much simpler, and we won't have to deal with the Nihil monoid.

==

data Nihil

instance Monoid Nihil where
  mappend _ _ = undefined

-- 
Svein Ove Aas
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to