2024/11/07

Newest at the top

2024-11-07 06:49:39 +0100 <Axman6> famubu: some things worth noting from probie's code, functions like null, head, tail etc. are often better replaced by case statements which allow you to perform the check (null) and also name the values you want (the head of the list) in one, efficient statement
2024-11-07 06:46:26 +0100 <famubu> Axman6: Oh.. didn't know that. Will keep that in mind.
2024-11-07 06:45:53 +0100merijn(~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 248 seconds)
2024-11-07 06:45:34 +0100 <famubu> probie: Thanks. :)
2024-11-07 06:44:53 +0100peterbecich(~Thunderbi@syn-047-229-123-186.res.spectrum.com) (Ping timeout: 252 seconds)
2024-11-07 06:42:03 +0100 <Axman6> famubu: you can make multiple definitions inside a let block: let mfn = ...\n bs = ...\n bb = ...\nin
2024-11-07 06:41:33 +0100merijn(~merijn@128-137-045-062.dynamic.caiway.nl) merijn
2024-11-07 06:40:57 +0100 <probie> fambu: Perhaps something like https://paste.tomsmeding.com/oA1DYLzQ
2024-11-07 06:39:09 +0100 <Axman6> Leary: nice, definitely simpler than the index monad version
2024-11-07 06:34:06 +0100 <famubu> The `foo` function feels a bit messy. Any suggestions to make it better? More readable?
2024-11-07 06:32:26 +0100 <famubu> It works.
2024-11-07 06:32:23 +0100 <famubu> Modified it to https://bpa.st/HQC4O
2024-11-07 06:32:17 +0100 <famubu> probie: Oh yeah.. Thanks!
2024-11-07 06:30:42 +0100merijn(~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 252 seconds)
2024-11-07 06:29:45 +0100 <EvanR> floats... so alluring... so deadly
2024-11-07 06:29:02 +0100 <EvanR> there is a // operator for integer division but it is doing the equivalent of `quot` instead of div
2024-11-07 06:28:29 +0100 <EvanR> was just musing with this bog standard python code for 36028797018963968 `div` 5... which is apparently int(36028797018963968 / 5), which round trips through float and gets the wrong answer xD
2024-11-07 06:26:08 +0100merijn(~merijn@128-137-045-062.dynamic.caiway.nl) merijn
2024-11-07 06:25:55 +0100 <probie> Why are you roundtripping via `Float`? Surely `isInt` could be more easily defined as `isInt x = denominator x == 1`. With that (and removing `fromRational`) I get correct answers with your code
2024-11-07 06:19:23 +0100 <famubu> should've been [2,15,825,725,1925,2275,425,390,
2024-11-07 06:19:09 +0100 <famubu> It's giving [2,15,825,725,1925,2275,425,25
2024-11-07 06:18:51 +0100 <famubu> Result is still incorrect though..
2024-11-07 06:18:41 +0100 <famubu> Made a version using Integer instead of Int: https://bpa.st/WT4TU
2024-11-07 06:15:00 +0100merijn(~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 246 seconds)
2024-11-07 06:14:26 +0100 <Leary> Axman6: (refresh to see improvements, if you already opened that link)
2024-11-07 06:14:05 +0100 <famubu> Doing Int instead of Integer made it necessary to convert between Int and Integer too.
2024-11-07 06:13:15 +0100 <famubu> I was doing it under the assumption that it won't go beyond Int. Maybe I should change it?
2024-11-07 06:11:51 +0100 <monochrom> Is it actually safe to use Int and Ratio Int for this? Will you get integers too big for Int?
2024-11-07 06:11:37 +0100 <famubu> Could be the `isInt` function?
2024-11-07 06:10:47 +0100merijn(~merijn@128-137-045-062.dynamic.caiway.nl) merijn
2024-11-07 06:10:08 +0100 <famubu> This is my first time using Data.Ratio
2024-11-07 06:09:57 +0100 <famubu> Any idea how to fix it?
2024-11-07 06:09:51 +0100 <famubu> It gets the first few numbers right, but then goes wrong.
2024-11-07 06:09:36 +0100 <famubu> This is what I did: https://bpa.st/2FVCW
2024-11-07 06:09:26 +0100 <famubu> Hi. I was trying to do the example shown in the FRACTRAN wikipedia article: https://en.wikipedia.org/wiki/FRACTRAN
2024-11-07 06:07:57 +0100famubu(~famubu@user/famubu) famubu
2024-11-07 06:00:24 +0100merijn(~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 276 seconds)
2024-11-07 05:58:31 +0100 <Leary> Axman6: https://gist.github.com/LSLeary/4484fb6bc4d96e59092d48592c162b9f
2024-11-07 05:55:46 +0100Square(~Square4@user/square) (Ping timeout: 252 seconds)
2024-11-07 05:50:02 +0100merijn(~merijn@128-137-045-062.dynamic.caiway.nl) merijn
2024-11-07 05:46:34 +0100aforemny(~aforemny@i577B13E8.versanet.de) (Ping timeout: 260 seconds)
2024-11-07 05:45:38 +0100aforemny_(~aforemny@i59F4C67C.versanet.de) aforemny
2024-11-07 05:42:19 +0100 <jackdk> Does anyone have a favourite rank2classes-style library that provides a class for HKD representables? I'm specifically looking for a class to associate a record with a GADT namings its fields (like a total DMap) and a FRepresentable sounds like it would fit the bill. I don't need a rank-2 tabulate, if that makes the search easier. The FIndexable in Ed's distributive library looks right but never made it from GitHub to Hackage.
2024-11-07 05:38:43 +0100merijn(~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 245 seconds)
2024-11-07 05:38:00 +0100peterbecich(~Thunderbi@syn-047-229-123-186.res.spectrum.com) peterbecich
2024-11-07 05:37:49 +0100Inst_(~Inst@user/Inst) (Ping timeout: 260 seconds)
2024-11-07 05:31:59 +0100merijn(~merijn@128-137-045-062.dynamic.caiway.nl) merijn
2024-11-07 05:21:06 +0100merijn(~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 248 seconds)
2024-11-07 05:17:46 +0100 <Axman6> Not sure I follow how that works, I thik I'd need to see the instances
2024-11-07 05:16:36 +0100merijn(~merijn@128-137-045-062.dynamic.caiway.nl) merijn