
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

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.

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.

Hello Rick
I suspect that in the context of Oleg's piece, a "distinguished type"
is merely a type that can be distinguished rather than a common
concept like say a "dynamic type" or a "sum type". As he mentions
further some types can have only one value such as Haskell's unit type
- ().
I can't find a definition for "distinguished type" in any of the
programming books I've checked: various Haskell ones, Pierce's TAPL,
and and various Scheme ones - Friedman, Wand and Haynes's EoPL, Lisp
in Small Pieces and Springer and Friedman's Scheme and the Art of
Programming; nor from a few searches on the web.
Best wishes
Stephen
On 13 February 2010 20:29, Rick Murphy
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.
participants (4)
-
Daniel Fischer
-
Felipe Lessa
-
Rick Murphy
-
Stephen Tetley