[Haskell-beginners] distinguished types

Felipe Lessa felipe.lessa at gmail.com
Sat Feb 13 16:03:20 EST 2010


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.  That said, I think he
used "distinguished" to mean that it is a "curious" data type
included in the language.  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