2025/12/28

Newest at the top

2025-12-28 06:39:28 +0100 <ski> yea, sounds like record of operations is more sensible, then
2025-12-28 06:39:17 +0100 <iqubic> Essentially, I'm trying to model simple combinatorial games like "nim" where I can write a function like "nextMoves :: a -> [a]", but then I realized that different games might have the type for the state variable.
2025-12-28 06:37:35 +0100 <haskellbridge> <slack1256> Record of functions can be used everywhere else. Most importantly where the provenance is a deciding factor on what the functions should do, not just the type. This is a fine concept, these records of functions are modules as ocaml sense
2025-12-28 06:37:15 +0100merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 240 seconds)
2025-12-28 06:36:56 +0100 <iqubic> The more I actually think about this, the more it makes sense to use a record of functions.
2025-12-28 06:36:37 +0100 <iqubic> In the thing that I'm modelling, the same type could very easily have different implementations. And I don't want to jump through newtype wrappers like Sum and Product for the two different Monoids over integers.
2025-12-28 06:32:32 +0100merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) merijn
2025-12-28 06:32:22 +0100 <ski> yea, you also most likely should not be making a type class, unless you already have at least two different instances in mind
2025-12-28 06:31:31 +0100 <haskellbridge> <slack1256> In summary, you had abstraction power via laws or you had a simple model ln the instances
2025-12-28 06:31:18 +0100 <ski> does the type determine a canonical instance ? or would it make sense to want to pass different records, at different times, for the same type ?
2025-12-28 06:30:52 +0100 <haskellbridge> <slack1256> The second case was that the class admitted obvious instances. For example show and read. Foldable was obvious even if kind of adhoc because `toList` was the only real method and everything else was a more efficient way to avoid the conversion to lists.
2025-12-28 06:29:31 +0100spew(~spew@user/spew) (Quit: nyaa~)
2025-12-28 06:29:23 +0100 <haskellbridge> <slack1256> Iqubic: the standard answer some years ago was that if you could give "algebraic laws" relating the operations between themselves or super classes you were in the right path
2025-12-28 06:05:55 +0100merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 246 seconds)
2025-12-28 06:03:27 +0100 <iqubic> I have a Haskell design question. How do I decide if I should make a typeclass to describe a particular constraint or just use and pass around a record of functions.
2025-12-28 06:01:20 +0100iqubic(~sophia@2601:602:9203:1660:c40f:f996:91cc:d34) iqubic
2025-12-28 06:01:16 +0100merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) merijn
2025-12-28 05:55:39 +0100merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 250 seconds)
2025-12-28 05:51:08 +0100merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) merijn
2025-12-28 05:49:31 +0100Pozyomka(~pyon@user/pyon) (Quit: bbl)
2025-12-28 05:40:07 +0100merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 240 seconds)
2025-12-28 05:35:22 +0100merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) merijn
2025-12-28 05:28:25 +0100Hafydd(~Hafydd@user/hafydd) Hafydd
2025-12-28 05:24:15 +0100merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 240 seconds)
2025-12-28 05:19:35 +0100merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) merijn
2025-12-28 05:15:25 +0100 <monochrom> oh heh
2025-12-28 05:14:21 +0100 <Leary> (turns out I'd forgotten to wait on forked threads, so criterion was measuring a load of nonsense)
2025-12-28 05:08:19 +0100merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 260 seconds)
2025-12-28 05:07:52 +0100 <monochrom> But if variance is negative, that's severely deflated or imploded, not inflated. >:)
2025-12-28 05:06:37 +0100 <Leary> Or that.
2025-12-28 05:06:30 +0100 <lambdabot> -9223372036854775808
2025-12-28 05:06:29 +0100 <Leary> > minBound :: Int
2025-12-28 05:06:16 +0100 <monochrom> That. :)
2025-12-28 05:06:12 +0100 <lambdabot> 9223372036854775808
2025-12-28 05:06:11 +0100 <monochrom> > 2^63
2025-12-28 05:04:27 +0100 <monochrom> That number looks awfully familar.
2025-12-28 05:01:32 +0100merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) merijn
2025-12-28 04:50:46 +0100Hafydd(~Hafydd@user/hafydd) (Quit: WeeChat 4.8.1)
2025-12-28 04:50:15 +0100merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 240 seconds)
2025-12-28 04:45:46 +0100merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) merijn
2025-12-28 04:40:19 +0100 <Leary> Thanks, criterion.
2025-12-28 04:40:15 +0100 <Leary> "variance introduced by outliers: -9223372036854775808% (severely inflated)"
2025-12-28 04:35:01 +0100merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 244 seconds)
2025-12-28 04:29:57 +0100merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) merijn
2025-12-28 04:22:03 +0100ttybitnik(~ttybitnik@user/wolper) (Quit: Fading out...)
2025-12-28 04:18:55 +0100merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 240 seconds)
2025-12-28 04:14:10 +0100merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) merijn
2025-12-28 04:05:39 +0100op_4(~tslil@user/op-4/x-9116473) op_4
2025-12-28 04:05:02 +0100op_4(~tslil@user/op-4/x-9116473) (Remote host closed the connection)
2025-12-28 04:03:25 +0100merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 250 seconds)