[Haskell-beginners] distinguished types
Rick Murphy
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 [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?
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 ?
1. http://okmij.org/ftp/Scheme/misc.html
--
Rick
cell: 703-201-9129
web: http://www.rickmurphy.org
blog: http://phaneron.rickmurphy.org
More information about the Beginners
mailing list