Home freenode/#haskell: Logs Calendar

Logs: freenode/#haskell

←Prev  Next→ 502,152 events total
2020-11-25 19:43:36 howdoi joins (uid224@gateway/web/irccloud.com/x-koaluaessvhmdatb)
2020-11-25 19:43:54 × christo quits (~chris@81.96.113.213) (Remote host closed the connection)
2020-11-25 19:43:54 <dminuoso> This little fact suggests that mappending traversals together can be wonky
2020-11-25 19:44:41 <dminuoso> or wait.. failing is not the right one
2020-11-25 19:44:48 <dminuoso> summing :: (Is k A_Fold, Is l A_Fold) => Optic' k is s a -> Optic' l js s a -> Fold s a
2020-11-25 19:44:50 <dminuoso> That's the one
2020-11-25 19:45:21 × LKoen quits (~LKoen@169.244.88.92.rev.sfr.net) (Read error: Connection reset by peer)
2020-11-25 19:46:02 LKoen joins (~LKoen@169.244.88.92.rev.sfr.net)
2020-11-25 19:46:34 <dminuoso> solonarv: At the very least for the documentation of `failing` on lens its suggested that its only lawful on disjoint traversals, Im guessing the same holds true for (<>)
2020-11-25 19:47:12 <ezzieyguywuf> hrm, another megaparsec question: is there a more concise way of doing `a <- digitChar; char ':'; b <- digitChar; pure (pack [a, ':', b'])`?
2020-11-25 19:48:28 <dminuoso> pack <$> traverse [digitChar, char ':', digitChar]
2020-11-25 19:48:30 <merijn> ezzieyguywuf: "a <- digitChar <* char ':'; b <- digitChar" is one way
2020-11-25 19:48:32 <dminuoso> err
2020-11-25 19:48:37 <dminuoso> pack <$> sequence [digitChar, char ':', digitChar]
2020-11-25 19:48:46 <merijn> ah, that's better
2020-11-25 19:49:06 christo joins (~chris@81.96.113.213)
2020-11-25 19:49:10 <ezzieyguywuf> ooooh, nice use of sequence there
2020-11-25 19:49:19 × skiold quits (~skiold@ns378912.ip-5-196-69.eu) (Quit: WeeChat 2.3)
2020-11-25 19:49:38 × raichoo quits (~raichoo@dslb-178-001-144-016.178.001.pools.vodafone-ip.de) (Quit: Lost terminal)
2020-11-25 19:49:52 × avdb quits (~avdb@ip-81-11-215-86.dsl.scarlet.be) (Quit: avdb)
2020-11-25 19:50:11 avdb joins (~avdb@ip-81-11-215-86.dsl.scarlet.be)
2020-11-25 19:50:20 mputz joins (~Thunderbi@dslb-084-058-211-084.084.058.pools.vodafone-ip.de)
2020-11-25 19:52:00 <koz_> :t sequence
2020-11-25 19:52:02 <lambdabot> (Traversable t, Monad m) => t (m a) -> m (t a)
2020-11-25 19:52:06 <koz_> Ah, so sequenceA.
2020-11-25 19:52:18 geekosaur joins (82659a09@host154-009.vpn.uakron.edu)
2020-11-25 19:52:40 × conal quits (~conal@64.71.133.70) (Quit: Computer has gone to sleep.)
2020-11-25 19:53:43 × christo quits (~chris@81.96.113.213) (Ping timeout: 256 seconds)
2020-11-25 19:53:54 <frdg> I purchased a vps service but I do not have enough ram on the VPS to compile my program with stack. The problem with making binaries is that my OS is openSUSE but the VPS is centos. What are my options?
2020-11-25 19:54:08 skiold joins (~skiold@ns378912.ip-5-196-69.eu)
2020-11-25 19:54:09 <dminuoso> frdg: Building inside a docker container
2020-11-25 19:54:21 <sm[m]> frdg: temporarily increase the size of your vps
2020-11-25 19:54:23 <merijn> frdg: Download VirtualBox, install centos in VM, build there, copy binary to VPS
2020-11-25 19:54:27 <ezzieyguywuf> hrm, "Couldn't match type 'Char' with [Char]"
2020-11-25 19:54:50 <frdg> ok many options
2020-11-25 19:54:53 <dminuoso> frdg: If you build inside alpine, you can statically link it and then extract the build artifact out of the container
2020-11-25 19:55:05 <dminuoso> that decouples you from any particular system
2020-11-25 19:55:11 <sm[m]> frdg: try to configure stack/cabal/ghc to build in less ram
2020-11-25 19:55:14 <dminuoso> haha
2020-11-25 19:55:17 <dminuoso> that's a good one
2020-11-25 19:55:20 <merijn> sm[m]: Pointless
2020-11-25 19:55:20 <sm[m]> frdg: configure enough swap on your vps, and let it run overnight
2020-11-25 19:55:34 <merijn> sm[m]: GHC just doesn't really work with less than 1-2GB
2020-11-25 19:55:44 <merijn> A super cheap VPS will have 256-512 MB or something
2020-11-25 19:55:45 <sm[m]> you can influence it
2020-11-25 19:56:02 <frdg> ok I think I am going to start with building from a VM.
2020-11-25 19:56:05 <sm[m]> we don't know how much frdg has, they might be close to success. And they asked for options
2020-11-25 19:56:07 <dminuoso> sm[m]: its a fairly lost cause
2020-11-25 19:56:09 <merijn> Yeah, but why bother? No reason to have GHC on the machine just because you plan to run it there
2020-11-25 19:56:16 <dminuoso> you add one wrong line of code, and things blow up
2020-11-25 19:56:20 <dminuoso> just because megaparsec
2020-11-25 19:56:38 <sm[m]> you're assuming a lot. Sometimes the nearby fix is the cheapest and best
2020-11-25 19:56:47 <dminuoso> sm[m]: No Im talking from experience
2020-11-25 19:56:47 <sm[m]> I've said my piece
2020-11-25 19:56:54 christo joins (~chris@81.96.113.213)
2020-11-25 19:57:10 <dminuoso> I have a 70 LoC parser that takes about 30 seconds for a single module and memory goes to crazy
2020-11-25 19:57:23 <dminuoso> for no reason other than megaparsec having inline on almost everything
2020-11-25 19:57:39 <dminuoso> best part of it is
2020-11-25 19:57:51 <merijn> It doesn't help performance? :p
2020-11-25 19:57:52 <dminuoso> I have this `asum [ ... ]` and if I slightly modify that list, it gets exponentially worse
2020-11-25 19:57:56 <int-e> dminuoso: But... how big is that single module?
2020-11-25 19:58:00 <dminuoso> int-e: 70 LoC.
2020-11-25 19:58:07 × alp quits (~alp@2a01:e0a:58b:4920:1429:542f:b729:d210) (Ping timeout: 272 seconds)
2020-11-25 19:58:14 <int-e> ...
2020-11-25 19:58:26 <dminuoso> oh
2020-11-25 19:58:28 <int-e> dminuoso: You mean the compiler takes 30 seconds to compile the module?
2020-11-25 19:58:31 <dminuoso> Yes
2020-11-25 19:58:49 <int-e> Fun.
2020-11-25 19:59:14 × LKoen quits (~LKoen@169.244.88.92.rev.sfr.net) (Read error: Connection reset by peer)
2020-11-25 19:59:15 <dminuoso> It's fairly simple, nothing fancy. Just rudimentary megaparsec usage
2020-11-25 19:59:25 kelsey joins (~keteskyl@2600:6c64:7b7f:fa42:e18f:e78b:7854:f771)
2020-11-25 19:59:28 <dminuoso> I debugged ghc a bit, filed a bug report. But it's just their overuse of inline
2020-11-25 19:59:46 <merijn> dminuoso: But INLINE makes things fast!
2020-11-25 19:59:51 <int-e> Right, overuse of inlining would've been my first guess.
2020-11-25 19:59:55 conal joins (~conal@64.71.133.70)
2020-11-25 19:59:58 <int-e> Then, exploding types.
2020-11-25 20:00:14 <merijn> I love when people make annotations for "performance" without benchmarks
2020-11-25 20:00:30 hackage migrant-core 0.1.0.0 - Semi-automatic database schema migrations https://hackage.haskell.org/package/migrant-core-0.1.0.0 (TobiasDammers)
2020-11-25 20:00:58 × skiold quits (~skiold@ns378912.ip-5-196-69.eu) (Quit: WeeChat 2.3)
2020-11-25 20:01:07 <int-e> compilation is a one time cost, right?
2020-11-25 20:01:10 int-e runs.
2020-11-25 20:01:14 <dminuoso> Result size of Simplifier iteration=1 = {terms: 4,972,599,types: 7,677,397,coercions: 516,358,joins: 146,810/146,811}
2020-11-25 20:01:22 <maerwald> int-e: hahaha
2020-11-25 20:01:23 <dminuoso> That's straight out of a minimalistic testcase
2020-11-25 20:01:24 <merijn> int-e: In my case I had someone mark all of my foreign imports as unsafe
2020-11-25 20:01:30 hackage migrant-sqlite-simple 0.1.0.0, migrant-postgresql-simple 0.1.0.0, migrant-hdbc 0.1.0.0 (TobiasDammers)
2020-11-25 20:01:41 <merijn> int-e: Because "unsafe foreign imports are faster, so you should use those by default"
2020-11-25 20:01:43 <monochrom> https://xkcd.com/303/ applies again. Today is "compiling" day.
2020-11-25 20:01:57 <koz_> dminuoso: Wat.
2020-11-25 20:01:59 LKoen joins (~LKoen@169.244.88.92.rev.sfr.net)
2020-11-25 20:02:00 <int-e> merijn: I think I was there for a previous discussion of that incident
2020-11-25 20:02:11 <dminuoso> koz_: https://gitlab.haskell.org/ghc/ghc/-/issues/17370
2020-11-25 20:02:13 <dminuoso> :>
2020-11-25 20:02:14 <merijn> int-e: On foreign calls that were all outside of the critical path and were mostly syscalls >.>
2020-11-25 20:02:25 skiold joins (~skiold@ns378912.ip-5-196-69.eu)
2020-11-25 20:02:29 × fendor_ quits (~fendor@178.165.131.166.wireless.dyn.drei.com) (Remote host closed the connection)
2020-11-25 20:02:31 <merijn> int-e: Could be, I get sad every time I'm reminded :p
2020-11-25 20:02:40 × skiold quits (~skiold@ns378912.ip-5-196-69.eu) (Client Quit)
2020-11-25 20:02:46 <int-e> fortunately, system calls never block
2020-11-25 20:03:09 <dminuoso> until they do

All times are in UTC.