[Haskell-beginners] distinguished types

Daniel Fischer daniel.is.fischer at web.de
Sat Feb 13 16:15:03 EST 2010


Am Samstag 13 Februar 2010 22:03:20 schrieb Felipe Lessa:
> On Sat, Feb 13, 2010 at 03:29:55PM -0500, Rick Murphy wrote:
> > I understand from [1] that a distinguised type is defined as a type
> > with only one non-bottom value and that value is in fact identical
> > to the name of the type. [1] provides the unit type () as an example
> > of a Haskell distinguished type.
> >
> > Would it be accurate to say that an approach to creating
> > distinguished types in Haskell is to create data types with a single
> > constructor whose name is identical to the data type name?
>
> Well, I don't have not even one milliOleg.

I must confess, I don't know how much type-fu a milliOleg denotes.

> That said, I think he used "distinguished" to mean that it is
> a "curious" data type included in the language.

Yep, "distinguished" as in "special" (often plays a role akin to void in 
C/Java).

> Maybe he also meant that, at least in
> Haskell, the type may receive special notation (you can't say
> 'data () = ()').
>
> HTH,
>
> --
> Felipe.


More information about the Beginners mailing list