2025/12/05

Newest at the top

2025-12-05 09:57:45 +0100acidjnk(~acidjnk@p200300d6e7171916e981ce74d2c64e2e.dip0.t-ipconnect.de) acidjnk
2025-12-05 09:55:39 +0100 <lucabtz> though i agree it would make more sense to keep it a separate function
2025-12-05 09:55:18 +0100 <lucabtz> <*> is not associative
2025-12-05 09:55:06 +0100 <lucabtz> im a bit confused by what associative law you are speaking about
2025-12-05 09:54:32 +0100peterbecich(~Thunderbi@172.222.148.214) (Ping timeout: 244 seconds)
2025-12-05 09:53:55 +0100merijn(~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 265 seconds)
2025-12-05 09:52:46 +0100tzh(~tzh@c-76-115-131-146.hsd1.or.comcast.net) (Quit: zzz)
2025-12-05 09:49:21 +0100merijn(~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 +0100lambda_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 +0100merijn(~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 264 seconds)
2025-12-05 09:38:20 +0100lambda_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 +0100merijn(~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 +0100tromp(~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 +0100merijn(~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 +0100merijn(~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 +0100Sgeo(~Sgeo@user/sgeo) (Read error: Connection reset by peer)