[Haskell-beginners] distinguished types
rick at rickmurphy.org
Sat Feb 13 15:29:55 EST 2010
Greetings and thanks in advance for all the great work on this list.
Being new Haskell I hope someone could help me clarify the use of the
term *distinguished type* in relation to Haskell 98 as well as confirm
my understanding of the construction of a distinguished type in GHC.
I understand from  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.  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?
More specifically, would
> data F = F deriving (Show)
create a distinguished type F in Haskell?
I've searched the Haskell Report, but there's no indication that the
report recognizes distinguished types. Is that true and if so why ?
More information about the Beginners