Logs on 2024-12-21 (liberachat/#haskell)
| 00:00:54 | <hellwolf> | fmap fromJust (filter isJust (fmap ifunc_name sfns)) <-- can it be simplified |
| 00:02:40 | <jackdk> | :t Data.Maybe.mapMaybe -- generalised by package `witherable` |
| 00:02:41 | <lambdabot> | (a -> Maybe b) -> [a] -> [b] |
| 00:02:45 | <Leary> | hellwolf: `mapMaybe ifunc_name sfns`? Even if `mapMaybe` didn't exist, you should invent it before you throw `fromJust` at your problem. |
| 00:03:33 | <probie> | :t \ifunc_name sfns -> [x | Just x <- map ifunc_name sfns] |
| 00:03:40 | <lambdabot> | (a1 -> Maybe a2) -> [a1] -> [a2] |
| 00:04:37 | → | merijn joins (~merijn@128-137-045-062.dynamic.caiway.nl) |
| 00:04:37 | <hellwolf> | catMaybes |
| 00:04:38 | <probie> | > let halfEven x = if even x then Just (x `div` 2) else Nothing in [x | Just x <- map halfEven [1..10]] |
| 00:04:39 | <hellwolf> | :t catMaybes |
| 00:04:41 | <lambdabot> | [1,2,3,4,5] |
| 00:04:41 | <lambdabot> | [Maybe a] -> [a] |
| 00:04:54 | <hellwolf> | that's the one |
| 00:05:49 | <probie> | > let halfEven x = if even x then Just (x `div` 2) else Nothing in catMaybes (map halfEven [1..10]) |
| 00:05:50 | <lambdabot> | [1,2,3,4,5] |
| 00:07:19 | <jackdk> | fromJust is way less useful than it seems, once you get used to using Functor/Applicative and sometimes Monad operations over Maybes. |
| 00:09:15 | × | merijn quits (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 246 seconds) |
| 00:12:49 | × | sawilagar quits (~sawilagar@user/sawilagar) (Ping timeout: 252 seconds) |
| 00:17:31 | → | L29Ah joins (~L29Ah@wikipedia/L29Ah) |
| 00:20:21 | → | merijn joins (~merijn@128-137-045-062.dynamic.caiway.nl) |
| 00:24:51 | × | merijn quits (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 244 seconds) |
| 00:35:45 | → | merijn joins (~merijn@128-137-045-062.dynamic.caiway.nl) |
| 00:36:25 | → | Smiles joins (uid551636@id-551636.lymington.irccloud.com) |
| 00:37:08 | → | peterbecich joins (~Thunderbi@syn-047-229-123-186.res.spectrum.com) |
| 00:40:17 | × | merijn quits (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 248 seconds) |
| 00:41:06 | → | weary-traveler joins (~user@user/user363627) |
| 00:42:32 | × | weary-traveler quits (~user@user/user363627) (Remote host closed the connection) |
| 00:44:37 | → | weary-traveler joins (~user@user/user363627) |
| 00:45:11 | × | CrunchyFlakes quits (~CrunchyFl@31.19.233.78) (Read error: Connection reset by peer) |
| 00:46:55 | → | CrunchyFlakes joins (~CrunchyFl@31.19.233.78) |
| 00:46:55 | <jle`> | yeah the "point" of Maybe is that you don't have to use fromJust, you would always be able to pattern match |
| 00:48:46 | <monochrom> | @quote monochrom safeFromJust |
| 00:48:47 | <lambdabot> | monochrom says: I use safeFromJust :: Maybe a -> Maybe a |
| 00:49:06 | × | cheater quits (~Username@user/cheater) (Quit: Going offline, see ya! (www.adiirc.com)) |
| 00:49:19 | <jle`> | safeHead . maybeToList |
| 00:51:19 | → | merijn joins (~merijn@128-137-045-062.dynamic.caiway.nl) |
| 00:52:27 | <hellwolf> | project_preamble_template :: T.Text |
| 00:52:27 | <hellwolf> | project_preamble_template = [fmt'| |
| 00:52:27 | <hellwolf> | #include "../../../templates/Preamble.sol" |
| 00:52:27 | <hellwolf> | |] |
| 00:52:44 | <hellwolf> | I use CPP extension, but it filters out all my "/* comments */" in the included file |
| 00:52:49 | <hellwolf> | sad |
| 00:54:10 | <geekosaur> | mm, I thought the way we invoke cpp disables that because it's inapplicable to Haskell code. clang, perhaps? |
| 00:54:40 | <ski> | > (\f xs -> [y | my <- map f xs,y <- maybeToList my]) (\n -> guard (even n) >> Just (n `div` 2)) [0,1,2,3,4] |
| 00:54:41 | <hellwolf> | maybe I am using it in a inconventional way |
| 00:54:42 | <lambdabot> | [0,1,2] |
| 00:54:45 | <ski> | @type \f xs -> [y | my <- map f xs,y <- maybeToList my] |
| 00:54:46 | <lambdabot> | (a1 -> Maybe a2) -> [a1] -> [a2] |
| 00:55:06 | <geekosaur> | if you're using it the default way, it strips comments |
| 00:55:16 | <hellwolf> | I include a chunk of file into a QQ. |
| 00:55:30 | <hellwolf> | actually I would like it to keep the comments |
| 00:55:42 | <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 |
| 00:55:46 | <hellwolf> | what is my alternative, that can include such a template file in a distribution. |
| 00:55:48 | → | housemate joins (~housemate@ppp203-122-213-191.static.internode.on.net) |
| 00:55:57 | × | housemate quits (~housemate@ppp203-122-213-191.static.internode.on.net) (Remote host closed the connection) |
| 00:55:59 | <hellwolf> | oh? how to enable -traditional |
| 00:56:08 | <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 |
| 00:56:20 | × | merijn quits (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 252 seconds) |
| 00:56:24 | <geekosaur> | gcc -E -traditional |
| 00:56:29 | <hellwolf> | platform dependent... hmm, better not |
| 00:56:53 | <hellwolf> | alternative is that I should not use CPP, but create QQ in a normal hs file |
| 00:56:59 | <hellwolf> | I think I should do that |
| 00:57:06 | <hellwolf> | this CPP usage is too weird. |
| 00:57:16 | <hellwolf> | probably will bring distribution problem later. |
| 00:57:23 | <hellwolf> | (need to set Cabal extra files) |
| 00:58:57 | × | machinedgod quits (~machinedg@d108-173-18-100.abhsia.telus.net) (Ping timeout: 244 seconds) |
| 01:01:59 | → | merijn joins (~merijn@128-137-045-062.dynamic.caiway.nl) |
| 01:03:54 | <monochrom> | I'm also very naughty and known to say: |
| 01:04:01 | <monochrom> | @quote monochrom unsafeCoerce |
| 01:04:01 | <lambdabot> | monochrom says: isTrue = (unsafeCoerce :: Either a b -> Bool) . (unsafeCoerce :: Maybe c -> Either a b) . (unsafeCoerce :: Bool -> Maybe c) |
| 01:04:05 | <monochrom> | >:) |
| 01:06:42 | × | merijn quits (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 265 seconds) |
| 01:08:49 | <jle`> | monochrom: hm, why do you need all three? |
| 01:10:17 | <monochrom> | To flex. >:) |
| 01:11:21 | <monochrom> | The chain enjoys round-trip pointer tagging invariance. >:) |
| 01:11:51 | × | sprotte24 quits (~sprotte24@p200300d16f0b5c0044534d8048ff44db.dip0.t-ipconnect.de) (Read error: Connection reset by peer) |
| 01:12:45 | → | harveypwca joins (~harveypwc@2601:246:d080:b40:1889:d9bf:2dd8:b288) |
| 01:13:37 | <jle`> | ah of course |
| 01:14:17 | × | acidjnk_new quits (~acidjnk@p200300d6e7283f13051c8d0c2a2bb459.dip0.t-ipconnect.de) (Ping timeout: 252 seconds) |
| 01:17:22 | → | merijn joins (~merijn@128-137-045-062.dynamic.caiway.nl) |
| 01:19:15 | <geekosaur> | hellwolf, there is also the possibility of a build-depends: cpphs, but I would avoid cpp's cursedness if possible |
| 01:19:20 | → | machinedgod joins (~machinedg@d108-173-18-100.abhsia.telus.net) |
| 01:21:59 | × | merijn quits (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 252 seconds) |
| 01:27:04 | → | housemate joins (~housemate@ppp203-122-213-191.static.internode.on.net) |
| 01:29:01 | × | housemate quits (~housemate@ppp203-122-213-191.static.internode.on.net) (Remote host closed the connection) |
| 01:32:44 | → | merijn joins (~merijn@128-137-045-062.dynamic.caiway.nl) |
| 01:35:06 | → | alp joins (~alp@2001:861:8ca0:4940:bd95:640a:d817:df55) |
| 01:35:57 | × | Tuplanolla quits (~Tuplanoll@91-159-69-59.elisa-laajakaista.fi) (Quit: Leaving.) |
| 01:37:21 | × | merijn quits (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 248 seconds) |
| 01:48:07 | → | merijn joins (~merijn@128-137-045-062.dynamic.caiway.nl) |
| 01:51:15 | × | kimiamania quits (~65804703@user/kimiamania) (Quit: PegeLinux) |
| 01:52:28 | → | kimiamania joins (~65804703@user/kimiamania) |
| 01:54:46 | → | OftenFaded joins (~OftenFade@user/tisktisk) |
| 01:55:00 | × | merijn quits (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 252 seconds) |
| 02:05:02 | × | harveypwca quits (~harveypwc@2601:246:d080:b40:1889:d9bf:2dd8:b288) (Quit: Leaving) |
| 02:05:04 | → | housemate joins (~housemate@1.125.109.132) |
| 02:10:48 | → | merijn joins (~merijn@128-137-045-062.dynamic.caiway.nl) |
| 02:12:26 | → | haritz joins (~hrtz@2a02:8010:65b5:0:5d9a:9bab:ee5e:b737) |
| 02:12:28 | × | haritz quits (~hrtz@2a02:8010:65b5:0:5d9a:9bab:ee5e:b737) (Changing host) |
| 02:12:28 | → | haritz joins (~hrtz@user/haritz) |
| 02:15:10 | × | merijn quits (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 252 seconds) |
| 02:17:34 | × | rekahsoft quits (~rekahsoft@76.69.85.220) (Remote host closed the connection) |
| 02:18:54 | → | krei-se- joins (~krei-se@p5085d4a6.dip0.t-ipconnect.de) |
| 02:19:56 | × | krei-se quits (~krei-se@p5085d4fd.dip0.t-ipconnect.de) (Ping timeout: 252 seconds) |
| 02:26:11 | → | merijn joins (~merijn@128-137-045-062.dynamic.caiway.nl) |
| 02:30:48 | × | merijn quits (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 265 seconds) |
| 02:32:22 | → | rekahsoft joins (~rekahsoft@76.69.85.220) |
| 02:32:33 | × | anpad quits (~pandeyan@user/anpad) (Quit: ZNC 1.8.2 - https://znc.in) |
| 02:32:54 | × | prasad quits (~Thunderbi@c-73-75-25-251.hsd1.in.comcast.net) (Ping timeout: 276 seconds) |
| 02:38:31 | → | anpad joins (~pandeyan@user/anpad) |
| 02:41:33 | → | merijn joins (~merijn@128-137-045-062.dynamic.caiway.nl) |
| 02:43:51 | × | housemate quits (~housemate@1.125.109.132) (Ping timeout: 265 seconds) |
| 02:45:29 | × | Smiles quits (uid551636@id-551636.lymington.irccloud.com) (Quit: Connection closed for inactivity) |
| 02:45:58 | × | merijn quits (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 252 seconds) |
| 02:50:31 | × | peterbecich quits (~Thunderbi@syn-047-229-123-186.res.spectrum.com) (Ping timeout: 264 seconds) |
| 02:51:51 | → | housemate joins (~housemate@246.224.218.139.sta.wbroadband.net.au) |
| 02:56:55 | → | merijn joins (~merijn@128-137-045-062.dynamic.caiway.nl) |
| 02:57:48 | → | housemate_ joins (~housemate@ppp203-122-213-191.static.internode.on.net) |
| 02:57:52 | × | housemate quits (~housemate@246.224.218.139.sta.wbroadband.net.au) (Ping timeout: 265 seconds) |
| 02:59:27 | × | housemate_ quits (~housemate@ppp203-122-213-191.static.internode.on.net) (Remote host closed the connection) |
| 03:01:55 | × | merijn quits (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 244 seconds) |
| 03:07:58 | → | bitdex joins (~bitdex@gateway/tor-sasl/bitdex) |
| 03:12:56 | → | merijn joins (~merijn@128-137-045-062.dynamic.caiway.nl) |
| 03:17:41 | × | merijn quits (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 265 seconds) |
| 03:18:25 | → | dsrt^ joins (~dsrt@c-98-242-74-66.hsd1.ga.comcast.net) |
| 03:21:06 | → | Enviosity_ joins (~Enviosity@2.219.56.221) |
| 03:22:31 | × | machinedgod quits (~machinedg@d108-173-18-100.abhsia.telus.net) (Ping timeout: 265 seconds) |
| 03:23:05 | → | Guest88 joins (~Guest88@syn-097-097-077-167.biz.spectrum.com) |
| 03:23:36 | × | haver quits (~Enviosity@2.219.56.221) (Ping timeout: 276 seconds) |
| 03:26:11 | ← | Guest88 parts (~Guest88@syn-097-097-077-167.biz.spectrum.com) () |
| 03:27:30 | → | merijn joins (~merijn@128-137-045-062.dynamic.caiway.nl) |
| 03:31:26 | → | fmira joins (~user@user/fmira) |
| 03:31:52 | × | fmira quits (~user@user/fmira) (Client Quit) |
| 03:33:09 | × | merijn quits (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 265 seconds) |
| 03:38:39 | → | housemate joins (~housemate@ppp203-122-213-191.static.internode.on.net) |
| 03:43:56 | → | merijn joins (~merijn@128-137-045-062.dynamic.caiway.nl) |
| 03:45:14 | × | td_ quits (~td@i53870935.versanet.de) (Ping timeout: 265 seconds) |
| 03:46:13 | × | fun-safe-math quits (~fun-safe-@24.21.106.247) () |
| 03:46:56 | → | td_ joins (~td@i53870903.versanet.de) |
| 03:47:39 | × | housemate quits (~housemate@ppp203-122-213-191.static.internode.on.net) (Ping timeout: 276 seconds) |
| 03:50:30 | × | merijn quits (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 252 seconds) |
| 03:58:21 | → | itscaleb joins (~itscaleb@user/itscaleb) |
| 04:01:58 | → | merijn joins (~merijn@128-137-045-062.dynamic.caiway.nl) |
| 04:06:30 | × | merijn quits (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 244 seconds) |
| 04:17:19 | → | merijn joins (~merijn@128-137-045-062.dynamic.caiway.nl) |
| 04:21:58 | × | merijn quits (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 265 seconds) |
| 04:23:11 | × | talismanick quits (~user@2601:644:937c:ed10::ae5) (Remote host closed the connection) |
| 04:24:56 | × | pavonia quits (~user@user/siracusa) (Quit: Bye!) |
| 04:27:53 | → | orangeflu joins (~flu@240-100-179-143.ftth.glasoperator.nl) |
| 04:28:15 | <orangeflu> | hello, i am losing my mind |
| 04:28:44 | × | aforemny_ quits (~aforemny@2001:9e8:6cd7:4a00:42f0:f044:3052:a50d) (Ping timeout: 265 seconds) |
| 04:28:57 | → | aforemny joins (~aforemny@2001:9e8:6cf6:8000:f088:f772:a53:8f63) |
| 04:30:16 | → | fun-safe-math joins (~fun-safe-@2601:1c2:1b7f:801f:a762:20cf:f426:d497) |
| 04:30:21 | <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 |
| 04:30:38 | <orangeflu> | is there a way of fixing this without moving everything again in one file? |
| 04:32:42 | → | merijn joins (~merijn@128-137-045-062.dynamic.caiway.nl) |
| 04:33:46 | <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`. |
| 04:35:32 | <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 |
| 04:36:31 | <orangeflu> | Correction, this is the flag i tried: -fexpose-all-unfoldings |
| 04:37:26 | × | merijn quits (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 265 seconds) |
| 04:38:33 | × | fun-safe-math quits (~fun-safe-@2601:1c2:1b7f:801f:a762:20cf:f426:d497) () |
| 04:39:26 | <Leary> | orangeflu: It's strange for that not to have an effect. Perhaps you also need `-fspecialise-aggressively`. |
| 04:41:27 | <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? |
| 04:41:57 | <Leary> | Probably. |
| 04:42:50 | <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. |
| 04:45:12 | <orangeflu> | Well, they don't seem to be making a difference either way unfortunately |
| 04:45:15 | → | fun-safe-math joins (~fun-safe-@2601:1c2:1b7f:801f:83ce:3f54:3f3c:7c89) |
| 04:45:18 | <orangeflu> | No change in behaviour |
| 04:45:29 | <orangeflu> | My program still eats 10 GB of RAM casually |
| 04:48:04 | → | merijn joins (~merijn@128-137-045-062.dynamic.caiway.nl) |
| 04:50:57 | × | alp quits (~alp@2001:861:8ca0:4940:bd95:640a:d817:df55) (Ping timeout: 248 seconds) |
| 04:50:58 | × | ljdarj quits (~Thunderbi@user/ljdarj) (Ping timeout: 265 seconds) |
| 04:52:45 | × | merijn quits (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 252 seconds) |
| 04:53:28 | → | peterbecich joins (~Thunderbi@syn-047-229-123-186.res.spectrum.com) |
| 04:55:08 | <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 |
| 04:55:25 | <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 |
| 04:57:38 | <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. |
| 04:59:36 | <orangeflu> | Bowuigi: no, I didn't refactor anything. The code is exactly the same before and after |
| 05:00:25 | <haskellbridge> | <Bowuigi> Any large globals mentioned in one module and used in another? |
| 05:00:34 | <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 |
| 05:01:11 | <orangeflu> | Bowuigi: define globals please, not sure what you are reffering to |
| 05:01:34 | <haskellbridge> | <Bowuigi> Maybe strictness analysis made something too lazy? Looking at the core of a file so large seems annoying though |
| 05:01:49 | <Leary> | Sure sounds like you lost streaming somewhere. |
| 05:02:07 | <orangeflu> | I can give you the source if it helps |
| 05:02:23 | <orangeflu> | https://github.com/Flu/avr-emulator |
| 05:02:32 | <orangeflu> | the file in question is src/Emulator.hs |
| 05:02:38 | <haskellbridge> | <Bowuigi> "Large globals" as in variables that are not functions, but very large values |
| 05:03:10 | <orangeflu> | I don't think i have any global variables |
| 05:03:27 | → | merijn joins (~merijn@128-137-045-062.dynamic.caiway.nl) |
| 05:04:39 | <haskellbridge> | <Bowuigi> You don't, just checked |
| 05:06:16 | <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) |
| 05:06:32 | <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 |
| 05:07:11 | <orangeflu> | if i do something like 'JMP -1' it starts taking a lot of space when emulating that |
| 05:08:13 | <haskellbridge> | <Bowuigi> Oh you have a list of instructions |
| 05:08:22 | × | merijn quits (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 265 seconds) |
| 05:08:46 | <orangeflu> | yeah, the "program" is [Instruction] |
| 05:09:24 | <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 |
| 05:11:03 | <haskellbridge> | <Bowuigi> You also seem to be evaluating the entire spine of the instructions list on every iteration of runProgram, unless GHC optimizes that |
| 05:11:48 | <haskellbridge> | <Bowuigi> Hmmm try switching from an instruction list to an instruction array |
| 05:11:53 | <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. |
| 05:12:05 | <haskellbridge> | <Bowuigi> You are treating it like one as far as I can see |
| 05:12:18 | <Leary> | And yeah, either an array or a list zipper for the instructions. |
| 05:12:36 | <haskellbridge> | <Bowuigi> Profiling is crucial here indeed |
| 05:13:07 | <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 |
| 05:13:20 | <orangeflu> | and it would still cause this problem |
| 05:13:27 | <orangeflu> | i am going to try profiling |
| 05:14:21 | <haskellbridge> | <Bowuigi> Oh then it's probably the memory, but yeah profiling will show the true cause |
| 05:14:40 | <orangeflu> | Also, the split-up version is on branch 'feature/18-add-step-by-step-emulation' |
| 05:18:17 | <haskellbridge> | <Bowuigi> Oh you didn't separate the functions from each instruction, I thought that was the main idea |
| 05:18:51 | → | merijn joins (~merijn@128-137-045-062.dynamic.caiway.nl) |
| 05:19:21 | <orangeflu> | What do you mean |
| 05:19:41 | × | rekahsoft quits (~rekahsoft@76.69.85.220) (Remote host closed the connection) |
| 05:21:58 | → | rekahsoft joins (~rekahsoft@bras-base-orllon1103w-grc-06-76-69-85-220.dsl.bell.ca) |
| 05:23:36 | → | remexre joins (~remexre@user/remexre) |
| 05:25:46 | × | merijn quits (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 265 seconds) |
| 05:28:35 | → | merijn joins (~merijn@128-137-045-062.dynamic.caiway.nl) |
| 05:30:51 | → | housemate joins (~housemate@1.147.119.169) |
| 05:36:46 | <orangeflu> | for whatever reason, the --enable-profiling flag has made ghc just hang.. |
| 05:36:50 | <orangeflu> | i am so done |
| 05:36:55 | × | merijn quits (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 244 seconds) |
| 05:37:26 | <orangeflu> | I am going to try and replace the list with an array and see what happens then |
| 05:37:43 | <orangeflu> | if that doesn't work, i am reverting back to the old way |
| 05:38:12 | × | housemate quits (~housemate@1.147.119.169) (Read error: Connection reset by peer) |
| 05:44:53 | <orangeflu> | Bowuigi: converted to array, still same behaviour |
| 05:47:15 | <haskellbridge> | <Bowuigi> Hmmm, so it wasn't that |
| 05:47:52 | → | merijn joins (~merijn@128-137-045-062.dynamic.caiway.nl) |
| 05:49:13 | → | housemate joins (~housemate@ppp203-122-213-191.static.internode.on.net) |
| 05:49:25 | <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) |
| 05:51:00 | <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 |
| 05:51:31 | × | codaraxis__ quits (~codaraxis@user/codaraxis) (Quit: Leaving) |
| 05:52:25 | × | merijn quits (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 244 seconds) |
| 05:52:35 | <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 |
| 05:52:47 | <orangeflu> | how do you enable strict mode |
| 05:53:06 | <haskellbridge> | <Bowuigi> It's a language extension |
| 05:53:57 | <haskellbridge> | <Bowuigi> So either {-# LANGUAGE Strict #-} or the equivalent in the Cabal/Stack file |
| 05:54:58 | <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) |
| 05:55:08 | <haskellbridge> | <Bowuigi> But it will give you a clue |
| 05:55:14 | <orangeflu> | So just put {-# LANGUAGE Strict #-} in all files that used to be part of Emulator.hs |
| 05:55:17 | <orangeflu> | ? |
| 05:55:41 | <haskellbridge> | <Bowuigi> Yeah that should work |
| 05:56:05 | → | tnt2 joins (~Thunderbi@user/tnt1) |
| 05:56:11 | × | CrunchyFlakes quits (~CrunchyFl@31.19.233.78) (Read error: Connection reset by peer) |
| 05:57:00 | × | tnt1 quits (~Thunderbi@user/tnt1) (Ping timeout: 276 seconds) |
| 05:57:00 | tnt2 | is now known as tnt1 |
| 05:57:32 | <haskellbridge> | <Bowuigi> If that doesn't work, just revert, unless someone else here has another idea |
| 05:58:52 | → | CrunchyFlakes joins (~CrunchyFl@31.19.233.78) |
| 05:59:07 | <orangeflu> | hmm, that's the first time the behaviour changed |
| 06:00:05 | <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 |
| 06:00:35 | <haskellbridge> | <Bowuigi> Oh that's a bit too strict lmao |
| 06:01:04 | <haskellbridge> | <Bowuigi> Enough to make GHC notice it loops forever |
| 06:01:22 | <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 |
| 06:01:36 | <orangeflu> | Yeah, but bubblesort.asm doesn't loop forever though |
| 06:01:58 | <haskellbridge> | <Bowuigi> https://stackoverflow.com/questions/21505192/haskell-program-outputs-loop#21554398 |
| 06:02:25 | <haskellbridge> | <Bowuigi> It probably loops with strictness turned on, which can happen if you generate an infinite data structure somewhere |
| 06:03:13 | → | merijn joins (~merijn@128-137-045-062.dynamic.caiway.nl) |
| 06:03:26 | <orangeflu> | this is so weird |
| 06:03:34 | <haskellbridge> | <Bowuigi> Your other test has been turned into a noop loop, GHC probably understood that it doesn't need anything from there |
| 06:03:59 | <orangeflu> | why do i always feel like i am making haskell bend in ways it was never supposed to, haha |
| 06:04:22 | <orangeflu> | also, on another note, can't ctrl-c it now |
| 06:04:25 | <orangeflu> | so that's fun |
| 06:04:36 | <haskellbridge> | <Bowuigi> The SO page also tells you how to profile to detect where it happened too, nice |
| 06:04:41 | <c_wraith> | Yeah, this is why I think Language Strict is usually a bad idea. |
| 06:04:52 | <c_wraith> | It turns out lots of correct Haskell code breaks when you turn it on |
| 06:05:08 | <orangeflu> | well, it did fix my issue to be fair |
| 06:05:10 | <haskellbridge> | <Bowuigi> Hmmm is StrictData also a bad idea? |
| 06:05:15 | <orangeflu> | but it also lobotomized my program |
| 06:05:45 | <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. |
| 06:05:53 | <haskellbridge> | <Bowuigi> The RTS literally decided to ignore SIGINT, wonderful |
| 06:06:21 | <orangeflu> | it can't ignore me killing the terminal, so its fine |
| 06:06:22 | × | housemate quits (~housemate@ppp203-122-213-191.static.internode.on.net) (Ping timeout: 265 seconds) |
| 06:06:50 | <orangeflu> | yeah, so guess i am going back to the monolithic file from before |
| 06:06:52 | <haskellbridge> | <Bowuigi> Ok, let's go with something less extreme, locate every data type that mentions the memory and make that strict only |
| 06:07:21 | × | weary-traveler quits (~user@user/user363627) (Remote host closed the connection) |
| 06:07:41 | <orangeflu> | Something like `memory :: !Array Int Word8`, you mean? |
| 06:07:49 | × | merijn quits (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 248 seconds) |
| 06:07:53 | <haskellbridge> | <Bowuigi> Yeah I think |
| 06:08:38 | <haskellbridge> | <Bowuigi> StrictData is technically faster to test but still seems like too much lol |
| 06:08:44 | <orangeflu> | that doesn't inspire confidence, to be fair |
| 06:09:50 | × | xal quits (~xal@mx1.xal.systems) (Quit: No Ping reply in 180 seconds.) |
| 06:10:29 | <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 |
| 06:11:04 | → | xal joins (~xal@mx1.xal.systems) |
| 06:12:39 | <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 |
| 06:13:00 | <orangeflu> | i call this an improvement |
| 06:13:26 | <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 |
| 06:14:17 | <haskellbridge> | <Bowuigi> Try profiling now, it might help with test.asm |
| 06:14:21 | <orangeflu> | I ran the whole test suite, and it actually made it through this time |
| 06:14:27 | <orangeflu> | including test.asm |
| 06:14:45 | <orangeflu> | it took like 9 gigs |
| 06:14:58 | <haskellbridge> | <Bowuigi> That's one less than before |
| 06:15:05 | <orangeflu> | but at least it finished in like 30 seconds |
| 06:15:11 | <orangeflu> | as opposed to not at all |
| 06:15:23 | <orangeflu> | but still 25 seconds slower than before i did this split |
| 06:15:30 | <[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) |
| 06:16:12 | <[exa]> | btw what's the program? the loopy situation and sigint ignore sounds wild |
| 06:16:22 | <haskellbridge> | <Bowuigi> Aggressive inlining should help too yeah |
| 06:16:32 | <orangeflu> | i think i tried that about 8 hours ago |
| 06:16:35 | <orangeflu> | can't remember |
| 06:16:36 | <haskellbridge> | <Bowuigi> [exa] https://github.com/Flu/avr-emulator |
| 06:16:49 | <[exa]> | I'm using these 2 for everything that goes to production |
| 06:17:01 | <orangeflu> | well, the loopy thing and ignoring sigint was when we tried {-# LANGUAGE Strict #-} |
| 06:17:10 | <orangeflu> | that doesn't happen normally |
| 06:17:22 | <haskellbridge> | <Bowuigi> [exa] The split-up version is on branch feature/18-add-step-by-step-emulation |
| 06:18:02 | <orangeflu> | ok, i am going to remove the strict data things, and try again with -finline-aggressively |
| 06:18:17 | × | rekahsoft quits (~rekahsoft@bras-base-orllon1103w-grc-06-76-69-85-220.dsl.bell.ca) (Remote host closed the connection) |
| 06:18:24 | <orangeflu> | haskell has taken years off my life at this point |
| 06:18:36 | → | merijn joins (~merijn@128-137-045-062.dynamic.caiway.nl) |
| 06:18:38 | → | JuanDaugherty joins (~juan@user/JuanDaugherty) |
| 06:19:00 | <haskellbridge> | <Bowuigi> No no keep strictness, those are supposed to mix together |
| 06:19:45 | <haskellbridge> | <Bowuigi> Or well, try both if you have some time, going blind here is not that fun lol |
| 06:19:51 | <[exa]> | I'd say trying without strictness should be a safe bet. Strictness changes semantics, aggressive inlining only changes weird corner cases |
| 06:20:31 | <orangeflu> | -finline-generics-aggressively |
| 06:20:36 | <orangeflu> | is this the one you meant? |
| 06:21:01 | <[exa]> | no thats generics only (not a bad choice either if you use generics) |
| 06:21:10 | <haskellbridge> | <Bowuigi> Put everything that has "aggressively" on your flags |
| 06:21:36 | <haskellbridge> | <Bowuigi> Probably a good idea for production stuff lol |
| 06:21:44 | <[exa]> | oh wait it is -fspecialize-aggressively |
| 06:22:09 | <orangeflu> | i already have that one then |
| 06:22:17 | <[exa]> | ah okay nvm then :( |
| 06:22:58 | <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 |
| 06:23:02 | × | merijn quits (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 252 seconds) |
| 06:23:17 | <[exa]> | but you have a space leak there right? suggest doing an allocation profile to see what's happening |
| 06:23:26 | <haskellbridge> | <Bowuigi> Yes, also try to profile the run on test.asm on both |
| 06:23:41 | <haskellbridge> | <Bowuigi> Both main and the memory-strict version |
| 06:24:16 | <orangeflu> | profiling doesn't seem to work for some reason |
| 06:24:21 | <orangeflu> | idk why |
| 06:24:26 | <orangeflu> | ghc just hangs |
| 06:24:30 | <orangeflu> | it says ' |
| 06:24:42 | <orangeflu> | Building vector-0.4.2 |
| 06:24:46 | <orangeflu> | and then stops there |
| 06:25:10 | <orangeflu> | waited 10 minutes for it to compile that |
| 06:25:23 | <haskellbridge> | <Bowuigi> I don't know much about profiling, [exa] any ideas? |
| 06:26:47 | <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 |
| 06:27:19 | <mauke> | https://infosec.exchange/@barubary/111126546998839428 |
| 06:28:17 | → | billchenchina joins (~billchenc@183.95.251.11) |
| 06:29:14 | <orangeflu> | Ok, so went back to main |
| 06:29:29 | → | merijn joins (~merijn@128-137-045-062.dynamic.caiway.nl) |
| 06:29:34 | × | euphores quits (~SASL_euph@user/euphores) (Quit: Leaving.) |
| 06:29:34 | <orangeflu> | test.asm performance is comparable to what it is now with the strict stuff |
| 06:30:09 | <orangeflu> | Idk what you mean by StrictData, I just put ! in front of some types |
| 06:30:17 | <orangeflu> | Still don't understand what it doese |
| 06:30:43 | <orangeflu> | But now it's comparable to what it was before the split |
| 06:30:57 | <orangeflu> | So I am happy, even if it feels a little bit hacky |
| 06:31:10 | <haskellbridge> | <Bowuigi> It disallows GHC from making a thunk in that position |
| 06:31:33 | <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 |
| 06:32:00 | <orangeflu> | but after the split, it got much much worse, that's why i noticed |
| 06:32:06 | <orangeflu> | interesting |
| 06:32:08 | <[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 |
| 06:32:12 | <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 |
| 06:32:21 | <[exa]> | 2nd suggestion: MVector |
| 06:32:50 | <[exa]> | you have plain arrays there right? if so that one _is_ the source of insane allocationery |
| 06:32:52 | × | billchenchina quits (~billchenc@183.95.251.11) (Ping timeout: 252 seconds) |
| 06:33:16 | <orangeflu> | [exa]: yes, now everything in EmulatorState is strict |
| 06:33:47 | <orangeflu> | What's a strict state monad? is it different from a normal State monad? |
| 06:34:02 | × | merijn quits (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 252 seconds) |
| 06:34:11 | <[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 |
| 06:34:53 | <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 |
| 06:34:54 | <[exa]> | State monad does not prevent this but since you never touch&hold the state explicitly, leak probability gets lower |
| 06:35:06 | <[exa]> | ah well |
| 06:35:16 | <haskellbridge> | <Bowuigi> Oh wait you are still learning monads? |
| 06:35:19 | × | JuanDaugherty quits (~juan@user/JuanDaugherty) (Quit: JuanDaugherty) |
| 06:35:20 | <[exa]> | try parser combinators, these usually demystify it |
| 06:35:37 | <orangeflu> | You mean the ones I have in Parser.hs? |
| 06:36:22 | <haskellbridge> | <Bowuigi> Strictness is definitely not a begginner's topic, it's ok if you don't understand it yet |
| 06:36:41 | <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 |
| 06:36:47 | <orangeflu> | Conceptually, i think i understand it |
| 06:36:54 | <orangeflu> | But to actually use them? |
| 06:37:22 | <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) |
| 06:37:57 | <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 |
| 06:38:29 | <orangeflu> | Although to be fair, i wrote most of the code in Emulator.hs before i read up on monads |
| 06:38:36 | <orangeflu> | maybe if i try now, it will be easier |
| 06:38:53 | <orangeflu> | But state monads are harder to understand than something like Maybe |
| 06:38:56 | <orangeflu> | That one I get |
| 06:38:59 | <haskellbridge> | <Bowuigi> ! automatically inserts one of those "case"s when using those values so you have at least one layer of evaluation now |
| 06:39:14 | → | euphores joins (~SASL_euph@user/euphores) |
| 06:39:48 | <orangeflu> | [exa]: what's MVector and why should i use it instead of arrays? |
| 06:40:11 | <haskellbridge> | <Bowuigi> MVector is fairly similar to a C array |
| 06:40:33 | <orangeflu> | i thought an array is similar to a c array.. because of the name |
| 06:40:37 | <orangeflu> | that's why i used it |
| 06:41:01 | <haskellbridge> | <Bowuigi> MVector is mutable, gets nice support for compiler magic and goes fast if you use it properly |
| 06:41:19 | <orangeflu> | am i going to have to use monads with it? |
| 06:41:49 | <orangeflu> | so its not going to be a drop-in replacement then |
| 06:42:01 | <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 |
| 06:42:45 | <orangeflu> | i am getting code-reviewed here, i love it |
| 06:43:12 | <haskellbridge> | <Bowuigi> https://hackage.haskell.org/package/vector-0.13.2.0/docs/Data-Vector-Mutable.html this should make some things clearer |
| 06:43:49 | <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 |
| 06:45:03 | <haskellbridge> | <Bowuigi> Haskell has some fancy optimization tricks that make low level-ish projects like yours feasible |
| 06:45:36 | → | JuanDaugherty joins (~juan@user/JuanDaugherty) |
| 06:45:37 | <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 |
| 06:46:29 | <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) |
| 06:46:58 | <haskellbridge> | <Bowuigi> Vector takes care of the fusion, strictness and mutability for you when you use the containers it provides |
| 06:48:50 | <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? |
| 06:50:17 | → | merijn joins (~merijn@128-137-045-062.dynamic.caiway.nl) |
| 06:50:20 | <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 |
| 06:50:46 | <haskellbridge> | <Bowuigi> You don't copy an MVector unless you call clone on it |
| 06:51:01 | <haskellbridge> | <Bowuigi> Modifying it doesn't copy it |
| 06:52:15 | <orangeflu> | i really need to understand monads properly.. |
| 06:53:06 | <haskellbridge> | <Bowuigi> Hmmm, if parser combinators didn't help, maybe playing with the free monad will? |
| 06:53:23 | <orangeflu> | They did help, don't get me wrong |
| 06:53:27 | <orangeflu> | Problem is |
| 06:53:32 | <orangeflu> | I go mostly by intuition |
| 06:53:54 | <orangeflu> | But if i think hard about it, my brain doesn't feel like it understands them |
| 06:54:18 | <orangeflu> | Like, if somebody asked me how they work, i don't know that i could explain |
| 06:54:51 | <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 |
| 06:54:58 | <orangeflu> | And each time I will get it a bit more |
| 06:55:30 | × | merijn quits (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 276 seconds) |
| 06:55:50 | <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 |
| 06:56:05 | <orangeflu> | And there's a lot of monads there |
| 06:56:29 | <orangeflu> | src/Repl.hs on my branch |
| 06:57:30 | <haskellbridge> | <Bowuigi> A nice explanation of free monads https://www.haskellforall.com/2012/06/you-could-have-invented-free-monads.html?m=1 |
| 06:59:32 | × | JuanDaugherty quits (~juan@user/JuanDaugherty) (Quit: JuanDaugherty) |
| 06:59:40 | <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 |
| 07:00:06 | × | manwithluck quits (~manwithlu@194.177.28.164) (Ping timeout: 244 seconds) |
| 07:00:10 | <orangeflu> | Ok, bookmarked the links you gave me |
| 07:00:17 | × | JamesMowery439 quits (~JamesMowe@ip68-228-212-232.ph.ph.cox.net) (Quit: Goodbye) |
| 07:00:29 | <orangeflu> | also, thank you for everything |
| 07:00:34 | → | JamesMowery439 joins (~JamesMowe@ip68-228-212-232.ph.ph.cox.net) |
| 07:00:45 | <orangeflu> | been at this for 12 hours now, and my brain is mush |
| 07:00:51 | <orangeflu> | you really helped |
| 07:01:08 | × | tnt1 quits (~Thunderbi@user/tnt1) (Ping timeout: 244 seconds) |
| 07:01:20 | <haskellbridge> | <Bowuigi> Step by step emulation shouldn't be painful at all, you structured this nicely with the instruction list |
| 07:01:33 | <haskellbridge> | <Bowuigi> Good luck and glad to help! |
| 07:01:49 | → | tnt1 joins (~Thunderbi@user/tnt1) |
| 07:03:10 | <orangeflu> | well, it is painful |
| 07:03:45 | <orangeflu> | cause look how many monads are involved in this: InputT, IO, Parser, Either, Maybe |
| 07:04:15 | <orangeflu> | I am actually surprised that what i wrote so far compiles even |
| 07:04:36 | <orangeflu> | even if it looks... questionable |
| 07:05:42 | → | merijn joins (~merijn@128-137-045-062.dynamic.caiway.nl) |
| 07:06:43 | × | peterbecich quits (~Thunderbi@syn-047-229-123-186.res.spectrum.com) (Quit: peterbecich) |
| 07:07:10 | → | peterbecich joins (~Thunderbi@syn-047-229-123-186.res.spectrum.com) |
| 07:10:35 | × | merijn quits (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 260 seconds) |
| 07:11:47 | → | manwithluck joins (~manwithlu@194.177.28.164) |
| 07:12:14 | × | manwithluck quits (~manwithlu@194.177.28.164) (Read error: Connection reset by peer) |
| 07:14:56 | → | takuan joins (~takuan@178-116-218-225.access.telenet.be) |
| 07:16:21 | → | manwithluck joins (~manwithlu@194.177.28.164) |
| 07:21:24 | → | merijn joins (~merijn@128-137-045-062.dynamic.caiway.nl) |
| 07:25:42 | × | merijn quits (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 246 seconds) |
| 07:30:34 | → | merijn joins (~merijn@128-137-045-062.dynamic.caiway.nl) |
| 07:32:43 | Digitteknohippie | is now known as Digit |
| 07:33:25 | × | CrunchyFlakes quits (~CrunchyFl@31.19.233.78) (Read error: Connection reset by peer) |
| 07:34:53 | → | Sgeo_ joins (~Sgeo@user/sgeo) |
| 07:35:13 | × | merijn quits (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 248 seconds) |
| 07:36:01 | → | CrunchyFlakes joins (~CrunchyFl@31.19.233.78) |
| 07:38:12 | × | Sgeo quits (~Sgeo@user/sgeo) (Ping timeout: 252 seconds) |
| 07:48:42 | → | merijn joins (~merijn@128-137-045-062.dynamic.caiway.nl) |
| 07:50:56 | × | j1n37 quits (~j1n37@user/j1n37) (Read error: Connection reset by peer) |
| 07:51:04 | <haskellbridge> | <magic_rb> Bowuigi what cabal flags are you referring to? |
| 07:52:38 | <[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 |
| 07:53:01 | × | merijn quits (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 244 seconds) |
| 07:54:01 | <[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) |
| 07:54:03 | → | j1n37 joins (~j1n37@user/j1n37) |
| 07:54:17 | <haskellbridge> | <Bowuigi> magic_rb the GHC flags -fspecialize-aggressively, -fexpose-all-unfoldings and -O2, maybe other stuff too idk |
| 07:54:29 | <[exa]> | orangeflu: btw highly recommend playing with a tiny prototype of each, helps a lot. |
| 07:54:49 | <haskellbridge> | <magic_rb> Ill try those for my little game engine, last time i profiled it, 40% of the time was >>= |
| 07:55:32 | <haskellbridge> | <Bowuigi> If that's due to an associativity issue try Codensity too |
| 07:57:36 | <haskellbridge> | <Bowuigi> Tangentially related, is smalltt a strict language? It seems to have quite a bit of focus on strictness optimization |
| 08:00:00 | × | caconym quits (~caconym@user/caconym) (Quit: bye) |
| 08:00:40 | → | caconym joins (~caconym@user/caconym) |
| 08:02:20 | <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 |
| 08:04:05 | → | merijn joins (~merijn@128-137-045-062.dynamic.caiway.nl) |
| 08:04:20 | × | peterbecich quits (~Thunderbi@syn-047-229-123-186.res.spectrum.com) (Ping timeout: 264 seconds) |
| 08:13:26 | × | tzh quits (~tzh@c-76-115-131-146.hsd1.or.comcast.net) (Quit: zzz) |
| 08:15:54 | × | merijn quits (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 265 seconds) |
| 08:21:01 | <probie> | It's not possible to override precedence for a function specified in another module is it? |
| 08:23:12 | → | Guest46 joins (~Guest46@2405:201:e016:301c:9934:efe2:6f7:528d) |
| 08:25:21 | × | Guest46 quits (~Guest46@2405:201:e016:301c:9934:efe2:6f7:528d) (Client Quit) |
| 08:25:45 | <geekosaur> | no |
| 08:26:19 | <geekosaur> | at least, not directly. You can do `` foo = bar; infixl 4 `foo` `` or similar though |
| 08:26:37 | → | merijn joins (~merijn@128-137-045-062.dynamic.caiway.nl) |
| 08:28:31 | → | Guest46 joins (~Guest46@2405:201:e016:301c:9934:efe2:6f7:528d) |
| 08:28:36 | × | Guest46 quits (~Guest46@2405:201:e016:301c:9934:efe2:6f7:528d) (Client Quit) |
| 08:31:02 | × | merijn quits (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 244 seconds) |
| 08:37:06 | × | Square quits (~Square@user/square) (Ping timeout: 246 seconds) |
| 08:46:38 | → | merijn joins (~merijn@128-137-045-062.dynamic.caiway.nl) |
| 08:51:30 | × | merijn quits (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 260 seconds) |
| 08:59:30 | → | ljdarj joins (~Thunderbi@user/ljdarj) |
| 09:02:01 | → | merijn joins (~merijn@128-137-045-062.dynamic.caiway.nl) |
| 09:06:41 | × | merijn quits (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 244 seconds) |
| 09:14:59 | → | merijn joins (~merijn@128-137-045-062.dynamic.caiway.nl) |
| 09:16:06 | → | Tuplanolla joins (~Tuplanoll@91-159-69-59.elisa-laajakaista.fi) |
| 09:19:48 | × | merijn quits (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 276 seconds) |
| 09:30:21 | → | merijn joins (~merijn@128-137-045-062.dynamic.caiway.nl) |
| 09:30:40 | × | rembo10_ quits (~rembo10@main.remulis.com) (Quit: ZNC 1.8.2 - https://znc.in) |
| 09:32:09 | → | rembo10 joins (~rembo10@main.remulis.com) |
| 09:36:39 | × | merijn quits (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 244 seconds) |
| 09:40:17 | → | __monty__ joins (~toonn@user/toonn) |
| 09:44:04 | → | acidjnk_new joins (~acidjnk@p200300d6e7283f52b5be3bacf47f1ed3.dip0.t-ipconnect.de) |
| 09:47:39 | → | merijn joins (~merijn@128-137-045-062.dynamic.caiway.nl) |
| 09:51:34 | → | vanishingideal joins (~vanishing@user/vanishingideal) |
| 09:51:51 | × | merijn quits (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 244 seconds) |
| 09:51:57 | → | ash3en joins (~Thunderbi@2a03:7846:b6eb:101:93ac:a90a:da67:f207) |
| 10:02:54 | → | tnt2 joins (~Thunderbi@user/tnt1) |
| 10:03:01 | → | merijn joins (~merijn@128-137-045-062.dynamic.caiway.nl) |
| 10:04:39 | × | tnt1 quits (~Thunderbi@user/tnt1) (Ping timeout: 265 seconds) |
| 10:04:39 | tnt2 | is now known as tnt1 |
| 10:07:47 | × | merijn quits (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 252 seconds) |
| 10:17:41 | × | Sgeo_ quits (~Sgeo@user/sgeo) (Read error: Connection reset by peer) |
| 10:18:34 | → | merijn joins (~merijn@128-137-045-062.dynamic.caiway.nl) |
| 10:19:45 | × | vanishingideal quits (~vanishing@user/vanishingideal) (Ping timeout: 244 seconds) |
| 10:23:12 | × | merijn quits (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 252 seconds) |
| 10:33:31 | → | merijn joins (~merijn@128-137-045-062.dynamic.caiway.nl) |
| 10:35:51 | → | sawilagar joins (~sawilagar@user/sawilagar) |
| 10:36:01 | × | pabs3 quits (~pabs3@user/pabs3) (Read error: Connection reset by peer) |
| 10:36:45 | → | pabs3 joins (~pabs3@user/pabs3) |
| 10:38:32 | × | merijn quits (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 264 seconds) |
| 10:44:31 | → | ephilalethes joins (~noumenon@202.186.203.84) |
| 10:45:41 | → | billchenchina joins (~billchenc@183.95.251.11) |
| 10:48:53 | → | merijn joins (~merijn@128-137-045-062.dynamic.caiway.nl) |
| 10:50:01 | × | billchenchina quits (~billchenc@183.95.251.11) (Ping timeout: 244 seconds) |
| 10:53:09 | × | merijn quits (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 248 seconds) |
| 10:56:51 | × | ljdarj quits (~Thunderbi@user/ljdarj) (Ping timeout: 272 seconds) |
| 11:00:44 | × | ash3en quits (~Thunderbi@2a03:7846:b6eb:101:93ac:a90a:da67:f207) (Quit: ash3en) |
| 11:03:46 | → | Guest93 joins (~Guest93@106.219.180.229) |
| 11:04:18 | → | merijn joins (~merijn@128-137-045-062.dynamic.caiway.nl) |
| 11:04:30 | × | Guest93 quits (~Guest93@106.219.180.229) (Client Quit) |
| 11:06:32 | carbolymer_ | is now known as carbolymer |
| 11:09:38 | → | tnt2 joins (~Thunderbi@user/tnt1) |
| 11:10:29 | × | tnt1 quits (~Thunderbi@user/tnt1) (Ping timeout: 252 seconds) |
| 11:10:29 | tnt2 | is now known as tnt1 |
| 11:10:49 | × | merijn quits (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 245 seconds) |
| 11:17:38 | × | AlexZenon quits (~alzenon@5.139.233.146) (Ping timeout: 265 seconds) |
| 11:19:23 | → | alexherbo2 joins (~alexherbo@2a02-8440-3508-e5d2-70ed-26be-f60d-e304.rev.sfr.net) |
| 11:22:18 | → | merijn joins (~merijn@128-137-045-062.dynamic.caiway.nl) |
| 11:23:03 | → | AlexZenon joins (~alzenon@5.139.233.146) |
| 11:24:09 | → | rvalue- joins (~rvalue@user/rvalue) |
| 11:24:43 | × | rvalue quits (~rvalue@user/rvalue) (Ping timeout: 264 seconds) |
| 11:26:30 | × | merijn quits (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 246 seconds) |
| 11:28:17 | rvalue- | is now known as rvalue |
| 11:30:12 | × | youthlic quits (~Thunderbi@user/youthlic) (Ping timeout: 265 seconds) |
| 11:34:30 | → | merijn joins (~merijn@128-137-045-062.dynamic.caiway.nl) |
| 11:36:12 | → | youthlic joins (~Thunderbi@user/youthlic) |
| 11:37:20 | × | alexherbo2 quits (~alexherbo@2a02-8440-3508-e5d2-70ed-26be-f60d-e304.rev.sfr.net) (Remote host closed the connection) |
| 11:39:30 | × | merijn quits (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 260 seconds) |
| 11:41:03 | × | mewra quits (~aranea@wireguard/contributorcat/mira) (Quit: back in a couple weeks :3) |
| 11:48:53 | → | Digitteknohippie joins (~user@user/digit) |
| 11:49:51 | → | merijn joins (~merijn@128-137-045-062.dynamic.caiway.nl) |
| 11:51:15 | × | dostoevsky quits (~dostoevsk@user/dostoevsky) (Ping timeout: 276 seconds) |
| 11:51:21 | × | Digit quits (~user@user/digit) (Ping timeout: 246 seconds) |
| 11:54:25 | × | merijn quits (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 248 seconds) |
| 11:55:32 | → | lxsameer joins (lxsameer@Serene/lxsameer) |
| 12:00:05 | × | caconym quits (~caconym@user/caconym) (Quit: bye) |
| 12:03:37 | → | caconym joins (~caconym@user/caconym) |
| 12:04:46 | × | lxsameer quits (lxsameer@Serene/lxsameer) (Ping timeout: 252 seconds) |
| 12:05:15 | → | merijn joins (~merijn@128-137-045-062.dynamic.caiway.nl) |
| 12:05:41 | → | dostoevsky joins (~dostoevsk@user/dostoevsky) |
| 12:06:44 | Digitteknohippie | is now known as Digit |
| 12:06:51 | → | lxsameer joins (lxsameer@Serene/lxsameer) |
| 12:09:54 | × | merijn quits (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 252 seconds) |
| 12:13:12 | × | lxsameer quits (lxsameer@Serene/lxsameer) (Ping timeout: 244 seconds) |
| 12:14:31 | × | califax quits (~califax@user/califx) (Remote host closed the connection) |
| 12:16:04 | → | califax joins (~califax@user/califx) |
| 12:16:11 | → | merijn joins (~merijn@128-137-045-062.dynamic.caiway.nl) |
| 12:35:19 | × | merijn quits (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 260 seconds) |
| 12:39:09 | × | Digit quits (~user@user/digit) (Ping timeout: 252 seconds) |
| 12:40:06 | → | Digitteknohippie joins (~user@user/digit) |
| 12:42:08 | → | Digit joins (~user@user/digit) |
| 12:44:04 | × | Digitteknohippie quits (~user@user/digit) (Quit: sorted my other instance from locking up with a forced umount and remount) |
| 12:45:04 | → | lxsameer joins (~lxsameer@Serene/lxsameer) |
| 12:46:52 | → | merijn joins (~merijn@128-137-045-062.dynamic.caiway.nl) |
| 12:48:51 | × | glguy quits (glguy@libera/staff/glguy) (Read error: Connection reset by peer) |
| 12:49:48 | × | lxsameer quits (~lxsameer@Serene/lxsameer) (Ping timeout: 246 seconds) |
| 12:51:37 | → | wootehfoot joins (~wootehfoo@user/wootehfoot) |
| 12:53:30 | × | merijn quits (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 244 seconds) |
| 13:02:53 | → | pavonia joins (~user@user/siracusa) |
| 13:04:31 | → | merijn joins (~merijn@128-137-045-062.dynamic.caiway.nl) |
| 13:08:56 | × | merijn quits (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 252 seconds) |
| 13:16:20 | → | Guest78 joins (~Guest78@37.228.252.73) |
| 13:17:50 | → | sprotte24 joins (~sprotte24@p200300d16f1a2c0064c6ee858fd5dcfe.dip0.t-ipconnect.de) |
| 13:19:53 | → | merijn joins (~merijn@128-137-045-062.dynamic.caiway.nl) |
| 13:21:57 | → | alp joins (~alp@2001:861:8ca0:4940:94c0:33a8:5f77:cbe8) |
| 13:24:37 | × | merijn quits (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 248 seconds) |
| 13:30:21 | → | Digitteknohippie joins (~user@user/digit) |
| 13:32:00 | × | Digit quits (~user@user/digit) (Ping timeout: 276 seconds) |
| 13:32:33 | × | alp quits (~alp@2001:861:8ca0:4940:94c0:33a8:5f77:cbe8) (Ping timeout: 248 seconds) |
| 13:34:07 | → | Smiles joins (uid551636@id-551636.lymington.irccloud.com) |
| 13:34:27 | → | machinedgod joins (~machinedg@d108-173-18-100.abhsia.telus.net) |
| 13:40:53 | → | merijn joins (~merijn@128-137-045-062.dynamic.caiway.nl) |
| 13:45:32 | × | merijn quits (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 265 seconds) |
| 13:53:06 | → | weary-traveler joins (~user@user/user363627) |
| 13:56:17 | → | merijn joins (~merijn@128-137-045-062.dynamic.caiway.nl) |
| 13:58:46 | → | meritamen joins (~user@user/meritamen) |
| 14:02:04 | → | tremon joins (~tremon@83.80.159.219) |
| 14:03:25 | Digitteknohippie | is now known as Digit |
| 14:03:51 | × | merijn quits (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 276 seconds) |
| 14:14:19 | → | merijn joins (~merijn@128-137-045-062.dynamic.caiway.nl) |
| 14:18:57 | × | merijn quits (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 252 seconds) |
| 14:29:16 | <zzz> | i've always wonder if Haskell without infix operators would be nicer |
| 14:29:40 | → | merijn joins (~merijn@128-137-045-062.dynamic.caiway.nl) |
| 14:30:19 | <zzz> | then again, function composition would get awkward |
| 14:31:14 | × | Guest78 quits (~Guest78@37.228.252.73) (Quit: Client closed) |
| 14:34:00 | <probie> | Personally, I wouldn't hate a version of Haskell where all infix operators have the same precedence as `$` |
| 14:38:28 | <enikar> | there is liskell, if many parentheses don't afraid you ;) |
| 14:38:56 | <ski> | `y * k + x' would be awkward |
| 14:40:34 | <probie> | ski: That's not annoying at all. The annoying operator is `-`, because `3 - 4 - 5 - 6` is `3 - (4 - (5 - 6))` |
| 14:41:01 | <ski> | it would get interpreted as `y * (k + x)' |
| 14:41:05 | <ski> | yea, that too |
| 14:46:06 | × | merijn quits (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 252 seconds) |
| 14:46:45 | <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 |
| 14:47:22 | <ski> | iirc, Smalltalk also does this (although to the left, not to the right) |
| 14:48:21 | <ski> | enikar : then there's the concatenative languages |
| 14:50:19 | <probie> | Re smalltalk: That's right, because x+k*y is (using pseudo-Java syntax) `x.Plus(k).Mult(y)` |
| 14:50:22 | × | meritamen quits (~user@user/meritamen) (Remote host closed the connection) |
| 14:52:21 | <enikar> | ski: concatenative languages? |
| 14:52:40 | <probie> | languages like Forth and Factor |
| 14:53:30 | <enikar> | I found that: https://en.wikipedia.org/wiki/Concatenative_programming_language |
| 14:54:52 | <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` |
| 14:56:59 | <enikar> | when I discovered forth it was a great moment :) |
| 14:57:24 | <ski> | > run (lit 3 . lit 2 . mult . lit 1 . add) -- `3 * 2 + 1' |
| 14:57:25 | <lambdabot> | 7 |
| 14:57:33 | × | wootehfoot quits (~wootehfoo@user/wootehfoot) (Ping timeout: 246 seconds) |
| 14:57:39 | <ski> | > run (lit 1 . lit 3 . lit 2 . mult . add) -- `1 + 3 * 2' |
| 14:57:57 | <lambdabot> | 7 |
| 14:58:03 | → | merijn joins (~merijn@128-137-045-062.dynamic.caiway.nl) |
| 14:58:06 | <ski> | > run (lit 3 . lit 2 . sub) -- `3 - 2' |
| 14:58:08 | <lambdabot> | 1 |
| 14:58:17 | <ski> | > run (lit 3 . lit 2 . swap_ . sub) -- `2 - 3' |
| 14:58:19 | <lambdabot> | -1 |
| 14:58:36 | <ski> | > run (lit 3 . dup . mult) -- `3 * 3' |
| 14:58:37 | <lambdabot> | 9 |
| 14:58:44 | <ski> | enikar : like that ^ |
| 14:58:54 | <enikar> | yes :) |
| 14:59:51 | <ski> | (btw, note how `foo . bar' does the word `foo' first, and then the word `bar', not the other way around) |
| 15:01:28 | <enikar> | oh! I see! |
| 15:01:30 | <ski> | probie : *nod* (re Smalltalk) |
| 15:01:59 | <ski> | enikar : .. which may be unexpected/surprising (re your comment about `f . g' above) |
| 15:02:20 | <enikar> | yes it is |
| 15:02:30 | × | merijn quits (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 260 seconds) |
| 15:03:42 | <ski> | (er, sorry, that was probie who said that) |
| 15:04:27 | <ski> | enikar : <https://en.wikipedia.org/wiki/Threaded_code> is also interesting |
| 15:04:33 | <enikar> | never mind :) |
| 15:05:33 | <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`. |
| 15:05:48 | → | wootehfoot joins (~wootehfoo@user/wootehfoot) |
| 15:05:55 | <ski> | that's interesting |
| 15:06:22 | <ski> | probie : does it have `swap',`drop' and `dup' ? |
| 15:07:14 | <enikar> | ski: thanks, I didn't know that, but I wrote a simple calculator that used threaded code. |
| 15:07:37 | × | youthlic quits (~Thunderbi@user/youthlic) (Quit: youthlic) |
| 15:10:49 | <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 |
| 15:13:21 | <probie> | e.g. `3 4 swap drop dup *` would be `×.◌:3 4` |
| 15:13:22 | → | merijn joins (~merijn@128-137-045-062.dynamic.caiway.nl) |
| 15:13:39 | ski | nods |
| 15:13:50 | <probie> | sorry, `×.◌:4 3` |
| 15:13:59 | → | youthlic joins (~Thunderbi@user/youthlic) |
| 15:14:01 | × | youthlic quits (~Thunderbi@user/youthlic) (Client Quit) |
| 15:15:04 | <enikar> | APL is too odd |
| 15:15:42 | × | tremon quits (~tremon@83.80.159.219) (Quit: getting boxed in) |
| 15:17:41 | × | merijn quits (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 248 seconds) |
| 15:18:32 | × | CrunchyFlakes quits (~CrunchyFl@31.19.233.78) (Read error: Connection reset by peer) |
| 15:20:23 | → | CrunchyFlakes joins (~CrunchyFl@ip1f13e94e.dynamic.kabel-deutschland.de) |
| 15:22:01 | × | ephilalethes quits (~noumenon@202.186.203.84) (Read error: Connection reset by peer) |
| 15:28:42 | → | merijn joins (~merijn@128-137-045-062.dynamic.caiway.nl) |
| 15:33:01 | × | merijn quits (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 252 seconds) |
| 15:34:52 | × | wootehfoot quits (~wootehfoo@user/wootehfoot) (Ping timeout: 252 seconds) |
| 15:39:43 | × | ft quits (~ft@p508db9c7.dip0.t-ipconnect.de) (Ping timeout: 264 seconds) |
| 15:43:03 | → | ljdarj joins (~Thunderbi@user/ljdarj) |
| 15:43:14 | × | Smiles quits (uid551636@id-551636.lymington.irccloud.com) (Quit: Connection closed for inactivity) |
| 15:44:03 | → | merijn joins (~merijn@128-137-045-062.dynamic.caiway.nl) |
| 15:46:09 | → | ft joins (~ft@p508db070.dip0.t-ipconnect.de) |
| 15:48:47 | × | merijn quits (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 265 seconds) |
| 15:49:59 | <hellwolf> | Question: even with NoImplicitPrelude, GHC.Types seem still imported |
| 15:50:09 | <hellwolf> | hence Int, Bool, etc. are all available. |
| 15:50:24 | <hellwolf> | can one go further to strip those away? |
| 15:54:27 | → | alecs joins (~alecs@61.pool85-58-154.dynamic.orange.es) |
| 15:57:33 | <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 |
| 15:57:50 | × | MyNetAz quits (~MyNetAz@user/MyNetAz) (Read error: Connection reset by peer) |
| 15:57:56 | <hellwolf> | you are right. |
| 15:58:10 | <hellwolf> | I did :Set -XNoImplicitPrelude afterwards |
| 15:58:25 | × | gmg quits (~user@user/gehmehgeh) (Quit: Leaving) |
| 15:58:48 | × | alecs quits (~alecs@61.pool85-58-154.dynamic.orange.es) (Ping timeout: 246 seconds) |
| 15:58:50 | × | ethantwardy quits (user@user/ethantwardy) (Quit: WeeChat 4.4.2) |
| 15:59:27 | → | merijn joins (~merijn@128-137-045-062.dynamic.caiway.nl) |
| 16:01:01 | → | ethantwardy joins (user@user/ethantwardy) |
| 16:02:32 | → | tzh joins (~tzh@c-76-115-131-146.hsd1.or.comcast.net) |
| 16:04:51 | → | MyNetAz joins (~MyNetAz@user/MyNetAz) |
| 16:06:31 | × | merijn quits (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 252 seconds) |
| 16:14:43 | × | ethantwardy quits (user@user/ethantwardy) (Quit: WeeChat 4.4.2) |
| 16:17:29 | → | merijn joins (~merijn@128-137-045-062.dynamic.caiway.nl) |
| 16:18:26 | → | ethantwardy joins (user@user/ethantwardy) |
| 16:22:08 | × | merijn quits (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 265 seconds) |
| 16:25:50 | × | sprotte24 quits (~sprotte24@p200300d16f1a2c0064c6ee858fd5dcfe.dip0.t-ipconnect.de) (Quit: Leaving) |
| 16:27:32 | × | ethantwardy quits (user@user/ethantwardy) (Quit: WeeChat 4.4.2) |
| 16:27:55 | → | tnt2 joins (~Thunderbi@user/tnt1) |
| 16:28:57 | × | tnt1 quits (~Thunderbi@user/tnt1) (Ping timeout: 244 seconds) |
| 16:28:57 | tnt2 | is now known as tnt1 |
| 16:32:53 | → | merijn joins (~merijn@128-137-045-062.dynamic.caiway.nl) |
| 16:33:41 | → | Smiles joins (uid551636@id-551636.lymington.irccloud.com) |
| 16:36:10 | → | ethantwardy joins (user@user/ethantwardy) |
| 16:37:09 | × | merijn quits (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 248 seconds) |
| 16:37:31 | × | ethantwardy quits (user@user/ethantwardy) (Client Quit) |
| 16:41:52 | → | ethantwardy joins (user@user/ethantwardy) |
| 16:42:39 | × | machinedgod quits (~machinedg@d108-173-18-100.abhsia.telus.net) (Ping timeout: 272 seconds) |
| 16:43:38 | → | merijn joins (~merijn@128-137-045-062.dynamic.caiway.nl) |
| 16:45:31 | × | ethantwardy quits (user@user/ethantwardy) (Client Quit) |
| 16:47:13 | → | ethantwardy joins (user@user/ethantwardy) |
| 16:47:45 | × | ethantwardy quits (user@user/ethantwardy) (Client Quit) |
| 16:48:29 | × | merijn quits (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 260 seconds) |
| 16:49:28 | → | ethantwardy joins (user@user/ethantwardy) |
| 16:50:02 | × | ethantwardy quits (user@user/ethantwardy) (Client Quit) |
| 16:51:22 | → | ethantwardy joins (user@user/ethantwardy) |
| 16:52:25 | × | ethantwardy quits (user@user/ethantwardy) (Client Quit) |
| 16:53:56 | × | rachelambda8 quits (~rachelamb@cust-95-80-25-71.csbnet.se) (Quit: β reduced) |
| 16:54:21 | → | ethantwardy joins (user@user/ethantwardy) |
| 16:54:54 | × | ethantwardy quits (user@user/ethantwardy) (Client Quit) |
| 16:56:18 | → | ethantwardy joins (user@user/ethantwardy) |
| 16:57:02 | × | ethantwardy quits (user@user/ethantwardy) (Client Quit) |
| 16:57:22 | × | tnt1 quits (~Thunderbi@user/tnt1) (Ping timeout: 252 seconds) |
| 16:57:25 | × | ljdarj quits (~Thunderbi@user/ljdarj) (Ping timeout: 265 seconds) |
| 16:57:46 | → | tnt1 joins (~Thunderbi@user/tnt1) |
| 16:59:02 | → | merijn joins (~merijn@128-137-045-062.dynamic.caiway.nl) |
| 17:00:46 | → | ethantwardy joins (user@user/ethantwardy) |
| 17:00:58 | → | tnt2 joins (~Thunderbi@user/tnt1) |
| 17:02:09 | × | tnt1 quits (~Thunderbi@user/tnt1) (Ping timeout: 248 seconds) |
| 17:02:10 | tnt2 | is now known as tnt1 |
| 17:03:45 | × | merijn quits (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 248 seconds) |
| 17:13:30 | × | toch quits (toch@user/toch) (Ping timeout: 252 seconds) |
| 17:14:25 | → | merijn joins (~merijn@128-137-045-062.dynamic.caiway.nl) |
| 17:19:04 | × | merijn quits (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 244 seconds) |
| 17:28:00 | → | merijn joins (~merijn@128-137-045-062.dynamic.caiway.nl) |
| 17:32:57 | × | merijn quits (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 246 seconds) |
| 17:33:18 | → | ljdarj joins (~Thunderbi@user/ljdarj) |
| 17:39:33 | <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 |
| 17:40:14 | <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) |
| 17:42:28 | → | toch joins (toch@user/toch) |
| 17:44:03 | → | merijn joins (~merijn@128-137-045-062.dynamic.caiway.nl) |
| 17:45:58 | <ski> | type role Foo phantom -- does adding this help ? (need `RoleAnnotations') |
| 17:46:45 | <WzC> | unfortunately not |
| 17:47:09 | → | michalz joins (~michalz@185.246.207.203) |
| 17:47:16 | <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 |
| 17:47:40 | <WzC> | i.e. the haddocks now say: class a ~R# b => Coercible (a :: k) (b :: k) |
| 17:49:58 | <ski> | hm, can you do `data Foo k (s :: k) = Foo' ? |
| 17:50:20 | → | lxsameer joins (~lxsameer@Serene/lxsameer) |
| 17:50:30 | ski | wonders whether that might help |
| 17:50:54 | × | merijn quits (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 252 seconds) |
| 17:51:49 | <WzC> | interesting idea; doesn't seem to though :( |
| 17:56:42 | → | alecs joins (~alecs@61.pool85-58-154.dynamic.orange.es) |
| 18:01:45 | × | alecs quits (~alecs@61.pool85-58-154.dynamic.orange.es) (Ping timeout: 276 seconds) |
| 18:02:07 | → | merijn joins (~merijn@128-137-045-062.dynamic.caiway.nl) |
| 18:06:18 | × | ljdarj quits (~Thunderbi@user/ljdarj) (Ping timeout: 244 seconds) |
| 18:06:57 | × | merijn quits (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 276 seconds) |
| 18:09:47 | → | Guest78 joins (~Guest78@37.228.252.73) |
| 18:17:28 | → | merijn joins (~merijn@128-137-045-062.dynamic.caiway.nl) |
| 18:19:29 | × | Lord_of_Life quits (~Lord@user/lord-of-life/x-2819915) (Ping timeout: 248 seconds) |
| 18:19:41 | → | Lord_of_Life_ joins (~Lord@user/lord-of-life/x-2819915) |
| 18:20:54 | × | weary-traveler quits (~user@user/user363627) (Remote host closed the connection) |
| 18:21:24 | → | rachelambda8 joins (~rachelamb@cust-95-80-25-71.csbnet.se) |
| 18:21:51 | <haskellbridge> | <thirdofmay18081814goya> "A :: Page" contains a list of elements "[ElemType]" such that "e :: ElemType" determines a new page "f(e) :: Page" |
| 18:22:00 | × | merijn quits (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 260 seconds) |
| 18:22:05 | <haskellbridge> | <thirdofmay18081814goya> what's the right data structure to capture both "A" and "f(e)" |
| 18:22:38 | Lord_of_Life_ | is now known as Lord_of_Life |
| 18:26:31 | → | Square joins (~Square@user/square) |
| 18:27:58 | × | Square quits (~Square@user/square) (Client Quit) |
| 18:28:13 | → | Square joins (~Square@user/square) |
| 18:32:54 | → | merijn joins (~merijn@128-137-045-062.dynamic.caiway.nl) |
| 18:37:27 | × | merijn quits (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 252 seconds) |
| 18:37:43 | <iqubic> | Is there a better way to write this function: "matchingKeys :: (Eq v) => Map k v -> v -> [k]" |
| 18:37:46 | <iqubic> | "matchingKeys map x = [value | (key, value) <- M.toList map, value == x]" |
| 18:41:05 | → | sprotte24 joins (~sprotte24@p200300d16f1a2c0064c6ee858fd5dcfe.dip0.t-ipconnect.de) |
| 18:43:14 | × | Smiles quits (uid551636@id-551636.lymington.irccloud.com) (Quit: Connection closed for inactivity) |
| 18:43:44 | × | rachelambda8 quits (~rachelamb@cust-95-80-25-71.csbnet.se) (Quit: β reduced) |
| 18:45:03 | → | rachelambda8 joins (~rachelamb@cust-95-80-25-71.csbnet.se) |
| 18:45:04 | → | merijn joins (~merijn@128-137-045-062.dynamic.caiway.nl) |
| 18:49:26 | <probie> | :t \m x -> M.keys $ M.filter (== x) $ m |
| 18:49:28 | <lambdabot> | Eq a => M.Map k a -> a -> [k] |
| 18:49:51 | <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) |
| 18:49:56 | × | merijn quits (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 264 seconds) |
| 18:50:49 | <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. |
| 18:51:13 | <ski> | @hoogle Map k v -> Map v [k] |
| 18:51:14 | <lambdabot> | Data.Map.Utils flipM :: (Ord key, Ord val) => Map key val -> Map val [key] |
| 18:51:27 | <geekosaur> | there are bedirectional maps, but I don't know if that fits your need |
| 18:52:17 | <EvanR> | yeah Data.Map has a filter function |
| 18:52:19 | <iqubic> | A bidirectional map would be overkill. |
| 18:52:34 | <EvanR> | probie showed a possible incantation to use it |
| 18:52:55 | <iqubic> | My map only has at most 10 key value pairs and all the values are distinct. |
| 18:53:18 | <EvanR> | even better |
| 18:53:26 | <EvanR> | now you don't have to worry about it being too slow |
| 18:55:30 | <orangeflu> | matchingKeys map x = Map.keys $ Map.filter (==x) map |
| 18:55:52 | <EvanR> | the $ there is really gratuitous |
| 18:56:13 | <orangeflu> | why |
| 18:56:57 | <EvanR> | it's not a complicated enough expression to require bringing another level of precedence to get the grouping across |
| 18:57:42 | <orangeflu> | Does it need to be complicated? I just like how it looks better than with paranthesis |
| 18:58:01 | <EvanR> | ok well then that's also my reason |
| 18:58:09 | <mauke> | $ only makes sense in non-complicated situations |
| 18:58:26 | <EvanR> | I like parentheses better, especially when it's easy to read |
| 18:58:35 | <mauke> | parentheses are usually harder to read |
| 18:58:39 | <probie> | i$use$it$everywhere |
| 18:59:04 | <orangeflu> | i am affirming i want money, nothing to do with grouping or precedence |
| 18:59:15 | <monochrom> | Hot take: $ only makes sense in the law (<*>) = liftA2 ($) |
| 18:59:46 | <mauke> | too hot |
| 19:00:18 | <monochrom> | Call me conservative and reactionary, but IMO today's programmers are too religious in eliminating parentheses. |
| 19:00:20 | <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 |
| 19:00:28 | → | merijn joins (~merijn@128-137-045-062.dynamic.caiway.nl) |
| 19:00:47 | <orangeflu> | I used to program a lot in lisp, i love parenthesis |
| 19:00:48 | <monochrom> | "f (g x y)" is not that hard to read and doesn't need "f $ g x y". |
| 19:01:08 | <mauke> | one level of parens is ok |
| 19:01:15 | <mauke> | nesting is where the trouble starts |
| 19:01:33 | <orangeflu> | matchingKeys map x = (Map.keys $ (Map.filter (==x) (map))) |
| 19:01:33 | <EvanR> | you have to admit you're a never nester? |
| 19:01:38 | <orangeflu> | jsut because i'm petty |
| 19:01:42 | <EvanR> | new operator for each level of nesting |
| 19:01:46 | <monochrom> | Oh by the time you have "f $ g $ h $ i $ x" it's simply (f . g . h . i) x |
| 19:02:18 | <EvanR> | that's too many parens up there |
| 19:02:33 | <orangeflu> | if anything, it needs more |
| 19:03:01 | <EvanR> | you can't use an appeal to lisp syntax since you can't just add arbitrary parens in lisp without breaking things |
| 19:03:08 | × | rachelambda8 quits (~rachelamb@cust-95-80-25-71.csbnet.se) (Quit: β reduced) |
| 19:03:23 | <EvanR> | since it's not just for grouping |
| 19:03:54 | <orangeflu> | just saying, not afraid of some parens |
| 19:04:26 | → | rachelambda8 joins (~rachelamb@cust-95-80-25-71.csbnet.se) |
| 19:05:29 | <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 |
| 19:05:49 | × | merijn quits (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 252 seconds) |
| 19:05:50 | <EvanR> | since we have multiple equivalent ways to group stuff wadler's law appears |
| 19:05:55 | <probie> | s/trying to hard/trying too hard/ |
| 19:05:56 | <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? |
| 19:06:58 | <mauke> | I once implemented a #$ macro in lisp |
| 19:07:14 | <mauke> | (f #$ g x) ==> (f (g x)) |
| 19:07:49 | <probie> | That's a reader macro, right? |
| 19:08:20 | <mauke> | yeah |
| 19:09:21 | <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 |
| 19:09:27 | → | ash3en joins (~Thunderbi@2a03:7846:b6eb:101:93ac:a90a:da67:f207) |
| 19:09:33 | × | ash3en quits (~Thunderbi@2a03:7846:b6eb:101:93ac:a90a:da67:f207) (Client Quit) |
| 19:10:44 | <monochrom> | hahaha |
| 19:11:10 | × | Guest78 quits (~Guest78@37.228.252.73) (Ping timeout: 240 seconds) |
| 19:11:37 | <ski> | `$'s are usually harder to read |
| 19:14:16 | <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 |
| 19:14:52 | <probie> | left$to$right$code$read$just |
| 19:16:02 | <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 |
| 19:16:27 | → | merijn joins (~merijn@128-137-045-062.dynamic.caiway.nl) |
| 19:17:09 | <ski> | (i very seldom use `$' at all, except as `($)', or as a section) |
| 19:17:53 | × | OftenFaded quits (~OftenFade@user/tisktisk) (Quit: Client closed) |
| 19:18:35 | <monochrom> | Yeah, map ($ x) [f, g, h] can be nice. |
| 19:20:44 | <orangeflu> | is anybody good at optparse-applicative? |
| 19:21:35 | → | tremon joins (~tremon@83.80.159.219) |
| 19:22:33 | → | OftenFaded joins (OftenFaded@user/tisktisk) |
| 19:24:25 | × | remexre quits (~remexre@user/remexre) (Ping timeout: 260 seconds) |
| 19:24:27 | <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) |
| 19:25:05 | → | remexre joins (~remexre@user/remexre) |
| 19:26:40 | × | merijn quits (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 272 seconds) |
| 19:27:10 | <probie> | monochrom: `$` considered harmful. Use ``map (`id` x) [f, g, h]`` instead |
| 19:33:56 | <ski> | > (sequence `flip` x) [cos,sin,tan] |
| 19:34:00 | <lambdabot> | [cos x,sin x,sin x / cos x] |
| 19:38:57 | <exarkun> | Why are those better than $? |
| 19:39:11 | → | merijn joins (~merijn@128-137-045-062.dynamic.caiway.nl) |
| 19:43:26 | × | merijn quits (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 244 seconds) |
| 19:46:05 | → | merijn joins (~merijn@128-137-045-062.dynamic.caiway.nl) |
| 19:47:04 | → | ash3en joins (~Thunderbi@2a03:7846:b6eb:101:93ac:a90a:da67:f207) |
| 19:49:28 | <ski> | which things ? |
| 19:50:00 | <ski> | (probie's joking, if it isn't clear) |
| 19:50:40 | × | merijn quits (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 260 seconds) |
| 19:51:23 | <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')) |
| 19:51:46 | × | rachelambda8 quits (~rachelamb@cust-95-80-25-71.csbnet.se) (Quit: Ping timeout (120 seconds)) |
| 19:52:04 | → | rachelambda8 joins (~rachelamb@cust-95-80-25-71.csbnet.se) |
| 19:55:26 | → | peterbecich joins (~Thunderbi@syn-047-229-123-186.res.spectrum.com) |
| 20:00:01 | × | caconym quits (~caconym@user/caconym) (Quit: bye) |
| 20:00:39 | → | caconym joins (~caconym@user/caconym) |
| 20:01:19 | × | sprotte24 quits (~sprotte24@p200300d16f1a2c0064c6ee858fd5dcfe.dip0.t-ipconnect.de) (Read error: Connection reset by peer) |
| 20:01:28 | → | merijn joins (~merijn@128-137-045-062.dynamic.caiway.nl) |
| 20:05:16 | → | Guest78 joins (~Guest78@37.228.252.73) |
| 20:07:40 | × | merijn quits (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 252 seconds) |
| 20:09:18 | × | zzz quits (~z@user/zero) (Ping timeout: 265 seconds) |
| 20:09:41 | × | TheCoffeMaker quits (~TheCoffeM@user/thecoffemaker) (Remote host closed the connection) |
| 20:09:47 | × | ash3en quits (~Thunderbi@2a03:7846:b6eb:101:93ac:a90a:da67:f207) (Ping timeout: 244 seconds) |
| 20:10:05 | → | TheCoffeMaker joins (~TheCoffeM@user/thecoffemaker) |
| 20:10:06 | → | zero joins (~z@user/zero) |
| 20:11:48 | <monochrom> | probie: :( XD |
| 20:16:44 | × | OftenFaded quits (OftenFaded@user/tisktisk) (Quit: Client closed) |
| 20:18:38 | → | merijn joins (~merijn@128-137-045-062.dynamic.caiway.nl) |
| 20:20:27 | <__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. |
| 20:21:56 | <monochrom> | Generally fixed-length non-zero-length data structures, e.g., data P a = MkP a a. |
| 20:22:13 | <monochrom> | because you want dynamic length for filter. |
| 20:22:22 | <WzC> | __monty__: have a look at the witherable package/typeclass that expresses filterable things |
| 20:23:13 | × | merijn quits (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 248 seconds) |
| 20:23:26 | <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 :) ) |
| 20:26:47 | <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 |
| 20:30:22 | <monochrom> | I haven't tried, but maybe https://downloads.haskell.org/ghc/latest/docs/users_guide/debugging.html#type-checking-and-renaming helps. |
| 20:30:45 | × | Guest78 quits (~Guest78@37.228.252.73) (Quit: Client closed) |
| 20:31:14 | → | econo_ joins (uid147250@id-147250.tinside.irccloud.com) |
| 20:31:19 | <WzC> | . |
| 20:31:48 | <WzC> | thanks, let's see if that helps :) |
| 20:32:03 | → | Guest78 joins (~Guest78@37.228.252.73) |
| 20:33:43 | <EvanR> | ski, is environment monad the same thing as reader monad |
| 20:34:01 | → | merijn joins (~merijn@128-137-045-062.dynamic.caiway.nl) |
| 20:34:37 | <monochrom> | (->)e for some e. I say yes, but that's when I go with structural typing. |
| 20:35:19 | <EvanR> | __monty__, in before someone else wants to insert some other ability into Foldable other than folding |
| 20:35:25 | <EvanR> | like indexing |
| 20:35:56 | <monochrom> | Oh, indexing is solved. That's just representable functor or Napier functor. :) |
| 20:35:56 | <EvanR> | until Foldable doesn't mean foldable specifically |
| 20:36:45 | <monochrom> | Yeah, smart phone no longer means phone. >:) |
| 20:37:20 | <EvanR> | the process of diluting the communication power of names |
| 20:37:26 | → | fmira joins (~user@user/fmira) |
| 20:37:36 | <monochrom> | Hell, dash board is neither dash nor board. |
| 20:37:45 | <monochrom> | Oh, and Holy Roman Empire... |
| 20:37:47 | <EvanR> | the red herring effect, or something |
| 20:38:22 | <monochrom> | "meaningful names" is a lie. |
| 20:38:30 | × | merijn quits (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 244 seconds) |
| 20:38:52 | <monochrom> | What really happens is mnemonic names. |
| 20:39:04 | <EvanR> | maybe more realistically, are strategies in a game |
| 20:39:41 | <EvanR> | a game programmers have been losing more often than not |
| 20:40:50 | <EvanR> | also meaningfulness implies semantics while successful communication doesn't necessarily have to |
| 20:41:06 | <ski> | EvanR : yes, aka "input" |
| 20:41:13 | <EvanR> | input monad??? |
| 20:41:18 | <ski> | (and "output" is another name for "writer") |
| 20:41:20 | <ski> | yes |
| 20:41:24 | <ski> | Wadler used this name |
| 20:41:39 | × | krei-se- quits (~krei-se@p5085d4a6.dip0.t-ipconnect.de) (Quit: ZNC 1.9.1 - https://znc.in) |
| 20:42:04 | <EvanR> | Writer monad is based on the Monoid class. Is this inevitable or just a haskell hack |
| 20:42:11 | ski | sometimes says "logging" or "summarizing" for output |
| 20:42:23 | <EvanR> | is this some kind of masterstroke way to do "output" |
| 20:42:40 | <probie> | So that means `type Input = ReaderT`, `type Output = WriterT`, therefore `type IO a = ReaderT (WriterT IO) a` |
| 20:42:48 | → | Sgeo joins (~Sgeo@user/sgeo) |
| 20:42:58 | <EvanR> | finally IO is well defined |
| 20:43:11 | <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) |
| 20:43:56 | <ski> | EvanR : "Reader monad is based on (trivial) comonoid" |
| 20:44:11 | <EvanR> | lol |
| 20:44:30 | <monochrom> | Insofar as generalization is inevitable (as in, if you don't generalize, someone else will), going from [X] to general monoids is inevitable. |
| 20:44:56 | <ski> | (makes me wonder if anyone experimented with a version, using `LinearImplicitParameters', and splitting ..) |
| 20:47:07 | → | merijn joins (~merijn@128-137-045-062.dynamic.caiway.nl) |
| 20:48:06 | × | fmira quits (~user@user/fmira) (Quit: fmira) |
| 20:48:25 | → | glguy joins (glguy@libera/staff/glguy) |
| 20:50:00 | → | E2Combinator joins (~E2Combina@190.180.45.137) |
| 20:51:43 | × | merijn quits (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 264 seconds) |
| 20:53:23 | × | michalz quits (~michalz@185.246.207.203) (Remote host closed the connection) |
| 20:55:19 | → | wootehfoot joins (~wootehfoo@user/wootehfoot) |
| 20:56:01 | × | CrunchyFlakes quits (~CrunchyFl@ip1f13e94e.dynamic.kabel-deutschland.de) (Read error: Connection reset by peer) |
| 20:57:02 | <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) |
| 20:58:10 | → | ljdarj joins (~Thunderbi@user/ljdarj) |
| 20:58:33 | → | CrunchyFlakes joins (~CrunchyFl@31.19.233.78) |
| 21:02:29 | → | merijn joins (~merijn@128-137-045-062.dynamic.caiway.nl) |
| 21:03:02 | × | peterbecich quits (~Thunderbi@syn-047-229-123-186.res.spectrum.com) (Ping timeout: 252 seconds) |
| 21:06:05 | <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 |
| 21:06:09 | <E2Combinator> | Hi. I have a question here I haven't been able to find anywhere else regarding how to extend effects using fused-effects. |
| 21:06:10 | <E2Combinator> | Here's some code: |
| 21:06:10 | <E2Combinator> | https://paste.tomsmeding.com/mudk4tjZ |
| 21:06:11 | <ski> | MkLSS b = k a in b) |
| 21:06:11 | <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. |
| 21:06:11 | <E2Combinator> | Fundamentally, It's just a Writer being used as a write-once flag during iteration. |
| 21:06:12 | <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 |
| 21:06:12 | <E2Combinator> | https://github.com/fused-effects/fused-effects/blob/main/docs/reinterpreting_effects.md |
| 21:06:13 | <E2Combinator> | won't do. |
| 21:06:13 | <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. |
| 21:06:14 | <E2Combinator> | Furthermore, It'd be nice I could handle the Writer internally, to avoid leaking implementation details. |
| 21:06:14 | <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. |
| 21:06:15 | <E2Combinator> | Is there a way to do this? |
| 21:08:59 | × | merijn quits (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 244 seconds) |
| 21:14:36 | × | bitdex quits (~bitdex@gateway/tor-sasl/bitdex) (Ping timeout: 264 seconds) |
| 21:20:20 | → | bitdex joins (~bitdex@gateway/tor-sasl/bitdex) |
| 21:20:51 | → | merijn joins (~merijn@128-137-045-062.dynamic.caiway.nl) |
| 21:25:23 | × | merijn quits (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 252 seconds) |
| 21:32:37 | × | E2Combinator quits (~E2Combina@190.180.45.137) (Quit: Client closed) |
| 21:33:12 | <haskellbridge> | <thirdofmay18081814goya> in the context of algebraic effects, are handlers sort of a fold over a tree of computations? |
| 21:33:32 | <haskellbridge> | <thirdofmay18081814goya> i.e. an interpreter for our tree of computations? |
| 21:36:14 | → | merijn joins (~merijn@128-137-045-062.dynamic.caiway.nl) |
| 21:36:45 | <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? |
| 21:41:08 | × | merijn quits (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 265 seconds) |
| 21:46:21 | × | Sgeo quits (~Sgeo@user/sgeo) (Quit: Leaving) |
| 21:46:40 | × | ljdarj quits (~Thunderbi@user/ljdarj) (Quit: ljdarj) |
| 21:46:48 | → | Sgeo joins (~Sgeo@user/sgeo) |
| 21:47:00 | → | ljdarj joins (~Thunderbi@user/ljdarj) |
| 21:49:38 | <monochrom> | Yes, handlers are interpreters, the tree is made of the obvious free monad. |
| 21:51:37 | → | merijn joins (~merijn@128-137-045-062.dynamic.caiway.nl) |
| 21:52:23 | <haskellbridge> | <thirdofmay18081814goya> I see, ty! |
| 21:52:47 | <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. |
| 21:53:13 | <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. |
| 21:53:21 | <haskellbridge> | <thirdofmay18081814goya> hm right |
| 21:53:29 | <monochrom> | So I would say that the selling point of algebraic effects is the algebraic part. :) |
| 21:53:34 | × | Guest78 quits (~Guest78@37.228.252.73) (Quit: Client closed) |
| 21:54:18 | <haskellbridge> | <thirdofmay18081814goya> noted, thanks for the comments! |
| 21:55:29 | × | lxsameer quits (~lxsameer@Serene/lxsameer) (Ping timeout: 248 seconds) |
| 21:56:46 | × | merijn quits (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 272 seconds) |
| 21:56:48 | <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). |
| 21:58:12 | <monochrom> | I have only skimmed some papers to get that impression. I don't know further details until I learn Lawvere theories properly. :) |
| 21:59:34 | × | wootehfoot quits (~wootehfoo@user/wootehfoot) (Read error: Connection reset by peer) |
| 22:02:39 | × | manwithluck quits (~manwithlu@194.177.28.164) (Read error: Connection reset by peer) |
| 22:04:18 | → | cheater joins (~Username@user/cheater) |
| 22:06:59 | → | merijn joins (~merijn@128-137-045-062.dynamic.caiway.nl) |
| 22:12:14 | × | merijn quits (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 260 seconds) |
| 22:15:08 | → | ubert joins (~Thunderbi@p200300ecdf117ce99c7826839207afbb.dip0.t-ipconnect.de) |
| 22:17:37 | × | Yumemi_ quits (~Yumemi@chamoin.net) (Quit: .) |
| 22:18:31 | → | Yumemi joins (~Yumemi@chamoin.net) |
| 22:22:18 | × | Pozyomka quits (~pyon@user/pyon) (Quit: bbl) |
| 22:22:46 | → | merijn joins (~merijn@128-137-045-062.dynamic.caiway.nl) |
| 22:27:21 | × | merijn quits (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 252 seconds) |
| 22:29:24 | × | Maxdamantus quits (~Maxdamant@user/maxdamantus) (Ping timeout: 246 seconds) |
| 22:33:39 | → | machinedgod joins (~machinedg@d108-173-18-100.abhsia.telus.net) |
| 22:36:01 | × | xff0x quits (~xff0x@2405:6580:b080:900:9795:bd44:dda3:9939) (Ping timeout: 248 seconds) |
| 22:38:08 | → | merijn joins (~merijn@128-137-045-062.dynamic.caiway.nl) |
| 22:42:43 | × | merijn quits (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 244 seconds) |
| 22:45:09 | → | Guest78 joins (~Guest78@37.228.252.73) |
| 22:47:42 | → | Maxdamantus joins (~Maxdamant@user/maxdamantus) |
| 22:53:32 | → | merijn joins (~merijn@128-137-045-062.dynamic.caiway.nl) |
| 22:53:38 | <haskellbridge> | <thirdofmay18081814goya> anyone used frp lately? |
| 22:58:20 | × | merijn quits (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 264 seconds) |
| 23:01:53 | → | peterbecich joins (~Thunderbi@syn-047-229-123-186.res.spectrum.com) |
| 23:03:53 | × | chexum quits (~quassel@gateway/tor-sasl/chexum) (Remote host closed the connection) |
| 23:04:13 | → | chexum joins (~quassel@gateway/tor-sasl/chexum) |
| 23:09:03 | → | merijn joins (~merijn@128-137-045-062.dynamic.caiway.nl) |
| 23:14:58 | × | merijn quits (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 252 seconds) |
| 23:20:26 | <exarkun> | today, right now |
| 23:20:41 | <haskellbridge> | <thirdofmay18081814goya> really? cool |
| 23:20:45 | <haskellbridge> | <thirdofmay18081814goya> what library are you using |
| 23:20:56 | <exarkun> | reflex-sdl2 |
| 23:21:10 | <exarkun> | and reflex, of course |
| 23:22:05 | <haskellbridge> | <thirdofmay18081814goya> neat, will try out reflex right now |
| 23:22:13 | → | ubert1 joins (~Thunderbi@p200300ecdf117cbda8ce35cba2c9a19e.dip0.t-ipconnect.de) |
| 23:23:13 | × | ubert quits (~Thunderbi@p200300ecdf117ce99c7826839207afbb.dip0.t-ipconnect.de) (Ping timeout: 252 seconds) |
| 23:23:13 | ubert1 | is now known as ubert |
| 23:25:41 | → | merijn joins (~merijn@128-137-045-062.dynamic.caiway.nl) |
| 23:30:39 | × | merijn quits (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 276 seconds) |
| 23:31:20 | × | son0p quits (~ff@186.121.98.118) (Ping timeout: 265 seconds) |
| 23:32:01 | × | peterbecich quits (~Thunderbi@syn-047-229-123-186.res.spectrum.com) (Ping timeout: 252 seconds) |
| 23:34:27 | × | hiredman quits (~hiredman@frontier1.downey.family) (Quit: Lost terminal) |
| 23:38:12 | → | son0p joins (~ff@186.121.98.118) |
| 23:39:51 | × | takuan quits (~takuan@178-116-218-225.access.telenet.be) (Remote host closed the connection) |
| 23:41:03 | → | merijn joins (~merijn@128-137-045-062.dynamic.caiway.nl) |
| 23:42:30 | × | tremon quits (~tremon@83.80.159.219) (Quit: getting boxed in) |
| 23:46:11 | × | merijn quits (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 252 seconds) |
| 23:49:00 | → | E2Combinator joins (~E2Combina@190.180.45.137) |
| 23:55:17 | → | merijn joins (~merijn@128-137-045-062.dynamic.caiway.nl) |
| 23:58:09 | → | housemate joins (~housemate@ppp203-122-213-191.static.internode.on.net) |
| 23:58:09 | × | MyNetAz quits (~MyNetAz@user/MyNetAz) (Remote host closed the connection) |
| 23:58:57 | × | gorignak quits (~gorignak@user/gorignak) (Ping timeout: 252 seconds) |
All times are in UTC on 2024-12-21.