Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.haskell > #646
| From | ram@zedat.fu-berlin.de (Stefan Ram) |
|---|---|
| Newsgroups | comp.lang.haskell |
| Subject | Re: Types |
| Date | 2026-06-11 23:05 +0000 |
| Organization | Stefan Ram |
| Message-ID | <sets-20260611235632@ram.dialup.fu-berlin.de> (permalink) |
| References | <types-20260419194256@ram.dialup.fu-berlin.de> <110fa87$1np5k$5@dont-email.me> |
Tristan Wibberley <tristan.wibberley+netnews2@alumni.manchester.ac.uk> wrote or quoted: >On 19/04/2026 19:51, Stefan Ram wrote: >>-- Both types have the exact same "extension" (two Integers) >>data Apple = Apple Int Int >>data Orange = Orange Int Int >Why do you call the two integers the "extension" ? In set theory, two sets are considered equal if and only if they contain the same elements, regardless of how they were defined or named. This concept is also called "extensional equality", because a set is defined by the elements to which it /extends/. Even though Apple and Orange have different names and may have different conceptual purposes in the mind of the programmer, both have the same set of possible values (a pair of integers). As the author of that book claimed that types /are/ sets he must then accept that set theoretic equality applies to these sets. In set theory, two sets that both contain all pairs of integers and nothing else are equal, even if they were introduced using two different names and two different descriptions. So when that comment said, "both types have the exact same 'extension'", it meant to remind the reader of the fact that if the types are deemed to be sets, they should be deemed to be equal. But Haskell does /not/ deem them to be equal, which shows that Haskell types are /not/ mathematical sets.
Back to comp.lang.haskell | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Types ram@zedat.fu-berlin.de (Stefan Ram) - 2026-04-19 18:51 +0000
Re: Types Jonathan Lamothe <jonathan@jlamothe.net> - 2026-04-19 17:17 -0400
Re: Types ram@zedat.fu-berlin.de (Stefan Ram) - 2026-04-20 10:32 +0000
Re: Types Paul Rubin <no.email@nospam.invalid> - 2026-04-20 11:19 -0700
Re: Types ram@zedat.fu-berlin.de (Stefan Ram) - 2026-04-20 19:32 +0000
Re: Types Tristan Wibberley <tristan.wibberley+netnews2@alumni.manchester.ac.uk> - 2026-06-11 22:48 +0100
Re: Types 8128 <lambda@dr.com> - 2026-05-30 21:50 +0000
Re: Types Tristan Wibberley <tristan.wibberley+netnews2@alumni.manchester.ac.uk> - 2026-06-11 22:44 +0100
Re: Types ram@zedat.fu-berlin.de (Stefan Ram) - 2026-06-11 23:05 +0000
Re: Types Tristan Wibberley <tristan.wibberley+netnews2@alumni.manchester.ac.uk> - 2026-06-12 13:42 +0100
Re: Types ram@zedat.fu-berlin.de (Stefan Ram) - 2026-06-12 13:17 +0000
Re: Types Tristan Wibberley <tristan.wibberley+netnews2@alumni.manchester.ac.uk> - 2026-06-12 15:17 +0100
csiph-web