Newest at the top
2025-02-08 11:15:38 +0100 | JuanDaugherty | ColinRobinson |
2025-02-08 11:12:52 +0100 | Sgeo | (~Sgeo@user/sgeo) (Read error: Connection reset by peer) |
2025-02-08 11:12:19 +0100 | lxsameer | (~lxsameer@Serene/lxsameer) lxsameer |
2025-02-08 11:04:07 +0100 | euleritian | (~euleritia@ip4d17fae8.dynamic.kabel-deutschland.de) |
2025-02-08 11:03:49 +0100 | euleritian | (~euleritia@dynamic-176-006-128-136.176.6.pool.telefonica.de) (Read error: Connection reset by peer) |
2025-02-08 11:03:04 +0100 | gabiruh | (~gabiruh@vps19177.publiccloud.com.br) gabiruh |
2025-02-08 11:01:47 +0100 | gabiruh | (~gabiruh@vps19177.publiccloud.com.br) (Ping timeout: 252 seconds) |
2025-02-08 10:56:21 +0100 | JuanDaugherty | (~juan@user/JuanDaugherty) JuanDaugherty |
2025-02-08 10:53:07 +0100 | __monty__ | (~toonn@user/toonn) toonn |
2025-02-08 10:48:53 +0100 | paddymahoney | (~paddymaho@pool-99-250-10-137.cpe.net.cable.rogers.com) |
2025-02-08 10:41:29 +0100 | alfiee | (~alfiee@user/alfiee) (Ping timeout: 260 seconds) |
2025-02-08 10:41:07 +0100 | remedan | (~remedan@ip-62-245-108-153.bb.vodafone.cz) remedan |
2025-02-08 10:38:00 +0100 | <tomsmeding> | I want an exception effect system so that I can statically determine whether an IO operation can throw |
2025-02-08 10:37:49 +0100 | AlexZenon | (~alzenon@178.34.151.30) |
2025-02-08 10:37:25 +0100 | <tomsmeding> | never mind the leagues of other partial functions in not-Prelude that don't have an x-partial warning |
2025-02-08 10:37:07 +0100 | alfiee | (~alfiee@user/alfiee) alfiee |
2025-02-08 10:37:05 +0100 | <tomsmeding> | you could even defend this sizeOfListElt as "I'm only turning off the partiality warning in this separate file, so I have to watch out more here, but there's little code so it's easy to audit" |
2025-02-08 10:36:43 +0100 | sprotte24 | (~sprotte24@p200300d16f1e3a00501959556750eb7a.dip0.t-ipconnect.de) |
2025-02-08 10:36:15 +0100 | remedan | (~remedan@ip-62-245-108-153.bb.vodafone.cz) (Quit: Bye!) |
2025-02-08 10:35:58 +0100 | <peutri> | mmm good point actually |
2025-02-08 10:35:55 +0100 | <tomsmeding> | put `sizeOfListElt :: [a] -> Int ; sizeOfListElt = sizeOf . head` in a file with -Wno-x-partial? |
2025-02-08 10:35:50 +0100 | <peutri> | oh sorry misread |
2025-02-08 10:35:11 +0100 | <peutri> | no, but it's a big file |
2025-02-08 10:35:02 +0100 | <tomsmeding> | in what situation is this warning going to help you? |
2025-02-08 10:34:46 +0100 | <peutri> | I want localized warning shunning :'( |
2025-02-08 10:34:33 +0100 | <tomsmeding> | and probably add -Wno-x-partial (or what was it) to the cabal file |
2025-02-08 10:34:30 +0100 | <peutri> | “function” overload. That's 1) functionality 2) signature match |
2025-02-08 10:34:24 +0100 | <tomsmeding> | I would accept your sizeOf (head) code in code review :p |
2025-02-08 10:33:49 +0100 | <peutri> | I mean, I'm not using it for the function at all, it's just the only [a]->a function I could think of |
2025-02-08 10:33:47 +0100 | AlexZenon | (~alzenon@178.34.151.30) (Ping timeout: 268 seconds) |
2025-02-08 10:33:19 +0100 | <tomsmeding> | if you don't know 'head' is partial, you should think about what it does :p |
2025-02-08 10:32:46 +0100 | tomsmeding | personally feels that this head-is-partial warning is not helpful -- indeed, head is partial, but the programmer knows that, and the sign that something is off (or to be manually checked) is right there in the code: "head" |
2025-02-08 10:31:18 +0100 | <tomsmeding> | and retain the connection between the list elements and the sizeOf call that your head code had, but the undefined code lost |
2025-02-08 10:30:59 +0100 | <tomsmeding> | now you can pass in your list directly to this sizeOf' |
2025-02-08 10:30:53 +0100 | <tomsmeding> | note the P -> p |
2025-02-08 10:30:50 +0100 | <tomsmeding> | sizeOf' :: forall a. proxy a -> Int ; sizeOf' _ = sizeOf (Prelude.undefined :: a) |
2025-02-08 10:30:45 +0100 | <tomsmeding> | ooh |
2025-02-08 10:30:45 +0100 | <peutri> | oh your thing too |
2025-02-08 10:30:32 +0100 | <peutri> | I think I'm going to end up defining some term proxy alias in the end |
2025-02-08 10:30:21 +0100 | <tomsmeding> | sizeOf' :: forall a. Proxy a -> Int ; sizeOf' _ = sizeOf (Prelude.undefined :: a) |
2025-02-08 10:30:07 +0100 | <peutri> | in a “You have undefineds remaining in your code” kind of way |
2025-02-08 10:29:51 +0100 | <peutri> | but I can use Prelude's I guess |
2025-02-08 10:29:42 +0100 | <tomsmeding> | in what way? |
2025-02-08 10:29:39 +0100 | <peutri> | “but then Relude yells at me” |
2025-02-08 10:29:33 +0100 | <tomsmeding> | (for the right a, that is) |
2025-02-08 10:29:26 +0100 | <tomsmeding> | undefined :: a |
2025-02-08 10:29:22 +0100 | <peutri> | any common solution out there? |
2025-02-08 10:29:16 +0100 | <peutri> | yup |
2025-02-08 10:29:12 +0100 | <tomsmeding> | peutri: you're running into the unfortunate design of sizeOf |
2025-02-08 10:28:55 +0100 | <peutri> | I could put some (undefined :: a), but then Relude yells at me |