[Haskell-beginners] Empty type

Brent Yorgey byorgey at seas.upenn.edu
Sun Oct 27 19:12:03 UTC 2013


On Sat, Oct 26, 2013 at 03:12:36AM +0700, Kim-Ee Yeoh wrote:
> On Sat, Oct 26, 2013 at 12:26 AM, Nicholas Vanderweit <
> nick.vanderweit at gmail.com> wrote:
> 
> > Or, alternatively, using fix from Data.Function:
> >
> > fix NotVoid
> >
> 
> Yes, and all of them are indistinguishable from bottom or 'undefined ::
> forall a. a', the ghost that inhabits all types, including the empty one:
> Void.

No, Nicholas was using NotVoid, which I defined as

  data NotVoid = NotVoid NotVoid

in this case fix NotVoid *is* distinguishable from bottom. But if
NotVoid is defined using newtype, it is not distinguishable.

> 
> What trips up beginners is the interpretation of indistinguishable-ness. At
> the level of denotational design, 'undefined' and 'error "(sadface)"' are
> to be treated as equal, although beginners would point out: "hey look, I
> get different output!"
> 
> Call it denotational design, or call it beautiful FP modelling, this stuff
> is really where it's at.
> 
> -- Kim-Ee

> _______________________________________________
> Beginners mailing list
> Beginners at haskell.org
> http://www.haskell.org/mailman/listinfo/beginners



More information about the Beginners mailing list