Newest at the top
2024-09-21 11:43:27 +0200 | <tomsmeding> | as does typescript |
2024-09-21 11:43:23 +0200 | <tomsmeding> | python also "has" union types |
2024-09-21 11:43:18 +0200 | <tomsmeding> | the haskell source language has sum types, and no union types; C has union types and no sum types |
2024-09-21 11:42:59 +0200 | <Inst> | ah, and that's why Cmm can't do it, and thus haskell can't |
2024-09-21 11:42:40 +0200 | <tomsmeding> | union types do not have a tag, sum types do |
2024-09-21 11:42:34 +0200 | <tomsmeding> | Inst: do you mean sum types or union types? |
2024-09-21 11:42:24 +0200 | <Inst> | i'd rather have sum types (i.e, C union types) with the newtype transparency |
2024-09-21 11:41:38 +0200 | <ski> | Hugs has restrricted type synonyms (like in the MLs) |
2024-09-21 11:41:36 +0200 | <Inst> | but the two characteristics of newtypes are, no sum types, and only one field allowed |
2024-09-21 11:41:30 +0200 | merijn | (~merijn@204-220-045-062.dynamic.caiway.nl) (Ping timeout: 246 seconds) |
2024-09-21 11:40:59 +0200 | <Inst> | also iirc there's some freaky laziness-related quirkiness there as well, i.e, the constructor doesn't exist and when you evaluate for the constructor you're also evaluating the underlying term, iirc |
2024-09-21 11:40:34 +0200 | <Inst> | i mean that newtype is just transparent, it's effectively a type synonym that's enforced only on the type level |
2024-09-21 11:37:21 +0200 | CiaoSen | (~Jura@2a05:5800:22d:f000:ca4b:d6ff:fec1:99da) |
2024-09-21 11:36:49 +0200 | merijn | (~merijn@204-220-045-062.dynamic.caiway.nl) |
2024-09-21 11:36:19 +0200 | random-jellyfish | (~developer@user/random-jellyfish) (Quit: Leaving) |
2024-09-21 11:30:05 +0200 | <tomsmeding> | at least it still behaves properly with the rest of the language, contrary to existentials :p |
2024-09-21 11:29:43 +0200 | <tomsmeding> | question is whether that's worth it |
2024-09-21 11:29:04 +0200 | <tomsmeding> | you could make it a GADT and give it a type parameter that is different for each constructor |
2024-09-21 11:28:46 +0200 | <tomsmeding> | have a type that allows just one of the constructors? |
2024-09-21 11:28:28 +0200 | <tomsmeding> | Inst: what do you mean? |
2024-09-21 11:28:19 +0200 | target_i | (~target_i@user/target-i/x-6023099) |
2024-09-21 11:27:15 +0200 | <Inst> | i'm more annoyed that you can't newtype constructors for these types of sumtypes |
2024-09-21 11:26:03 +0200 | merijn | (~merijn@204-220-045-062.dynamic.caiway.nl) (Ping timeout: 265 seconds) |
2024-09-21 11:21:01 +0200 | merijn | (~merijn@204-220-045-062.dynamic.caiway.nl) |
2024-09-21 11:20:50 +0200 | morb | (~morb@pool-108-41-100-120.nycmny.fios.verizon.net) (Ping timeout: 255 seconds) |
2024-09-21 11:12:03 +0200 | <tomsmeding> | but if you're in that world, you tend to know it |
2024-09-21 11:11:44 +0200 | <tomsmeding> | mind you, exceptions exist, especially if your types have some GADT-like type parameters and you're doing some computations that cannot (or should not) be fully reflected on the type level |
2024-09-21 11:10:34 +0200 | merijn | (~merijn@204-220-045-062.dynamic.caiway.nl) (Ping timeout: 260 seconds) |
2024-09-21 11:10:16 +0200 | <tomsmeding> | Inst: what ski posted, but also just that they tend to make life more annoying while not actually helping much |
2024-09-21 11:09:25 +0200 | srazkvt | (~sarah@user/srazkvt) (Client Quit) |
2024-09-21 11:09:00 +0200 | srazkvt | (~sarah@user/srazkvt) |
2024-09-21 11:05:15 +0200 | merijn | (~merijn@204-220-045-062.dynamic.caiway.nl) |
2024-09-21 11:03:53 +0200 | Sgeo | (~Sgeo@user/sgeo) (Read error: Connection reset by peer) |
2024-09-21 10:59:22 +0200 | morb | (~morb@pool-108-41-100-120.nycmny.fios.verizon.net) |
2024-09-21 10:56:55 +0200 | tromp | (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) |
2024-09-21 10:56:35 +0200 | merijn | (~merijn@204-220-045-062.dynamic.caiway.nl) (Ping timeout: 252 seconds) |
2024-09-21 10:55:33 +0200 | __monty__ | (~toonn@user/toonn) |
2024-09-21 10:51:37 +0200 | merijn | (~merijn@204-220-045-062.dynamic.caiway.nl) |
2024-09-21 10:50:31 +0200 | <Inst> | oh fine, i'll do it the old fashioned way with a sum type :( |
2024-09-21 10:45:38 +0200 | morb | (~morb@pool-108-41-100-120.nycmny.fios.verizon.net) (Ping timeout: 248 seconds) |
2024-09-21 10:42:13 +0200 | random-jellyfish | (~developer@user/random-jellyfish) |
2024-09-21 10:40:49 +0200 | merijn | (~merijn@204-220-045-062.dynamic.caiway.nl) (Ping timeout: 260 seconds) |
2024-09-21 10:40:20 +0200 | morb | (~morb@pool-108-41-100-120.nycmny.fios.verizon.net) |
2024-09-21 10:38:12 +0200 | gary_borg | (~gary_borg@144.6.194.76) (Killed (ozone (No Spam))) |
2024-09-21 10:36:27 +0200 | tromp | (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…) |
2024-09-21 10:35:50 +0200 | merijn | (~merijn@204-220-045-062.dynamic.caiway.nl) |
2024-09-21 10:35:02 +0200 | <lambdabot> | "Haskell Antipattern: Existential Typeclass" by Luke Palmer at <https://web.archive.org/web/20220121105027/https://lukepalmer.wordpress.com/2010/01/24/haskell-ant…> |
2024-09-21 10:35:02 +0200 | <ski> | @where existential-antipattern |
2024-09-21 10:31:36 +0200 | <Inst> | tomsmeding: why are existential types a bad idea? |
2024-09-21 10:29:10 +0200 | econo_ | (uid147250@id-147250.tinside.irccloud.com) (Quit: Connection closed for inactivity) |