Logs: liberachat/#haskell
| 2025-12-03 19:44:57 | → | Googulator joins (~Googulato@2a01-036d-0106-479c-d9ec-010d-f188-ffcb.pool6.digikabel.hu) |
| 2025-12-03 19:47:17 | trickard_ | is now known as trickard |
| 2025-12-03 19:55:48 | × | spew quits (~spew@user/spew) (Quit: WeeChat 4.7.2) |
| 2025-12-03 19:58:12 | <tomsmeding> | Leary: it turns out `NOINLINE [0]` yields the desired behaviour, at least on 9.8, 9.10, 9.12 and the 9.14 RC |
| 2025-12-03 19:58:24 | <tomsmeding> | (credit doesn't go to me though) |
| 2025-12-03 20:07:21 | <Leary> | tomsmeding: Weird. Any idea why? |
| 2025-12-03 20:08:03 | → | lambda_gibbon joins (~lambda_gi@208.83.175.39) |
| 2025-12-03 20:08:13 | <tomsmeding> | perhaps if GHC inlines the whole thing in one go it fuses the two lambdas before it realises something can be lifted? |
| 2025-12-03 20:08:15 | <tomsmeding> | I don't know |
| 2025-12-03 20:12:15 | × | lambda_gibbon quits (~lambda_gi@208.83.175.39) (Ping timeout: 240 seconds) |
| 2025-12-03 20:20:17 | → | merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl) |
| 2025-12-03 20:24:22 | × | sp1ff quits (~user@2601:1c2:4c00:6820::e122) (Read error: Connection reset by peer) |
| 2025-12-03 20:25:04 | × | merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 246 seconds) |
| 2025-12-03 20:25:29 | × | trickard quits (~trickard@cpe-85-98-47-163.wireline.com.au) (Read error: Connection reset by peer) |
| 2025-12-03 20:25:43 | → | trickard_ joins (~trickard@cpe-85-98-47-163.wireline.com.au) |
| 2025-12-03 20:31:21 | → | pavonia joins (~user@user/siracusa) |
| 2025-12-03 20:32:31 | trickard_ | is now known as trickard |
| 2025-12-03 20:35:46 | × | Googulator quits (~Googulato@2a01-036d-0106-479c-d9ec-010d-f188-ffcb.pool6.digikabel.hu) (Quit: Client closed) |
| 2025-12-03 20:35:47 | → | Googulator33 joins (~Googulato@2a01-036d-0106-479c-d9ec-010d-f188-ffcb.pool6.digikabel.hu) |
| 2025-12-03 20:35:55 | Googulator33 | is now known as Googulator |
| 2025-12-03 20:36:05 | → | merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl) |
| 2025-12-03 20:37:07 | × | collide2954 quits (~collide29@user/collide2954) (Quit: The Lounge - https://thelounge.chat) |
| 2025-12-03 20:39:45 | × | AlexNoo quits (~AlexNoo@85.174.183.177) (Read error: Connection reset by peer) |
| 2025-12-03 20:40:12 | → | AlexNoo joins (~AlexNoo@85.174.183.177) |
| 2025-12-03 20:40:55 | × | merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 244 seconds) |
| 2025-12-03 20:48:31 | → | euphores joins (~SASL_euph@user/euphores) |
| 2025-12-03 20:51:52 | → | merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl) |
| 2025-12-03 20:53:21 | × | Googulator quits (~Googulato@2a01-036d-0106-479c-d9ec-010d-f188-ffcb.pool6.digikabel.hu) (Quit: Client closed) |
| 2025-12-03 20:53:40 | → | Googulator joins (~Googulato@2a01-036d-0106-479c-d9ec-010d-f188-ffcb.pool6.digikabel.hu) |
| 2025-12-03 20:54:43 | × | jreicher quits (~user@user/jreicher) (Quit: In transit) |
| 2025-12-03 20:55:23 | × | sam113101 quits (~sam@modemcable200.189-202-24.mc.videotron.ca) (Read error: Connection reset by peer) |
| 2025-12-03 20:56:58 | × | merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 256 seconds) |
| 2025-12-03 21:04:37 | → | merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl) |
| 2025-12-03 21:04:55 | × | euphores quits (~SASL_euph@user/euphores) (Ping timeout: 240 seconds) |
| 2025-12-03 21:09:26 | × | merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 256 seconds) |
| 2025-12-03 21:18:20 | × | jrm quits (~jrm@user/jrm) (Quit: ciao) |
| 2025-12-03 21:19:37 | → | jrm joins (~jrm@user/jrm) |
| 2025-12-03 21:20:01 | → | merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl) |
| 2025-12-03 21:23:02 | × | jrm quits (~jrm@user/jrm) (Client Quit) |
| 2025-12-03 21:24:13 | → | jrm joins (~jrm@user/jrm) |
| 2025-12-03 21:24:44 | × | merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 256 seconds) |
| 2025-12-03 21:25:49 | <haskellbridge> | <lucabtz> I kinda wish + and times had their own typeclasses instead of being in Num |
| 2025-12-03 21:28:36 | <EvanR> | truth |
| 2025-12-03 21:29:06 | <Rembane> | Hard agree |
| 2025-12-03 21:29:31 | <EvanR> | lots of stuff has only + or * not both |
| 2025-12-03 21:29:58 | → | sam113101 joins (~sam@modemcable200.189-202-24.mc.videotron.ca) |
| 2025-12-03 21:30:15 | <EvanR> | then negative starts to make it weird |
| 2025-12-03 21:30:50 | <monochrom> | It's OK, a subclass of + that adds -, a subclass of * that adds / |
| 2025-12-03 21:31:13 | <tomsmeding> | also fromInteger separately please |
| 2025-12-03 21:31:29 | <tomsmeding> | matrices can be Num just fine except that fromInteger makes no sense (what size to return?) |
| 2025-12-03 21:31:42 | <Rembane> | Six, seven! |
| 2025-12-03 21:31:53 | <tomsmeding> | a six-by-seven matrix, it has been decided |
| 2025-12-03 21:32:13 | <haskellbridge> | <lucabtz> Yeah there should be Additive with just + and Multiplicative with just *, no inverses either I think |
| 2025-12-03 21:33:10 | <tomsmeding> | it would be most flexible if it was all split out, yes, though then you do get that you have to give 6 instance declarations to get anywhere for a number-like thing |
| 2025-12-03 21:33:31 | <Leary> | The good reason to separate `fromInteger` is to allow literals when you don't have a ring. When you do, you always have a unique homomorphism from `Integer`, so `fromInteger` makes as much sense as your `Num` instance. |
| 2025-12-03 21:34:10 | <haskellbridge> | <lucabtz> tomsmeding that could be fixed by having an alias for a set of constraints |
| 2025-12-03 21:34:12 | <tomsmeding> | Leary: do matrices form a ring? |
| 2025-12-03 21:34:52 | <haskellbridge> | <lucabtz> Num would become something like AdditiveGroup & MultiplicativeGroup & FromInteger etc. |
| 2025-12-03 21:34:58 | <tomsmeding> | lucabtz: I was talking about the declarations rather than the user side. But yes, the user side is even worse -- fortunately mostly addressed by synonyms, as you say |
| 2025-12-03 21:35:38 | → | merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl) |
| 2025-12-03 21:35:49 | <tomsmeding> | Leary: my answer would be: no, it's some kind of indexed ring. It's morally a ring, kind of, but it isn't in the strict sense, and bye goes your unique fromInteger |
| 2025-12-03 21:36:14 | <tomsmeding> | (there's probably a way to make precise exactly what it is) |
| 2025-12-03 21:36:17 | <monochrom> | I would do this. Semigroup takes one more type param, it specifies the operator. Likewise for Monoid and Group. Then you just have 3 type classes, and they cover +, negate, *, recip, and, or, ... |
| 2025-12-03 21:36:32 | <tomsmeding> | monochrom: how does that help? |
| 2025-12-03 21:36:47 | <tomsmeding> | I guess it floods the namespace less |
| 2025-12-03 21:37:00 | <tomsmeding> | you need exactly the same number of instance declarations and constraints, though |
| 2025-12-03 21:37:13 | <haskellbridge> | <lucabtz> Yeah it's the same as I'm saying where Additive = Monoid + |
| 2025-12-03 21:37:15 | <monochrom> | "instance Semigroup Sum Int", "instance Semigroup Product Int". |
| 2025-12-03 21:37:26 | <haskellbridge> | <lucabtz> And AdditiveGroup = Group + |
| 2025-12-03 21:37:47 | <tomsmeding> | monochrom: where the first parameter is a phantom parameter? |
| 2025-12-03 21:37:57 | <Leary> | tomsmeding: Square matrices of a /given dimension/ will be. If that dimension is in your type, fine. If it isn't, your other operations are screwed too. |
| 2025-12-03 21:38:02 | <tomsmeding> | and (+) :: Semigroup Sum a => a -> a -> a |
| 2025-12-03 21:38:25 | <tomsmeding> | Leary: well, the other operations are partial. |
| 2025-12-03 21:38:27 | <monochrom> | Yeah, a phantom type that specifies the binary operator. |
| 2025-12-03 21:38:40 | <tomsmeding> | I can't even suffice with a partial fromInteger -- well, one that is defined as `error` is possible, yes |
| 2025-12-03 21:38:50 | <haskellbridge> | <lucabtz> What if you want a Monoid neither of those? |
| 2025-12-03 21:38:51 | <Leary> | tomsmeding: Yep, hence "makes as much sense as your `Num`." |
| 2025-12-03 21:38:58 | <tomsmeding> | less! |
| 2025-12-03 21:39:28 | <tomsmeding> | I'd say an untyped matrix type with (+) and (*) makes some amount of sense, even if the operations are necessarily partial. I have not even a partial definition to give for fromInteger |
| 2025-12-03 21:39:58 | <tomsmeding> | (yes, if the dimensions are in the type all is fine) |
| 2025-12-03 21:40:11 | → | ljdarj1 joins (~Thunderbi@user/ljdarj) |
| 2025-12-03 21:40:27 | × | ljdarj quits (~Thunderbi@user/ljdarj) (Ping timeout: 252 seconds) |
| 2025-12-03 21:40:27 | ljdarj1 | is now known as ljdarj |
| 2025-12-03 21:40:32 | × | dhil quits (~dhil@5.151.29.137) (Ping timeout: 240 seconds) |
| 2025-12-03 21:40:47 | × | merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 265 seconds) |
| 2025-12-03 21:42:09 | × | takuan quits (~takuan@d8D86B9E9.access.telenet.be) (Remote host closed the connection) |
| 2025-12-03 21:42:25 | <tomsmeding> | https://hackage.haskell.org/package/hmatrix-0.20.2/docs/src/Numeric.Matrix.html#line-48 |
| 2025-12-03 21:42:36 | <tomsmeding> | this instance returns a 1x1 matrix in fromInteger, which is about the best you can do |
| 2025-12-03 21:43:25 | <tomsmeding> | (which is ameliorated by binary operations auto-broadcasting their operands when one of their dimensions has size 1) |
| 2025-12-03 21:43:44 | <EvanR> | tomsmeding, a zero by zero matrix |
| 2025-12-03 21:43:57 | <tomsmeding> | that makes only slightly less sense than a 1x1 matrix |
| 2025-12-03 21:44:45 | <EvanR> | it's the first choice in the list |
| 2025-12-03 21:44:51 | <EvanR> | xD |
| 2025-12-03 21:47:38 | <EvanR> | to simplify the "untyped matrix" thing, make it an infinite grid with cell 0 0 at the center |
| 2025-12-03 21:47:57 | <EvanR> | compute the answers lazily, fits any finite use case |
| 2025-12-03 21:48:39 | <EvanR> | now it's not partial and fails on you just like untyped languages |
| 2025-12-03 21:48:54 | <EvanR> | by producing nonsense when you mess up |
| 2025-12-03 21:49:12 | <EvanR> | also answers what fromInteger does |
| 2025-12-03 21:51:27 | → | merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl) |
| 2025-12-03 21:56:07 | × | merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 240 seconds) |
All times are in UTC.