2024-12-21 00:00:34 +0100 | Smiles | (uid551636@id-551636.lymington.irccloud.com) (Quit: Connection closed for inactivity) |
2024-12-21 00:05:55 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) merijn |
2024-12-21 00:10:42 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 265 seconds) |
2024-12-21 00:11:12 +0100 | remexre | (~remexre@user/remexre) (Remote host closed the connection) |
2024-12-21 00:13:32 +0100 | machinedgod | (~machinedg@d108-173-18-100.abhsia.telus.net) machinedgod |
2024-12-21 00:16:46 +0100 | fmira | (~user@user/fmira) (Quit: fmira) |
2024-12-21 00:18:26 +0100 | <jle`> | has anyone noticed that the Quick Jump on haddocks hasn't seem to worked for like a year or something |
2024-12-21 00:18:35 +0100 | <jle`> | on hackage |
2024-12-21 00:19:59 +0100 | <jackdk> | For some strange reason, it continues to work once you're inside a module's documentation. |
2024-12-21 00:21:17 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) merijn |
2024-12-21 00:21:51 +0100 | <glguy> | jle`: I find it doesn't work on packages that haven't been updated |
2024-12-21 00:22:01 +0100 | <glguy> | but otherwise I use it whenever I'm on hackage |
2024-12-21 00:25:46 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 252 seconds) |
2024-12-21 00:26:49 +0100 | <jle`> | oh i didn't even realize you could access it from module documentation |
2024-12-21 00:27:03 +0100 | <jle`> | that's a nice workaround at least |
2024-12-21 00:29:37 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) merijn |
2024-12-21 00:32:02 +0100 | ash3en | (~Thunderbi@2a03:7846:b6eb:101:93ac:a90a:da67:f207) (Quit: ash3en) |
2024-12-21 00:34:09 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 248 seconds) |
2024-12-21 00:39:06 +0100 | wootehfoot | (~wootehfoo@user/wootehfoot) (Read error: Connection reset by peer) |
2024-12-21 00:45:49 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) merijn |
2024-12-21 00:53:43 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 265 seconds) |
2024-12-21 00:55:00 +0100 | alexherbo2 | (~alexherbo@2a02-8440-3502-b49c-c41e-bf6a-4195-2af5.rev.sfr.net) (Remote host closed the connection) |
2024-12-21 00:55:21 +0100 | alexherbo2 | (~alexherbo@2a02-8440-3502-b49c-c1d1-ea55-d74a-1dc7.rev.sfr.net) alexherbo2 |
2024-12-21 00:59:00 +0100 | alexherbo2 | (~alexherbo@2a02-8440-3502-b49c-c1d1-ea55-d74a-1dc7.rev.sfr.net) (Remote host closed the connection) |
2024-12-21 01:00:54 +0100 | <hellwolf> | fmap fromJust (filter isJust (fmap ifunc_name sfns)) <-- can it be simplified |
2024-12-21 01:02:40 +0100 | <jackdk> | :t Data.Maybe.mapMaybe -- generalised by package `witherable` |
2024-12-21 01:02:41 +0100 | <lambdabot> | (a -> Maybe b) -> [a] -> [b] |
2024-12-21 01:02:45 +0100 | <Leary> | hellwolf: `mapMaybe ifunc_name sfns`? Even if `mapMaybe` didn't exist, you should invent it before you throw `fromJust` at your problem. |
2024-12-21 01:03:33 +0100 | <probie> | :t \ifunc_name sfns -> [x | Just x <- map ifunc_name sfns] |
2024-12-21 01:03:40 +0100 | <lambdabot> | (a1 -> Maybe a2) -> [a1] -> [a2] |
2024-12-21 01:04:37 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) merijn |
2024-12-21 01:04:37 +0100 | <hellwolf> | catMaybes |
2024-12-21 01:04:38 +0100 | <probie> | > let halfEven x = if even x then Just (x `div` 2) else Nothing in [x | Just x <- map halfEven [1..10]] |
2024-12-21 01:04:39 +0100 | <hellwolf> | :t catMaybes |
2024-12-21 01:04:41 +0100 | <lambdabot> | [1,2,3,4,5] |
2024-12-21 01:04:41 +0100 | <lambdabot> | [Maybe a] -> [a] |
2024-12-21 01:04:54 +0100 | <hellwolf> | that's the one |
2024-12-21 01:05:49 +0100 | <probie> | > let halfEven x = if even x then Just (x `div` 2) else Nothing in catMaybes (map halfEven [1..10]) |
2024-12-21 01:05:50 +0100 | <lambdabot> | [1,2,3,4,5] |
2024-12-21 01:07:19 +0100 | <jackdk> | fromJust is way less useful than it seems, once you get used to using Functor/Applicative and sometimes Monad operations over Maybes. |
2024-12-21 01:09:15 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 246 seconds) |
2024-12-21 01:12:49 +0100 | sawilagar | (~sawilagar@user/sawilagar) (Ping timeout: 252 seconds) |
2024-12-21 01:17:31 +0100 | L29Ah | (~L29Ah@wikipedia/L29Ah) L29Ah |
2024-12-21 01:20:21 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) merijn |
2024-12-21 01:24:51 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 244 seconds) |
2024-12-21 01:35:45 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) merijn |
2024-12-21 01:36:25 +0100 | Smiles | (uid551636@id-551636.lymington.irccloud.com) Smiles |
2024-12-21 01:37:08 +0100 | peterbecich | (~Thunderbi@syn-047-229-123-186.res.spectrum.com) peterbecich |
2024-12-21 01:40:17 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 248 seconds) |
2024-12-21 01:41:06 +0100 | weary-traveler | (~user@user/user363627) user363627 |
2024-12-21 01:42:32 +0100 | weary-traveler | (~user@user/user363627) (Remote host closed the connection) |
2024-12-21 01:44:37 +0100 | weary-traveler | (~user@user/user363627) user363627 |
2024-12-21 01:45:11 +0100 | CrunchyFlakes | (~CrunchyFl@31.19.233.78) (Read error: Connection reset by peer) |
2024-12-21 01:46:55 +0100 | CrunchyFlakes | (~CrunchyFl@31.19.233.78) |
2024-12-21 01:46:55 +0100 | <jle`> | yeah the "point" of Maybe is that you don't have to use fromJust, you would always be able to pattern match |
2024-12-21 01:48:46 +0100 | <monochrom> | @quote monochrom safeFromJust |
2024-12-21 01:48:47 +0100 | <lambdabot> | monochrom says: I use safeFromJust :: Maybe a -> Maybe a |
2024-12-21 01:49:06 +0100 | cheater | (~Username@user/cheater) (Quit: Going offline, see ya! (www.adiirc.com)) |
2024-12-21 01:49:19 +0100 | <jle`> | safeHead . maybeToList |
2024-12-21 01:51:19 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) merijn |
2024-12-21 01:52:27 +0100 | <hellwolf> | project_preamble_template :: T.Text |
2024-12-21 01:52:27 +0100 | <hellwolf> | project_preamble_template = [fmt'| |
2024-12-21 01:52:27 +0100 | <hellwolf> | #include "../../../templates/Preamble.sol" |
2024-12-21 01:52:27 +0100 | <hellwolf> | |] |
2024-12-21 01:52:44 +0100 | <hellwolf> | I use CPP extension, but it filters out all my "/* comments */" in the included file |
2024-12-21 01:52:49 +0100 | <hellwolf> | sad |
2024-12-21 01:54:10 +0100 | <geekosaur> | mm, I thought the way we invoke cpp disables that because it's inapplicable to Haskell code. clang, perhaps? |
2024-12-21 01:54:40 +0100 | <ski> | > (\f xs -> [y | my <- map f xs,y <- maybeToList my]) (\n -> guard (even n) >> Just (n `div` 2)) [0,1,2,3,4] |
2024-12-21 01:54:41 +0100 | <hellwolf> | maybe I am using it in a inconventional way |
2024-12-21 01:54:42 +0100 | <lambdabot> | [0,1,2] |
2024-12-21 01:54:45 +0100 | <ski> | @type \f xs -> [y | my <- map f xs,y <- maybeToList my] |
2024-12-21 01:54:46 +0100 | <lambdabot> | (a1 -> Maybe a2) -> [a1] -> [a2] |
2024-12-21 01:55:06 +0100 | <geekosaur> | if you're using it the default way, it strips comments |
2024-12-21 01:55:16 +0100 | <hellwolf> | I include a chunk of file into a QQ. |
2024-12-21 01:55:30 +0100 | <hellwolf> | actually I would like it to keep the comments |
2024-12-21 01:55:42 +0100 | <geekosaur> | if you're using it as ghc configures it via the CPP extension and you're not on a Mac, it should use `-traditional` and disable comment stripping |
2024-12-21 01:55:46 +0100 | <hellwolf> | what is my alternative, that can include such a template file in a distribution. |
2024-12-21 01:55:48 +0100 | housemate | (~housemate@ppp203-122-213-191.static.internode.on.net) housemate |
2024-12-21 01:55:57 +0100 | housemate | (~housemate@ppp203-122-213-191.static.internode.on.net) (Remote host closed the connection) |
2024-12-21 01:55:59 +0100 | <hellwolf> | oh? how to enable -traditional |
2024-12-21 01:56:08 +0100 | <geekosaur> | if you're on a Mac, you're getting clang instead of gcc and your cpp will strip things and can't be told not to |
2024-12-21 01:56:20 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 252 seconds) |
2024-12-21 01:56:24 +0100 | <geekosaur> | gcc -E -traditional |
2024-12-21 01:56:29 +0100 | <hellwolf> | platform dependent... hmm, better not |
2024-12-21 01:56:53 +0100 | <hellwolf> | alternative is that I should not use CPP, but create QQ in a normal hs file |
2024-12-21 01:56:59 +0100 | <hellwolf> | I think I should do that |
2024-12-21 01:57:06 +0100 | <hellwolf> | this CPP usage is too weird. |
2024-12-21 01:57:16 +0100 | <hellwolf> | probably will bring distribution problem later. |
2024-12-21 01:57:23 +0100 | <hellwolf> | (need to set Cabal extra files) |
2024-12-21 01:58:57 +0100 | machinedgod | (~machinedg@d108-173-18-100.abhsia.telus.net) (Ping timeout: 244 seconds) |
2024-12-21 02:01:59 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) merijn |
2024-12-21 02:03:54 +0100 | <monochrom> | I'm also very naughty and known to say: |
2024-12-21 02:04:01 +0100 | <monochrom> | @quote monochrom unsafeCoerce |
2024-12-21 02:04:01 +0100 | <lambdabot> | monochrom says: isTrue = (unsafeCoerce :: Either a b -> Bool) . (unsafeCoerce :: Maybe c -> Either a b) . (unsafeCoerce :: Bool -> Maybe c) |
2024-12-21 02:04:05 +0100 | <monochrom> | >:) |
2024-12-21 02:06:42 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 265 seconds) |
2024-12-21 02:08:49 +0100 | <jle`> | monochrom: hm, why do you need all three? |
2024-12-21 02:10:17 +0100 | <monochrom> | To flex. >:) |
2024-12-21 02:11:21 +0100 | <monochrom> | The chain enjoys round-trip pointer tagging invariance. >:) |
2024-12-21 02:11:51 +0100 | sprotte24 | (~sprotte24@p200300d16f0b5c0044534d8048ff44db.dip0.t-ipconnect.de) (Read error: Connection reset by peer) |
2024-12-21 02:12:45 +0100 | harveypwca | (~harveypwc@2601:246:d080:b40:1889:d9bf:2dd8:b288) HarveyPwca |
2024-12-21 02:13:37 +0100 | <jle`> | ah of course |
2024-12-21 02:14:17 +0100 | acidjnk_new | (~acidjnk@p200300d6e7283f13051c8d0c2a2bb459.dip0.t-ipconnect.de) (Ping timeout: 252 seconds) |
2024-12-21 02:17:22 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) merijn |
2024-12-21 02:19:15 +0100 | <geekosaur> | hellwolf, there is also the possibility of a build-depends: cpphs, but I would avoid cpp's cursedness if possible |
2024-12-21 02:19:20 +0100 | machinedgod | (~machinedg@d108-173-18-100.abhsia.telus.net) machinedgod |
2024-12-21 02:21:59 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 252 seconds) |
2024-12-21 02:27:04 +0100 | housemate | (~housemate@ppp203-122-213-191.static.internode.on.net) housemate |
2024-12-21 02:29:01 +0100 | housemate | (~housemate@ppp203-122-213-191.static.internode.on.net) (Remote host closed the connection) |
2024-12-21 02:32:44 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) merijn |
2024-12-21 02:35:06 +0100 | alp | (~alp@2001:861:8ca0:4940:bd95:640a:d817:df55) |
2024-12-21 02:35:57 +0100 | Tuplanolla | (~Tuplanoll@91-159-69-59.elisa-laajakaista.fi) (Quit: Leaving.) |
2024-12-21 02:37:21 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 248 seconds) |
2024-12-21 02:48:07 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) merijn |
2024-12-21 02:51:15 +0100 | kimiamania | (~65804703@user/kimiamania) (Quit: PegeLinux) |
2024-12-21 02:52:28 +0100 | kimiamania | (~65804703@user/kimiamania) kimiamania |
2024-12-21 02:54:46 +0100 | OftenFaded | (~OftenFade@user/tisktisk) OftenFaded |
2024-12-21 02:55:00 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 252 seconds) |
2024-12-21 03:05:02 +0100 | harveypwca | (~harveypwc@2601:246:d080:b40:1889:d9bf:2dd8:b288) (Quit: Leaving) |
2024-12-21 03:05:04 +0100 | housemate | (~housemate@1.125.109.132) housemate |
2024-12-21 03:10:48 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) merijn |
2024-12-21 03:12:26 +0100 | haritz | (~hrtz@2a02:8010:65b5:0:5d9a:9bab:ee5e:b737) |
2024-12-21 03:12:28 +0100 | haritz | (~hrtz@2a02:8010:65b5:0:5d9a:9bab:ee5e:b737) (Changing host) |
2024-12-21 03:12:28 +0100 | haritz | (~hrtz@user/haritz) haritz |
2024-12-21 03:15:10 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 252 seconds) |
2024-12-21 03:17:34 +0100 | rekahsoft | (~rekahsoft@76.69.85.220) (Remote host closed the connection) |
2024-12-21 03:18:54 +0100 | krei-se- | (~krei-se@p5085d4a6.dip0.t-ipconnect.de) krei-se |
2024-12-21 03:19:56 +0100 | krei-se | (~krei-se@p5085d4fd.dip0.t-ipconnect.de) (Ping timeout: 252 seconds) |
2024-12-21 03:26:11 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) merijn |
2024-12-21 03:30:48 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 265 seconds) |
2024-12-21 03:32:22 +0100 | rekahsoft | (~rekahsoft@76.69.85.220) rekahsoft |
2024-12-21 03:32:33 +0100 | anpad | (~pandeyan@user/anpad) (Quit: ZNC 1.8.2 - https://znc.in) |
2024-12-21 03:32:54 +0100 | prasad | (~Thunderbi@c-73-75-25-251.hsd1.in.comcast.net) (Ping timeout: 276 seconds) |
2024-12-21 03:38:31 +0100 | anpad | (~pandeyan@user/anpad) anpad |
2024-12-21 03:41:33 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) merijn |
2024-12-21 03:43:51 +0100 | housemate | (~housemate@1.125.109.132) (Ping timeout: 265 seconds) |
2024-12-21 03:45:29 +0100 | Smiles | (uid551636@id-551636.lymington.irccloud.com) (Quit: Connection closed for inactivity) |
2024-12-21 03:45:58 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 252 seconds) |
2024-12-21 03:50:31 +0100 | peterbecich | (~Thunderbi@syn-047-229-123-186.res.spectrum.com) (Ping timeout: 264 seconds) |
2024-12-21 03:51:51 +0100 | housemate | (~housemate@246.224.218.139.sta.wbroadband.net.au) housemate |
2024-12-21 03:56:55 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) merijn |
2024-12-21 03:57:48 +0100 | housemate_ | (~housemate@ppp203-122-213-191.static.internode.on.net) housemate |
2024-12-21 03:57:52 +0100 | housemate | (~housemate@246.224.218.139.sta.wbroadband.net.au) (Ping timeout: 265 seconds) |
2024-12-21 03:59:27 +0100 | housemate_ | (~housemate@ppp203-122-213-191.static.internode.on.net) (Remote host closed the connection) |
2024-12-21 04:01:55 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 244 seconds) |
2024-12-21 04:07:58 +0100 | bitdex | (~bitdex@gateway/tor-sasl/bitdex) bitdex |
2024-12-21 04:12:56 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) merijn |
2024-12-21 04:17:41 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 265 seconds) |
2024-12-21 04:18:25 +0100 | dsrt^ | (~dsrt@c-98-242-74-66.hsd1.ga.comcast.net) |
2024-12-21 04:21:06 +0100 | Enviosity_ | (~Enviosity@2.219.56.221) |
2024-12-21 04:22:31 +0100 | machinedgod | (~machinedg@d108-173-18-100.abhsia.telus.net) (Ping timeout: 265 seconds) |
2024-12-21 04:23:05 +0100 | Guest88 | (~Guest88@syn-097-097-077-167.biz.spectrum.com) |
2024-12-21 04:23:36 +0100 | haver | (~Enviosity@2.219.56.221) (Ping timeout: 276 seconds) |
2024-12-21 04:26:11 +0100 | Guest88 | (~Guest88@syn-097-097-077-167.biz.spectrum.com) () |
2024-12-21 04:27:30 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) merijn |
2024-12-21 04:31:26 +0100 | fmira | (~user@user/fmira) fmira |
2024-12-21 04:31:52 +0100 | fmira | (~user@user/fmira) (Client Quit) |
2024-12-21 04:33:09 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 265 seconds) |
2024-12-21 04:38:39 +0100 | housemate | (~housemate@ppp203-122-213-191.static.internode.on.net) housemate |
2024-12-21 04:43:56 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) merijn |
2024-12-21 04:45:14 +0100 | td_ | (~td@i53870935.versanet.de) (Ping timeout: 265 seconds) |
2024-12-21 04:46:13 +0100 | fun-safe-math | (~fun-safe-@24.21.106.247) () |
2024-12-21 04:46:56 +0100 | td_ | (~td@i53870903.versanet.de) td_ |
2024-12-21 04:47:39 +0100 | housemate | (~housemate@ppp203-122-213-191.static.internode.on.net) (Ping timeout: 276 seconds) |
2024-12-21 04:50:30 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 252 seconds) |
2024-12-21 04:58:21 +0100 | itscaleb | (~itscaleb@user/itscaleb) itscaleb |
2024-12-21 05:01:58 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) merijn |
2024-12-21 05:06:30 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 244 seconds) |
2024-12-21 05:17:19 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) merijn |
2024-12-21 05:21:58 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 265 seconds) |
2024-12-21 05:23:11 +0100 | talismanick | (~user@2601:644:937c:ed10::ae5) (Remote host closed the connection) |
2024-12-21 05:24:56 +0100 | pavonia | (~user@user/siracusa) (Quit: Bye!) |
2024-12-21 05:27:53 +0100 | orangeflu | (~flu@240-100-179-143.ftth.glasoperator.nl) orangeFlu |
2024-12-21 05:28:15 +0100 | <orangeflu> | hello, i am losing my mind |
2024-12-21 05:28:44 +0100 | aforemny_ | (~aforemny@2001:9e8:6cd7:4a00:42f0:f044:3052:a50d) (Ping timeout: 265 seconds) |
2024-12-21 05:28:57 +0100 | aforemny | (~aforemny@2001:9e8:6cf6:8000:f088:f772:a53:8f63) aforemny |
2024-12-21 05:30:16 +0100 | fun-safe-math | (~fun-safe-@2601:1c2:1b7f:801f:a762:20cf:f426:d497) fun-safe-math |
2024-12-21 05:30:21 +0100 | <orangeflu> | what i'm about to ask may be more of a ghc question than anything else, so feel free to point me in the right direction if this is not the place. i have a cabal app, in it there used to be a big file (like 2000 files long). Being a responsible programmer, i split it up into multiple files. Since then, the performance of my app degraded considerably, even with -O2 |
2024-12-21 05:30:38 +0100 | <orangeflu> | is there a way of fixing this without moving everything again in one file? |
2024-12-21 05:32:42 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) merijn |
2024-12-21 05:33:46 +0100 | <Leary> | orangeflu: Presumably the issue is a lack of cross-module inlining and specialisation. You can rectify it with manual use of `INLINE`/`INLINABLE`/`SPECIALISE` pragmata, or with flags such as `-fexpose-overloaded-unfoldings`. |
2024-12-21 05:35:32 +0100 | <orangeflu> | i tried -fexpose-overloaded-unfoldings, and it doesn't seem to make a difference. As for INLINE/INLINEABLE, i did happen upon those pragmas in the docs, but it seems i have to put them for every function in my files.. which there are hundreds of. Surely there's a better way |
2024-12-21 05:36:31 +0100 | <orangeflu> | Correction, this is the flag i tried: -fexpose-all-unfoldings |
2024-12-21 05:37:26 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 265 seconds) |
2024-12-21 05:38:33 +0100 | fun-safe-math | (~fun-safe-@2601:1c2:1b7f:801f:a762:20cf:f426:d497) () |
2024-12-21 05:39:26 +0100 | <Leary> | orangeflu: It's strange for that not to have an effect. Perhaps you also need `-fspecialise-aggressively`. |
2024-12-21 05:41:27 +0100 | <orangeflu> | I am going to try with that one too. Until it compiles, just to be sure, where do i need to put those flags? I put them in ghc-options in my library component, should i put them in ghc-options for the executable as well? |
2024-12-21 05:41:57 +0100 | <Leary> | Probably. |
2024-12-21 05:42:50 +0100 | <Leary> | These flags are big hammers though, so while it's more tedious, you can get better results by identifying which exact functions want which pragmata. |
2024-12-21 05:45:12 +0100 | <orangeflu> | Well, they don't seem to be making a difference either way unfortunately |
2024-12-21 05:45:15 +0100 | fun-safe-math | (~fun-safe-@2601:1c2:1b7f:801f:83ce:3f54:3f3c:7c89) fun-safe-math |
2024-12-21 05:45:18 +0100 | <orangeflu> | No change in behaviour |
2024-12-21 05:45:29 +0100 | <orangeflu> | My program still eats 10 GB of RAM casually |
2024-12-21 05:48:04 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) merijn |
2024-12-21 05:50:57 +0100 | alp | (~alp@2001:861:8ca0:4940:bd95:640a:d817:df55) (Ping timeout: 248 seconds) |
2024-12-21 05:50:58 +0100 | ljdarj | (~Thunderbi@user/ljdarj) (Ping timeout: 265 seconds) |
2024-12-21 05:52:45 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 252 seconds) |
2024-12-21 05:53:28 +0100 | peterbecich | (~Thunderbi@syn-047-229-123-186.res.spectrum.com) peterbecich |
2024-12-21 05:55:08 +0100 | <orangeflu> | Fuck it, i'm going to put the file back together and then remove groups of functions until i find the culprits, and that will be that |
2024-12-21 05:55:25 +0100 | <haskellbridge> | <Bowuigi> Did you have to refactor some functions in order to split the file? Losing sharing on a big data structure can cause those problems |
2024-12-21 05:57:38 +0100 | <Leary> | Cross-module optimisation issues often have a big effect on time costs, but I haven't seen them ruin space usage before. I don't have enough information or expertise to say what the issue is, but if you can share the source then someone may be able to help. |
2024-12-21 05:59:36 +0100 | <orangeflu> | Bowuigi: no, I didn't refactor anything. The code is exactly the same before and after |
2024-12-21 06:00:25 +0100 | <haskellbridge> | <Bowuigi> Any large globals mentioned in one module and used in another? |
2024-12-21 06:00:34 +0100 | <orangeflu> | Leary: I mean, it does both. Things that used to take 100ms now take minutes, and instead f using neglijable RAM, it takes all of it |
2024-12-21 06:01:11 +0100 | <orangeflu> | Bowuigi: define globals please, not sure what you are reffering to |
2024-12-21 06:01:34 +0100 | <haskellbridge> | <Bowuigi> Maybe strictness analysis made something too lazy? Looking at the core of a file so large seems annoying though |
2024-12-21 06:01:49 +0100 | <Leary> | Sure sounds like you lost streaming somewhere. |
2024-12-21 06:02:07 +0100 | <orangeflu> | I can give you the source if it helps |
2024-12-21 06:02:23 +0100 | <orangeflu> | https://github.com/Flu/avr-emulator |
2024-12-21 06:02:32 +0100 | <orangeflu> | the file in question is src/Emulator.hs |
2024-12-21 06:02:38 +0100 | <haskellbridge> | <Bowuigi> "Large globals" as in variables that are not functions, but very large values |
2024-12-21 06:03:10 +0100 | <orangeflu> | I don't think i have any global variables |
2024-12-21 06:03:27 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) merijn |
2024-12-21 06:04:39 +0100 | <haskellbridge> | <Bowuigi> You don't, just checked |
2024-12-21 06:06:16 +0100 | <haskellbridge> | <Bowuigi> The only "large" stuff I can see is the memory and the Instruction enum (not too large tho, its representation should be fairly small) |
2024-12-21 06:06:32 +0100 | <orangeflu> | like, i have a program loop (runProgram function, bottom of file). I know that it may be responsible because the program only starts taking up a lot of space when i have long assemb;y files, that do a lot of jumps and continue for many cycles |
2024-12-21 06:07:11 +0100 | <orangeflu> | if i do something like 'JMP -1' it starts taking a lot of space when emulating that |
2024-12-21 06:08:13 +0100 | <haskellbridge> | <Bowuigi> Oh you have a list of instructions |
2024-12-21 06:08:22 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 265 seconds) |
2024-12-21 06:08:46 +0100 | <orangeflu> | yeah, the "program" is [Instruction] |
2024-12-21 06:09:24 +0100 | <haskellbridge> | <Bowuigi> So it's either losing streaming on the instruction list (which is likely very large because it's a whole program) or losing sharing (or similar) in memory |
2024-12-21 06:11:03 +0100 | <haskellbridge> | <Bowuigi> You also seem to be evaluating the entire spine of the instructions list on every iteration of runProgram, unless GHC optimizes that |
2024-12-21 06:11:48 +0100 | <haskellbridge> | <Bowuigi> Hmmm try switching from an instruction list to an instruction array |
2024-12-21 06:11:53 +0100 | <Leary> | It's probably best to investigate with profiling, but I've never done much of that myself. Personally, I'd strictify `go` and your custom data types first. |
2024-12-21 06:12:05 +0100 | <haskellbridge> | <Bowuigi> You are treating it like one as far as I can see |
2024-12-21 06:12:18 +0100 | <Leary> | And yeah, either an array or a list zipper for the instructions. |
2024-12-21 06:12:36 +0100 | <haskellbridge> | <Bowuigi> Profiling is crucial here indeed |
2024-12-21 06:13:07 +0100 | <orangeflu> | that's just it though, the instruction list doesn't have to be very big, it could just be [(ADD R1, R1), (JMP -1)], thus looping endlessly |
2024-12-21 06:13:20 +0100 | <orangeflu> | and it would still cause this problem |
2024-12-21 06:13:27 +0100 | <orangeflu> | i am going to try profiling |
2024-12-21 06:14:21 +0100 | <haskellbridge> | <Bowuigi> Oh then it's probably the memory, but yeah profiling will show the true cause |
2024-12-21 06:14:40 +0100 | <orangeflu> | Also, the split-up version is on branch 'feature/18-add-step-by-step-emulation' |
2024-12-21 06:18:17 +0100 | <haskellbridge> | <Bowuigi> Oh you didn't separate the functions from each instruction, I thought that was the main idea |
2024-12-21 06:18:51 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) merijn |
2024-12-21 06:19:21 +0100 | <orangeflu> | What do you mean |
2024-12-21 06:19:41 +0100 | rekahsoft | (~rekahsoft@76.69.85.220) (Remote host closed the connection) |
2024-12-21 06:21:58 +0100 | rekahsoft | (~rekahsoft@bras-base-orllon1103w-grc-06-76-69-85-220.dsl.bell.ca) rekahsoft |
2024-12-21 06:23:36 +0100 | remexre | (~remexre@user/remexre) remexre |
2024-12-21 06:25:46 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 265 seconds) |
2024-12-21 06:28:35 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) merijn |
2024-12-21 06:30:51 +0100 | housemate | (~housemate@1.147.119.169) housemate |
2024-12-21 06:36:46 +0100 | <orangeflu> | for whatever reason, the --enable-profiling flag has made ghc just hang.. |
2024-12-21 06:36:50 +0100 | <orangeflu> | i am so done |
2024-12-21 06:36:55 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 244 seconds) |
2024-12-21 06:37:26 +0100 | <orangeflu> | I am going to try and replace the list with an array and see what happens then |
2024-12-21 06:37:43 +0100 | <orangeflu> | if that doesn't work, i am reverting back to the old way |
2024-12-21 06:38:12 +0100 | housemate | (~housemate@1.147.119.169) (Read error: Connection reset by peer) |
2024-12-21 06:44:53 +0100 | <orangeflu> | Bowuigi: converted to array, still same behaviour |
2024-12-21 06:47:15 +0100 | <haskellbridge> | <Bowuigi> Hmmm, so it wasn't that |
2024-12-21 06:47:52 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) merijn |
2024-12-21 06:49:13 +0100 | housemate | (~housemate@ppp203-122-213-191.static.internode.on.net) housemate |
2024-12-21 06:49:25 +0100 | <haskellbridge> | <Bowuigi> Every way of checking will take some time because it involves either checking Core or comparing the results of strictness analysis (the easiest way to do this for datatypes is deriving generic and using the "from" function on them IIRC) |
2024-12-21 06:51:00 +0100 | <haskellbridge> | <Bowuigi> If it is the memory not being shared/streamed or something like that, trying to isolate it on a function level won't help much |
2024-12-21 06:51:31 +0100 | codaraxis__ | (~codaraxis@user/codaraxis) (Quit: Leaving) |
2024-12-21 06:52:25 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 244 seconds) |
2024-12-21 06:52:35 +0100 | <haskellbridge> | <Bowuigi> Also does the problem persist if you enable Strict mode? It doesn't make everything strict but it may minimize the memory issue if it has to do with strictness |
2024-12-21 06:52:47 +0100 | <orangeflu> | how do you enable strict mode |
2024-12-21 06:53:06 +0100 | <haskellbridge> | <Bowuigi> It's a language extension |
2024-12-21 06:53:57 +0100 | <haskellbridge> | <Bowuigi> So either {-# LANGUAGE Strict #-} or the equivalent in the Cabal/Stack file |
2024-12-21 06:54:58 +0100 | <haskellbridge> | <Bowuigi> It probably won't fix the issue entirely (no idea how does streaming interact with strictness analysis or if they are actually different on the two versions) |
2024-12-21 06:55:08 +0100 | <haskellbridge> | <Bowuigi> But it will give you a clue |
2024-12-21 06:55:14 +0100 | <orangeflu> | So just put {-# LANGUAGE Strict #-} in all files that used to be part of Emulator.hs |
2024-12-21 06:55:17 +0100 | <orangeflu> | ? |
2024-12-21 06:55:41 +0100 | <haskellbridge> | <Bowuigi> Yeah that should work |
2024-12-21 06:56:05 +0100 | tnt2 | (~Thunderbi@user/tnt1) tnt1 |
2024-12-21 06:56:11 +0100 | CrunchyFlakes | (~CrunchyFl@31.19.233.78) (Read error: Connection reset by peer) |
2024-12-21 06:57:00 +0100 | tnt1 | (~Thunderbi@user/tnt1) (Ping timeout: 276 seconds) |
2024-12-21 06:57:00 +0100 | tnt2 | tnt1 |
2024-12-21 06:57:32 +0100 | <haskellbridge> | <Bowuigi> If that doesn't work, just revert, unless someone else here has another idea |
2024-12-21 06:58:52 +0100 | CrunchyFlakes | (~CrunchyFl@31.19.233.78) |
2024-12-21 06:59:07 +0100 | <orangeflu> | hmm, that's the first time the behaviour changed |
2024-12-21 07:00:05 +0100 | <orangeflu> | Like, if I run bubblesort.asm, it just prints 'avr-emulator: <<loop>>', which i have no idea what it means cause i am pretty sure i never programmed that behaviour, nor do i have any idea what it means |
2024-12-21 07:00:35 +0100 | <haskellbridge> | <Bowuigi> Oh that's a bit too strict lmao |
2024-12-21 07:01:04 +0100 | <haskellbridge> | <Bowuigi> Enough to make GHC notice it loops forever |
2024-12-21 07:01:22 +0100 | <orangeflu> | If i run test.asm, the one that ate all the RAM, now it doesn't, but it also doesn't seem to do anything? Like, it should have finished by now, but it doesn't seem to consume ANY resources |
2024-12-21 07:01:36 +0100 | <orangeflu> | Yeah, but bubblesort.asm doesn't loop forever though |
2024-12-21 07:01:58 +0100 | <haskellbridge> | <Bowuigi> https://stackoverflow.com/questions/21505192/haskell-program-outputs-loop#21554398 |
2024-12-21 07:02:25 +0100 | <haskellbridge> | <Bowuigi> It probably loops with strictness turned on, which can happen if you generate an infinite data structure somewhere |
2024-12-21 07:03:13 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) merijn |
2024-12-21 07:03:26 +0100 | <orangeflu> | this is so weird |
2024-12-21 07:03:34 +0100 | <haskellbridge> | <Bowuigi> Your other test has been turned into a noop loop, GHC probably understood that it doesn't need anything from there |
2024-12-21 07:03:59 +0100 | <orangeflu> | why do i always feel like i am making haskell bend in ways it was never supposed to, haha |
2024-12-21 07:04:22 +0100 | <orangeflu> | also, on another note, can't ctrl-c it now |
2024-12-21 07:04:25 +0100 | <orangeflu> | so that's fun |
2024-12-21 07:04:36 +0100 | <haskellbridge> | <Bowuigi> The SO page also tells you how to profile to detect where it happened too, nice |
2024-12-21 07:04:41 +0100 | <c_wraith> | Yeah, this is why I think Language Strict is usually a bad idea. |
2024-12-21 07:04:52 +0100 | <c_wraith> | It turns out lots of correct Haskell code breaks when you turn it on |
2024-12-21 07:05:08 +0100 | <orangeflu> | well, it did fix my issue to be fair |
2024-12-21 07:05:10 +0100 | <haskellbridge> | <Bowuigi> Hmmm is StrictData also a bad idea? |
2024-12-21 07:05:15 +0100 | <orangeflu> | but it also lobotomized my program |
2024-12-21 07:05:45 +0100 | <c_wraith> | StrictData is not nearly as bad, but also not nearly as useful. You don't need *any* extensions to add a few !s to your data types. |
2024-12-21 07:05:53 +0100 | <haskellbridge> | <Bowuigi> The RTS literally decided to ignore SIGINT, wonderful |
2024-12-21 07:06:21 +0100 | <orangeflu> | it can't ignore me killing the terminal, so its fine |
2024-12-21 07:06:22 +0100 | housemate | (~housemate@ppp203-122-213-191.static.internode.on.net) (Ping timeout: 265 seconds) |
2024-12-21 07:06:50 +0100 | <orangeflu> | yeah, so guess i am going back to the monolithic file from before |
2024-12-21 07:06:52 +0100 | <haskellbridge> | <Bowuigi> Ok, let's go with something less extreme, locate every data type that mentions the memory and make that strict only |
2024-12-21 07:07:21 +0100 | weary-traveler | (~user@user/user363627) (Remote host closed the connection) |
2024-12-21 07:07:41 +0100 | <orangeflu> | Something like `memory :: !Array Int Word8`, you mean? |
2024-12-21 07:07:49 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 248 seconds) |
2024-12-21 07:07:53 +0100 | <haskellbridge> | <Bowuigi> Yeah I think |
2024-12-21 07:08:38 +0100 | <haskellbridge> | <Bowuigi> StrictData is technically faster to test but still seems like too much lol |
2024-12-21 07:08:44 +0100 | <orangeflu> | that doesn't inspire confidence, to be fair |
2024-12-21 07:09:50 +0100 | xal | (~xal@mx1.xal.systems) (Quit: No Ping reply in 180 seconds.) |
2024-12-21 07:10:29 +0100 | <haskellbridge> | <Bowuigi> Oh it's just that Strict adds too many !s (on functions and data types, maybe lets too but I don't remember), StrictData only adds !s on the ADTs you define |
2024-12-21 07:11:04 +0100 | xal | (~xal@mx1.xal.systems) xal |
2024-12-21 07:12:39 +0100 | <orangeflu> | Well, I mean, bubblesort.asm is definitely faster and takes neglijible ram, but test.asm still takes some gigabytes, can't tell if less than before |
2024-12-21 07:13:00 +0100 | <orangeflu> | i call this an improvement |
2024-12-21 07:13:26 +0100 | <haskellbridge> | <Bowuigi> Also note that ! makes strict only the thing you refer to directly, so ! on a List parameter means that the value itself is strict, not that the whole list gets fully evaluated ASAP |
2024-12-21 07:14:17 +0100 | <haskellbridge> | <Bowuigi> Try profiling now, it might help with test.asm |
2024-12-21 07:14:21 +0100 | <orangeflu> | I ran the whole test suite, and it actually made it through this time |
2024-12-21 07:14:27 +0100 | <orangeflu> | including test.asm |
2024-12-21 07:14:45 +0100 | <orangeflu> | it took like 9 gigs |
2024-12-21 07:14:58 +0100 | <haskellbridge> | <Bowuigi> That's one less than before |
2024-12-21 07:15:05 +0100 | <orangeflu> | but at least it finished in like 30 seconds |
2024-12-21 07:15:11 +0100 | <orangeflu> | as opposed to not at all |
2024-12-21 07:15:23 +0100 | <orangeflu> | but still 25 seconds slower than before i did this split |
2024-12-21 07:15:30 +0100 | <[exa]> | orangeflu: the -fexpose-all-unfoldings is not sufficient by itself, you also need something like -finline-aggressively (not very sure about the name but it sounded this way) |
2024-12-21 07:16:12 +0100 | <[exa]> | btw what's the program? the loopy situation and sigint ignore sounds wild |
2024-12-21 07:16:22 +0100 | <haskellbridge> | <Bowuigi> Aggressive inlining should help too yeah |
2024-12-21 07:16:32 +0100 | <orangeflu> | i think i tried that about 8 hours ago |
2024-12-21 07:16:35 +0100 | <orangeflu> | can't remember |
2024-12-21 07:16:36 +0100 | <haskellbridge> | <Bowuigi> [exa] https://github.com/Flu/avr-emulator |
2024-12-21 07:16:49 +0100 | <[exa]> | I'm using these 2 for everything that goes to production |
2024-12-21 07:17:01 +0100 | <orangeflu> | well, the loopy thing and ignoring sigint was when we tried {-# LANGUAGE Strict #-} |
2024-12-21 07:17:10 +0100 | <orangeflu> | that doesn't happen normally |
2024-12-21 07:17:22 +0100 | <haskellbridge> | <Bowuigi> [exa] The split-up version is on branch feature/18-add-step-by-step-emulation |
2024-12-21 07:18:02 +0100 | <orangeflu> | ok, i am going to remove the strict data things, and try again with -finline-aggressively |
2024-12-21 07:18:17 +0100 | rekahsoft | (~rekahsoft@bras-base-orllon1103w-grc-06-76-69-85-220.dsl.bell.ca) (Remote host closed the connection) |
2024-12-21 07:18:24 +0100 | <orangeflu> | haskell has taken years off my life at this point |
2024-12-21 07:18:36 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) merijn |
2024-12-21 07:18:38 +0100 | JuanDaugherty | (~juan@user/JuanDaugherty) JuanDaugherty |
2024-12-21 07:19:00 +0100 | <haskellbridge> | <Bowuigi> No no keep strictness, those are supposed to mix together |
2024-12-21 07:19:45 +0100 | <haskellbridge> | <Bowuigi> Or well, try both if you have some time, going blind here is not that fun lol |
2024-12-21 07:19:51 +0100 | <[exa]> | I'd say trying without strictness should be a safe bet. Strictness changes semantics, aggressive inlining only changes weird corner cases |
2024-12-21 07:20:31 +0100 | <orangeflu> | -finline-generics-aggressively |
2024-12-21 07:20:36 +0100 | <orangeflu> | is this the one you meant? |
2024-12-21 07:21:01 +0100 | <[exa]> | no thats generics only (not a bad choice either if you use generics) |
2024-12-21 07:21:10 +0100 | <haskellbridge> | <Bowuigi> Put everything that has "aggressively" on your flags |
2024-12-21 07:21:36 +0100 | <haskellbridge> | <Bowuigi> Probably a good idea for production stuff lol |
2024-12-21 07:21:44 +0100 | <[exa]> | oh wait it is -fspecialize-aggressively |
2024-12-21 07:22:09 +0100 | <orangeflu> | i already have that one then |
2024-12-21 07:22:17 +0100 | <[exa]> | ah okay nvm then :( |
2024-12-21 07:22:58 +0100 | <orangeflu> | let me go back to main to see how it compares to test.asm before all of this, maybe i am wrong and it used to be this way before as well |
2024-12-21 07:23:02 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 252 seconds) |
2024-12-21 07:23:17 +0100 | <[exa]> | but you have a space leak there right? suggest doing an allocation profile to see what's happening |
2024-12-21 07:23:26 +0100 | <haskellbridge> | <Bowuigi> Yes, also try to profile the run on test.asm on both |
2024-12-21 07:23:41 +0100 | <haskellbridge> | <Bowuigi> Both main and the memory-strict version |
2024-12-21 07:24:16 +0100 | <orangeflu> | profiling doesn't seem to work for some reason |
2024-12-21 07:24:21 +0100 | <orangeflu> | idk why |
2024-12-21 07:24:26 +0100 | <orangeflu> | ghc just hangs |
2024-12-21 07:24:30 +0100 | <orangeflu> | it says ' |
2024-12-21 07:24:42 +0100 | <orangeflu> | Building vector-0.4.2 |
2024-12-21 07:24:46 +0100 | <orangeflu> | and then stops there |
2024-12-21 07:25:10 +0100 | <orangeflu> | waited 10 minutes for it to compile that |
2024-12-21 07:25:23 +0100 | <haskellbridge> | <Bowuigi> I don't know much about profiling, [exa] any ideas? |
2024-12-21 07:26:47 +0100 | <haskellbridge> | <Bowuigi> On the meantime, how good is the performance if you use StrictData on the split up version? It should be close to the memory-strict one, maybe faster |
2024-12-21 07:27:19 +0100 | <mauke> | https://infosec.exchange/@barubary/111126546998839428 |
2024-12-21 07:28:17 +0100 | billchenchina | (~billchenc@183.95.251.11) billchenchina |
2024-12-21 07:29:14 +0100 | <orangeflu> | Ok, so went back to main |
2024-12-21 07:29:29 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) merijn |
2024-12-21 07:29:34 +0100 | euphores | (~SASL_euph@user/euphores) (Quit: Leaving.) |
2024-12-21 07:29:34 +0100 | <orangeflu> | test.asm performance is comparable to what it is now with the strict stuff |
2024-12-21 07:30:09 +0100 | <orangeflu> | Idk what you mean by StrictData, I just put ! in front of some types |
2024-12-21 07:30:17 +0100 | <orangeflu> | Still don't understand what it doese |
2024-12-21 07:30:43 +0100 | <orangeflu> | But now it's comparable to what it was before the split |
2024-12-21 07:30:57 +0100 | <orangeflu> | So I am happy, even if it feels a little bit hacky |
2024-12-21 07:31:10 +0100 | <haskellbridge> | <Bowuigi> It disallows GHC from making a thunk in that position |
2024-12-21 07:31:33 +0100 | <orangeflu> | Still don't know why test.asm takes gigabytes of memory.. that seems to have been a problem for some time, but never noticed |
2024-12-21 07:32:00 +0100 | <orangeflu> | but after the split, it got much much worse, that's why i noticed |
2024-12-21 07:32:06 +0100 | <orangeflu> | interesting |
2024-12-21 07:32:08 +0100 | <[exa]> | ok I had a bit of a look at the code, you certainly want the stuff in your State struct strict, and on top of that I'd vote running that in a strict State monad so that you're sure the program isn't keeping one million versions of this state by accident |
2024-12-21 07:32:12 +0100 | <haskellbridge> | <Bowuigi> What apparently happened is that you had a space leak, multiple copies of the entire emulator's memory were floating around at the same time, being left as thunks |
2024-12-21 07:32:21 +0100 | <[exa]> | 2nd suggestion: MVector |
2024-12-21 07:32:50 +0100 | <[exa]> | you have plain arrays there right? if so that one _is_ the source of insane allocationery |
2024-12-21 07:32:52 +0100 | billchenchina | (~billchenc@183.95.251.11) (Ping timeout: 252 seconds) |
2024-12-21 07:33:16 +0100 | <orangeflu> | [exa]: yes, now everything in EmulatorState is strict |
2024-12-21 07:33:47 +0100 | <orangeflu> | What's a strict state monad? is it different from a normal State monad? |
2024-12-21 07:34:02 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 252 seconds) |
2024-12-21 07:34:11 +0100 | <[exa]> | yeah, the other question is how to make sure you're not keeping some of the states by accident together with some other unevaluated data |
2024-12-21 07:34:53 +0100 | <orangeflu> | me personally, still wrapping my head around the whole monad thing. I did use some monads here and there, but made them work just by trying shit until the compiler accepted it, can't say i understand it |
2024-12-21 07:34:54 +0100 | <[exa]> | State monad does not prevent this but since you never touch&hold the state explicitly, leak probability gets lower |
2024-12-21 07:35:06 +0100 | <[exa]> | ah well |
2024-12-21 07:35:16 +0100 | <haskellbridge> | <Bowuigi> Oh wait you are still learning monads? |
2024-12-21 07:35:19 +0100 | JuanDaugherty | (~juan@user/JuanDaugherty) (Quit: JuanDaugherty) |
2024-12-21 07:35:20 +0100 | <[exa]> | try parser combinators, these usually demystify it |
2024-12-21 07:35:37 +0100 | <orangeflu> | You mean the ones I have in Parser.hs? |
2024-12-21 07:36:22 +0100 | <haskellbridge> | <Bowuigi> Strictness is definitely not a begginner's topic, it's ok if you don't understand it yet |
2024-12-21 07:36:41 +0100 | <orangeflu> | Bowuigi: yeah, shit, it's hard to wrap my head around them. I understand them somewhat. I read the chapters in Learn you a haskell a bunch of times |
2024-12-21 07:36:47 +0100 | <orangeflu> | Conceptually, i think i understand it |
2024-12-21 07:36:54 +0100 | <orangeflu> | But to actually use them? |
2024-12-21 07:37:22 +0100 | <haskellbridge> | <Bowuigi> Essentially, when Haskell says it evaluates stuff only when needed it really means that. The only primitive that evaluates anything is "case" (IIRC) |
2024-12-21 07:37:57 +0100 | <orangeflu> | i've been wanting to use State monad instead of whatever the fuck i created here, but could never make it work, it always gives me some error i don't understand how to fix |
2024-12-21 07:38:29 +0100 | <orangeflu> | Although to be fair, i wrote most of the code in Emulator.hs before i read up on monads |
2024-12-21 07:38:36 +0100 | <orangeflu> | maybe if i try now, it will be easier |
2024-12-21 07:38:53 +0100 | <orangeflu> | But state monads are harder to understand than something like Maybe |
2024-12-21 07:38:56 +0100 | <orangeflu> | That one I get |
2024-12-21 07:38:59 +0100 | <haskellbridge> | <Bowuigi> ! automatically inserts one of those "case"s when using those values so you have at least one layer of evaluation now |
2024-12-21 07:39:14 +0100 | euphores | (~SASL_euph@user/euphores) euphores |
2024-12-21 07:39:48 +0100 | <orangeflu> | [exa]: what's MVector and why should i use it instead of arrays? |
2024-12-21 07:40:11 +0100 | <haskellbridge> | <Bowuigi> MVector is fairly similar to a C array |
2024-12-21 07:40:33 +0100 | <orangeflu> | i thought an array is similar to a c array.. because of the name |
2024-12-21 07:40:37 +0100 | <orangeflu> | that's why i used it |
2024-12-21 07:41:01 +0100 | <haskellbridge> | <Bowuigi> MVector is mutable, gets nice support for compiler magic and goes fast if you use it properly |
2024-12-21 07:41:19 +0100 | <orangeflu> | am i going to have to use monads with it? |
2024-12-21 07:41:49 +0100 | <orangeflu> | so its not going to be a drop-in replacement then |
2024-12-21 07:42:01 +0100 | <haskellbridge> | <Bowuigi> Array is not a C array, but more like a functional array (not to be confused with a List zipper, which is a tree) that gets copied around |
2024-12-21 07:42:45 +0100 | <orangeflu> | i am getting code-reviewed here, i love it |
2024-12-21 07:43:12 +0100 | <haskellbridge> | <Bowuigi> https://hackage.haskell.org/package/vector-0.13.2.0/docs/Data-Vector-Mutable.html this should make some things clearer |
2024-12-21 07:43:49 +0100 | <orangeflu> | i was actually kinda scared while writing this emulator that it would be a terrible misuse of haskell, but it seems to be alright, you guys didn't complain too much about it |
2024-12-21 07:45:03 +0100 | <haskellbridge> | <Bowuigi> Haskell has some fancy optimization tricks that make low level-ish projects like yours feasible |
2024-12-21 07:45:36 +0100 | JuanDaugherty | (~juan@user/JuanDaugherty) JuanDaugherty |
2024-12-21 07:45:37 +0100 | <orangeflu> | ok, i get it. it would still require me to go and replace a lot of stuff in the instruction implementations, but it seems doable |
2024-12-21 07:46:29 +0100 | <haskellbridge> | <Bowuigi> Those tricks include inlining, strictness, mutable data and fusion (we haven't mentioned it explicitly but it's the magic that makes mapping multiple times fast by mapping once, and similar) |
2024-12-21 07:46:58 +0100 | <haskellbridge> | <Bowuigi> Vector takes care of the fusion, strictness and mutability for you when you use the containers it provides |
2024-12-21 07:48:50 +0100 | <orangeflu> | But would i not still need to return EmulatorState each time i execute an instruction? Therefore the MVector will be copied, so what's the difference between this and an array then? What issue did i solve? |
2024-12-21 07:50:17 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) merijn |
2024-12-21 07:50:20 +0100 | <haskellbridge> | <Bowuigi> Here's a very comprehensive guide to GHC optimization for later. Note that those topics are advanced (tho explained clearly there) https://www.stackbuilders.com/insights/ghc-optimization-and-fusion/#specializing |
2024-12-21 07:50:46 +0100 | <haskellbridge> | <Bowuigi> You don't copy an MVector unless you call clone on it |
2024-12-21 07:51:01 +0100 | <haskellbridge> | <Bowuigi> Modifying it doesn't copy it |
2024-12-21 07:52:15 +0100 | <orangeflu> | i really need to understand monads properly.. |
2024-12-21 07:53:06 +0100 | <haskellbridge> | <Bowuigi> Hmmm, if parser combinators didn't help, maybe playing with the free monad will? |
2024-12-21 07:53:23 +0100 | <orangeflu> | They did help, don't get me wrong |
2024-12-21 07:53:27 +0100 | <orangeflu> | Problem is |
2024-12-21 07:53:32 +0100 | <orangeflu> | I go mostly by intuition |
2024-12-21 07:53:54 +0100 | <orangeflu> | But if i think hard about it, my brain doesn't feel like it understands them |
2024-12-21 07:54:18 +0100 | <orangeflu> | Like, if somebody asked me how they work, i don't know that i could explain |
2024-12-21 07:54:51 +0100 | <orangeflu> | i just need to use them some more, go back, re-read the chapter about it in Learn you a haskell, rinse and repeat |
2024-12-21 07:54:58 +0100 | <orangeflu> | And each time I will get it a bit more |
2024-12-21 07:55:30 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 276 seconds) |
2024-12-21 07:55:50 +0100 | <orangeflu> | But right now, I want to implement a REPL and step by step emulation, which was the point of all this headache to begin with |
2024-12-21 07:56:05 +0100 | <orangeflu> | And there's a lot of monads there |
2024-12-21 07:56:29 +0100 | <orangeflu> | src/Repl.hs on my branch |
2024-12-21 07:57:30 +0100 | <haskellbridge> | <Bowuigi> A nice explanation of free monads https://www.haskellforall.com/2012/06/you-could-have-invented-free-monads.html?m=1 |
2024-12-21 07:59:32 +0100 | JuanDaugherty | (~juan@user/JuanDaugherty) (Quit: JuanDaugherty) |
2024-12-21 07:59:40 +0100 | <haskellbridge> | <Bowuigi> As for the emulator, just going with MVector, messing around with strictness and adding the "aggressively" flags to the Cabal file will fix 70%-75% of your performance/space issues, the rest are fixed by even deeper magic which would not help now |
2024-12-21 08:00:06 +0100 | manwithluck | (~manwithlu@194.177.28.164) (Ping timeout: 244 seconds) |
2024-12-21 08:00:10 +0100 | <orangeflu> | Ok, bookmarked the links you gave me |
2024-12-21 08:00:17 +0100 | JamesMowery439 | (~JamesMowe@ip68-228-212-232.ph.ph.cox.net) (Quit: Goodbye) |
2024-12-21 08:00:29 +0100 | <orangeflu> | also, thank you for everything |
2024-12-21 08:00:34 +0100 | JamesMowery439 | (~JamesMowe@ip68-228-212-232.ph.ph.cox.net) JamesMowery |
2024-12-21 08:00:45 +0100 | <orangeflu> | been at this for 12 hours now, and my brain is mush |
2024-12-21 08:00:51 +0100 | <orangeflu> | you really helped |
2024-12-21 08:01:08 +0100 | tnt1 | (~Thunderbi@user/tnt1) (Ping timeout: 244 seconds) |
2024-12-21 08:01:20 +0100 | <haskellbridge> | <Bowuigi> Step by step emulation shouldn't be painful at all, you structured this nicely with the instruction list |
2024-12-21 08:01:33 +0100 | <haskellbridge> | <Bowuigi> Good luck and glad to help! |
2024-12-21 08:01:49 +0100 | tnt1 | (~Thunderbi@user/tnt1) tnt1 |
2024-12-21 08:03:10 +0100 | <orangeflu> | well, it is painful |
2024-12-21 08:03:45 +0100 | <orangeflu> | cause look how many monads are involved in this: InputT, IO, Parser, Either, Maybe |
2024-12-21 08:04:15 +0100 | <orangeflu> | I am actually surprised that what i wrote so far compiles even |
2024-12-21 08:04:36 +0100 | <orangeflu> | even if it looks... questionable |
2024-12-21 08:05:42 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) merijn |
2024-12-21 08:06:43 +0100 | peterbecich | (~Thunderbi@syn-047-229-123-186.res.spectrum.com) (Quit: peterbecich) |
2024-12-21 08:07:10 +0100 | peterbecich | (~Thunderbi@syn-047-229-123-186.res.spectrum.com) peterbecich |
2024-12-21 08:10:35 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 260 seconds) |
2024-12-21 08:11:47 +0100 | manwithluck | (~manwithlu@194.177.28.164) manwithluck |
2024-12-21 08:12:14 +0100 | manwithluck | (~manwithlu@194.177.28.164) (Read error: Connection reset by peer) |
2024-12-21 08:14:56 +0100 | takuan | (~takuan@178-116-218-225.access.telenet.be) |
2024-12-21 08:16:21 +0100 | manwithluck | (~manwithlu@194.177.28.164) manwithluck |
2024-12-21 08:21:24 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) merijn |
2024-12-21 08:25:42 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 246 seconds) |
2024-12-21 08:30:34 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) merijn |
2024-12-21 08:32:43 +0100 | Digitteknohippie | Digit |
2024-12-21 08:33:25 +0100 | CrunchyFlakes | (~CrunchyFl@31.19.233.78) (Read error: Connection reset by peer) |
2024-12-21 08:34:53 +0100 | Sgeo_ | (~Sgeo@user/sgeo) Sgeo |
2024-12-21 08:35:13 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 248 seconds) |
2024-12-21 08:36:01 +0100 | CrunchyFlakes | (~CrunchyFl@31.19.233.78) |
2024-12-21 08:38:12 +0100 | Sgeo | (~Sgeo@user/sgeo) (Ping timeout: 252 seconds) |
2024-12-21 08:48:42 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) merijn |
2024-12-21 08:50:56 +0100 | j1n37 | (~j1n37@user/j1n37) (Read error: Connection reset by peer) |
2024-12-21 08:51:04 +0100 | <haskellbridge> | <magic_rb> Bowuigi what cabal flags are you referring to? |
2024-12-21 08:52:38 +0100 | <[exa]> | orangeflu: the change to State won't be completely plug-in but you somewhat implicitly do the State there already so I'd say lots of code would just disappear |
2024-12-21 08:53:01 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 244 seconds) |
2024-12-21 08:54:01 +0100 | <[exa]> | change from arrays to mvectors after that should be quite painless (you change State to StateT IO or ST or so to get the sequenced operations, and then just adjust the memory-changing operation) |
2024-12-21 08:54:03 +0100 | j1n37 | (~j1n37@user/j1n37) j1n37 |
2024-12-21 08:54:17 +0100 | <haskellbridge> | <Bowuigi> magic_rb the GHC flags -fspecialize-aggressively, -fexpose-all-unfoldings and -O2, maybe other stuff too idk |
2024-12-21 08:54:29 +0100 | <[exa]> | orangeflu: btw highly recommend playing with a tiny prototype of each, helps a lot. |
2024-12-21 08:54:49 +0100 | <haskellbridge> | <magic_rb> Ill try those for my little game engine, last time i profiled it, 40% of the time was >>= |
2024-12-21 08:55:32 +0100 | <haskellbridge> | <Bowuigi> If that's due to an associativity issue try Codensity too |
2024-12-21 08:57:36 +0100 | <haskellbridge> | <Bowuigi> Tangentially related, is smalltt a strict language? It seems to have quite a bit of focus on strictness optimization |
2024-12-21 09:00:00 +0100 | caconym | (~caconym@user/caconym) (Quit: bye) |
2024-12-21 09:00:40 +0100 | caconym | (~caconym@user/caconym) caconym |
2024-12-21 09:02:20 +0100 | <haskellbridge> | <Bowuigi> Implementation-wise, it kinda switches between lazy and eager depending on what needs to be done (for performance reasons), but I'm not sure about its semantics in the usual tasks |
2024-12-21 09:04:05 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) merijn |
2024-12-21 09:04:20 +0100 | peterbecich | (~Thunderbi@syn-047-229-123-186.res.spectrum.com) (Ping timeout: 264 seconds) |
2024-12-21 09:13:26 +0100 | tzh | (~tzh@c-76-115-131-146.hsd1.or.comcast.net) (Quit: zzz) |
2024-12-21 09:15:54 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 265 seconds) |
2024-12-21 09:21:01 +0100 | <probie> | It's not possible to override precedence for a function specified in another module is it? |
2024-12-21 09:23:12 +0100 | Guest46 | (~Guest46@2405:201:e016:301c:9934:efe2:6f7:528d) |
2024-12-21 09:25:21 +0100 | Guest46 | (~Guest46@2405:201:e016:301c:9934:efe2:6f7:528d) (Client Quit) |
2024-12-21 09:25:45 +0100 | <geekosaur> | no |
2024-12-21 09:26:19 +0100 | <geekosaur> | at least, not directly. You can do `` foo = bar; infixl 4 `foo` `` or similar though |
2024-12-21 09:26:37 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) merijn |
2024-12-21 09:28:31 +0100 | Guest46 | (~Guest46@2405:201:e016:301c:9934:efe2:6f7:528d) |
2024-12-21 09:28:36 +0100 | Guest46 | (~Guest46@2405:201:e016:301c:9934:efe2:6f7:528d) (Client Quit) |
2024-12-21 09:31:02 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 244 seconds) |
2024-12-21 09:37:06 +0100 | Square | (~Square@user/square) (Ping timeout: 246 seconds) |
2024-12-21 09:46:38 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) merijn |
2024-12-21 09:51:30 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 260 seconds) |
2024-12-21 09:59:30 +0100 | ljdarj | (~Thunderbi@user/ljdarj) ljdarj |
2024-12-21 10:02:01 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) merijn |
2024-12-21 10:06:41 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 244 seconds) |
2024-12-21 10:14:59 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) merijn |
2024-12-21 10:16:06 +0100 | Tuplanolla | (~Tuplanoll@91-159-69-59.elisa-laajakaista.fi) Tuplanolla |
2024-12-21 10:19:48 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 276 seconds) |
2024-12-21 10:30:21 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) merijn |
2024-12-21 10:30:40 +0100 | rembo10_ | (~rembo10@main.remulis.com) (Quit: ZNC 1.8.2 - https://znc.in) |
2024-12-21 10:32:09 +0100 | rembo10 | (~rembo10@main.remulis.com) rembo10 |
2024-12-21 10:36:39 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 244 seconds) |
2024-12-21 10:40:17 +0100 | __monty__ | (~toonn@user/toonn) toonn |
2024-12-21 10:44:04 +0100 | acidjnk_new | (~acidjnk@p200300d6e7283f52b5be3bacf47f1ed3.dip0.t-ipconnect.de) acidjnk |
2024-12-21 10:47:39 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) merijn |
2024-12-21 10:51:34 +0100 | vanishingideal | (~vanishing@user/vanishingideal) vanishingideal |
2024-12-21 10:51:51 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 244 seconds) |
2024-12-21 10:51:57 +0100 | ash3en | (~Thunderbi@2a03:7846:b6eb:101:93ac:a90a:da67:f207) ash3en |
2024-12-21 11:02:54 +0100 | tnt2 | (~Thunderbi@user/tnt1) tnt1 |
2024-12-21 11:03:01 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) merijn |
2024-12-21 11:04:39 +0100 | tnt1 | (~Thunderbi@user/tnt1) (Ping timeout: 265 seconds) |
2024-12-21 11:04:39 +0100 | tnt2 | tnt1 |
2024-12-21 11:07:47 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 252 seconds) |
2024-12-21 11:17:41 +0100 | Sgeo_ | (~Sgeo@user/sgeo) (Read error: Connection reset by peer) |
2024-12-21 11:18:34 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) merijn |
2024-12-21 11:19:45 +0100 | vanishingideal | (~vanishing@user/vanishingideal) (Ping timeout: 244 seconds) |
2024-12-21 11:23:12 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 252 seconds) |
2024-12-21 11:33:31 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) merijn |
2024-12-21 11:35:51 +0100 | sawilagar | (~sawilagar@user/sawilagar) sawilagar |
2024-12-21 11:36:01 +0100 | pabs3 | (~pabs3@user/pabs3) (Read error: Connection reset by peer) |
2024-12-21 11:36:45 +0100 | pabs3 | (~pabs3@user/pabs3) pabs3 |
2024-12-21 11:38:32 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 264 seconds) |
2024-12-21 11:44:31 +0100 | ephilalethes | (~noumenon@202.186.203.84) noumenon |
2024-12-21 11:45:41 +0100 | billchenchina | (~billchenc@183.95.251.11) billchenchina |
2024-12-21 11:48:53 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) merijn |
2024-12-21 11:50:01 +0100 | billchenchina | (~billchenc@183.95.251.11) (Ping timeout: 244 seconds) |
2024-12-21 11:53:09 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 248 seconds) |
2024-12-21 11:56:51 +0100 | ljdarj | (~Thunderbi@user/ljdarj) (Ping timeout: 272 seconds) |
2024-12-21 12:00:44 +0100 | ash3en | (~Thunderbi@2a03:7846:b6eb:101:93ac:a90a:da67:f207) (Quit: ash3en) |
2024-12-21 12:03:46 +0100 | Guest93 | (~Guest93@106.219.180.229) |
2024-12-21 12:04:18 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) merijn |
2024-12-21 12:04:30 +0100 | Guest93 | (~Guest93@106.219.180.229) (Client Quit) |
2024-12-21 12:06:32 +0100 | carbolymer_ | carbolymer |
2024-12-21 12:09:38 +0100 | tnt2 | (~Thunderbi@user/tnt1) tnt1 |
2024-12-21 12:10:29 +0100 | tnt1 | (~Thunderbi@user/tnt1) (Ping timeout: 252 seconds) |
2024-12-21 12:10:29 +0100 | tnt2 | tnt1 |
2024-12-21 12:10:49 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 245 seconds) |
2024-12-21 12:17:38 +0100 | AlexZenon | (~alzenon@5.139.233.146) (Ping timeout: 265 seconds) |
2024-12-21 12:19:23 +0100 | alexherbo2 | (~alexherbo@2a02-8440-3508-e5d2-70ed-26be-f60d-e304.rev.sfr.net) alexherbo2 |
2024-12-21 12:22:18 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) merijn |
2024-12-21 12:23:03 +0100 | AlexZenon | (~alzenon@5.139.233.146) |
2024-12-21 12:24:09 +0100 | rvalue- | (~rvalue@user/rvalue) rvalue |
2024-12-21 12:24:43 +0100 | rvalue | (~rvalue@user/rvalue) (Ping timeout: 264 seconds) |
2024-12-21 12:26:30 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 246 seconds) |
2024-12-21 12:28:17 +0100 | rvalue- | rvalue |
2024-12-21 12:30:12 +0100 | youthlic | (~Thunderbi@user/youthlic) (Ping timeout: 265 seconds) |
2024-12-21 12:34:30 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) merijn |
2024-12-21 12:36:12 +0100 | youthlic | (~Thunderbi@user/youthlic) youthlic |
2024-12-21 12:37:20 +0100 | alexherbo2 | (~alexherbo@2a02-8440-3508-e5d2-70ed-26be-f60d-e304.rev.sfr.net) (Remote host closed the connection) |
2024-12-21 12:39:30 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 260 seconds) |
2024-12-21 12:41:03 +0100 | mewra | (~aranea@wireguard/contributorcat/mira) (Quit: back in a couple weeks :3) |
2024-12-21 12:48:53 +0100 | Digitteknohippie | (~user@user/digit) Digit |
2024-12-21 12:49:51 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) merijn |
2024-12-21 12:51:15 +0100 | dostoevsky | (~dostoevsk@user/dostoevsky) (Ping timeout: 276 seconds) |
2024-12-21 12:51:21 +0100 | Digit | (~user@user/digit) (Ping timeout: 246 seconds) |
2024-12-21 12:54:25 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 248 seconds) |
2024-12-21 12:55:32 +0100 | lxsameer | (lxsameer@Serene/lxsameer) lxsameer |
2024-12-21 13:00:05 +0100 | caconym | (~caconym@user/caconym) (Quit: bye) |
2024-12-21 13:03:37 +0100 | caconym | (~caconym@user/caconym) caconym |
2024-12-21 13:04:46 +0100 | lxsameer | (lxsameer@Serene/lxsameer) (Ping timeout: 252 seconds) |
2024-12-21 13:05:15 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) merijn |
2024-12-21 13:05:41 +0100 | dostoevsky | (~dostoevsk@user/dostoevsky) dostoevsky |
2024-12-21 13:06:44 +0100 | Digitteknohippie | Digit |
2024-12-21 13:06:51 +0100 | lxsameer | (lxsameer@Serene/lxsameer) lxsameer |
2024-12-21 13:09:54 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 252 seconds) |
2024-12-21 13:13:12 +0100 | lxsameer | (lxsameer@Serene/lxsameer) (Ping timeout: 244 seconds) |
2024-12-21 13:14:31 +0100 | califax | (~califax@user/califx) (Remote host closed the connection) |
2024-12-21 13:16:04 +0100 | califax | (~califax@user/califx) califx |
2024-12-21 13:16:11 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) merijn |
2024-12-21 13:35:19 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 260 seconds) |
2024-12-21 13:39:09 +0100 | Digit | (~user@user/digit) (Ping timeout: 252 seconds) |
2024-12-21 13:40:06 +0100 | Digitteknohippie | (~user@user/digit) Digit |
2024-12-21 13:42:08 +0100 | Digit | (~user@user/digit) Digit |
2024-12-21 13:44:04 +0100 | Digitteknohippie | (~user@user/digit) (Quit: sorted my other instance from locking up with a forced umount and remount) |
2024-12-21 13:45:04 +0100 | lxsameer | (~lxsameer@Serene/lxsameer) lxsameer |
2024-12-21 13:46:52 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) merijn |
2024-12-21 13:48:51 +0100 | glguy | (glguy@libera/staff/glguy) (Read error: Connection reset by peer) |
2024-12-21 13:49:48 +0100 | lxsameer | (~lxsameer@Serene/lxsameer) (Ping timeout: 246 seconds) |
2024-12-21 13:51:37 +0100 | wootehfoot | (~wootehfoo@user/wootehfoot) wootehfoot |
2024-12-21 13:53:30 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 244 seconds) |
2024-12-21 14:02:53 +0100 | pavonia | (~user@user/siracusa) siracusa |
2024-12-21 14:04:31 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) merijn |
2024-12-21 14:08:56 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 252 seconds) |
2024-12-21 14:16:20 +0100 | Guest78 | (~Guest78@37.228.252.73) |
2024-12-21 14:17:50 +0100 | sprotte24 | (~sprotte24@p200300d16f1a2c0064c6ee858fd5dcfe.dip0.t-ipconnect.de) |
2024-12-21 14:19:53 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) merijn |
2024-12-21 14:21:57 +0100 | alp | (~alp@2001:861:8ca0:4940:94c0:33a8:5f77:cbe8) |
2024-12-21 14:24:37 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 248 seconds) |
2024-12-21 14:30:21 +0100 | Digitteknohippie | (~user@user/digit) Digit |
2024-12-21 14:32:00 +0100 | Digit | (~user@user/digit) (Ping timeout: 276 seconds) |
2024-12-21 14:32:33 +0100 | alp | (~alp@2001:861:8ca0:4940:94c0:33a8:5f77:cbe8) (Ping timeout: 248 seconds) |
2024-12-21 14:34:07 +0100 | Smiles | (uid551636@id-551636.lymington.irccloud.com) Smiles |
2024-12-21 14:34:27 +0100 | machinedgod | (~machinedg@d108-173-18-100.abhsia.telus.net) machinedgod |
2024-12-21 14:40:53 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) merijn |
2024-12-21 14:45:32 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 265 seconds) |
2024-12-21 14:53:06 +0100 | weary-traveler | (~user@user/user363627) user363627 |
2024-12-21 14:56:17 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) merijn |
2024-12-21 14:58:46 +0100 | meritamen | (~user@user/meritamen) meritamen |
2024-12-21 15:02:04 +0100 | tremon | (~tremon@83.80.159.219) tremon |
2024-12-21 15:03:25 +0100 | Digitteknohippie | Digit |
2024-12-21 15:03:51 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 276 seconds) |
2024-12-21 15:14:19 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) merijn |
2024-12-21 15:18:57 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 252 seconds) |
2024-12-21 15:29:16 +0100 | <zzz> | i've always wonder if Haskell without infix operators would be nicer |
2024-12-21 15:29:40 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) merijn |
2024-12-21 15:30:19 +0100 | <zzz> | then again, function composition would get awkward |
2024-12-21 15:31:14 +0100 | Guest78 | (~Guest78@37.228.252.73) (Quit: Client closed) |
2024-12-21 15:34:00 +0100 | <probie> | Personally, I wouldn't hate a version of Haskell where all infix operators have the same precedence as `$` |
2024-12-21 15:38:28 +0100 | <enikar> | there is liskell, if many parentheses don't afraid you ;) |
2024-12-21 15:38:56 +0100 | <ski> | `y * k + x' would be awkward |
2024-12-21 15:40:34 +0100 | <probie> | ski: That's not annoying at all. The annoying operator is `-`, because `3 - 4 - 5 - 6` is `3 - (4 - (5 - 6))` |
2024-12-21 15:41:01 +0100 | <ski> | it would get interpreted as `y * (k + x)' |
2024-12-21 15:41:05 +0100 | <ski> | yea, that too |
2024-12-21 15:46:06 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 252 seconds) |
2024-12-21 15:46:45 +0100 | <probie> | ski: Pretty much all the APL descendants (APL itself, K, J, Q, BQN) already do this, and their users seems satisfied with how `y*k+x` is parsed |
2024-12-21 15:47:22 +0100 | <ski> | iirc, Smalltalk also does this (although to the left, not to the right) |
2024-12-21 15:48:21 +0100 | <ski> | enikar : then there's the concatenative languages |
2024-12-21 15:50:19 +0100 | <probie> | Re smalltalk: That's right, because x+k*y is (using pseudo-Java syntax) `x.Plus(k).Mult(y)` |
2024-12-21 15:50:22 +0100 | meritamen | (~user@user/meritamen) (Remote host closed the connection) |
2024-12-21 15:52:21 +0100 | <enikar> | ski: concatenative languages? |
2024-12-21 15:52:40 +0100 | <probie> | languages like Forth and Factor |
2024-12-21 15:53:30 +0100 | <enikar> | I found that: https://en.wikipedia.org/wiki/Concatenative_programming_language |
2024-12-21 15:54:52 +0100 | <probie> | In a concatenative programming language, If I have a function `f` and a function `g`, their composition (written in Haskell as `f . g`) is just `g f` |
2024-12-21 15:56:59 +0100 | <enikar> | when I discovered forth it was a great moment :) |
2024-12-21 15:57:24 +0100 | <ski> | > run (lit 3 . lit 2 . mult . lit 1 . add) -- `3 * 2 + 1' |
2024-12-21 15:57:25 +0100 | <lambdabot> | 7 |
2024-12-21 15:57:33 +0100 | wootehfoot | (~wootehfoo@user/wootehfoot) (Ping timeout: 246 seconds) |
2024-12-21 15:57:39 +0100 | <ski> | > run (lit 1 . lit 3 . lit 2 . mult . add) -- `1 + 3 * 2' |
2024-12-21 15:57:57 +0100 | <lambdabot> | 7 |
2024-12-21 15:58:03 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) merijn |
2024-12-21 15:58:06 +0100 | <ski> | > run (lit 3 . lit 2 . sub) -- `3 - 2' |
2024-12-21 15:58:08 +0100 | <lambdabot> | 1 |
2024-12-21 15:58:17 +0100 | <ski> | > run (lit 3 . lit 2 . swap_ . sub) -- `2 - 3' |
2024-12-21 15:58:19 +0100 | <lambdabot> | -1 |
2024-12-21 15:58:36 +0100 | <ski> | > run (lit 3 . dup . mult) -- `3 * 3' |
2024-12-21 15:58:37 +0100 | <lambdabot> | 9 |
2024-12-21 15:58:44 +0100 | <ski> | enikar : like that ^ |
2024-12-21 15:58:54 +0100 | <enikar> | yes :) |
2024-12-21 15:59:51 +0100 | <ski> | (btw, note how `foo . bar' does the word `foo' first, and then the word `bar', not the other way around) |
2024-12-21 16:01:28 +0100 | <enikar> | oh! I see! |
2024-12-21 16:01:30 +0100 | <ski> | probie : *nod* (re Smalltalk) |
2024-12-21 16:01:59 +0100 | <ski> | enikar : .. which may be unexpected/surprising (re your comment about `f . g' above) |
2024-12-21 16:02:20 +0100 | <enikar> | yes it is |
2024-12-21 16:02:30 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 260 seconds) |
2024-12-21 16:03:42 +0100 | <ski> | (er, sorry, that was probie who said that) |
2024-12-21 16:04:27 +0100 | <ski> | enikar : <https://en.wikipedia.org/wiki/Threaded_code> is also interesting |
2024-12-21 16:04:33 +0100 | <enikar> | never mind :) |
2024-12-21 16:05:33 +0100 | <probie> | I'm not sure if I'd call it a truly concatenative language, but Uiuia is stack based language in which Haskell's `f . g` is written as `f g`. However `f\ng` (where \n is a literal newline) is the same as `g f`. |
2024-12-21 16:05:48 +0100 | wootehfoot | (~wootehfoo@user/wootehfoot) wootehfoot |
2024-12-21 16:05:55 +0100 | <ski> | that's interesting |
2024-12-21 16:06:22 +0100 | <ski> | probie : does it have `swap',`drop' and `dup' ? |
2024-12-21 16:07:14 +0100 | <enikar> | ski: thanks, I didn't know that, but I wrote a simple calculator that used threaded code. |
2024-12-21 16:07:37 +0100 | youthlic | (~Thunderbi@user/youthlic) (Quit: youthlic) |
2024-12-21 16:10:49 +0100 | <probie> | ski: yes, but it since it's also inspired by APL and therefore everything important needs to be a single character, they're most commonly spelled `:`, `◌` and `.` respectively |
2024-12-21 16:13:21 +0100 | <probie> | e.g. `3 4 swap drop dup *` would be `×.◌:3 4` |
2024-12-21 16:13:22 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) merijn |
2024-12-21 16:13:39 +0100 | ski | nods |
2024-12-21 16:13:50 +0100 | <probie> | sorry, `×.◌:4 3` |
2024-12-21 16:13:59 +0100 | youthlic | (~Thunderbi@user/youthlic) youthlic |
2024-12-21 16:14:01 +0100 | youthlic | (~Thunderbi@user/youthlic) (Client Quit) |
2024-12-21 16:15:04 +0100 | <enikar> | APL is too odd |
2024-12-21 16:15:42 +0100 | tremon | (~tremon@83.80.159.219) (Quit: getting boxed in) |
2024-12-21 16:17:41 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 248 seconds) |
2024-12-21 16:18:32 +0100 | CrunchyFlakes | (~CrunchyFl@31.19.233.78) (Read error: Connection reset by peer) |
2024-12-21 16:20:23 +0100 | CrunchyFlakes | (~CrunchyFl@ip1f13e94e.dynamic.kabel-deutschland.de) |
2024-12-21 16:22:01 +0100 | ephilalethes | (~noumenon@202.186.203.84) (Read error: Connection reset by peer) |
2024-12-21 16:28:42 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) merijn |
2024-12-21 16:33:01 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 252 seconds) |
2024-12-21 16:34:52 +0100 | wootehfoot | (~wootehfoo@user/wootehfoot) (Ping timeout: 252 seconds) |
2024-12-21 16:39:43 +0100 | ft | (~ft@p508db9c7.dip0.t-ipconnect.de) (Ping timeout: 264 seconds) |
2024-12-21 16:43:03 +0100 | ljdarj | (~Thunderbi@user/ljdarj) ljdarj |
2024-12-21 16:43:14 +0100 | Smiles | (uid551636@id-551636.lymington.irccloud.com) (Quit: Connection closed for inactivity) |
2024-12-21 16:44:03 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) merijn |
2024-12-21 16:46:09 +0100 | ft | (~ft@p508db070.dip0.t-ipconnect.de) ft |
2024-12-21 16:48:47 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 265 seconds) |
2024-12-21 16:49:59 +0100 | <hellwolf> | Question: even with NoImplicitPrelude, GHC.Types seem still imported |
2024-12-21 16:50:09 +0100 | <hellwolf> | hence Int, Bool, etc. are all available. |
2024-12-21 16:50:24 +0100 | <hellwolf> | can one go further to strip those away? |
2024-12-21 16:54:27 +0100 | alecs | (~alecs@61.pool85-58-154.dynamic.orange.es) alecs |
2024-12-21 16:57:33 +0100 | <probie> | hellwolf: are you sure? They're not imported for me. If I run `ghci -XNoImplicitPrelude` and ask `:k Int` I definitely get a "Not in scope" error |
2024-12-21 16:57:50 +0100 | MyNetAz | (~MyNetAz@user/MyNetAz) (Read error: Connection reset by peer) |
2024-12-21 16:57:56 +0100 | <hellwolf> | you are right. |
2024-12-21 16:58:10 +0100 | <hellwolf> | I did :Set -XNoImplicitPrelude afterwards |
2024-12-21 16:58:25 +0100 | gmg | (~user@user/gehmehgeh) (Quit: Leaving) |
2024-12-21 16:58:48 +0100 | alecs | (~alecs@61.pool85-58-154.dynamic.orange.es) (Ping timeout: 246 seconds) |
2024-12-21 16:58:50 +0100 | ethantwardy | (user@user/ethantwardy) (Quit: WeeChat 4.4.2) |
2024-12-21 16:59:27 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) merijn |
2024-12-21 17:01:01 +0100 | ethantwardy | (user@user/ethantwardy) ethantwardy |
2024-12-21 17:02:32 +0100 | tzh | (~tzh@c-76-115-131-146.hsd1.or.comcast.net) tzh |
2024-12-21 17:04:51 +0100 | MyNetAz | (~MyNetAz@user/MyNetAz) MyNetAz |
2024-12-21 17:06:31 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 252 seconds) |
2024-12-21 17:14:43 +0100 | ethantwardy | (user@user/ethantwardy) (Quit: WeeChat 4.4.2) |
2024-12-21 17:17:29 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) merijn |
2024-12-21 17:18:26 +0100 | ethantwardy | (user@user/ethantwardy) ethantwardy |
2024-12-21 17:22:08 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 265 seconds) |
2024-12-21 17:25:50 +0100 | sprotte24 | (~sprotte24@p200300d16f1a2c0064c6ee858fd5dcfe.dip0.t-ipconnect.de) (Quit: Leaving) |
2024-12-21 17:27:32 +0100 | ethantwardy | (user@user/ethantwardy) (Quit: WeeChat 4.4.2) |
2024-12-21 17:27:55 +0100 | tnt2 | (~Thunderbi@user/tnt1) tnt1 |
2024-12-21 17:28:57 +0100 | tnt1 | (~Thunderbi@user/tnt1) (Ping timeout: 244 seconds) |
2024-12-21 17:28:57 +0100 | tnt2 | tnt1 |
2024-12-21 17:32:53 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) merijn |
2024-12-21 17:33:41 +0100 | Smiles | (uid551636@id-551636.lymington.irccloud.com) Smiles |
2024-12-21 17:36:10 +0100 | ethantwardy | (user@user/ethantwardy) ethantwardy |
2024-12-21 17:37:09 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 248 seconds) |
2024-12-21 17:37:31 +0100 | ethantwardy | (user@user/ethantwardy) (Client Quit) |
2024-12-21 17:41:52 +0100 | ethantwardy | (user@user/ethantwardy) ethantwardy |
2024-12-21 17:42:39 +0100 | machinedgod | (~machinedg@d108-173-18-100.abhsia.telus.net) (Ping timeout: 272 seconds) |
2024-12-21 17:43:38 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) merijn |
2024-12-21 17:45:31 +0100 | ethantwardy | (user@user/ethantwardy) (Client Quit) |
2024-12-21 17:47:13 +0100 | ethantwardy | (user@user/ethantwardy) ethantwardy |
2024-12-21 17:47:45 +0100 | ethantwardy | (user@user/ethantwardy) (Client Quit) |
2024-12-21 17:48:29 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 260 seconds) |
2024-12-21 17:49:28 +0100 | ethantwardy | (user@user/ethantwardy) ethantwardy |
2024-12-21 17:50:02 +0100 | ethantwardy | (user@user/ethantwardy) (Client Quit) |
2024-12-21 17:51:22 +0100 | ethantwardy | (user@user/ethantwardy) ethantwardy |
2024-12-21 17:52:25 +0100 | ethantwardy | (user@user/ethantwardy) (Client Quit) |
2024-12-21 17:53:56 +0100 | rachelambda8 | (~rachelamb@cust-95-80-25-71.csbnet.se) (Quit: β reduced) |
2024-12-21 17:54:21 +0100 | ethantwardy | (user@user/ethantwardy) ethantwardy |
2024-12-21 17:54:54 +0100 | ethantwardy | (user@user/ethantwardy) (Client Quit) |
2024-12-21 17:56:18 +0100 | ethantwardy | (user@user/ethantwardy) ethantwardy |
2024-12-21 17:57:02 +0100 | ethantwardy | (user@user/ethantwardy) (Client Quit) |
2024-12-21 17:57:22 +0100 | tnt1 | (~Thunderbi@user/tnt1) (Ping timeout: 252 seconds) |
2024-12-21 17:57:25 +0100 | ljdarj | (~Thunderbi@user/ljdarj) (Ping timeout: 265 seconds) |
2024-12-21 17:57:46 +0100 | tnt1 | (~Thunderbi@user/tnt1) tnt1 |
2024-12-21 17:59:02 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) merijn |
2024-12-21 18:00:46 +0100 | ethantwardy | (user@user/ethantwardy) ethantwardy |
2024-12-21 18:00:58 +0100 | tnt2 | (~Thunderbi@user/tnt1) tnt1 |
2024-12-21 18:02:09 +0100 | tnt1 | (~Thunderbi@user/tnt1) (Ping timeout: 248 seconds) |
2024-12-21 18:02:10 +0100 | tnt2 | tnt1 |
2024-12-21 18:03:45 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 248 seconds) |
2024-12-21 18:13:30 +0100 | toch | (toch@user/toch) (Ping timeout: 252 seconds) |
2024-12-21 18:14:25 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) merijn |
2024-12-21 18:19:04 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 244 seconds) |
2024-12-21 18:28:00 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) merijn |
2024-12-21 18:32:57 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 246 seconds) |
2024-12-21 18:33:18 +0100 | ljdarj | (~Thunderbi@user/ljdarj) ljdarj |
2024-12-21 18:39:33 +0100 | <WzC> | Hmm, does anyone know if I can/how to use coerce to coerce some phantom parameter from one kind into another? More concretely; I would like this to just work : https://paste.tomsmeding.com/MdEGcxHR (and I feel it should, sicne 's' and the kind is universally quantified anyway |
2024-12-21 18:40:14 +0100 | <WzC> | I think something like this used to work (porting some old code to newer ghc's, but now s.t. like this gives an error) |
2024-12-21 18:42:28 +0100 | toch | (toch@user/toch) toch |
2024-12-21 18:44:03 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) merijn |
2024-12-21 18:45:58 +0100 | <ski> | type role Foo phantom -- does adding this help ? (need `RoleAnnotations') |
2024-12-21 18:46:45 +0100 | <WzC> | unfortunately not |
2024-12-21 18:47:09 +0100 | michalz | (~michalz@185.246.207.203) |
2024-12-21 18:47:16 +0100 | <WzC> | I think the issue is that the coercible typeclass seems to actually have kind annotations that force that the types have to have the same kind |
2024-12-21 18:47:40 +0100 | <WzC> | i.e. the haddocks now say: class a ~R# b => Coercible (a :: k) (b :: k) |
2024-12-21 18:49:58 +0100 | <ski> | hm, can you do `data Foo k (s :: k) = Foo' ? |
2024-12-21 18:50:20 +0100 | lxsameer | (~lxsameer@Serene/lxsameer) lxsameer |
2024-12-21 18:50:30 +0100 | ski | wonders whether that might help |
2024-12-21 18:50:54 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 252 seconds) |
2024-12-21 18:51:49 +0100 | <WzC> | interesting idea; doesn't seem to though :( |
2024-12-21 18:56:42 +0100 | alecs | (~alecs@61.pool85-58-154.dynamic.orange.es) alecs |
2024-12-21 19:01:45 +0100 | alecs | (~alecs@61.pool85-58-154.dynamic.orange.es) (Ping timeout: 276 seconds) |
2024-12-21 19:02:07 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) merijn |
2024-12-21 19:06:18 +0100 | ljdarj | (~Thunderbi@user/ljdarj) (Ping timeout: 244 seconds) |
2024-12-21 19:06:57 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 276 seconds) |
2024-12-21 19:09:47 +0100 | Guest78 | (~Guest78@37.228.252.73) |
2024-12-21 19:17:28 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) merijn |
2024-12-21 19:19:29 +0100 | Lord_of_Life | (~Lord@user/lord-of-life/x-2819915) (Ping timeout: 248 seconds) |
2024-12-21 19:19:41 +0100 | Lord_of_Life_ | (~Lord@user/lord-of-life/x-2819915) Lord_of_Life |
2024-12-21 19:20:54 +0100 | weary-traveler | (~user@user/user363627) (Remote host closed the connection) |
2024-12-21 19:21:24 +0100 | rachelambda8 | (~rachelamb@cust-95-80-25-71.csbnet.se) |
2024-12-21 19:21:51 +0100 | <haskellbridge> | <thirdofmay18081814goya> "A :: Page" contains a list of elements "[ElemType]" such that "e :: ElemType" determines a new page "f(e) :: Page" |
2024-12-21 19:22:00 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 260 seconds) |
2024-12-21 19:22:05 +0100 | <haskellbridge> | <thirdofmay18081814goya> what's the right data structure to capture both "A" and "f(e)" |
2024-12-21 19:22:38 +0100 | Lord_of_Life_ | Lord_of_Life |
2024-12-21 19:26:31 +0100 | Square | (~Square@user/square) Square |
2024-12-21 19:27:58 +0100 | Square | (~Square@user/square) (Client Quit) |
2024-12-21 19:28:13 +0100 | Square | (~Square@user/square) Square |
2024-12-21 19:32:54 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) merijn |
2024-12-21 19:37:27 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 252 seconds) |
2024-12-21 19:37:43 +0100 | <iqubic> | Is there a better way to write this function: "matchingKeys :: (Eq v) => Map k v -> v -> [k]" |
2024-12-21 19:37:46 +0100 | <iqubic> | "matchingKeys map x = [value | (key, value) <- M.toList map, value == x]" |
2024-12-21 19:41:05 +0100 | sprotte24 | (~sprotte24@p200300d16f1a2c0064c6ee858fd5dcfe.dip0.t-ipconnect.de) |
2024-12-21 19:43:14 +0100 | Smiles | (uid551636@id-551636.lymington.irccloud.com) (Quit: Connection closed for inactivity) |
2024-12-21 19:43:44 +0100 | rachelambda8 | (~rachelamb@cust-95-80-25-71.csbnet.se) (Quit: β reduced) |
2024-12-21 19:45:03 +0100 | rachelambda8 | (~rachelamb@cust-95-80-25-71.csbnet.se) |
2024-12-21 19:45:04 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) merijn |
2024-12-21 19:49:26 +0100 | <probie> | :t \m x -> M.keys $ M.filter (== x) $ m |
2024-12-21 19:49:28 +0100 | <lambdabot> | Eq a => M.Map k a -> a -> [k] |
2024-12-21 19:49:51 +0100 | <ski> | iqubic : i think you need to iterate through all associations in the map (because they're indexed by key, not by value). if you could do with `Ord v', there might be some bimap data structure, or a `(Ord k,Ord v) => Map k v -> Map v [k]' (or `NonEmpty' instead of `[]', perhaps) |
2024-12-21 19:49:56 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 264 seconds) |
2024-12-21 19:50:49 +0100 | <iqubic> | I was just wondering if there was a helper function that did this for me, but I guess not. What I have is clean enough for my purposes. |
2024-12-21 19:51:13 +0100 | <ski> | @hoogle Map k v -> Map v [k] |
2024-12-21 19:51:14 +0100 | <lambdabot> | Data.Map.Utils flipM :: (Ord key, Ord val) => Map key val -> Map val [key] |
2024-12-21 19:51:27 +0100 | <geekosaur> | there are bedirectional maps, but I don't know if that fits your need |
2024-12-21 19:52:17 +0100 | <EvanR> | yeah Data.Map has a filter function |
2024-12-21 19:52:19 +0100 | <iqubic> | A bidirectional map would be overkill. |
2024-12-21 19:52:34 +0100 | <EvanR> | probie showed a possible incantation to use it |
2024-12-21 19:52:55 +0100 | <iqubic> | My map only has at most 10 key value pairs and all the values are distinct. |
2024-12-21 19:53:18 +0100 | <EvanR> | even better |
2024-12-21 19:53:26 +0100 | <EvanR> | now you don't have to worry about it being too slow |
2024-12-21 19:55:30 +0100 | <orangeflu> | matchingKeys map x = Map.keys $ Map.filter (==x) map |
2024-12-21 19:55:52 +0100 | <EvanR> | the $ there is really gratuitous |
2024-12-21 19:56:13 +0100 | <orangeflu> | why |
2024-12-21 19:56:57 +0100 | <EvanR> | it's not a complicated enough expression to require bringing another level of precedence to get the grouping across |
2024-12-21 19:57:42 +0100 | <orangeflu> | Does it need to be complicated? I just like how it looks better than with paranthesis |
2024-12-21 19:58:01 +0100 | <EvanR> | ok well then that's also my reason |
2024-12-21 19:58:09 +0100 | <mauke> | $ only makes sense in non-complicated situations |
2024-12-21 19:58:26 +0100 | <EvanR> | I like parentheses better, especially when it's easy to read |
2024-12-21 19:58:35 +0100 | <mauke> | parentheses are usually harder to read |
2024-12-21 19:58:39 +0100 | <probie> | i$use$it$everywhere |
2024-12-21 19:59:04 +0100 | <orangeflu> | i am affirming i want money, nothing to do with grouping or precedence |
2024-12-21 19:59:15 +0100 | <monochrom> | Hot take: $ only makes sense in the law (<*>) = liftA2 ($) |
2024-12-21 19:59:46 +0100 | <mauke> | too hot |
2024-12-21 20:00:18 +0100 | <monochrom> | Call me conservative and reactionary, but IMO today's programmers are too religious in eliminating parentheses. |
2024-12-21 20:00:20 +0100 | <EvanR> | someone trained to distrust haskell and doesn't know haskell sees a gratuitous use of $ and says haskell has too many operators. Someone less dumb who doesn't know haskell might see a gratuitous $ and ask, why didn't you just use parentheses there |
2024-12-21 20:00:28 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) merijn |
2024-12-21 20:00:47 +0100 | <orangeflu> | I used to program a lot in lisp, i love parenthesis |
2024-12-21 20:00:48 +0100 | <monochrom> | "f (g x y)" is not that hard to read and doesn't need "f $ g x y". |
2024-12-21 20:01:08 +0100 | <mauke> | one level of parens is ok |
2024-12-21 20:01:15 +0100 | <mauke> | nesting is where the trouble starts |
2024-12-21 20:01:33 +0100 | <orangeflu> | matchingKeys map x = (Map.keys $ (Map.filter (==x) (map))) |
2024-12-21 20:01:33 +0100 | <EvanR> | you have to admit you're a never nester? |
2024-12-21 20:01:38 +0100 | <orangeflu> | jsut because i'm petty |
2024-12-21 20:01:42 +0100 | <EvanR> | new operator for each level of nesting |
2024-12-21 20:01:46 +0100 | <monochrom> | Oh by the time you have "f $ g $ h $ i $ x" it's simply (f . g . h . i) x |
2024-12-21 20:02:18 +0100 | <EvanR> | that's too many parens up there |
2024-12-21 20:02:33 +0100 | <orangeflu> | if anything, it needs more |
2024-12-21 20:03:01 +0100 | <EvanR> | you can't use an appeal to lisp syntax since you can't just add arbitrary parens in lisp without breaking things |
2024-12-21 20:03:08 +0100 | rachelambda8 | (~rachelamb@cust-95-80-25-71.csbnet.se) (Quit: β reduced) |
2024-12-21 20:03:23 +0100 | <EvanR> | since it's not just for grouping |
2024-12-21 20:03:54 +0100 | <orangeflu> | just saying, not afraid of some parens |
2024-12-21 20:04:26 +0100 | rachelambda8 | (~rachelamb@cust-95-80-25-71.csbnet.se) |
2024-12-21 20:05:29 +0100 | <probie> | monochrom: Déjà vu. I was having a similar conversation with some APL people a few hours ago who were complaining about people trying to hard to remove parens. Although to do that, they make excessive use of their equivalent of `flip` which I think is even more confusing |
2024-12-21 20:05:49 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 252 seconds) |
2024-12-21 20:05:50 +0100 | <EvanR> | since we have multiple equivalent ways to group stuff wadler's law appears |
2024-12-21 20:05:55 +0100 | <probie> | s/trying to hard/trying too hard/ |
2024-12-21 20:05:56 +0100 | <orangeflu> | Also, completely unrelated, but i turned on code coverage with cabal, and now it generates a tix file everytime i run my app, then when i modify something, it complains that the tix file doesn't match the hash, so i have to delete it. What do? Can I make it generate it only when `cabal test` or something similar? |
2024-12-21 20:06:58 +0100 | <mauke> | I once implemented a #$ macro in lisp |
2024-12-21 20:07:14 +0100 | <mauke> | (f #$ g x) ==> (f (g x)) |
2024-12-21 20:07:49 +0100 | <probie> | That's a reader macro, right? |
2024-12-21 20:08:20 +0100 | <mauke> | yeah |
2024-12-21 20:09:21 +0100 | <mauke> | oh, and I just remembered, for people who are allergic to symbols, f $ g $ h $ i $ x can be written as f do g do h do i x |
2024-12-21 20:09:27 +0100 | ash3en | (~Thunderbi@2a03:7846:b6eb:101:93ac:a90a:da67:f207) ash3en |
2024-12-21 20:09:33 +0100 | ash3en | (~Thunderbi@2a03:7846:b6eb:101:93ac:a90a:da67:f207) (Client Quit) |
2024-12-21 20:10:44 +0100 | <monochrom> | hahaha |
2024-12-21 20:11:10 +0100 | Guest78 | (~Guest78@37.228.252.73) (Ping timeout: 240 seconds) |
2024-12-21 20:11:37 +0100 | <ski> | `$'s are usually harder to read |
2024-12-21 20:14:16 +0100 | <ski> | i'd definitely prefer `f (g (h (i x)))' over `f $ g $ h $ i $ x'. `(f . g . h . i) x' can be nice at times, too, or `f . g . h . i $ x' if you must |
2024-12-21 20:14:52 +0100 | <probie> | left$to$right$code$read$just |
2024-12-21 20:16:02 +0100 | <ski> | main issue is if you have `)' (or a bunch of them in sequence) with corresponding `(' on a line with a bunch of lines inbetween |
2024-12-21 20:16:27 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) merijn |
2024-12-21 20:17:09 +0100 | <ski> | (i very seldom use `$' at all, except as `($)', or as a section) |
2024-12-21 20:17:53 +0100 | OftenFaded | (~OftenFade@user/tisktisk) (Quit: Client closed) |
2024-12-21 20:18:35 +0100 | <monochrom> | Yeah, map ($ x) [f, g, h] can be nice. |
2024-12-21 20:20:44 +0100 | <orangeflu> | is anybody good at optparse-applicative? |
2024-12-21 20:21:35 +0100 | tremon | (~tremon@83.80.159.219) tremon |
2024-12-21 20:22:33 +0100 | OftenFaded | (OftenFaded@user/tisktisk) OftenFaded |
2024-12-21 20:24:25 +0100 | remexre | (~remexre@user/remexre) (Ping timeout: 260 seconds) |
2024-12-21 20:24:27 +0100 | <ski> | (occasionally i use `foo $ bar . baz', applying a function to a composition (spanning multiple lines). most commonly, this would be when doing `ShowS' stuff, like e.g. writing a `Show' instance manually) |
2024-12-21 20:25:05 +0100 | remexre | (~remexre@user/remexre) remexre |
2024-12-21 20:26:40 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 272 seconds) |
2024-12-21 20:27:10 +0100 | <probie> | monochrom: `$` considered harmful. Use ``map (`id` x) [f, g, h]`` instead |
2024-12-21 20:33:56 +0100 | <ski> | > (sequence `flip` x) [cos,sin,tan] |
2024-12-21 20:34:00 +0100 | <lambdabot> | [cos x,sin x,sin x / cos x] |
2024-12-21 20:38:57 +0100 | <exarkun> | Why are those better than $? |
2024-12-21 20:39:11 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) merijn |
2024-12-21 20:43:26 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 244 seconds) |
2024-12-21 20:46:05 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) merijn |
2024-12-21 20:47:04 +0100 | ash3en | (~Thunderbi@2a03:7846:b6eb:101:93ac:a90a:da67:f207) ash3en |
2024-12-21 20:49:28 +0100 | <ski> | which things ? |
2024-12-21 20:50:00 +0100 | <ski> | (probie's joking, if it isn't clear) |
2024-12-21 20:50:40 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 260 seconds) |
2024-12-21 20:51:23 +0100 | <ski> | (and my version was just a curious observation, about the environment monad (well, idiom / applicative functor would suffice, here .. could've used `sequenceA' rather than `sequence')) |
2024-12-21 20:51:46 +0100 | rachelambda8 | (~rachelamb@cust-95-80-25-71.csbnet.se) (Quit: Ping timeout (120 seconds)) |
2024-12-21 20:52:04 +0100 | rachelambda8 | (~rachelamb@cust-95-80-25-71.csbnet.se) |
2024-12-21 20:55:26 +0100 | peterbecich | (~Thunderbi@syn-047-229-123-186.res.spectrum.com) peterbecich |
2024-12-21 21:00:01 +0100 | caconym | (~caconym@user/caconym) (Quit: bye) |
2024-12-21 21:00:39 +0100 | caconym | (~caconym@user/caconym) caconym |
2024-12-21 21:01:19 +0100 | sprotte24 | (~sprotte24@p200300d16f1a2c0064c6ee858fd5dcfe.dip0.t-ipconnect.de) (Read error: Connection reset by peer) |
2024-12-21 21:01:28 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) merijn |
2024-12-21 21:05:16 +0100 | Guest78 | (~Guest78@37.228.252.73) |
2024-12-21 21:07:40 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 252 seconds) |
2024-12-21 21:09:18 +0100 | zzz | (~z@user/zero) (Ping timeout: 265 seconds) |
2024-12-21 21:09:41 +0100 | TheCoffeMaker | (~TheCoffeM@user/thecoffemaker) (Remote host closed the connection) |
2024-12-21 21:09:47 +0100 | ash3en | (~Thunderbi@2a03:7846:b6eb:101:93ac:a90a:da67:f207) (Ping timeout: 244 seconds) |
2024-12-21 21:10:05 +0100 | TheCoffeMaker | (~TheCoffeM@user/thecoffemaker) TheCoffeMaker |
2024-12-21 21:10:06 +0100 | zero | (~z@user/zero) zero |
2024-12-21 21:11:48 +0100 | <monochrom> | probie: :( XD |
2024-12-21 21:16:44 +0100 | OftenFaded | (OftenFaded@user/tisktisk) (Quit: Client closed) |
2024-12-21 21:18:38 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) merijn |
2024-12-21 21:20:27 +0100 | <__monty__> | It feels like filter could be part of something like Foldable. Are there a lot of Foldable structures that aren't filterable? I can only think of tuples. |
2024-12-21 21:21:56 +0100 | <monochrom> | Generally fixed-length non-zero-length data structures, e.g., data P a = MkP a a. |
2024-12-21 21:22:13 +0100 | <monochrom> | because you want dynamic length for filter. |
2024-12-21 21:22:22 +0100 | <WzC> | __monty__: have a look at the witherable package/typeclass that expresses filterable things |
2024-12-21 21:23:13 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 248 seconds) |
2024-12-21 21:23:26 +0100 | <monochrom> | But yeah tuple is a good start, you just have to think why tuple breaks to see that the issue is fixed length (except zero-length, that one vacuously works :) ) |
2024-12-21 21:26:47 +0100 | <WzC> | is there some flag to get GHC to print whatever typeclass resolution GHC is doing? I think I accidentally created a cycle in some typeclass instances; but it is not so clear what/why exactly. i.e. it would be convenient to see what GHC is actually doing |
2024-12-21 21:30:22 +0100 | <monochrom> | I haven't tried, but maybe https://downloads.haskell.org/ghc/latest/docs/users_guide/debugging.html#type-checking-and-renaming helps. |
2024-12-21 21:30:45 +0100 | Guest78 | (~Guest78@37.228.252.73) (Quit: Client closed) |
2024-12-21 21:31:14 +0100 | econo_ | (uid147250@id-147250.tinside.irccloud.com) |
2024-12-21 21:31:19 +0100 | <WzC> | . |
2024-12-21 21:31:48 +0100 | <WzC> | thanks, let's see if that helps :) |
2024-12-21 21:32:03 +0100 | Guest78 | (~Guest78@37.228.252.73) |
2024-12-21 21:33:43 +0100 | <EvanR> | ski, is environment monad the same thing as reader monad |
2024-12-21 21:34:01 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) merijn |
2024-12-21 21:34:37 +0100 | <monochrom> | (->)e for some e. I say yes, but that's when I go with structural typing. |
2024-12-21 21:35:19 +0100 | <EvanR> | __monty__, in before someone else wants to insert some other ability into Foldable other than folding |
2024-12-21 21:35:25 +0100 | <EvanR> | like indexing |
2024-12-21 21:35:56 +0100 | <monochrom> | Oh, indexing is solved. That's just representable functor or Napier functor. :) |
2024-12-21 21:35:56 +0100 | <EvanR> | until Foldable doesn't mean foldable specifically |
2024-12-21 21:36:45 +0100 | <monochrom> | Yeah, smart phone no longer means phone. >:) |
2024-12-21 21:37:20 +0100 | <EvanR> | the process of diluting the communication power of names |
2024-12-21 21:37:26 +0100 | fmira | (~user@user/fmira) fmira |
2024-12-21 21:37:36 +0100 | <monochrom> | Hell, dash board is neither dash nor board. |
2024-12-21 21:37:45 +0100 | <monochrom> | Oh, and Holy Roman Empire... |
2024-12-21 21:37:47 +0100 | <EvanR> | the red herring effect, or something |
2024-12-21 21:38:22 +0100 | <monochrom> | "meaningful names" is a lie. |
2024-12-21 21:38:30 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 244 seconds) |
2024-12-21 21:38:52 +0100 | <monochrom> | What really happens is mnemonic names. |
2024-12-21 21:39:04 +0100 | <EvanR> | maybe more realistically, are strategies in a game |
2024-12-21 21:39:41 +0100 | <EvanR> | a game programmers have been losing more often than not |
2024-12-21 21:40:50 +0100 | <EvanR> | also meaningfulness implies semantics while successful communication doesn't necessarily have to |
2024-12-21 21:41:06 +0100 | <ski> | EvanR : yes, aka "input" |
2024-12-21 21:41:13 +0100 | <EvanR> | input monad??? |
2024-12-21 21:41:18 +0100 | <ski> | (and "output" is another name for "writer") |
2024-12-21 21:41:20 +0100 | <ski> | yes |
2024-12-21 21:41:24 +0100 | <ski> | Wadler used this name |
2024-12-21 21:41:39 +0100 | krei-se- | (~krei-se@p5085d4a6.dip0.t-ipconnect.de) (Quit: ZNC 1.9.1 - https://znc.in) |
2024-12-21 21:42:04 +0100 | <EvanR> | Writer monad is based on the Monoid class. Is this inevitable or just a haskell hack |
2024-12-21 21:42:11 +0100 | ski | sometimes says "logging" or "summarizing" for output |
2024-12-21 21:42:23 +0100 | <EvanR> | is this some kind of masterstroke way to do "output" |
2024-12-21 21:42:40 +0100 | <probie> | So that means `type Input = ReaderT`, `type Output = WriterT`, therefore `type IO a = ReaderT (WriterT IO) a` |
2024-12-21 21:42:48 +0100 | Sgeo | (~Sgeo@user/sgeo) Sgeo |
2024-12-21 21:42:58 +0100 | <EvanR> | finally IO is well defined |
2024-12-21 21:43:11 +0100 | <monochrom> | I guess Moggi and then Plotkin too, but they didn't have a separate input monad, they had a combined input/output monad, the free monad I/O a = a + (Char -> I/O a) + (Char, I/O a) |
2024-12-21 21:43:56 +0100 | <ski> | EvanR : "Reader monad is based on (trivial) comonoid" |
2024-12-21 21:44:11 +0100 | <EvanR> | lol |
2024-12-21 21:44:30 +0100 | <monochrom> | Insofar as generalization is inevitable (as in, if you don't generalize, someone else will), going from [X] to general monoids is inevitable. |
2024-12-21 21:44:56 +0100 | <ski> | (makes me wonder if anyone experimented with a version, using `LinearImplicitParameters', and splitting ..) |
2024-12-21 21:47:07 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) merijn |
2024-12-21 21:48:06 +0100 | fmira | (~user@user/fmira) (Quit: fmira) |
2024-12-21 21:48:25 +0100 | glguy | (glguy@libera/staff/glguy) glguy |
2024-12-21 21:50:00 +0100 | E2Combinator | (~E2Combina@190.180.45.137) |
2024-12-21 21:51:43 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 264 seconds) |
2024-12-21 21:53:23 +0100 | michalz | (~michalz@185.246.207.203) (Remote host closed the connection) |
2024-12-21 21:55:19 +0100 | wootehfoot | (~wootehfoo@user/wootehfoot) wootehfoot |
2024-12-21 21:56:01 +0100 | CrunchyFlakes | (~CrunchyFl@ip1f13e94e.dynamic.kabel-deutschland.de) (Read error: Connection reset by peer) |
2024-12-21 21:57:02 +0100 | <ski> | newtype RandomSupply g a = MkRS (g -> a); instance RandomGen g => Monad (RandomSupply g) where return a = MkRS (\_ -> a); MkRS ga >>= k = MkRS (\g -> let (g0,g1) = split g; MkRS gb = k (ga g0) in gb g1) |
2024-12-21 21:58:10 +0100 | ljdarj | (~Thunderbi@user/ljdarj) ljdarj |
2024-12-21 21:58:33 +0100 | CrunchyFlakes | (~CrunchyFl@31.19.233.78) |
2024-12-21 22:02:29 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) merijn |
2024-12-21 22:03:02 +0100 | peterbecich | (~Thunderbi@syn-047-229-123-186.res.spectrum.com) (Ping timeout: 252 seconds) |
2024-12-21 22:06:05 +0100 | <ski> | newtype RandomGenSplit g = MkRGS g; instance RandomGen g => Splittable (RandomGenSplit g) where {split (MkRGS g) = (MkRGS g0,MkRGS g1) where {(g0,g1) = System.Random.split g}}; newtype LinearSplitSupply l a = MkLSS ((%l :: l) => a); supply :: Splittable l => LinearSplitSupply l l; supply = MkLSS %l; instance Splittable l => Monad (LinearSplitSupply l) where return a = MkLSS a; MkLSS a >>= k = MkLSS (let |
2024-12-21 22:06:09 +0100 | <E2Combinator> | Hi. I have a question here I haven't been able to find anywhere else regarding how to extend effects using fused-effects. |
2024-12-21 22:06:10 +0100 | <E2Combinator> | Here's some code: |
2024-12-21 22:06:10 +0100 | <E2Combinator> | https://paste.tomsmeding.com/mudk4tjZ |
2024-12-21 22:06:11 +0100 | <ski> | MkLSS b = k a in b) |
2024-12-21 22:06:11 +0100 | <E2Combinator> | What I'm trying to do here is make a simple Effect based on the Writer effect, acting as a cumulative flag for use during iteration, to avoid expensive equality comparisons on every iteration of a pretty complicated loop. |
2024-12-21 22:06:11 +0100 | <E2Combinator> | Fundamentally, It's just a Writer being used as a write-once flag during iteration. |
2024-12-21 22:06:12 +0100 | <E2Combinator> | I've been trying to extend the Writer effect and abstract away the underlying writer, to ensure consumers of my API can't arbitrarily reset the flag, and to provide a clean API, and the normal pathway for doing this described in |
2024-12-21 22:06:12 +0100 | <E2Combinator> | https://github.com/fused-effects/fused-effects/blob/main/docs/reinterpreting_effects.md |
2024-12-21 22:06:13 +0100 | <E2Combinator> | won't do. |
2024-12-21 22:06:13 +0100 | <E2Combinator> | I want to do some post-processing on the outputs of the Writer effect during my run function, and preferably not have to provide a carrier and run function for the underlying Writer effect, "Baking" them into my own carrier and Algebra Impl. |
2024-12-21 22:06:14 +0100 | <E2Combinator> | Furthermore, It'd be nice I could handle the Writer internally, to avoid leaking implementation details. |
2024-12-21 22:06:14 +0100 | <E2Combinator> | However, I can't seem to figure out what to put in the missing spot, to make it work out, without having to go into the internals of the Writer effect. |
2024-12-21 22:06:15 +0100 | <E2Combinator> | Is there a way to do this? |
2024-12-21 22:08:59 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 244 seconds) |
2024-12-21 22:14:36 +0100 | bitdex | (~bitdex@gateway/tor-sasl/bitdex) (Ping timeout: 264 seconds) |
2024-12-21 22:20:20 +0100 | bitdex | (~bitdex@gateway/tor-sasl/bitdex) bitdex |
2024-12-21 22:20:51 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) merijn |
2024-12-21 22:25:23 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 252 seconds) |
2024-12-21 22:32:37 +0100 | E2Combinator | (~E2Combina@190.180.45.137) (Quit: Client closed) |
2024-12-21 22:33:12 +0100 | <haskellbridge> | <thirdofmay18081814goya> in the context of algebraic effects, are handlers sort of a fold over a tree of computations? |
2024-12-21 22:33:32 +0100 | <haskellbridge> | <thirdofmay18081814goya> i.e. an interpreter for our tree of computations? |
2024-12-21 22:36:14 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) merijn |
2024-12-21 22:36:45 +0100 | <haskellbridge> | <thirdofmay18081814goya> or, would it be correct to say that the selling point is that you can compose handlers, giving us a way to compose folds? |
2024-12-21 22:41:08 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 265 seconds) |
2024-12-21 22:46:21 +0100 | Sgeo | (~Sgeo@user/sgeo) (Quit: Leaving) |
2024-12-21 22:46:40 +0100 | ljdarj | (~Thunderbi@user/ljdarj) (Quit: ljdarj) |
2024-12-21 22:46:48 +0100 | Sgeo | (~Sgeo@user/sgeo) Sgeo |
2024-12-21 22:47:00 +0100 | ljdarj | (~Thunderbi@user/ljdarj) ljdarj |
2024-12-21 22:49:38 +0100 | <monochrom> | Yes, handlers are interpreters, the tree is made of the obvious free monad. |
2024-12-21 22:51:37 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) merijn |
2024-12-21 22:52:23 +0100 | <haskellbridge> | <thirdofmay18081814goya> I see, ty! |
2024-12-21 22:52:47 +0100 | <monochrom> | Composing handlers in the exact order you want is true of all 3 effect systems we know of: monad transformer stacks (the stack order is how you express handler order, e.g., StateT Except vs ExceptT State), Oleg's open union, handlers for algebraic effects. |
2024-12-21 22:53:13 +0100 | <monochrom> | So it can't be the selling point of one of them. At most it's the selling point common to all of them. |
2024-12-21 22:53:21 +0100 | <haskellbridge> | <thirdofmay18081814goya> hm right |
2024-12-21 22:53:29 +0100 | <monochrom> | So I would say that the selling point of algebraic effects is the algebraic part. :) |
2024-12-21 22:53:34 +0100 | Guest78 | (~Guest78@37.228.252.73) (Quit: Client closed) |
2024-12-21 22:54:18 +0100 | <haskellbridge> | <thirdofmay18081814goya> noted, thanks for the comments! |
2024-12-21 22:55:29 +0100 | lxsameer | (~lxsameer@Serene/lxsameer) (Ping timeout: 248 seconds) |
2024-12-21 22:56:46 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 272 seconds) |
2024-12-21 22:56:48 +0100 | <monochrom> | I think recently I am learning that the more detailed but advanced way of saying that is: an algebraic effect system = a Lawvere theory, and it is pretty well understood how to combine two Lawvere theories (there is a nice tensor product). It actually explains, e.g., why StateT is s -> m (a, s) but MaybeT is m (Maybe a). |
2024-12-21 22:58:12 +0100 | <monochrom> | I have only skimmed some papers to get that impression. I don't know further details until I learn Lawvere theories properly. :) |
2024-12-21 22:59:34 +0100 | wootehfoot | (~wootehfoo@user/wootehfoot) (Read error: Connection reset by peer) |
2024-12-21 23:02:39 +0100 | manwithluck | (~manwithlu@194.177.28.164) (Read error: Connection reset by peer) |
2024-12-21 23:04:18 +0100 | cheater | (~Username@user/cheater) cheater |
2024-12-21 23:06:59 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) merijn |
2024-12-21 23:12:14 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 260 seconds) |
2024-12-21 23:15:08 +0100 | ubert | (~Thunderbi@p200300ecdf117ce99c7826839207afbb.dip0.t-ipconnect.de) ubert |
2024-12-21 23:17:37 +0100 | Yumemi_ | (~Yumemi@chamoin.net) (Quit: .) |
2024-12-21 23:18:31 +0100 | Yumemi | (~Yumemi@chamoin.net) Yumemi |
2024-12-21 23:22:18 +0100 | Pozyomka | (~pyon@user/pyon) (Quit: bbl) |
2024-12-21 23:22:46 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) merijn |
2024-12-21 23:27:21 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 252 seconds) |
2024-12-21 23:29:24 +0100 | Maxdamantus | (~Maxdamant@user/maxdamantus) (Ping timeout: 246 seconds) |
2024-12-21 23:33:39 +0100 | machinedgod | (~machinedg@d108-173-18-100.abhsia.telus.net) machinedgod |
2024-12-21 23:36:01 +0100 | xff0x | (~xff0x@2405:6580:b080:900:9795:bd44:dda3:9939) (Ping timeout: 248 seconds) |
2024-12-21 23:38:08 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) merijn |
2024-12-21 23:42:43 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 244 seconds) |
2024-12-21 23:45:09 +0100 | Guest78 | (~Guest78@37.228.252.73) |
2024-12-21 23:47:42 +0100 | Maxdamantus | (~Maxdamant@user/maxdamantus) Maxdamantus |
2024-12-21 23:53:32 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) merijn |
2024-12-21 23:53:38 +0100 | <haskellbridge> | <thirdofmay18081814goya> anyone used frp lately? |
2024-12-21 23:58:20 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 264 seconds) |