Newest at the top
| 2025-12-05 09:49:21 +0100 | merijn | (~merijn@host-vr.cgnat-g.v4.dfn.nl) merijn |
| 2025-12-05 09:45:49 +0100 | <ski> | (i don't much like this kind of implicit broadcasting) |
| 2025-12-05 09:45:16 +0100 | <ski> | btw, i'd probably just define a separate function |
| 2025-12-05 09:44:39 +0100 | <ski> | it'd be annoying, if rewriting a total use, with one of the laws, would give a partial use |
| 2025-12-05 09:43:44 +0100 | <ski> | (and similarly for the other laws) |
| 2025-12-05 09:42:56 +0100 | lambda_gibbon | (~lambda_gi@2603:7080:ee00:37d8:35d4:1aac:9a2f:cd11) (Ping timeout: 256 seconds) |
| 2025-12-05 09:42:24 +0100 | <ski> | if you take assocative law, such that all applications on one side satisfies this condition, do the ones on the other side also satisfy it ? |
| 2025-12-05 09:41:05 +0100 | <lucabtz> | yep |
| 2025-12-05 09:40:49 +0100 | <ski> | (m0 == m1 || any (1 ==) [m0,m1]) && (n0 == n1 || any (1 ==) [n0,n1]) -- ? |
| 2025-12-05 09:40:41 +0100 | <lucabtz> | *instead of equality to 1 |
| 2025-12-05 09:40:28 +0100 | <lucabtz> | technically i suppose you could weaken the constraint with divisibility instead of 1, but it is not like that in numpy |
| 2025-12-05 09:39:53 +0100 | <lucabtz> | if you have say (w, 1) (w, h) the result is (w, h) and the first one is broadcasted to (w, h) by repeating the row h times over the columns |
| 2025-12-05 09:39:07 +0100 | <lucabtz> | either widths are equal or some are 1 and same for height |
| 2025-12-05 09:39:01 +0100 | merijn | (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 264 seconds) |
| 2025-12-05 09:38:20 +0100 | lambda_gibbon | (~lambda_gi@2603:7080:ee00:37d8:35d4:1aac:9a2f:cd11) |
| 2025-12-05 09:37:29 +0100 | <ski> | when is it possible/impossible ? |
| 2025-12-05 09:35:41 +0100 | <lucabtz> | maybe it is just better to have another function for all of this so i can put HasCallStack too, even if it will have the same signature as <*> |
| 2025-12-05 09:35:02 +0100 | <lucabtz> | by partial i mean it will call error if broadcasting is not possible |
| 2025-12-05 09:33:36 +0100 | <lucabtz> | pure can just embed in a 1x1 Grid |
| 2025-12-05 09:33:33 +0100 | merijn | (~merijn@host-vr.cgnat-g.v4.dfn.nl) merijn |
| 2025-12-05 09:33:26 +0100 | <lucabtz> | i need a function Grid (a -> b) -> Grid a -> Grid b which is <*>, but this needs to work only if broadcasting is possible (so for some conditions over the grids width and height) |
| 2025-12-05 09:32:19 +0100 | <lucabtz> | i have a type Grid a which is a grid of data and i want something similar to numpy's broadcasting |
| 2025-12-05 09:30:55 +0100 | <lucabtz> | dminuoso no both pure and <*>, but <*> will be a partial function |
| 2025-12-05 09:30:11 +0100 | tromp | (~textual@2001:1c00:3487:1b00:4ec:c6c9:2447:6676) |
| 2025-12-05 09:25:12 +0100 | <[exa]> | "it works" |
| 2025-12-05 09:24:53 +0100 | <dminuoso> | Of course. |
| 2025-12-05 09:24:43 +0100 | <[exa]> | dminuoso: well that gives kinda circular definition of approved :D |
| 2025-12-05 09:22:49 +0100 | merijn | (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 264 seconds) |
| 2025-12-05 09:22:10 +0100 | <[exa]> | naturally... |
| 2025-12-05 09:21:57 +0100 | <lambdabot> | *Exception: arithmetic underflow |
| 2025-12-05 09:21:53 +0100 | <ski> | > (0 :: Natural) - 1 |
| 2025-12-05 09:19:24 +0100 | <jackdk> | I personally also shy away from using `class Pointed`, for reasons Ed writes about at https://wiki.haskell.org/Why_not_Pointed%3F |
| 2025-12-05 09:18:57 +0100 | <dminuoso> | Plus, you may later refactor and reuse some other library that imposes a `Applicative` constraint - it may not even be obvious that you're tapping into a bottom. It's a mine waiting to be stepped on. |
| 2025-12-05 09:18:03 +0100 | merijn | (~merijn@host-vr.cgnat-g.v4.dfn.nl) merijn |
| 2025-12-05 09:17:54 +0100 | <jackdk> | lucabtz: I would write code against a different typeclass (class Apply from semigroupoids, for example) or provide a different named function. The benefit of a programming culture where people only write complete and lawful instances, is that anyone writing polymorphic code can expect their code to work for any instance, instead of for "any instance except a growing list of exceptions" |
| 2025-12-05 09:17:44 +0100 | <dminuoso> | [exa]: Of course "approved" is quite a nebulous term. If "approved" means "perfectly safe", that statement is absolutely correct. |
| 2025-12-05 09:16:54 +0100 | <[exa]> | lucabtz: probably depends on how much partial |
| 2025-12-05 09:16:08 +0100 | <[exa]> | ...is that a joke? (can't tell) |
| 2025-12-05 09:16:01 +0100 | <[exa]> | reading the wiki here https://wiki.haskell.org/index.php?title=Top_level_mutable_state it says "In contrast, other 'approved' uses of unsafePerformIO are perfectly safe." |
| 2025-12-05 09:14:53 +0100 | <dminuoso> | And in case you just care about pure, https://hackage.haskell.org/package/pointed-5.0.5/docs/Data-Pointed.html#t:Pointed |
| 2025-12-05 09:14:21 +0100 | <dminuoso> | https://hackage.haskell.org/package/semigroupoids-6.0.1/docs/Data-Functor-Apply.html#t:Apply |
| 2025-12-05 09:13:34 +0100 | <dminuoso> | lucabtz: Do you just intend to define <*> but not pure? |
| 2025-12-05 09:12:28 +0100 | Sgeo | (~Sgeo@user/sgeo) (Read error: Connection reset by peer) |
| 2025-12-05 09:12:13 +0100 | annamalai | (~annamalai@157.32.204.27) annamalai |
| 2025-12-05 09:11:23 +0100 | divlamir | (~divlamir@user/divlamir) (Ping timeout: 265 seconds) |
| 2025-12-05 09:10:37 +0100 | Googulator | (~Googulato@2a01-036d-0106-479c-d9ec-010d-f188-ffcb.pool6.digikabel.hu) (Ping timeout: 250 seconds) |
| 2025-12-05 09:10:20 +0100 | <lucabtz> | is it fine to have an Applicative instance be partial? or it is better i just make separate functions with same signatures as Applicative |
| 2025-12-05 09:10:11 +0100 | xff0x | (~xff0x@fsb6a9491c.tkyc517.ap.nuro.jp) |
| 2025-12-05 09:10:11 +0100 | chencheng | (~chencheng@38.207.158.7) (Ping timeout: 250 seconds) |
| 2025-12-05 09:08:15 +0100 | xff0x | (~xff0x@fsb6a9491c.tkyc517.ap.nuro.jp) (Ping timeout: 245 seconds) |