2021/12/07

2021-12-07 00:01:39 +0100 <senoraraton> So like this -> https://termbin.com/5c4w I still get an error 'parse error on input 'h''
2021-12-07 00:02:24 +0100 <monochrom> print (take h ( gridMaker 1 w))
2021-12-07 00:04:00 +0100 <senoraraton> Ah ha, and now it all makes much more sense.
2021-12-07 00:04:13 +0100learner-monad(~ehanneken@user/learner-monad) (Ping timeout: 240 seconds)
2021-12-07 00:04:44 +0100michalz(~michalz@185.246.204.40) (Remote host closed the connection)
2021-12-07 00:07:03 +0100emf(~emf@2620:10d:c090:400::5:6c88) (Read error: Connection reset by peer)
2021-12-07 00:08:07 +0100merijn(~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 256 seconds)
2021-12-07 00:11:56 +0100 <oats> finally got around to doing AoC day 4 https://github.com/oatberry/aoc2021-haskell/blob/main/src/Day4.hs
2021-12-07 00:12:01 +0100 <oats> lenses are fun
2021-12-07 00:13:20 +0100emf(~emf@2620:10d:c091:480::1:c2f8)
2021-12-07 00:14:35 +0100abrantesasf(~abrantesa@187.36.170.211)
2021-12-07 00:16:56 +0100azimut_(~azimut@gateway/tor-sasl/azimut) (Remote host closed the connection)
2021-12-07 00:21:21 +0100 <dsal> oats: numP == Text.Megaparsec.Char.Lexer.decimal
2021-12-07 00:21:53 +0100 <oats> oh neat, I didn't know about that module
2021-12-07 00:22:21 +0100 <oats> I really want to get more familiar with lens
2021-12-07 00:22:59 +0100 <oats> kinda scary though, so much terminology and scary-looking types
2021-12-07 00:23:06 +0100 <dsal> Yeah, I spent a while getting familiar with parsers on these things. I don't do as much with lens.
2021-12-07 00:23:45 +0100justsomeguy(~justsomeg@user/justsomeguy) (Quit: WeeChat 3.3)
2021-12-07 00:24:31 +0100 <Axman6> senoraraton: you can't use `'s like that, just use brackets: print (take h ( gridMaker 1 w))
2021-12-07 00:25:08 +0100__monty__(~toonn@user/toonn) (Quit: leaving)
2021-12-07 00:25:39 +0100 <dsal> oats: I don't see anything particularly confusing in the lens stuff, though. I use .~ instead of set. heh
2021-12-07 00:25:48 +0100 <Axman6> senoraraton: also, defining the type signature for main, then randomly sticking in the definition of an unrelated function, and then defining the implementation of maine is pretty odd
2021-12-07 00:26:10 +0100 <dsal> Oh actually, I used lens in day4...
2021-12-07 00:26:17 +0100 <oats> dsal, I don't love using too much infix lens stuff lol
2021-12-07 00:26:42 +0100 <dsal> oats: I did this for detecting wins: https://www.irccloud.com/pastebin/qYCqiEaV/winners.hs
2021-12-07 00:26:43 +0100max22-(~maxime@2a01cb08833598003eb627eec416786c.ipv6.abo.wanadoo.fr) (Quit: Leaving)
2021-12-07 00:27:21 +0100kennyd(~bc8165b6@cerf.good1.com)
2021-12-07 00:27:24 +0100 <dsal> colFill and rowFill are counts of numbers at each row and column. When one hits zero, we have a winner.
2021-12-07 00:27:59 +0100 <Axman6> senoraraton: also, you understand that gridmaker is going to make an infinite list right?
2021-12-07 00:28:04 +0100 <oats> hmm, interesting
2021-12-07 00:28:13 +0100 <Axman6> > let gridMaker n k = [ n .. n+k-1 ] : gridMaker (n+k) k in gridMaker 2 3
2021-12-07 00:28:13 +0100 <dsal> -~ is nice there. :)
2021-12-07 00:28:15 +0100 <lambdabot> [[2,3,4],[5,6,7],[8,9,10],[11,12,13],[14,15,16],[17,18,19],[20,21,22],[23,24...
2021-12-07 00:28:17 +0100 <oats> dsal, is your whole soln up anywhere?
2021-12-07 00:28:33 +0100 <dsal> Not at the moment. Just have my repo in keybase right now. I'll paste it.
2021-12-07 00:28:37 +0100 <Axman6> oh you use take as well, all good
2021-12-07 00:29:02 +0100 <dsal> oats: This is my whole day 4. https://www.irccloud.com/pastebin/wNWecKmJ/day4.hs
2021-12-07 00:29:46 +0100xkuru(~xkuru@user/xkuru) (Read error: Connection reset by peer)
2021-12-07 00:29:52 +0100 <oats> dsal, I like the way you represent boards, probably more performant than mine
2021-12-07 00:29:55 +0100 <dsal> The parser is a bit lame in that it doesn't detect the board size, I just tell it.
2021-12-07 00:30:19 +0100raehik(~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net) (Ping timeout: 265 seconds)
2021-12-07 00:30:30 +0100 <dsal> The numbers in the board are the sequence of numbers being called. So you an solve each one independently, and then use the map to figure out what the actual called numbers are.
2021-12-07 00:32:07 +0100bontaq(~user@ool-45779fe5.dyn.optonline.net) (ERC (IRC client for Emacs 27.1))
2021-12-07 00:32:12 +0100 <dsal> They're also in order of call. I did some heavy lifting in the parser.
2021-12-07 00:32:35 +0100bontaq(~user@ool-45779fe5.dyn.optonline.net)
2021-12-07 00:33:29 +0100 <dsal> I run benchmarks with one of the larger inputs, but you can see where I put the effort: https://s3.amazonaws.com/public.west.spy.net/tmp/bench-day4.html
2021-12-07 00:33:42 +0100Gurkenglas(~Gurkengla@dslb-002-203-144-204.002.203.pools.vodafone-ip.de) (Ping timeout: 265 seconds)
2021-12-07 00:36:35 +0100 <oats> I don't love my `findBoard` function, wish there were a nicer way of doing that
2021-12-07 00:40:43 +0100 <dsal> Yeah, I don't quite understand what you're going for there. I just did all of them. Then you could use a monoid or minimum/maximum or similar.
2021-12-07 00:42:42 +0100 <dsal> @hoogle Last
2021-12-07 00:42:43 +0100 <lambdabot> Data.Monoid newtype Last a
2021-12-07 00:42:43 +0100 <lambdabot> Data.Monoid Last :: Maybe a -> Last a
2021-12-07 00:42:43 +0100 <lambdabot> Data.Semigroup newtype Last a
2021-12-07 00:44:08 +0100azimut(~azimut@gateway/tor-sasl/azimut)
2021-12-07 00:44:59 +0100lbseale(~ep1ctetus@user/ep1ctetus) (Quit: Leaving)
2021-12-07 00:45:23 +0100 <EvanR> cool the fish thing if taken as a matrix turns into pascals triangles
2021-12-07 00:45:34 +0100 <EvanR> day 6
2021-12-07 00:46:16 +0100 <EvanR> also if coded with loop unrolling i got to day trillion lol
2021-12-07 00:47:09 +0100 <dsal> Somebody did 10^18. That's apparently a large number.
2021-12-07 00:48:12 +0100 <dsal> oats: try either First/Min or Last/Max
2021-12-07 00:49:15 +0100 <oats> dsal: the way I did it, playBingo can calculate out the whole game, and then I wanted a generic way that I could use for part 1 and 2 that will find a board in a round with some criteria
2021-12-07 00:49:29 +0100 <oats> That's what findBoard is doing
2021-12-07 00:50:34 +0100 <dsal> Yeah, I see. It's basically Last.
2021-12-07 00:50:50 +0100 <oats> Hmm, I'll take a look at those in a second, interesting
2021-12-07 00:51:01 +0100 <oats> Hadn't thought Monoid might be useful
2021-12-07 00:51:15 +0100dhouthoo(~dhouthoo@178-117-36-167.access.telenet.be) (Quit: WeeChat 3.3)
2021-12-07 00:51:17 +0100abraham(~abraham@143.244.185.86) (The Lounge - https://thelounge.chat)
2021-12-07 00:51:37 +0100 <dsal> my part 1 is minimum and my part 2 is maximum, but I could also use foldMap or something to implement winners and have it monoidify the thing for me.
2021-12-07 00:52:57 +0100 <dsal> Something like `winners :: Monoid m => Input -> ((Int, Int) -> m) -> m`
2021-12-07 00:55:19 +0100 <dsal> Actually, switch the first two arguments. Now my part1, 2, and big run are all basically the same.
2021-12-07 00:58:09 +0100pfurla(~pfurla@2804:14d:5c81:4104:91cd:1543:8918:bc14)
2021-12-07 00:59:16 +0100 <dsal> oats: This way, `winners` doesn't make/return a list. Just the thing I'm interested in. https://www.irccloud.com/pastebin/qIkpC0Gr/winning.hs
2021-12-07 00:59:53 +0100darchitect(~darchitec@2a00:23c6:3584:df00:7dec:bf13:8fa:748c) (Ping timeout: 252 seconds)
2021-12-07 00:59:54 +0100 <dsal> In the 'biggun' case, that's both the min *and* the max because I just have it do parts 1 and 2 in one pass.
2021-12-07 01:01:59 +0100 <dsal> The return includes the number of turns and the score. I could get rid of that, but the both case is actually a bit different.
2021-12-07 01:03:09 +0100 <dsal> though I'm using parMap, so I do make a list anyway. but parMap sped things up noticeably for me.
2021-12-07 01:06:12 +0100 <dsal> That's not actually faster, but it's a neat way to think about it, because now it can return the first, the smallest, the last, the largest, or a complete list. Or whatever other monoid you might come up with. The highest score. The first one that has a score lower than the previous…
2021-12-07 01:06:53 +0100wroathe(~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
2021-12-07 01:06:53 +0100wroathe(~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Changing host)
2021-12-07 01:06:53 +0100wroathe(~wroathe@user/wroathe)
2021-12-07 01:13:11 +0100 <senoraraton> So now how do I install/include libraries?
2021-12-07 01:13:34 +0100 <senoraraton> I ran ghc-pkg check and ended up with a LOT of missing files.
2021-12-07 01:14:23 +0100fizbin(~fizbin@c-73-33-197-160.hsd1.nj.comcast.net)
2021-12-07 01:16:00 +0100 <sm> senoraraton: sounds like you deleted some files from there, or ran out of disk space ?
2021-12-07 01:16:04 +0100 <senoraraton> If I try cabal install -p ncurses it tries to build alex and happy, and fails
2021-12-07 01:16:18 +0100 <senoraraton> I never deleted anything. I have lots of file space.
2021-12-07 01:16:37 +0100 <sm> why do you say ended up with a lot of missing files ?
2021-12-07 01:17:54 +0100 <senoraraton> It prints out a list of 100+ that are all similiar to:
2021-12-07 01:18:10 +0100 <senoraraton> Warning: haddock-html: /usr/share/doc/haskell-annotated-wl-pprint/html doesn't exist or isn't a directory
2021-12-07 01:18:42 +0100 <sm> ah, I think those can be (must be) ignored
2021-12-07 01:18:45 +0100 <sm> and how does building alex and happy fail ? I found I had to install happy from $HOME, not inside a project
2021-12-07 01:18:57 +0100fizbin(~fizbin@c-73-33-197-160.hsd1.nj.comcast.net) (Ping timeout: 252 seconds)
2021-12-07 01:19:35 +0100 <senoraraton> !psate
2021-12-07 01:19:37 +0100 <senoraraton> !paste
2021-12-07 01:20:53 +0100 <dsal> senoraraton: Generally, you want to make a project with cabal or stack and don't "install" libraries.
2021-12-07 01:21:04 +0100 <senoraraton> Sure, cabal install -p ncurses fails.
2021-12-07 01:21:19 +0100 <senoraraton> I'm trying to save the output for context.
2021-12-07 01:21:45 +0100 <dsal> I don't use cabal, so I don't know what 'cabal install' does. It may not be what you want.
2021-12-07 01:21:59 +0100 <senoraraton> It is supposed to fetch dependencies, and install the package.
2021-12-07 01:22:04 +0100bontaq(~user@ool-45779fe5.dyn.optonline.net) (Remote host closed the connection)
2021-12-07 01:22:05 +0100 <senoraraton> The dependencie build fails.
2021-12-07 01:22:08 +0100 <Axman6> @where paste
2021-12-07 01:22:08 +0100 <lambdabot> Help us help you: please paste full code, input and/or output at e.g. https://paste.tomsmeding.com
2021-12-07 01:23:50 +0100 <senoraraton> https://controlc.com/1df340e3
2021-12-07 01:24:16 +0100 <senoraraton> This is the error. Sorry for the atrocious pastebin, I don't know of a better one.
2021-12-07 01:25:37 +0100 <dsal> "install the packages" sounds like a bad idea, though. I don't ever want to do that when I'm building a haskell project.
2021-12-07 01:26:08 +0100 <senoraraton> https://paste.tomsmeding.com/tbsyq9R9
2021-12-07 01:26:13 +0100 <senoraraton> There is a better link to the paste.
2021-12-07 01:26:42 +0100 <senoraraton> I need to be able to use the libraries, which implies the libraries are "installed"
2021-12-07 01:27:04 +0100 <dsal> I use libraries, but I do not install libraries.
2021-12-07 01:27:14 +0100 <senoraraton> So then how do you import the said libraries?
2021-12-07 01:27:23 +0100 <geekosaur> with modern stack or cabal you do not install libraries, you declare dependencies on them and stack or cabal will install them as needed without lewtting different versions interfere with each other
2021-12-07 01:27:55 +0100burnsidesLlama(~burnsides@dhcp168-017.wadham.ox.ac.uk) (Remote host closed the connection)
2021-12-07 01:28:12 +0100 <senoraraton> Sure. How.
2021-12-07 01:28:26 +0100 <geekosaur> you use stack/cabal projects to do this. a project is defined by a stack.yaml for stack or a cabal.project for cabal. dependencies are listed in a file foo.cabal for a project named foo
2021-12-07 01:28:28 +0100burnsidesLlama(~burnsides@client-8-78.eduroam.oxuni.org.uk)
2021-12-07 01:28:45 +0100 <kennyd> with stack each project has its own sandbox, with local copies of libraries
2021-12-07 01:28:55 +0100 <dsal> stack usually gives you an hpack package.yaml with a dependencies section.
2021-12-07 01:29:02 +0100 <dsal> cabal also has a dependencies section, but I don't use it directly.
2021-12-07 01:29:03 +0100 <geekosaur> if you want to then import them into a ghc session, instead of running ghci directly you use stack ghci or cabal repl
2021-12-07 01:29:19 +0100 <kennyd> (well not copies, IIRC libraries are shared between projects. but multiple versions of same libraries can coexist)
2021-12-07 01:29:21 +0100 <senoraraton> I want to compile the binary with the dependencies.
2021-12-07 01:29:44 +0100 <dsal> Right, so you list them as dependencies in your project.
2021-12-07 01:29:48 +0100 <sm> senoraraton: `There are files missing in the ‘base-4.15.0.0’ package` is never a good sign, it means something went wrong in the past and you should probably just reinstall ghc
2021-12-07 01:29:52 +0100 <dsal> How did you start your project?
2021-12-07 01:30:01 +0100 <dsal> And how did you get ghc/cabal?
2021-12-07 01:30:11 +0100 <geekosaur> also what platform are you on?
2021-12-07 01:30:12 +0100Techcable(~Techcable@168.235.93.147)
2021-12-07 01:30:39 +0100 <geekosaur> (you will have lots of missing files on arch linux because of the way they butcher their haskell packaging)
2021-12-07 01:30:45 +0100 <senoraraton> I'm so confused. There is all this noise about semantics and what is and isn't "installation".
2021-12-07 01:30:48 +0100 <senoraraton> I'm on linux
2021-12-07 01:31:00 +0100 <geekosaur> we need more than "linux"
2021-12-07 01:31:06 +0100pfurla(~pfurla@2804:14d:5c81:4104:91cd:1543:8918:bc14) (Quit: gone to sleep. ZZZzzz…)
2021-12-07 01:31:06 +0100 <senoraraton> GNU linux
2021-12-07 01:31:09 +0100 <dsal> You seem to be trying to learn haskell by throwing stuff into a shell and seeing what happens.
2021-12-07 01:31:12 +0100 <kennyd> :)
2021-12-07 01:31:12 +0100 <geekosaur> sigh
2021-12-07 01:31:36 +0100 <sm> senoraraton: yes it is confusing, sorry about that. Stick to the paste and the missing files issue, and we'll hopefully focus on that
2021-12-07 01:31:38 +0100 <geekosaur> arch? debian? ubuntu? gentoo? void? …
2021-12-07 01:31:41 +0100 <dsal> `nix-shell -p stack` works pretty well on my system for getting something set up.
2021-12-07 01:32:14 +0100 <sm> ha ha it was time to drag nix in ... :)
2021-12-07 01:32:53 +0100burnsidesLlama(~burnsides@client-8-78.eduroam.oxuni.org.uk) (Ping timeout: 252 seconds)
2021-12-07 01:33:01 +0100 <senoraraton> I'm running archlinux.
2021-12-07 01:33:21 +0100Midjak(~Midjak@may53-1-78-226-116-92.fbx.proxad.net) (Quit: This computer has gone to sleep)
2021-12-07 01:33:23 +0100 <dsal> It sounds like you used arch packages to get ghc and cabal, then. Which is known to be unnecessarily difficult.
2021-12-07 01:33:26 +0100 <senoraraton> I'm using cabal as my build tool, and I'm trying to import NCurses.
2021-12-07 01:33:47 +0100 <senoraraton> Of course I did, thats how you install packages on Arch.... >..
2021-12-07 01:34:11 +0100 <dsal> Yes, we've encountered many suffering arch users in here, so we're familiar with the issues.
2021-12-07 01:34:23 +0100 <senoraraton> Go on...
2021-12-07 01:34:36 +0100 <dsal> geekosaur described some of the issues above.
2021-12-07 01:34:37 +0100 <sclv> arch’s packages are broken
2021-12-07 01:34:43 +0100 <sm> do we have any arch ghc package experts in here ? if not you might be better off asking #arch or the arch haskell wiki page which I've heard is good
2021-12-07 01:34:48 +0100 <dsal> I don't use arch, so I don't have any of those issues and can't help get past them.
2021-12-07 01:34:53 +0100 <sclv> they don’t give the full set of built libs
2021-12-07 01:35:09 +0100 <sm> OR, you can skip arch packages and install ghc another wa
2021-12-07 01:35:12 +0100 <sclv> because they compile dynamic only
2021-12-07 01:35:14 +0100 <sm> y
2021-12-07 01:35:30 +0100 <senoraraton> Okay....
2021-12-07 01:36:01 +0100 <senoraraton> Do I need to uninstall and build from source haskell? ghc? cabal? ALL of it?
2021-12-07 01:36:19 +0100 <monochrom> Uninstall arch's haskell packages. Switch to https://www.haskell.org/ghcup/
2021-12-07 01:36:20 +0100 <yushyin> if you want to write haskell on arch linux use ghcup
2021-12-07 01:36:22 +0100 <dsal> ghcup might work for you.
2021-12-07 01:36:38 +0100 <sm> I would install the stack binary and let it install the rest. Others would recommend ghcup. Two good alternatives to the arch packages.
2021-12-07 01:36:40 +0100 <sclv> ghcup gives you correct binary distribution
2021-12-07 01:36:58 +0100 <senoraraton> Does ghcup include cabal?
2021-12-07 01:37:02 +0100 <sclv> arch just deletes half the official distro
2021-12-07 01:37:16 +0100 <dsal> yeah, ghcup seems to give me stack and cabal
2021-12-07 01:37:16 +0100 <sclv> ghcup manages installing ghc and cabal both
2021-12-07 01:37:26 +0100 <monochrom> Don't succumb to the false dichotomy "either from my distro or build from source". There is always a 3rd choice.
2021-12-07 01:37:30 +0100 <senoraraton> So I need to remove haskell, and GHC, and cabal before installing.
2021-12-07 01:37:33 +0100dsalhas never actually *used* ghcup
2021-12-07 01:37:46 +0100 <dsal> Removing the broken installation would probably make things easier.
2021-12-07 01:38:00 +0100 <geekosaur> ghcup includes both stack anbd cabal
2021-12-07 01:38:25 +0100 <geekosaur> and hls which is an editor plugin for IDE-loike editing of haskell source
2021-12-07 01:42:42 +0100tfeb(~tfb@88.98.95.237)
2021-12-07 01:43:17 +0100senoraraton(~senorarat@192-195-83-130.static.monkeybrains.net) (Read error: No route to host)
2021-12-07 01:43:20 +0100 <yin> what are the performance differences between working with Word8 and Word ?
2021-12-07 01:43:32 +0100 <monochrom> It depends.
2021-12-07 01:43:35 +0100 <monochrom> Show actual code.
2021-12-07 01:43:48 +0100senoraraton(~senorarat@192-195-83-130.static.monkeybrains.net)
2021-12-07 01:44:37 +0100deadmarshal(~deadmarsh@95.38.114.2) (Ping timeout: 240 seconds)
2021-12-07 01:45:28 +0100tfeb(~tfb@88.98.95.237) (Client Quit)
2021-12-07 01:46:29 +0100 <hpc> yin: what are the performance differences between working with uint8_t and uint64_t? :P
2021-12-07 01:47:24 +0100 <monochrom> In fact I believe that even with uint8_t vs uint64_t in C, the correct answer is still "It depends. Show actual code."
2021-12-07 01:47:40 +0100ChaiTRex(~ChaiTRex@user/chaitrex) (Quit: ChaiTRex)
2021-12-07 01:48:17 +0100ChaiTRex(~ChaiTRex@user/chaitrex)
2021-12-07 01:48:23 +0100 <hpc> that's what i was getting at
2021-12-07 01:48:58 +0100 <unclechu> Hey, can I evaluate a type family in a GHC REPL?
2021-12-07 01:49:30 +0100 <monochrom> IIRC :kind! helps but maybe not fully.
2021-12-07 01:49:37 +0100 <monochrom> or s/fully/always/
2021-12-07 01:50:18 +0100 <unclechu> monochrom thanks, :k! helps in my case
2021-12-07 01:53:36 +0100 <senoraraton> ghcup is throwin errors that there is no space on my drive... >.>
2021-12-07 01:54:10 +0100 <monochrom> It installs stuff in your home directory. It's some 1-2GB.
2021-12-07 01:55:17 +0100 <monochrom> 2GB.
2021-12-07 01:55:19 +0100xsarnik1(xsarnik@lounge.fi.muni.cz)
2021-12-07 01:55:32 +0100slice(~slice@user/slice)
2021-12-07 01:55:50 +0100 <monochrom> But then first it downloads the tarball. That's an addition 0.2-0.5GB.
2021-12-07 01:56:01 +0100xstill-1(xstill@fimu/xstill)
2021-12-07 01:56:11 +0100 <senoraraton> It also is using my /tmp drive which is mounted as 1.5G, and it wants 5G...
2021-12-07 01:56:22 +0100 <monochrom> Yeah.
2021-12-07 01:56:31 +0100 <senoraraton> My data drive has 50G free.
2021-12-07 01:56:59 +0100xsarnik(xsarnik@lounge.fi.muni.cz) (Read error: Connection reset by peer)
2021-12-07 01:56:59 +0100xsarnik1xsarnik
2021-12-07 01:57:12 +0100 <monochrom> Set the TMPDIR environment variable to help.
2021-12-07 01:57:32 +0100xstill-(xstill@fimu/xstill) (Ping timeout: 268 seconds)
2021-12-07 01:57:32 +0100xstill-1xstill-
2021-12-07 02:01:26 +0100 <senoraraton> It looks like its building.....
2021-12-07 02:01:58 +0100nvmd(~nvmd@user/nvmd)
2021-12-07 02:04:32 +0100 <yushyin> 'Consider freeing up disk space or setting TMPDIR env variable. ...waiting for 10 seconds before continuing anyway, you can still abort...' is part of the warning that ghcup throws
2021-12-07 02:05:01 +0100merijn(~merijn@83-160-49-249.ip.xs4all.nl)
2021-12-07 02:05:54 +0100senoraraton(~senorarat@192-195-83-130.static.monkeybrains.net) (Quit: Lost terminal)
2021-12-07 02:06:35 +0100 <monochrom> People no longer read error messages.
2021-12-07 02:06:54 +0100 <monochrom> They stopped reading docs a decade ago. This is the next step of the evolution.
2021-12-07 02:07:44 +0100senoraraton(~senorarat@192-195-83-130.static.monkeybrains.net)
2021-12-07 02:08:00 +0100 <senoraraton> Okay.. so ghcup and cabal are installed, but its not recokginizing gch(i)
2021-12-07 02:08:17 +0100 <dsal> Guessing you didn't put them in your path.
2021-12-07 02:08:47 +0100 <yushyin> monochrom: you can repeat yourself here :D
2021-12-07 02:10:04 +0100 <senoraraton> I did add ghcup and cabal. ghci is in the ghcup directory I believe. I used the TUI of the binary, and then I installed ghcup and it gave me a different interface, so I'm uninstalling/reinstalling GHC through there.
2021-12-07 02:10:54 +0100pfurla(~pfurla@2804:14d:5c81:4104:91cd:1543:8918:bc14)
2021-12-07 02:11:24 +0100 <dsal> Yeah, they're all in the ghcup bin directory.
2021-12-07 02:14:31 +0100Morrow(~quassel@bzq-110-168-31-106.red.bezeqint.net) (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.)
2021-12-07 02:17:05 +0100renzhi(~xp@2607:fa49:6500:b100::5cef)
2021-12-07 02:17:20 +0100 <senoraraton> So the bin dir is in my path, and ghcup runs, but ghc(i) doesn't
2021-12-07 02:18:07 +0100 <senoraraton> O, they do run. It just isn't symlinked to ghc
2021-12-07 02:18:37 +0100 <yushyin> try `where ghci' in your shell
2021-12-07 02:18:48 +0100 <senoraraton> Not found.
2021-12-07 02:19:06 +0100 <senoraraton> In the bin dir, I can run ghci-8.10
2021-12-07 02:19:23 +0100 <senoraraton> Its just not symlinked to ghc, as I said. I'm just gonna create the sym link.
2021-12-07 02:19:36 +0100 <yushyin> echo $PATH
2021-12-07 02:20:23 +0100 <senoraraton> $HOME/.ghcup/bin is in my path. ghcup works, so it must be in my path....
2021-12-07 02:20:43 +0100myShoggoth(~myShoggot@97-120-85-195.ptld.qwest.net) (Ping timeout: 256 seconds)
2021-12-07 02:20:59 +0100 <yushyin> you should set a ghc default with ghcup tui
2021-12-07 02:21:16 +0100 <senoraraton> I do not.
2021-12-07 02:21:47 +0100 <yushyin> but you should, if you want that symlink
2021-12-07 02:21:52 +0100 <senoraraton> O... You have to set it.
2021-12-07 02:22:20 +0100 <senoraraton> I had ghc installed, but there is a "set" flag.
2021-12-07 02:22:35 +0100 <senoraraton> Now that makes sense, because I can change the version if needed.
2021-12-07 02:23:03 +0100 <senoraraton> Now time to solve the original problem I had. Importing libraries
2021-12-07 02:23:17 +0100 <dsal> Step one: Start a project.
2021-12-07 02:23:25 +0100jkaye(~jkaye@2601:281:8300:7530:1572:52e4:1190:1c22) (Ping timeout: 240 seconds)
2021-12-07 02:23:48 +0100 <dsal> I use stack. Some people use cabal. In any case, you list your dependencies in the files and they become available at build time.
2021-12-07 02:23:58 +0100d34df00d(~d34df00d@2600:1700:8c60:3a10::48)
2021-12-07 02:24:06 +0100 <d34df00d> Hi!
2021-12-07 02:24:18 +0100 <d34df00d> I have an UArray of Word8's. What's the best way to dump its contents into a file?
2021-12-07 02:26:06 +0100 <senoraraton> dsal Sure, that sounds simple. the "list your dependencies" part is the hard part.
2021-12-07 02:26:44 +0100hskpractice(~hskpracti@94-255-217-215.cust.bredband2.com)
2021-12-07 02:28:24 +0100hskpractice(~hskpracti@94-255-217-215.cust.bredband2.com) (Remote host closed the connection)
2021-12-07 02:28:51 +0100 <yushyin> senoraraton: https://cabal.readthedocs.io/en/3.6/getting-started.html#adding-dependencies
2021-12-07 02:29:13 +0100nvmd(~nvmd@user/nvmd) (Ping timeout: 265 seconds)
2021-12-07 02:29:22 +0100lavaman(~lavaman@98.38.249.169) (Remote host closed the connection)
2021-12-07 02:29:55 +0100nvmd(~nvmd@user/nvmd)
2021-12-07 02:30:13 +0100acidjnk_new(~acidjnk@p200300d0c7271e6304137ec8947839cf.dip0.t-ipconnect.de) (Ping timeout: 240 seconds)
2021-12-07 02:30:29 +0100 <senoraraton> I'm reading it now, do I need to declare my dependencies dependencies?
2021-12-07 02:30:49 +0100 <yushyin> no you don't
2021-12-07 02:31:05 +0100 <sm> nice doc
2021-12-07 02:31:47 +0100 <senoraraton> So this is my package: https://hackage.haskell.org/package/ncurses
2021-12-07 02:32:07 +0100mmhat(~mmh@55d45587.access.ecotel.net) (Quit: WeeChat 3.3)
2021-12-07 02:32:10 +0100 <geekosaur> is that the package you are working with, or one you need as a dependency for something else?
2021-12-07 02:32:26 +0100 <geekosaur> if the latter, you just list it as a dependency and let stack or cabal worry about it
2021-12-07 02:33:27 +0100 <senoraraton> That is the package I want to import.
2021-12-07 02:33:35 +0100 <sm> and they will fail to install the right c libs, passing the buck back to you but never mind that :)
2021-12-07 02:35:42 +0100 <geekosaur> so it's a dependency and not your actual package. your package is the one that does the importing; anything you import from it is a dependency
2021-12-07 02:35:43 +0100 <senoraraton> Okay so i added ncurses ^>=0.2.16 to my build-dependencies.
2021-12-07 02:36:20 +0100 <oats> dsal, MONOIDS https://github.com/oatberry/aoc2021-haskell/commit/2bf909dbd7507d68a1fa160b94db0783d3aa640a
2021-12-07 02:36:29 +0100 <oats> Last and First are nifty
2021-12-07 02:36:44 +0100pretty_dumm_guy(trottel@gateway/vpn/protonvpn/prettydummguy/x-88029655) (Quit: WeeChat 3.3)
2021-12-07 02:36:52 +0100 <geekosaur> arch doesn't distinguish between build and run dependencies itself,m and ncurses is needed by the base system, so you should have no problems with C dependencies
2021-12-07 02:36:52 +0100 <oats> I feel happy with my solution now :)
2021-12-07 02:37:18 +0100 <senoraraton> It is a dependency, I want to import the library into my code, I first need to "install" or link or whatever semantic statement you wanna make, make the thing avaliable, and I make it avaliable by putting it in the foo.cabal file.
2021-12-07 02:37:29 +0100 <geekosaur> (this would come up on fedora or debian/ubuntu, where build and run dependencies differ)
2021-12-07 02:37:37 +0100 <geekosaur> no, you do not need to install it
2021-12-07 02:37:48 +0100 <senoraraton> I need to make cabal aware of it.
2021-12-07 02:37:48 +0100 <geekosaur> cabal or stack will do it for you when it sees the dependency
2021-12-07 02:38:22 +0100 <geekosaur> really, that's all you need to do is declare the dependency and cabal/stack will do the rest for you
2021-12-07 02:38:40 +0100 <senoraraton> expecting space, "&&", white space, "||", comma or end of input
2021-12-07 02:38:40 +0100 <senoraraton> 35 | base ^>=4.15.0.0 36 | nCurses ^>=0.2.16
2021-12-07 02:38:49 +0100 <senoraraton> Apparently its not that easy.
2021-12-07 02:39:25 +0100merijn(~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 256 seconds)
2021-12-07 02:39:39 +0100 <geekosaur> comma
2021-12-07 02:39:59 +0100 <geekosaur> put a comma at the end of line 35
2021-12-07 02:39:59 +0100jkaye(~jkaye@2601:281:8300:7530:da02:a8ec:4a68:7358)
2021-12-07 02:40:25 +0100lavaman(~lavaman@98.38.249.169)
2021-12-07 02:41:16 +0100 <geekosaur> there is method to this madness, by the way: if you install packages yourself, you can end up in a situation where different of your packages require different versions — but multiple versions will conflict with each other and won't work. cabal and stack were developed to manage this for you so each project sees only the version it wants instead of running into dependency conflicts
2021-12-07 02:41:30 +0100 <senoraraton> https://termbin.com/6xx3
2021-12-07 02:41:55 +0100 <senoraraton> I'm not installing packages myself, never wanted to. Otherwise what is the entire purpose of the build tool....
2021-12-07 02:42:13 +0100 <senoraraton> I'm trying to configure cabal to do it for me, and I have been doing that since I started asking questions.
2021-12-07 02:42:25 +0100 <geekosaur> in C this is done by having a developer package which links always to the latest version, which is effectively the only one available. in perl and python there's no good way to deal with this except to make your own private language installation, so there are tools that do that for you
2021-12-07 02:43:02 +0100 <geekosaur> hm.
2021-12-07 02:44:03 +0100 <geekosaur> base 4.15.0.0 corresponds to ghc 9.0.1. you probably have 8.10.7 installed from the base version number\
2021-12-07 02:44:10 +0100 <senoraraton> Why does cabal require 15, when ghcup recommends 4.14.3
2021-12-07 02:44:18 +0100 <senoraraton> I installed 4.14.3, does that matter?
2021-12-07 02:44:19 +0100 <geekosaur> base cannot be upgraded, it's wired into the compiler
2021-12-07 02:44:43 +0100 <geekosaur> you said ^>=4.15.0.0 on line 35. why?
2021-12-07 02:44:56 +0100 <senoraraton> So then just change the cabal file to match, but that means every program I generate will be wrong for my build environment?
2021-12-07 02:45:27 +0100 <geekosaur> I don't understand that question
2021-12-07 02:45:48 +0100 <geekosaur> did you have some specific reason to specify 4.15.0.0?
2021-12-07 02:45:52 +0100 <senoraraton> That was autogenerated by cabal
2021-12-07 02:46:02 +0100 <senoraraton> when I ran cabal init
2021-12-07 02:46:03 +0100 <geekosaur> if not, just change it to match the version that comes with 8.10.7
2021-12-07 02:46:14 +0100 <geekosaur> huh
2021-12-07 02:46:20 +0100 <geekosaur> that sounds wrong
2021-12-07 02:46:38 +0100 <senoraraton> To start a project you type cabal init. It gives you a little questionairre, and sets up the files.
2021-12-07 02:46:49 +0100 <geekosaur> it implies that you have a ghc 9.0.1 hanging around somewhere and cabal found it and used its versions
2021-12-07 02:46:57 +0100 <senoraraton> Maybe it was because the previous version of cabal generated it, and I rolled back with ghcup
2021-12-07 02:47:02 +0100 <senoraraton> I uninstalled it.
2021-12-07 02:47:08 +0100 <sclv> you may want to pass “init -i” to ask for interactive too
2021-12-07 02:47:10 +0100 <geekosaur> then you'll want to regenerate it, yes
2021-12-07 02:47:33 +0100 <geekosaur> also the reason we don't recommend 9.0.1 is that it's known buggy
2021-12-07 02:47:43 +0100 <geekosaur> 9.2.1 is the fix but it has its own problems :(
2021-12-07 02:47:55 +0100 <geekosaur> so for now 8.10.7 remains recommended
2021-12-07 02:47:56 +0100 <dsal> oats: those constraints are intense.
2021-12-07 02:48:02 +0100 <geekosaur> unless you like to do compiler debugging
2021-12-07 02:48:24 +0100 <oats> dsal, haha indeed, I let hls deduce them for me
2021-12-07 02:48:34 +0100 <sm> poor senoraraton.. so many pitfalls in this landscape
2021-12-07 02:48:56 +0100 <dsal> oats: Ah. You probably just need 'm'
2021-12-07 02:49:34 +0100 <oats> dsal, I thought so too, but the `fmap` in `findBoard` adds the Functor constraint
2021-12-07 02:50:05 +0100 <dsal> I'm trying to follow something here. You're doing a bit more than you need to.
2021-12-07 02:50:18 +0100 <oats> oh?
2021-12-07 02:50:35 +0100 <dsal> e.g., `monoid . fmap` might be `foldMap monoid` but I just got out of the shower, so the peak of my brain power is down the drain.
2021-12-07 02:52:01 +0100 <sm> what are the problems with 9.2.1, geekosaur ?
2021-12-07 02:52:01 +0100 <monochrom> Is that why nerds don't take showers? >:)
2021-12-07 02:52:06 +0100 <dsal> ha
2021-12-07 02:52:22 +0100 <dsal> oats: I'm pretty sure you have too many maps and/or concats, but I'm not entirely sure which are superfluous.
2021-12-07 02:52:48 +0100 <oats> oh, I can reduce `mconcat . map findBoard` to `foldMap findBoard`
2021-12-07 02:53:45 +0100 <dsal> Well, yes, but you actually want to fold it into the monoid you want.
2021-12-07 02:53:57 +0100 <dsal> :t mconcat . map
2021-12-07 02:53:58 +0100 <lambdabot> error:
2021-12-07 02:53:58 +0100 <lambdabot> • Couldn't match type ‘[a] -> [b]’ with ‘[c]’
2021-12-07 02:53:58 +0100 <lambdabot> Expected type: (a -> b) -> [c]
2021-12-07 02:54:02 +0100 <dsal> :t mconcat . map f
2021-12-07 02:54:03 +0100 <lambdabot> (Monoid c, Show a, FromExpr c) => [a] -> c
2021-12-07 02:54:10 +0100 <dsal> :t foldMap f
2021-12-07 02:54:11 +0100 <lambdabot> (Foldable t, Monoid m, Show a, FromExpr m) => t a -> m
2021-12-07 02:54:35 +0100 <dsal> (show is kind of weird there, but that's that expr thing)
2021-12-07 02:55:21 +0100 <dsal> But your monoider function should be `t -> m` for some monoid, then it's something like `foldMap (monoider . findBoard)`
2021-12-07 02:55:45 +0100nvmd(~nvmd@user/nvmd) (Ping timeout: 252 seconds)
2021-12-07 02:57:08 +0100 <dsal> Oh, I see findBoard is already doing that (getting out of the diff view makes code easier to read)
2021-12-07 02:57:26 +0100 <oats> ah yeah, I was confused about what you were trying to "fix" lol
2021-12-07 02:57:44 +0100 <oats> and I was wrong, it's the `fmap boardScore` that adds the Functor constraint
2021-12-07 02:58:53 +0100 <dsal> Is the functor `Maybe`? This might be a case where being more concrete makes things a bit clearer.
2021-12-07 02:59:33 +0100 <oats> `f` is either `Last` or `First`
2021-12-07 02:59:41 +0100 <senoraraton> https://termbin.com/ezoe So it fails, but we are making progress.
2021-12-07 03:00:44 +0100 <oats> oh but maybe if I put the `fmap boardScore` before call `monoid`...
2021-12-07 03:00:57 +0100 <sm> senoraraton: yes, this is a more common error. You may need to install some
2021-12-07 03:00:57 +0100 <sm> ncurses-dev system package
2021-12-07 03:01:23 +0100 <senoraraton> How.
2021-12-07 03:01:30 +0100 <dsal> oats: Yeah, i see. I had a similar problem with wanting to keep the tuple, but eventually extract it. Yours is easier because you probably could just untuple it first.
2021-12-07 03:01:42 +0100 <dsal> I'm using Min and Max, so I need the tuple.
2021-12-07 03:01:54 +0100 <oats> HAH
2021-12-07 03:01:54 +0100 <sm> with your arch package manager. Search the ncurses packages to find the exact name.
2021-12-07 03:01:55 +0100 <oats> got it
2021-12-07 03:03:24 +0100nvmd(~nvmd@user/nvmd)
2021-12-07 03:03:27 +0100InternetCitizen(~fuzzypixe@eth-west-pareq2-46-193-4-100.wb.wifirst.net) (Ping timeout: 252 seconds)
2021-12-07 03:03:50 +0100 <senoraraton> o... there is no dev package.
2021-12-07 03:04:04 +0100 <senoraraton> Its supposed to be bundled within the ncurses package, which is installed.
2021-12-07 03:04:21 +0100 <dsal> oats: If you flip it, you could probably end up with just `Monoid m` as a constraint, returning `m`
2021-12-07 03:04:34 +0100 <yushyin> you need to set use-pkgconfig flag for the ncurses dep
2021-12-07 03:04:59 +0100 <senoraraton> In arch?
2021-12-07 03:05:01 +0100 <yushyin> or force-narrow-library
2021-12-07 03:05:05 +0100 <yushyin> no in the cabal config file
2021-12-07 03:05:13 +0100 <senoraraton> How do I do that?
2021-12-07 03:05:28 +0100machinedgod(~machinedg@135-23-192-217.cpe.pppoe.ca) (Ping timeout: 265 seconds)
2021-12-07 03:05:28 +0100 <geekosaur> sm: the new codegen for Apple M1s has sign extension problems
2021-12-07 03:05:38 +0100 <geekosaur> shouldn't matter on any other platform
2021-12-07 03:06:07 +0100 <yushyin> sometimes linux distribution put the header files in ncursesw/ncurses.h and sometimes in ncurses.h the package has flags for this
2021-12-07 03:06:15 +0100 <sm> thanks.. I installed 9.2.1 on m1 today, let's see if I notice
2021-12-07 03:06:31 +0100 <senoraraton> ncurses >= 0.2.16 -use-pkgconfig?
2021-12-07 03:06:55 +0100doyougnu(~doyougnu@c-73-25-202-122.hsd1.or.comcast.net) (Ping timeout: 265 seconds)
2021-12-07 03:07:05 +0100 <geekosaur> ncursesw may have gone away since it's deprecated in ncurses 6 (all versions are "w")
2021-12-07 03:07:20 +0100 <geekosaur> so it may be in ncurses/ncurses.h
2021-12-07 03:07:24 +0100 <senoraraton> I have ncurses 6.
2021-12-07 03:07:31 +0100 <sm> worth a try: did you find the arch haskell wiki page ? they might mention this there. Also try the issue tracker for the ncurses packages on hackage (all of them)
2021-12-07 03:07:43 +0100 <senoraraton> I'm not installing haskell through arch
2021-12-07 03:07:48 +0100 <senoraraton> Apparently it doesn't work.
2021-12-07 03:07:54 +0100 <senoraraton> I installed haskell through ghcup
2021-12-07 03:08:02 +0100 <sm> this happens basically everyone who builds anything curses related in haskell :(
2021-12-07 03:08:04 +0100 <geekosaur> no, but you got your C ncurses package via arch and this will affect those as well
2021-12-07 03:08:16 +0100 <senoraraton> So how do I fix it?
2021-12-07 03:08:34 +0100nvmd(~nvmd@user/nvmd) (Quit: Later, nerds.)
2021-12-07 03:08:54 +0100 <oats> dsal, yay check it out https://github.com/oatberry/aoc2021-haskell/commit/4c1dacf65732fc135dad35366bbb4900a3e68ccc
2021-12-07 03:09:10 +0100 <oats> thanks for the help :)
2021-12-07 03:09:48 +0100 <senoraraton> How do I tell cabal the correct inlcude path?
2021-12-07 03:10:31 +0100 <sclv> senoraraton: the cabal help describes many flags including for include and linking
2021-12-07 03:10:35 +0100genieliu(~genieliu@103.37.140.24)
2021-12-07 03:10:48 +0100 <sclv> extra lib dirs and extra include dirs
2021-12-07 03:11:41 +0100 <senoraraton> I don't know, I think this might have broken me.
2021-12-07 03:11:58 +0100 <senoraraton> Its like I climb one mountain, and their is another mountain ahead of me.
2021-12-07 03:12:11 +0100 <senoraraton> I'm not interested in climbing toolchain mountain anymore.
2021-12-07 03:13:46 +0100 <yushyin> if you follow the link from the hackage ncurses page you then you can do it e.g. like this https://cabal.readthedocs.io/en/latest/setup-commands.html#controlling-flag-assignments
2021-12-07 03:14:42 +0100kennyd(~bc8165b6@cerf.good1.com) (Quit: CGI:IRC)
2021-12-07 03:14:55 +0100 <yin> is there a canonical way of doin (toEnum . fromEnum) ?
2021-12-07 03:15:13 +0100 <senoraraton> So I run cabal build -use-pkgconfig?
2021-12-07 03:15:16 +0100kennyd(~bc8165b6@cerf.good1.com)
2021-12-07 03:15:33 +0100 <senoraraton> Unrecongized build option
2021-12-07 03:15:37 +0100 <geekosaur> sadly, there is little consistency between different linux distributions or even different versions of the same distribution. which is a large part of the problem with arch; they'll break something like this without warning and you get to pick up the pieces
2021-12-07 03:15:53 +0100 <geekosaur> yin, no
2021-12-07 03:16:01 +0100 <yin> geekosaur: thanks
2021-12-07 03:16:11 +0100 <geekosaur> I call it "twiddle" when I need it
2021-12-07 03:16:23 +0100 <sclv> -fuse-pkgconfig
2021-12-07 03:16:37 +0100 <sclv> -f says its a package flag
2021-12-07 03:16:53 +0100 <senoraraton> Where would I put this? constraint: ncurses +force-narrow-library
2021-12-07 03:17:31 +0100 <yushyin> this is a valid field in cabal.project, i guess
2021-12-07 03:18:14 +0100 <senoraraton> Nope, both solutions fail.
2021-12-07 03:18:17 +0100 <senoraraton> Same issue.
2021-12-07 03:20:00 +0100Vajb(~Vajb@hag-jnsbng11-58c3a8-176.dhcp.inet.fi) (Read error: Connection reset by peer)
2021-12-07 03:20:24 +0100 <senoraraton> So do I have to build it from source and make the changes myself inorder to specify the proper version of ncurses? Cause I don't wanna do that.
2021-12-07 03:20:36 +0100 <yushyin> https://cabal.readthedocs.io/en/latest/cabal-project.html?#cfg-flag---constraint seems like the field name is constraints (plural)
2021-12-07 03:22:05 +0100 <senoraraton> Still fails.
2021-12-07 03:22:08 +0100 <yushyin> also, you do need pkgconf installed
2021-12-07 03:22:13 +0100 <dsal> oats: nice
2021-12-07 03:22:31 +0100 <senoraraton> It is installed.
2021-12-07 03:22:33 +0100 <yushyin> (pacman -S pkgconf)
2021-12-07 03:23:12 +0100 <senoraraton> Its installed.
2021-12-07 03:23:35 +0100 <senoraraton> Neither of those work.
2021-12-07 03:24:56 +0100 <senoraraton> The include line is wrong, at least for my system, and I don't know how to edit it.
2021-12-07 03:25:58 +0100 <sm> maybe https://github.com/commercialhaskell/stack/issues/3509 has some clues
2021-12-07 03:27:17 +0100xff0x(~xff0x@2001:1a81:5269:5600:97b6:69e2:8ab7:379a) (Ping timeout: 252 seconds)
2021-12-07 03:28:47 +0100yauhsien(~yauhsien@61-231-32-247.dynamic-ip.hinet.net)
2021-12-07 03:28:50 +0100 <senoraraton> This is all stack related, so I don't know how to fix it for cabal.
2021-12-07 03:29:03 +0100 <senoraraton> But it is broken.
2021-12-07 03:29:10 +0100xff0x(~xff0x@2001:1a81:52ad:7f00:7dec:e953:6848:5983)
2021-12-07 03:29:11 +0100 <sm> https://bbs.archlinux.org/viewtopic.php?id=255197: "I corrected this by adding `constraint: ncurses +force-narrow-library` to my .cabal/config file, and running cabal clean, configure...etc." I'm just throwing out links, not an arch user.
2021-12-07 03:29:35 +0100 <senoraraton> Also issue for 3 years, still not fixed FTW
2021-12-07 03:29:43 +0100 <senoraraton> I added that. Did not work
2021-12-07 03:29:51 +0100 <senoraraton> I also modified it to be constraints, did not work
2021-12-07 03:30:07 +0100 <senoraraton> -fuse-pkgconfig also didn't work, and none of those things worked in any combination either
2021-12-07 03:30:23 +0100 <yushyin> can confirm that it is not working, might be a bug in the haskell package or cabal
2021-12-07 03:31:13 +0100 <senoraraton> It wants the ncursesw directory, but ncursesw is deprecated anddoens't exist anymore.
2021-12-07 03:31:30 +0100 <senoraraton> And I don't know how to edit where cabal is looking for the thing to update the script.
2021-12-07 03:33:17 +0100 <sm> I will add that https://hackage.haskell.org/package/ncurses was last touched in 2017, and probably not the one you should start with
2021-12-07 03:33:36 +0100 <sm> https://hackage.haskell.org/package/vty is much more used
2021-12-07 03:33:55 +0100 <dsal> oats: for a good time, return Int
2021-12-07 03:33:59 +0100yauhsien(~yauhsien@61-231-32-247.dynamic-ip.hinet.net) (Ping timeout: 265 seconds)
2021-12-07 03:34:30 +0100 <senoraraton> vty or brick?
2021-12-07 03:34:44 +0100 <sclv> on that one, if you pass both use-pkgconfig and force-narrow-library then that should avoid depending on ncursesw but yeah, its a very old lib, and probably not in the best shape
2021-12-07 03:36:30 +0100 <sm> senoraraton: both are excellent, vty is lower level and simpler so why not get that working first
2021-12-07 03:40:40 +0100Vajb(~Vajb@hag-jnsbng11-58c3a8-176.dhcp.inet.fi)
2021-12-07 03:41:14 +0100 <yushyin> senoraraton: it is unfortunate that you started with an outdated package which causes problems :/
2021-12-07 03:41:20 +0100 <oats> dsal, for a good time? huh
2021-12-07 03:41:36 +0100 <dsal> oats: do you understand how Data.Coerce works?
2021-12-07 03:41:39 +0100 <dsal> :t coerce
2021-12-07 03:41:40 +0100 <lambdabot> error:
2021-12-07 03:41:40 +0100 <lambdabot> • Variable not in scope: coerce
2021-12-07 03:41:40 +0100 <lambdabot> • Perhaps you meant ‘coerced’ (imported from Control.Lens)
2021-12-07 03:41:47 +0100 <dsal> Oh right, Lambdabot wouldn't let that happen
2021-12-07 03:41:51 +0100 <sm> yushyin, and it's one of those things we always forget to check at the start
2021-12-07 03:42:00 +0100 <oats> I am not familiar with Data.Coerce
2021-12-07 03:42:02 +0100oatspeeks
2021-12-07 03:42:03 +0100 <dsal> % :t coerce
2021-12-07 03:42:03 +0100 <yahb> dsal: Coercible a b => a -> b
2021-12-07 03:42:40 +0100 <dsal> If `a` and `b` have the same representation and coercion is allowed (by role) then you can just do that.
2021-12-07 03:43:09 +0100 <sm> hackage/cabal should have some kind of warning system to steer new folks away from troublesome packages
2021-12-07 03:43:17 +0100 <yushyin> senoraraton: but good luck in the further process and that everything works out now ;D
2021-12-07 03:43:32 +0100 <yushyin> sm: so true
2021-12-07 03:44:07 +0100 <sm> well, I guess that is in part what stackage is
2021-12-07 03:44:18 +0100 <dsal> oats: this is typically a newtype wrapper thing, where you can take the result out of it without actually doing anything at runtime. e.g., you can coerce an entire list of stuff into a different type with the same representation.
2021-12-07 03:44:32 +0100myShoggoth(~myShoggot@97-120-85-195.ptld.qwest.net)
2021-12-07 03:44:59 +0100 <dsal> For example, `sum` is implemented as `sum = getSum #. foldMap' Sum`
2021-12-07 03:45:34 +0100 <dsal> where (#.) _f = coerce
2021-12-07 03:46:38 +0100ub(~Thunderbi@p200300ecdf0ba286bd3e231ce6977cbe.dip0.t-ipconnect.de)
2021-12-07 03:47:28 +0100 <yushyin> sm: that's true of course, but someone new might quickly find out that the package they want is on hackage (and not with stackage), googles how to add hackage packages to stack (extra-deps:) and promptly run into similar problems
2021-12-07 03:47:33 +0100 <dsal> So if your monioidification function is (a -> m) with just a simple newtype wrapper like First or Last, then coerce can get the value back out without you having to explicitly name the "extraction" function.
2021-12-07 03:48:00 +0100ubert(~Thunderbi@p200300ecdf0ba2ca3910be5e8791151b.dip0.t-ipconnect.de) (Ping timeout: 265 seconds)
2021-12-07 03:48:00 +0100ububert
2021-12-07 03:49:39 +0100 <oats> interesting
2021-12-07 03:49:44 +0100 <oats> this is safe?
2021-12-07 03:50:03 +0100InternetCitizen(~fuzzypixe@eth-west-pareq2-46-193-4-100.wb.wifirst.net)
2021-12-07 03:50:26 +0100 <dsal> Yeah.
2021-12-07 03:50:34 +0100 <dsal> There's also unsafeCoerce. That's less safe.
2021-12-07 03:50:49 +0100 <sm> yushyin: indeed, but at least they are more likely to find an use something in the stackage snapshot (like vty)
2021-12-07 03:52:27 +0100 <dsal> In addition to just straight memory representation, there are also roles to limit where you can coerce. For example, if you have a `Map Int Int` you can coerce it to a `Map Int (X Int)` for some newtype X over Int, but you can't coerce it to a `Map (X Int) Int` because that X type can have ordering rules that differ from the underlying Int and that would cause the map to misbehave.
2021-12-07 03:53:23 +0100 <senoraraton> Well vty builds, I can't find any documentation on how to use it, but cabal imported it.
2021-12-07 03:53:33 +0100 <senoraraton> Is there a way to supress the "up to date" output from cabal run?
2021-12-07 03:53:45 +0100 <dsal> Weird. I can't find that in the docs, but in the source, you'll see `type role Map nominal representational` -- you can coerce something whose role is representational, but not nominal.
2021-12-07 03:54:05 +0100 <senoraraton> I found the docs.
2021-12-07 03:54:41 +0100 <sm> yes, https://hackage.haskell.org/package/vty-5.33/docs/Graphics-Vty.html
2021-12-07 03:55:02 +0100 <sm> when you try brick, don't miss the excellent user guide, as I did
2021-12-07 03:55:37 +0100 <dsal> I don't think I could use brick without that Carnage/Migos song playing the whole time.
2021-12-07 03:56:18 +0100 <senoraraton> I love how I spent 4 hours solving a problem, to just give up and try a different library.
2021-12-07 03:56:32 +0100 <dsal> To be fair, you have a variety of problems and you solved many of them.
2021-12-07 03:56:37 +0100InternetCitizen(~fuzzypixe@eth-west-pareq2-46-193-4-100.wb.wifirst.net) (Ping timeout: 252 seconds)
2021-12-07 03:56:54 +0100 <sm> well, and learning valuable arch / haskell package management troubleshooting skills
2021-12-07 03:57:25 +0100 <oats> dsal, oh and now I also need a Coercible constraint on playBingo, I see
2021-12-07 03:57:31 +0100 <oats> playBingo :: (Monoid b, Coercible b c) => (Maybe Int -> b) -> Bingo -> c
2021-12-07 03:57:34 +0100 <sm> number one being: be careful about using packages not touched in the last year
2021-12-07 03:57:40 +0100 <dsal> oats: Yeah, that's neat.
2021-12-07 03:57:43 +0100mvk(~mvk@2607:fea8:5cdd:f000::9788) (Ping timeout: 252 seconds)
2021-12-07 03:58:07 +0100 <dsal> But you can also just return Int and have `Coercible b Int`
2021-12-07 03:58:27 +0100 <sm> dsal: https://www.youtube.com/watch?v=dermyeoLDgs ?
2021-12-07 03:58:32 +0100oatsadds FlexibleContexts
2021-12-07 03:58:56 +0100 <dsal> sm: My mama says stay patient
2021-12-07 03:59:18 +0100hskpractice(~hskpracti@94-255-217-215.cust.bredband2.com)
2021-12-07 04:00:43 +0100[itchyjunk](~itchyjunk@user/itchyjunk/x-7353470)
2021-12-07 04:02:20 +0100 <janus> using stack, what is the motivation for putting version bounds in package.yaml? the versions are already determined by the stack.yaml
2021-12-07 04:03:01 +0100 <dsal> They translate directly to cabal. You might still have an upper bound. Sometimes I have lower bounds and I have to go outside of package.yaml to do that.
2021-12-07 04:03:08 +0100 <sm> janus: 1. package.yaml generates the .cabal file, which is a standard required by most tools
2021-12-07 04:03:11 +0100 <dsal> e.g., I'm using amazonka 2 in some of my stuff.
2021-12-07 04:03:39 +0100 <dsal> It would be nice of hpack could make reasonable guesses for stackage, though.
2021-12-07 04:03:44 +0100 <sm> 2. package.yaml/*.cabal describe the range of versions allowed, which is useful and different information than what's in stack.yaml
2021-12-07 04:03:47 +0100hskpractice(~hskpracti@94-255-217-215.cust.bredband2.com) (Ping timeout: 256 seconds)
2021-12-07 04:04:22 +0100 <oats> playBingo :: (Monoid b, Coercible b (Maybe Int)) => (Maybe Int -> b) -> Bingo -> Maybe Int
2021-12-07 04:04:26 +0100 <oats> this is super interesting
2021-12-07 04:04:31 +0100 <sm> 3. they also define the packages visible to your code, which is a small subset of the stackage snapshot
2021-12-07 04:04:32 +0100 <oats> this shit is why I do AoC
2021-12-07 04:04:43 +0100 <dsal> oats: Yeah, neat. :)
2021-12-07 04:04:43 +0100abrantesasf(~abrantesa@187.36.170.211) (Remote host closed the connection)
2021-12-07 04:04:58 +0100 <oats> dsal, I've learned more than a couple things today, thank you
2021-12-07 04:05:07 +0100 <janus> this project has a hundred deps, we will never be able to put the versions that would theoretically work
2021-12-07 04:05:11 +0100 <dsal> oats: woo. Great. Hopefully I didn't do any damage.
2021-12-07 04:05:29 +0100 <janus> i ran cabal-plan on it and the plan that was generated built fine
2021-12-07 04:05:48 +0100 <sm> janus: you at least need to list their names though, rather than importing random packages from stackage/hackage
2021-12-07 04:05:50 +0100 <janus> so since there were no bounds, it seemed that no package made a breaking release for 8.6.5 which is the compiler used
2021-12-07 04:06:01 +0100 <dsal> janus: Its use is proportional to the number of different projects using your package.
2021-12-07 04:06:18 +0100lavaman(~lavaman@98.38.249.169) (Remote host closed the connection)
2021-12-07 04:06:23 +0100 <dsal> If you're using amazonka and you don't have an upper bound, you're likely to have a bad time when 2.0 ships. :)
2021-12-07 04:07:01 +0100jkaye(~jkaye@2601:281:8300:7530:da02:a8ec:4a68:7358) (Ping timeout: 268 seconds)
2021-12-07 04:07:38 +0100 <janus> dsal: it won't ever land in lts-14. and even if it did, we'd just make an extra-dep once compilation fails
2021-12-07 04:08:01 +0100 <janus> this "reactive" way of working that stack encourages is growing on me...
2021-12-07 04:08:41 +0100 <dsal> janus: Yeah, that's cool. But if you publish your package, it's not published as an lts
2021-12-07 04:08:45 +0100 <janus> dsal: actually i went on this whole adventure with cabal-plan because i wanted to run amazonka2. so now i have this giant list of extra-deps that replaces bascially every package in the lts...
2021-12-07 04:08:57 +0100 <dsal> lts-14 is pretty old
2021-12-07 04:09:00 +0100 <sm> janus: if it suits your needs, you are certainly free to list all deps in stack.yaml and generate package.yaml from it (some will probably have to be comments)
2021-12-07 04:09:45 +0100 <sm> I could see that being convenient in some use cases
2021-12-07 04:09:58 +0100 <sm> or, vice versa
2021-12-07 04:10:01 +0100 <janus> sm: what would be gained by generating package.yaml from stack.yaml? so that it could be published? i gather it is only useful for libraries
2021-12-07 04:10:26 +0100 <sm> you asked why the two files exist, and suggested that two was unnecessary for you
2021-12-07 04:10:40 +0100bitdex(~bitdex@gateway/tor-sasl/bitdex)
2021-12-07 04:10:48 +0100 <janus> aah right, i didn't think about it
2021-12-07 04:10:57 +0100 <sm> so, perhaps you'd gain more simplicity that you were hoping for
2021-12-07 04:11:10 +0100 <sm> I have never heard of it done though
2021-12-07 04:11:22 +0100 <janus> yeah. it sounds nice. but the stack.yaml includes transitive dependencies too. seems a bit weird to list those in package.yaml
2021-12-07 04:11:46 +0100 <sm> normally stack.yaml is very minimal. A long list of deps there is a sign that you're using libraries not well packaged / with the wrong ghc version
2021-12-07 04:12:10 +0100 <janus> right, it was minimal before i attempted this... :P
2021-12-07 04:12:29 +0100 <janus> i could start deleting random stuff from it, but it seems weird, since it would effectively downgrade libraries
2021-12-07 04:12:51 +0100 <janus> like i saw cabal-plan put happy 1.20 and if i remove it from extra deps, it rebuilds a couple of packages with happy 1.19
2021-12-07 04:13:02 +0100 <sm> consider trying snapshots of other major ghc versions ? probably one will be easier
2021-12-07 04:13:04 +0100 <janus> so since i generated it by machine, may as well let it be...
2021-12-07 04:13:58 +0100 <sm> I made a huge stack.yaml this morning, only because there's no snapshot for ghc 9.2 yet
2021-12-07 04:14:41 +0100 <janus> sm: with cabal-plan it seems easy either way... but yeah, maybe you're right that i could delete more of the stack.yaml. maybe the version in the snapshot would even be the same as the stack.yaml
2021-12-07 04:14:47 +0100 <janus> but there is no tooling for me to know, i guess
2021-12-07 04:15:02 +0100 <sm> there are tricks, but yes tooling could be better
2021-12-07 04:15:24 +0100 <janus> cabal-plan is already magic for me, i am so excited :D
2021-12-07 04:16:00 +0100 <sm> I usually try things like stack init --resolver lts-X.Y --dry-run in my project for several recent ghc versions.
2021-12-07 04:16:31 +0100 <sm> better integration between cabal plan and stack snapshots would be nice
2021-12-07 04:18:03 +0100 <janus> it definitely wasn't intuitive... i mean, i had to 1. write a cabal.project 2. realize that cabal gen-bounds doesn't read cabal.project 3. use cabal-plan topo and fiddle with its results
2021-12-07 04:21:25 +0100 <janus> sm: do you ever use "stack init --solver" ? it is undocumented
2021-12-07 04:24:42 +0100 <sclv> i think they deprecated solver and stopped supporting it
2021-12-07 04:25:14 +0100 <janus> ok, so i guess cabal-plan is better nowadays
2021-12-07 04:25:55 +0100 <sm> oh is that still there ? I thought it was removed
2021-12-07 04:26:03 +0100pavonia(~user@user/siracusa) (Read error: Connection reset by peer)
2021-12-07 04:26:23 +0100mbuf(~Shakthi@223.178.74.194)
2021-12-07 04:26:41 +0100 <janus> it is mentioned on https://docs.haskellstack.org/en/stable/nonstandard_project_init/
2021-12-07 04:31:02 +0100azimut(~azimut@gateway/tor-sasl/azimut) (Remote host closed the connection)
2021-12-07 04:31:24 +0100azimut(~azimut@gateway/tor-sasl/azimut)
2021-12-07 04:32:44 +0100td_(~td@muedsl-82-207-238-027.citykom.de) (Ping timeout: 252 seconds)
2021-12-07 04:34:30 +0100deadmarshal(~deadmarsh@95.38.118.214)
2021-12-07 04:34:41 +0100td_(~td@94.134.91.180)
2021-12-07 04:34:49 +0100lavaman(~lavaman@98.38.249.169)
2021-12-07 04:34:52 +0100lavaman(~lavaman@98.38.249.169) (Remote host closed the connection)
2021-12-07 04:35:25 +0100lavaman(~lavaman@98.38.249.169)
2021-12-07 04:35:37 +0100merijn(~merijn@83-160-49-249.ip.xs4all.nl)
2021-12-07 04:36:12 +0100FinnElija(~finn_elij@user/finn-elija/x-0085643) (Killed (NickServ (Forcing logout FinnElija -> finn_elija)))
2021-12-07 04:36:12 +0100finn_elija(~finn_elij@user/finn-elija/x-0085643)
2021-12-07 04:36:12 +0100finn_elijaFinnElija
2021-12-07 04:38:59 +0100deadmarshal(~deadmarsh@95.38.118.214) (Ping timeout: 256 seconds)
2021-12-07 04:39:49 +0100lavaman(~lavaman@98.38.249.169) (Ping timeout: 240 seconds)
2021-12-07 04:40:04 +0100 <senoraraton> I can't get any of these sample codes for vty to compile... >.<
2021-12-07 04:41:06 +0100 <dsal> senoraraton: What are you trying? What errors are you getting?
2021-12-07 04:42:29 +0100 <senoraraton> https://hackage.haskell.org/package/vty-examples-5.5.0/src/ Missing dependencies that I then added to app.cabal but things are deprecated and it fails
2021-12-07 04:42:37 +0100genieliu(~genieliu@103.37.140.24) (Ping timeout: 265 seconds)
2021-12-07 04:43:34 +0100pavonia(~user@user/siracusa)
2021-12-07 04:43:56 +0100 <senoraraton> I cloned the repo, it seems to be working better.
2021-12-07 04:44:13 +0100renzhi(~xp@2607:fa49:6500:b100::5cef) (Ping timeout: 240 seconds)
2021-12-07 04:44:50 +0100kjak(~kjak@pool-108-45-56-21.washdc.fios.verizon.net) (Ping timeout: 252 seconds)
2021-12-07 04:47:24 +0100 <sm> janus, you mean the `:TODO: Document --solver` ? it's a documentation bug, it's not in current stack
2021-12-07 04:51:58 +0100genieliu(~genieliu@103.37.140.38)
2021-12-07 04:53:35 +0100slice(~slice@user/slice) (Quit: zzz)
2021-12-07 04:54:18 +0100 <senoraraton> https://termbin.com/u6ci
2021-12-07 04:56:10 +0100 <EvanR> what's the goto package for doing a 9x9 matrix multiplication
2021-12-07 04:58:30 +0100myShoggoth(~myShoggot@97-120-85-195.ptld.qwest.net) (Remote host closed the connection)
2021-12-07 04:58:50 +0100myShoggoth(~myShoggot@97-120-85-195.ptld.qwest.net)
2021-12-07 04:59:29 +0100 <dmj`> hmatrix or linear
2021-12-07 04:59:40 +0100 <dsal> senoraraton: It seems pretty clear. But I can't see the code.
2021-12-07 05:01:16 +0100 <sm> senoraraton: at https://hackage.haskell.org/package/vty-examples, look at the Uploaded date: 2016. This means you should avoid this package
2021-12-07 05:01:25 +0100 <dsal> Config doesn't have a Default instance, but it has a Monoid instance.
2021-12-07 05:01:58 +0100 <sm> I think they are just built in to the main vty package now.
2021-12-07 05:02:18 +0100 <dsal> If you use a vty of similar vintage to the code you're trying to compile, it might work.
2021-12-07 05:03:19 +0100 <jle`> phaazon: hope it wasn't too disappointing :D
2021-12-07 05:03:29 +0100 <dsal> Yeah, the changelog says they removed Default in 5.15.
2021-12-07 05:04:02 +0100biberu(~biberu@user/biberu) (Ping timeout: 240 seconds)
2021-12-07 05:04:12 +0100 <sm> there's a newer vty-examples.cabal in https://github.com/jtdaugherty/vty/tree/master/test . Perhaps that is better
2021-12-07 05:05:54 +0100 <EvanR> in linear, the relevant function appears to be (!*!) :: (Functor m, Foldable t, Additive t, Additive n, Num a) => m (t a) -> t (n a) -> m (n a)
2021-12-07 05:06:29 +0100 <EvanR> that 9x9 matrix multiplication is an instance of this, and how to convince ghc of it, will be an interesting diversion
2021-12-07 05:07:06 +0100 <EvanR> I guess you'd make a V9 type
2021-12-07 05:07:23 +0100 <glguy> senoraraton: How about: https://github.com/glguy/set-game
2021-12-07 05:08:02 +0100 <jackdk> EvanR: https://hackage.haskell.org/package/linear-1.21.8/docs/Linear-V.html
2021-12-07 05:09:13 +0100emf(~emf@2620:10d:c091:480::1:c2f8) (Ping timeout: 252 seconds)
2021-12-07 05:09:21 +0100emf_(~emf@2620:10d:c091:480::1:c2f8)
2021-12-07 05:10:09 +0100merijn(~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 256 seconds)
2021-12-07 05:11:16 +0100 <sm> glguy: I tested you / haskell. :) Sorry to say, one of your deps fails to build horribly here on mac with ghc 8.10. Am I Doing Something Wrong ? https://termbin.com/t9c5
2021-12-07 05:11:22 +0100hskpractice(~hskpracti@94-255-217-215.cust.bredband2.com)
2021-12-07 05:12:03 +0100 <glguy> That looks like your GHC install is bad
2021-12-07 05:12:15 +0100biberu(~biberu@user/biberu)
2021-12-07 05:12:20 +0100 <glguy> is that arm mac or old mac?
2021-12-07 05:12:28 +0100 <sm> this is an m1 mac
2021-12-07 05:12:48 +0100 <glguy> ghcup manages ghc installs, I don't know if homebrew works or not
2021-12-07 05:13:18 +0100 <glguy> I'll try on my M1
2021-12-07 05:13:41 +0100 <glguy> Err, I guess I'll try later; wife is using it :)
2021-12-07 05:13:54 +0100 <sm> (`stack init && stack build` worked though)
2021-12-07 05:14:08 +0100 <sm> (cool looking game!)
2021-12-07 05:14:48 +0100 <glguy> Have you played the actual Set card game already?
2021-12-07 05:15:28 +0100doyougnu(~doyougnu@c-73-25-202-122.hsd1.or.comcast.net)
2021-12-07 05:15:30 +0100 <sm> never, so I don't know what to do here
2021-12-07 05:15:45 +0100hskpractice(~hskpracti@94-255-217-215.cust.bredband2.com) (Ping timeout: 256 seconds)
2021-12-07 05:15:56 +0100 <glguy> OK, the way this works is you're looking for sets of three cards such that each property of the cards is all the same, or all different
2021-12-07 05:16:10 +0100 <glguy> so there are: color, count, shape, fill-pattern
2021-12-07 05:16:28 +0100 <glguy> so all three need to be the same of red, green, blue, or one of each
2021-12-07 05:16:36 +0100fizbin(~fizbin@c-73-33-197-160.hsd1.nj.comcast.net)
2021-12-07 05:17:01 +0100 <glguy> same for chevron, oval, triangle; hollow, stripped, hashed; 1, 2, 3
2021-12-07 05:17:13 +0100 <sm> cool. I was trying to match 2.. and when I select 3 I should.. (D)eal ?
2021-12-07 05:17:15 +0100 <glguy> usually you'd play it in a group and yell out SET! when you see one
2021-12-07 05:17:26 +0100 <sm> oh it's automatic
2021-12-07 05:17:48 +0100 <sm> I just really like the colours and semigraphics :)
2021-12-07 05:17:50 +0100 <dsal> I just built that in a nix-shell
2021-12-07 05:17:57 +0100 <dsal> Works fine
2021-12-07 05:18:34 +0100 <glguy> If there are *no sets* you can deal out 3 more cards
2021-12-07 05:19:10 +0100leah2(~leah@vuxu.org) (Ping timeout: 268 seconds)
2021-12-07 05:19:49 +0100myShoggoth(~myShoggot@97-120-85-195.ptld.qwest.net) (Ping timeout: 240 seconds)
2021-12-07 05:21:01 +0100fizbin(~fizbin@c-73-33-197-160.hsd1.nj.comcast.net) (Ping timeout: 263 seconds)
2021-12-07 05:21:14 +0100 <jackdk> glguy: set is a mean nerdsnipe to throw into a >=700 person chan ^^
2021-12-07 05:21:33 +0100 <glguy> I shoud make a set game channel bot :3
2021-12-07 05:21:51 +0100 <glguy> Just need to figure out a nice compact set of glyphs!
2021-12-07 05:22:11 +0100 <sm> that's a really weird cabal build failure with blaze-builder. cabal repl works, stack build with same ghc version works..
2021-12-07 05:22:12 +0100curiousgay(~curiousga@77-120-141-90.kha.volia.net)
2021-12-07 05:22:45 +0100 <sm> and blaze-builder has zero issues so clearly I'm special
2021-12-07 05:23:27 +0100cjb(~cjb@user/cjb) (Quit: rcirc on GNU Emacs 29.0.50)
2021-12-07 05:23:39 +0100 <EvanR> oh dang did not know about that API thanks jackdk
2021-12-07 05:25:28 +0100 <glguy> 04▲△◭ 03●○◐ 06■□◧
2021-12-07 05:25:42 +0100[itchyjunk](~itchyjunk@user/itchyjunk/x-7353470) (Quit: Leaving)
2021-12-07 05:27:14 +0100 <jackdk> Set!
2021-12-07 05:34:30 +0100leah2(~leah@vuxu.org)
2021-12-07 05:37:14 +0100doyougnu(~doyougnu@c-73-25-202-122.hsd1.or.comcast.net) (Ping timeout: 265 seconds)
2021-12-07 05:38:24 +0100waleee(~waleee@2001:9b0:216:8200:d457:9189:7843:1dbd) (Quit: WeeChat 3.3)
2021-12-07 05:39:22 +0100fizbin(~fizbin@c-73-33-197-160.hsd1.nj.comcast.net)
2021-12-07 05:43:01 +0100genieliu(~genieliu@103.37.140.38) (Ping timeout: 240 seconds)
2021-12-07 05:47:42 +0100 <dibblego> who's up for a game of set
2021-12-07 05:56:33 +0100genieliu(~genieliu@103.37.140.24)
2021-12-07 05:59:51 +0100dhruvasagar(~dhruvasag@49.207.222.205) (Quit: WeeChat 3.3)
2021-12-07 06:03:30 +0100shriekingnoise(~shrieking@186.137.144.80) (Quit: Quit)
2021-12-07 06:09:15 +0100Kaiepi(~Kaiepi@156.34.44.192) (Remote host closed the connection)
2021-12-07 06:09:37 +0100Kaiepi(~Kaiepi@156.34.44.192)
2021-12-07 06:09:56 +0100mvk(~mvk@2607:fea8:5cdd:f000::9788)
2021-12-07 06:17:01 +0100biberu(~biberu@user/biberu) (Ping timeout: 240 seconds)
2021-12-07 06:18:30 +0100genieliu_(~genieliu@103.37.140.24)
2021-12-07 06:18:53 +0100emf_(~emf@2620:10d:c091:480::1:c2f8) (Ping timeout: 252 seconds)
2021-12-07 06:19:15 +0100slack1256(~slack1256@191.126.99.210)
2021-12-07 06:19:17 +0100genieliu(~genieliu@103.37.140.24) (Ping timeout: 256 seconds)
2021-12-07 06:23:16 +0100pfurla(~pfurla@2804:14d:5c81:4104:91cd:1543:8918:bc14) (Quit: gone to sleep. ZZZzzz…)
2021-12-07 06:24:32 +0100biberu(~biberu@user/biberu)
2021-12-07 06:25:29 +0100 <EvanR> whoa whoa... what is set?
2021-12-07 06:25:43 +0100 <EvanR> scrolling up
2021-12-07 06:26:03 +0100 <int-e> EvanR: https://en.wikipedia.org/wiki/Set_(game)
2021-12-07 06:26:27 +0100lavaman(~lavaman@98.38.249.169)
2021-12-07 06:26:53 +0100 <int-e> (more context won't help :P)
2021-12-07 06:29:54 +0100VoidNoir0(~VoidNoir0@72.80.203.52) (Quit: Connection closed)
2021-12-07 06:30:32 +0100 <int-e> Hmm, it would... I didn't look far enough.
2021-12-07 06:30:37 +0100lavaman(~lavaman@98.38.249.169) (Ping timeout: 240 seconds)
2021-12-07 06:31:12 +0100 <int-e> Did glguy's line have colors?
2021-12-07 06:31:22 +0100 <EvanR> not for me but this is hexchat
2021-12-07 06:31:32 +0100 <dibblego> did for me, and this is hexchat
2021-12-07 06:31:47 +0100 <dibblego> https://i.imgur.com/rQLzGP0.png
2021-12-07 06:32:05 +0100 <EvanR> oof
2021-12-07 06:32:35 +0100 <int-e> (I filter those because it keeps me saner, but this was one instance where they would be appropriate... though maybe not those colors, exactly)
2021-12-07 06:32:36 +0100 <EvanR> maybe a version thing
2021-12-07 06:32:57 +0100 <int-e> EvanR: xchat had a setting for that, I bet hexchat still has it
2021-12-07 06:34:20 +0100 <Axman6> it has colours in the best client too, glirc
2021-12-07 06:34:42 +0100pfurla(~pfurla@2804:14d:5c81:4104:91cd:1543:8918:bc14)
2021-12-07 06:36:00 +0100 <int-e> Axman6: check under [menu] Settings -> Preferences -> [categories] Interface -> Colors -> [tab] Color Stripping -> Messages
2021-12-07 06:36:22 +0100 <Axman6> eh? I'm saying I do have colours...
2021-12-07 06:36:44 +0100 <int-e> uh, I'm mixing up nicks again, that was for EvanR
2021-12-07 06:36:53 +0100 <EvanR> thanks, I totally didn't see that
2021-12-07 06:36:54 +0100 <Axman6> :thumbsup:
2021-12-07 06:38:08 +0100genieliu_(~genieliu@103.37.140.24) (Ping timeout: 265 seconds)
2021-12-07 06:38:55 +0100_ht(~quassel@82-169-194-8.biz.kpn.net)
2021-12-07 06:38:57 +0100 <int-e> Now let's speculate why https://adventofcode.com/2021/leaderboard/self is temporarily disabled. It displays global ranks, but maybe they're not in the database, making their computation a linear time operation?
2021-12-07 06:40:36 +0100 <EvanR> earlier it was 500ing
2021-12-07 06:40:50 +0100 <int-e> earlier it worked ;)
2021-12-07 06:40:51 +0100 <EvanR> private leaderboards seem to be outdated as well
2021-12-07 06:40:56 +0100 <int-e> oh
2021-12-07 06:41:22 +0100 <EvanR> ah it updated
2021-12-07 06:41:48 +0100 <int-e> those may be a thing that's recomputed every 5 seconds and cached
2021-12-07 06:42:23 +0100 <EvanR> if so it's greater than 5 seconds xD
2021-12-07 06:42:41 +0100 <EvanR> (but in previous days it seemed responsive, since that's of course first thing I do once "winning" lol)
2021-12-07 06:43:07 +0100 <EvanR> (see how far down glguy's leaderboard I fell to)
2021-12-07 06:43:38 +0100 <int-e> (I wonder how many requests per second that website gets... hundreds, thousands, or more?)
2021-12-07 06:44:01 +0100 <xerox> maybe last year hiccup post sheds some light on that number, I forget
2021-12-07 06:44:40 +0100zebrag(~chris@user/zebrag) (Quit: Konversation terminated!)
2021-12-07 06:44:51 +0100 <int-e> (and of course there'll be a huge spike to handle around 5:00:00 UTC)
2021-12-07 06:45:26 +0100deadmarshal(~deadmarsh@95.38.118.214)
2021-12-07 06:45:41 +0100yauhsien(~yauhsien@61-231-32-247.dynamic-ip.hinet.net)
2021-12-07 06:48:33 +0100jmorris(uid433911@id-433911.hampstead.irccloud.com)
2021-12-07 06:49:32 +0100jmorris(uid433911@id-433911.hampstead.irccloud.com) (Client Quit)
2021-12-07 06:49:44 +0100 <EvanR> aka "ridiculous AM"
2021-12-07 06:51:25 +0100xff0x(~xff0x@2001:1a81:52ad:7f00:7dec:e953:6848:5983) (Ping timeout: 240 seconds)
2021-12-07 06:52:07 +0100yauhsien(~yauhsien@61-231-32-247.dynamic-ip.hinet.net) (Remote host closed the connection)
2021-12-07 06:52:21 +0100xff0x(~xff0x@2001:1a81:52ad:7f00:b931:f565:16a0:6381)
2021-12-07 06:53:07 +0100yauhsien(~yauhsien@61-231-32-247.dynamic-ip.hinet.net)
2021-12-07 06:55:21 +0100slowButPresent(~slowButPr@user/slowbutpresent) (Quit: leaving)
2021-12-07 06:56:45 +0100 <glguy> I don't know what's going on with the leaderboards, but it's neat to see 32 people are keeping up with it so far
2021-12-07 07:01:03 +0100slack1256(~slack1256@191.126.99.210) (Ping timeout: 252 seconds)
2021-12-07 07:01:03 +0100hskpractice(~hskpracti@94-255-217-215.cust.bredband2.com)
2021-12-07 07:01:14 +0100genieliu(~genieliu@103.37.140.38)
2021-12-07 07:02:54 +0100hskpractice(~hskpracti@94-255-217-215.cust.bredband2.com) (Remote host closed the connection)
2021-12-07 07:03:49 +0100wroathe(~wroathe@user/wroathe) (Ping timeout: 240 seconds)
2021-12-07 07:06:12 +0100merijn(~merijn@83-160-49-249.ip.xs4all.nl)
2021-12-07 07:09:26 +0100bitmapper(uid464869@id-464869.lymington.irccloud.com) (Quit: Connection closed for inactivity)
2021-12-07 07:11:41 +0100deadmarshal(~deadmarsh@95.38.118.214) (Ping timeout: 252 seconds)
2021-12-07 07:11:42 +0100takuan(~takuan@178-116-218-225.access.telenet.be)
2021-12-07 07:14:49 +0100img(~img@user/img) (Quit: ZNC 1.8.2 - https://znc.in)
2021-12-07 07:15:03 +0100 <EvanR> (anonymous user #815608) is threatening to eat your lunch
2021-12-07 07:16:28 +0100_ht(~quassel@82-169-194-8.biz.kpn.net) (Remote host closed the connection)
2021-12-07 07:17:50 +0100mjrosenb(~mjrosenb@pool-108-54-97-96.nycmny.fios.verizon.net)
2021-12-07 07:18:11 +0100img(~img@user/img)
2021-12-07 07:21:12 +0100wroathe(~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
2021-12-07 07:21:12 +0100wroathe(~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Changing host)
2021-12-07 07:21:12 +0100wroathe(~wroathe@user/wroathe)
2021-12-07 07:25:25 +0100wroathe(~wroathe@user/wroathe) (Ping timeout: 240 seconds)
2021-12-07 07:28:37 +0100xff0x(~xff0x@2001:1a81:52ad:7f00:b931:f565:16a0:6381) (Ping timeout: 240 seconds)
2021-12-07 07:29:32 +0100xff0x(~xff0x@2001:1a81:52ad:7f00:d65b:5d2c:2ffb:2456)
2021-12-07 07:30:49 +0100notzmv(~zmv@user/notzmv) (Ping timeout: 265 seconds)
2021-12-07 07:32:32 +0100hololeap(~hololeap@user/hololeap) (Remote host closed the connection)
2021-12-07 07:33:49 +0100MidAutumnMoon6(~MidAutumn@user/midautumnmoon) (Ping timeout: 240 seconds)
2021-12-07 07:36:22 +0100deadmarshal(~deadmarsh@95.38.118.214)
2021-12-07 07:36:25 +0100 <xerox> what is that trick to do a one-file cabal package that runs as a haskell script and you can also have dependencies?
2021-12-07 07:40:13 +0100merijn(~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 240 seconds)
2021-12-07 07:44:41 +0100shapr(~user@pool-100-36-247-68.washdc.fios.verizon.net) (Ping timeout: 252 seconds)
2021-12-07 07:45:59 +0100 <sm> https://docs.haskellstack.org/en/stable/GUIDE/#script-interpreter , https://cabal.readthedocs.io/en/3.6/cabal-commands.html?highlight=script#cabal-v2-run
2021-12-07 07:48:43 +0100michalz(~michalz@185.246.204.62)
2021-12-07 07:50:38 +0100senoraraton(~senorarat@192-195-83-130.static.monkeybrains.net) (Ping timeout: 265 seconds)
2021-12-07 07:51:22 +0100 <xerox> sm: appreciate it
2021-12-07 07:57:02 +0100emf(~emf@2620:10d:c091:480::1:1ebc)
2021-12-07 07:58:28 +0100pfurla(~pfurla@2804:14d:5c81:4104:91cd:1543:8918:bc14) (Quit: gone to sleep. ZZZzzz…)
2021-12-07 07:58:37 +0100xff0x(~xff0x@2001:1a81:52ad:7f00:d65b:5d2c:2ffb:2456) (Ping timeout: 240 seconds)
2021-12-07 07:59:42 +0100xff0x(~xff0x@port-92-193-200-89.dynamic.as20676.net)
2021-12-07 08:03:30 +0100yauhsien(~yauhsien@61-231-32-247.dynamic-ip.hinet.net) (Remote host closed the connection)
2021-12-07 08:04:09 +0100yauhsien(~yauhsien@61-231-32-247.dynamic-ip.hinet.net)
2021-12-07 08:04:32 +0100 <int-e> > unwords $ map (\x -> printf "%.2f" (192-x/14)) [2653,2627,2603,2590,2577,2528,2522,2520,2511,2507] -- average rank so far, top 10
2021-12-07 08:04:33 +0100 <lambdabot> "2.50 4.36 6.07 7.00 7.93 11.43 11.86 12.00 12.64 12.93"
2021-12-07 08:04:50 +0100 <int-e> EvanR: ^^ it looks much less close like this
2021-12-07 08:06:47 +0100 <EvanR> what is this doctoring of the data lol
2021-12-07 08:07:27 +0100 <dmj`> @pl (\x y -> abs (x - y))
2021-12-07 08:07:27 +0100 <lambdabot> (abs .) . (-)
2021-12-07 08:07:31 +0100 <dmj`> oof
2021-12-07 08:07:37 +0100hskpractice(~hskpracti@94-255-217-215.cust.bredband2.com)
2021-12-07 08:08:31 +0100hskpractice(~hskpracti@94-255-217-215.cust.bredband2.com) (Remote host closed the connection)
2021-12-07 08:08:35 +0100 <int-e> EvanR: 191 users, so an average score of 191 would mean average rank 1... 192 - 191 = 1.
2021-12-07 08:08:37 +0100yauhsien(~yauhsien@61-231-32-247.dynamic-ip.hinet.net) (Ping timeout: 240 seconds)
2021-12-07 08:08:48 +0100hskpractice(~hskpracti@94-255-217-215.cust.bredband2.com)
2021-12-07 08:09:41 +0100emf(~emf@2620:10d:c091:480::1:1ebc) (Quit: emf)
2021-12-07 08:10:09 +0100emf(~emf@2620:10d:c091:480::1:1ebc)
2021-12-07 08:10:48 +0100 <int-e> EvanR: I think it's illuminating, not doctoring :P
2021-12-07 08:11:04 +0100 <int-e> dmj`: hah. don't do that then? :-)
2021-12-07 08:11:11 +0100 <EvanR> the rank for a particular day makes sense
2021-12-07 08:11:21 +0100 <EvanR> not sure what the default is showing though
2021-12-07 08:11:39 +0100 <EvanR> average?
2021-12-07 08:11:57 +0100 <int-e> EvanR: the score is [number of users, currently 191] for rank 1, down to 1 for rank [... 191].
2021-12-07 08:12:14 +0100chele(~chele@user/chele)
2021-12-07 08:12:14 +0100 <int-e> EvanR: averaging makes sense because those numbers are simply added together
2021-12-07 08:12:16 +0100 <EvanR> that's what i mean... the number
2021-12-07 08:12:19 +0100 <dsal> dmj`: compute inp cost t = sum (cost . abs . subtract t <$> inp)
2021-12-07 08:13:22 +0100 <EvanR> is average of 1 - x the same as 1 - average of x xD
2021-12-07 08:13:39 +0100 <int-e> EvanR: yes, averaging commutes with affine maps
2021-12-07 08:13:39 +0100deadmarshal(~deadmarsh@95.38.118.214) (Ping timeout: 252 seconds)
2021-12-07 08:13:47 +0100 <dmj`> int-e: searching for a fancy point-free way to write absolute value after subtraction
2021-12-07 08:14:06 +0100 <dmj`> :t zipWith (curry (abs . uncurry subtract))
2021-12-07 08:14:07 +0100 <lambdabot> Num c => [c] -> [c] -> [c]
2021-12-07 08:14:46 +0100 <EvanR> abs .: subtract ?
2021-12-07 08:14:47 +0100 <int-e> dmj`: sections of composition are a code smell :P
2021-12-07 08:15:09 +0100 <EvanR> :t (.) . (.)
2021-12-07 08:15:10 +0100 <lambdabot> (b -> c) -> (a1 -> a2 -> b) -> a1 -> a2 -> c
2021-12-07 08:15:19 +0100 <EvanR> :t abs (.) . (.) subtract
2021-12-07 08:15:20 +0100 <lambdabot> (Num a1, Num ((b -> a1 -> a1) -> (a2 -> b) -> a2 -> a1 -> a1)) => (b -> a1) -> (a2 -> b) -> a2 -> a1 -> a1
2021-12-07 08:15:25 +0100 <EvanR> \o/
2021-12-07 08:15:26 +0100 <int-e> anyway, just voicing an opinion here.
2021-12-07 08:15:39 +0100 <EvanR> oops no
2021-12-07 08:16:21 +0100 <int-e> sum [abs (x - median xs) | x <- xs] -- that was a bit too clever for part 1, given what part 2 did
2021-12-07 08:16:29 +0100 <dmj`> int-e: I don't disagree *shrug*, was hoping for something swanky like (compare `on` fst) .. etc.
2021-12-07 08:16:44 +0100 <EvanR> the type for (.) . (.) looks like what you're looking for dmj`
2021-12-07 08:16:48 +0100 <EvanR> aka (.:)
2021-12-07 08:17:03 +0100 <EvanR> dunno why it turns out crazy
2021-12-07 08:17:44 +0100 <dmj`> too much point freeness there
2021-12-07 08:18:13 +0100 <int-e> dmj`: I like quipping that you can recognize point-free code by its abundance of dots.
2021-12-07 08:18:23 +0100 <EvanR> :t let (.:) = (.).(.) in (abs .: subtract)
2021-12-07 08:18:24 +0100 <lambdabot> Num c => c -> c -> c
2021-12-07 08:18:40 +0100 <EvanR> > let (.:) = (.).(.) in (abs .: subtract) 4 6
2021-12-07 08:18:42 +0100 <lambdabot> 2
2021-12-07 08:18:46 +0100 <EvanR> > let (.:) = (.).(.) in (abs .: subtract) 6 4
2021-12-07 08:18:47 +0100 <lambdabot> 2
2021-12-07 08:19:04 +0100 <EvanR> see also (.::) = (.).(.).(.)
2021-12-07 08:19:09 +0100 <int-e> Note how .: has *three* dots ;-)
2021-12-07 08:19:33 +0100int-enever acquired a taste for .:
2021-12-07 08:20:06 +0100edrx(~Eduardo@2804:56c:d2ee:ea00:6dc:e4b2:d28a:5637)
2021-12-07 08:21:06 +0100 <edrx> hi! is there an easy way to make agda-mode prefer to use a single frame split into two windows instead of two frames?
2021-12-07 08:22:41 +0100 <Axman6> int-e: looks like you needed my foldl-statistics package
2021-12-07 08:23:08 +0100 <int-e> Axman6: I use a more base-d approach though
2021-12-07 08:23:37 +0100 <xerox> int-e: how to interpret those average rank values? 12 is 4.8 times .. something .. from 2.5, the first one?
2021-12-07 08:24:51 +0100kennyd(~bc8165b6@cerf.good1.com) (Quit: CGI:IRC (Session timeout))
2021-12-07 08:24:51 +0100 <int-e> xerox: Hmm, what's that 4.8? 12 is 9.5 ranks below 2.5.
2021-12-07 08:25:16 +0100 <xerox> ah!! just diff, I did a division
2021-12-07 08:25:21 +0100 <xerox> gotcha
2021-12-07 08:25:40 +0100edrx(~Eduardo@2804:56c:d2ee:ea00:6dc:e4b2:d28a:5637) (Killed buffer)
2021-12-07 08:25:50 +0100bollu(uid233390@id-233390.helmsley.irccloud.com)
2021-12-07 08:26:26 +0100senoraraton(~senorarat@192-195-83-130.static.monkeybrains.net)
2021-12-07 08:27:49 +0100max22-(~maxime@lfbn-ren-1-762-224.w81-53.abo.wanadoo.fr)
2021-12-07 08:28:05 +0100yauhsien(~yauhsien@61-231-32-247.dynamic-ip.hinet.net)
2021-12-07 08:29:32 +0100 <int-e> xerox: So for example if A has ranks 4 and 1 for parts 1 and 2, and B has ranks 3 and 21, that would average to 2.5 and 12, an 9.5 is the average of -1 (B is one place above A in part 1) and 20 (B is 20 places below A in part 2).
2021-12-07 08:30:50 +0100 <int-e> But the main point of this computation is that we are familiar with the idea that 1 is the best possible rank. So it's more intuitive than taking the actual scores and put them into relation with 14*191 = 2674.
2021-12-07 08:31:21 +0100 <int-e> (It's also annoying because the number of users can change)
2021-12-07 08:31:26 +0100 <xerox> yeah
2021-12-07 08:31:48 +0100 <xerox> it'd be cool to see the rankings in your simpler scale, but only for the people who finished them all
2021-12-07 08:31:54 +0100 <xerox> you'd have to take the json and filter it out I guess
2021-12-07 08:33:03 +0100jrm(~jrm@156.34.187.65) (Ping timeout: 265 seconds)
2021-12-07 08:35:11 +0100hskpractice(~hskpracti@94-255-217-215.cust.bredband2.com) (Remote host closed the connection)
2021-12-07 08:35:28 +0100hskpractice(~hskpracti@94-255-217-215.cust.bredband2.com)
2021-12-07 08:36:55 +0100danso(~danso@23-233-111-52.cpe.pppoe.ca) (Ping timeout: 256 seconds)
2021-12-07 08:41:25 +0100hskpractice(~hskpracti@94-255-217-215.cust.bredband2.com) (Remote host closed the connection)
2021-12-07 08:41:43 +0100hskpractice(~hskpracti@94-255-217-215.cust.bredband2.com)
2021-12-07 08:43:23 +0100hskpractice(~hskpracti@94-255-217-215.cust.bredband2.com) (Remote host closed the connection)
2021-12-07 08:43:40 +0100hskpractice(~hskpracti@94-255-217-215.cust.bredband2.com)
2021-12-07 08:44:47 +0100neurocyte0132889(~neurocyte@94.46.70.70)
2021-12-07 08:44:47 +0100neurocyte0132889(~neurocyte@94.46.70.70) (Changing host)
2021-12-07 08:44:47 +0100neurocyte0132889(~neurocyte@user/neurocyte)
2021-12-07 08:45:48 +0100FinnElija(~finn_elij@user/finn-elija/x-0085643) (Ping timeout: 276 seconds)
2021-12-07 08:47:26 +0100FinnElija(~finn_elij@user/finn-elija/x-0085643)
2021-12-07 08:49:04 +0100dhouthoo(~dhouthoo@178-117-36-167.access.telenet.be)
2021-12-07 08:53:28 +0100senoraraton(~senorarat@192-195-83-130.static.monkeybrains.net) (Ping timeout: 265 seconds)
2021-12-07 08:55:01 +0100simendsjo(~user@84.211.91.241)
2021-12-07 08:55:40 +0100yauhsien(~yauhsien@61-231-32-247.dynamic-ip.hinet.net) (Remote host closed the connection)
2021-12-07 08:55:43 +0100genieliu_(~genieliu@103.37.140.24)
2021-12-07 08:56:33 +0100genieliu(~genieliu@103.37.140.38) (Ping timeout: 252 seconds)
2021-12-07 08:56:56 +0100deadmarshal(~deadmarsh@95.38.118.214)
2021-12-07 09:00:36 +0100xsebek(~xsebek@176.74.150.21)
2021-12-07 09:02:07 +0100xsebek(~xsebek@176.74.150.21) (Client Quit)
2021-12-07 09:03:50 +0100hskpractice(~hskpracti@94-255-217-215.cust.bredband2.com) (Remote host closed the connection)
2021-12-07 09:04:07 +0100hskpractice(~hskpracti@94-255-217-215.cust.bredband2.com)
2021-12-07 09:05:47 +0100hskpractice(~hskpracti@94-255-217-215.cust.bredband2.com) (Remote host closed the connection)
2021-12-07 09:06:05 +0100hskpractice(~hskpracti@94-255-217-215.cust.bredband2.com)
2021-12-07 09:07:45 +0100hskpractice(~hskpracti@94-255-217-215.cust.bredband2.com) (Remote host closed the connection)
2021-12-07 09:08:03 +0100hskpractice(~hskpracti@94-255-217-215.cust.bredband2.com)
2021-12-07 09:11:56 +0100senoraraton(~senorarat@192-195-83-130.static.monkeybrains.net)
2021-12-07 09:13:32 +0100dschrempf(~dominik@070-207.dynamic.dsl.fonira.net)
2021-12-07 09:15:24 +0100Sgeo(~Sgeo@user/sgeo) (Read error: Connection reset by peer)
2021-12-07 09:18:49 +0100hskpractice(~hskpracti@94-255-217-215.cust.bredband2.com) (Remote host closed the connection)
2021-12-07 09:19:07 +0100hskpractice(~hskpracti@94-255-217-215.cust.bredband2.com)
2021-12-07 09:20:00 +0100mcgroin(~mcgroin@roc37-h01-176-170-197-243.dsl.sta.abo.bbox.fr)
2021-12-07 09:20:37 +0100senoraraton(~senorarat@192-195-83-130.static.monkeybrains.net) (Ping timeout: 256 seconds)
2021-12-07 09:23:15 +0100hskpractice(~hskpracti@94-255-217-215.cust.bredband2.com) (Remote host closed the connection)
2021-12-07 09:23:33 +0100hskpractice(~hskpracti@94-255-217-215.cust.bredband2.com)
2021-12-07 09:25:13 +0100hskpractice(~hskpracti@94-255-217-215.cust.bredband2.com) (Remote host closed the connection)
2021-12-07 09:25:31 +0100hskpractice(~hskpracti@94-255-217-215.cust.bredband2.com)
2021-12-07 09:27:11 +0100hskpractice(~hskpracti@94-255-217-215.cust.bredband2.com) (Remote host closed the connection)
2021-12-07 09:27:29 +0100hskpractice(~hskpracti@94-255-217-215.cust.bredband2.com)
2021-12-07 09:29:09 +0100hskpractice(~hskpracti@94-255-217-215.cust.bredband2.com) (Remote host closed the connection)
2021-12-07 09:29:27 +0100hskpractice(~hskpracti@94-255-217-215.cust.bredband2.com)
2021-12-07 09:30:26 +0100merijn(~merijn@83-160-49-249.ip.xs4all.nl)
2021-12-07 09:30:39 +0100emf(~emf@2620:10d:c091:480::1:1ebc) (Ping timeout: 252 seconds)
2021-12-07 09:33:46 +0100hskpractice(~hskpracti@94-255-217-215.cust.bredband2.com) (Remote host closed the connection)
2021-12-07 09:33:54 +0100cfricke(~cfricke@user/cfricke)
2021-12-07 09:34:02 +0100hskpractice(~hskpracti@94-255-217-215.cust.bredband2.com)
2021-12-07 09:35:42 +0100emf(~emf@2620:10d:c091:480::1:1ebc)
2021-12-07 09:36:07 +0100 <dminuoso> Is there some cute trick to have a list of acceptable parameters in optparse-applicative?
2021-12-07 09:38:05 +0100hskpractice(~hskpracti@94-255-217-215.cust.bredband2.com) (Remote host closed the connection)
2021-12-07 09:38:23 +0100hskpractice(~hskpracti@94-255-217-215.cust.bredband2.com)
2021-12-07 09:38:41 +0100 <dminuoso> Ideally I'd love being able to say: enumArgument [Choice "foo" Foo, Choice "bar" Bar] (long "thing" <> showDefault <> value (Choice "foo" Foo))
2021-12-07 09:38:44 +0100 <mjrosenb> can lsp give me the list of things that I need to implement for a class instance?
2021-12-07 09:39:29 +0100notzmv(~zmv@user/notzmv)
2021-12-07 09:39:30 +0100 <dminuoso> mjrosenb: Well GHC would warn you about missing method implementations, so there's that at least.
2021-12-07 09:40:37 +0100 <[exa]> dminuoso: the tradition kinda dictates that these should form separate switches/flags/subcommands but yeah having one would be great
2021-12-07 09:44:48 +0100ph88(~ph88@ip5f5af068.dynamic.kabel-deutschland.de) (Quit: Leaving)
2021-12-07 09:46:35 +0100hskpractice(~hskpracti@94-255-217-215.cust.bredband2.com) (Remote host closed the connection)
2021-12-07 09:46:53 +0100hskpractice(~hskpracti@94-255-217-215.cust.bredband2.com)
2021-12-07 09:48:13 +0100 <dminuoso> [exa]: None of these are good alternatives though.
2021-12-07 09:48:38 +0100 <dminuoso> [exa]: With switches/flags you cannot model exlusivitiy, and I dont think you can have commands conditional based on the presence of another switch/flag.
2021-12-07 09:48:40 +0100eggplantade(~Eggplanta@2600:1700:bef1:5e10:e52b:eca6:e736:3c6b) (Remote host closed the connection)
2021-12-07 09:50:12 +0100econo(uid147250@user/econo) (Quit: Connection closed for inactivity)
2021-12-07 09:51:16 +0100 <[exa]> dminuoso: conditional ones work with subparses/subcommands, but that doesn't really solve your problem
2021-12-07 09:52:06 +0100 <[exa]> I was solving a similar thing with one gpg-style utility, you can smash various combinations of verify/decrypt/encrypt/sign/ascii/cleartext/detached in there and it would really have helped to have an enumerable monoid or something in there
2021-12-07 09:52:40 +0100 <[exa]> otoh honestly I don't see that logic being portable to anywhere else
2021-12-07 09:53:13 +0100 <dminuoso> Internally I think all we have to do is add another field to OptPropertiers
2021-12-07 09:54:12 +0100 <dminuoso> Or maybe not, gah this lack of documentation is ghastly.
2021-12-07 09:57:21 +0100hskpractice(~hskpracti@94-255-217-215.cust.bredband2.com) (Remote host closed the connection)
2021-12-07 09:57:39 +0100hskpractice(~hskpracti@94-255-217-215.cust.bredband2.com)
2021-12-07 09:59:19 +0100hskpractice(~hskpracti@94-255-217-215.cust.bredband2.com) (Remote host closed the connection)
2021-12-07 09:59:37 +0100hskpractice(~hskpracti@94-255-217-215.cust.bredband2.com)
2021-12-07 10:00:08 +0100gdhffd[m](~gdhffdmat@2001:470:69fc:105::1:799) (Quit: You have been kicked for being idle)
2021-12-07 10:00:14 +0100kevin[m]1(~pnotequal@2001:470:69fc:105::a54) (Quit: You have been kicked for being idle)
2021-12-07 10:01:54 +0100hskpractice(~hskpracti@94-255-217-215.cust.bredband2.com) (Remote host closed the connection)
2021-12-07 10:02:11 +0100hskpractice(~hskpracti@94-255-217-215.cust.bredband2.com)
2021-12-07 10:03:50 +0100euandreh(~euandreh@2804:14c:33:9fe5:b36c:1fc0:956d:d06c) (Ping timeout: 252 seconds)
2021-12-07 10:03:54 +0100perrierjouet(~perrier-j@modemcable012.251-130-66.mc.videotron.ca) (Quit: WeeChat 3.3)
2021-12-07 10:04:52 +0100machinedgod(~machinedg@142.169.78.167)
2021-12-07 10:05:05 +0100perrierjouet(~perrier-j@modemcable012.251-130-66.mc.videotron.ca)
2021-12-07 10:05:35 +0100euandreh(~euandreh@2804:14c:33:9fe5:da4:9ec6:5ef5:74d6)
2021-12-07 10:05:53 +0100spoofer(~spoofer@64.185.111.205) (Ping timeout: 256 seconds)
2021-12-07 10:06:02 +0100spoofer(~spoofer@64.185.111.205)
2021-12-07 10:07:12 +0100Gurkenglas(~Gurkengla@dslb-002-203-144-204.002.203.pools.vodafone-ip.de)
2021-12-07 10:08:04 +0100 <merijn> dminuoso: I have a bunch
2021-12-07 10:08:30 +0100user0(~aj@langw.roketelkom.co.ug)
2021-12-07 10:09:10 +0100 <merijn> dminuoso: https://github.com/merijn/Belewitte/blob/master/benchmark-analysis/src/OptionParsers.hs#L481-L508
2021-12-07 10:09:50 +0100yauhsien(~yauhsien@61-231-32-247.dynamic-ip.hinet.net)
2021-12-07 10:12:39 +0100hskpractice(~hskpracti@94-255-217-215.cust.bredband2.com) (Remote host closed the connection)
2021-12-07 10:12:58 +0100hskpractice(~hskpracti@94-255-217-215.cust.bredband2.com)
2021-12-07 10:14:38 +0100hskpractice(~hskpracti@94-255-217-215.cust.bredband2.com) (Remote host closed the connection)
2021-12-07 10:14:40 +0100yauhsien(~yauhsien@61-231-32-247.dynamic-ip.hinet.net) (Ping timeout: 265 seconds)
2021-12-07 10:14:56 +0100hskpractice(~hskpracti@94-255-217-215.cust.bredband2.com)
2021-12-07 10:17:34 +0100allbery_b(~geekosaur@xmonad/geekosaur)
2021-12-07 10:17:34 +0100geekosaur(~geekosaur@xmonad/geekosaur) (Killed (NickServ (GHOST command used by allbery_b)))
2021-12-07 10:17:37 +0100allbery_bgeekosaur
2021-12-07 10:20:53 +0100emf(~emf@2620:10d:c091:480::1:1ebc) (Ping timeout: 252 seconds)
2021-12-07 10:21:31 +0100 <dminuoso> merijn: Oh just what I was looking for!
2021-12-07 10:22:04 +0100 <dminuoso> Mmm, but this I cannot copy and paste due to the licensing involved.
2021-12-07 10:22:18 +0100user01(~aj@154.0.137.32)
2021-12-07 10:23:14 +0100 <dminuoso> Any chance you can submit these combinators to optparse-applicative?
2021-12-07 10:24:09 +0100 <merijn> tbh, I'm not sure they're general enough to really fit in?
2021-12-07 10:25:49 +0100hskpractice(~hskpracti@94-255-217-215.cust.bredband2.com) (Remote host closed the connection)
2021-12-07 10:26:05 +0100hskpractice(~hskpracti@94-255-217-215.cust.bredband2.com)
2021-12-07 10:26:45 +0100user0(~aj@langw.roketelkom.co.ug) (Ping timeout: 265 seconds)
2021-12-07 10:27:56 +0100 <dminuoso> Perhaps, Ill just write it myself then. :)
2021-12-07 10:28:18 +0100 <dminuoso> Somewhat relatedly, is there a name for data types that support an isomorphism `T a b ~~~ T b a`?
2021-12-07 10:30:06 +0100 <merijn> Not really, afaik?
2021-12-07 10:32:05 +0100 <dminuoso> Something like commutatitve bifunctor
2021-12-07 10:33:13 +0100 <dminuoso> Guess this is the categorical description. A bifunctor that commutes up to isomorphism
2021-12-07 10:33:15 +0100acidjnk_new(~acidjnk@p200300d0c7271e6304137ec8947839cf.dip0.t-ipconnect.de)
2021-12-07 10:34:55 +0100hskpractice(~hskpracti@94-255-217-215.cust.bredband2.com) (Remote host closed the connection)
2021-12-07 10:34:58 +0100danso(~danso@23-233-111-52.cpe.pppoe.ca)
2021-12-07 10:35:12 +0100hskpractice(~hskpracti@94-255-217-215.cust.bredband2.com)
2021-12-07 10:36:52 +0100hskpractice(~hskpracti@94-255-217-215.cust.bredband2.com) (Remote host closed the connection)
2021-12-07 10:37:10 +0100hskpractice(~hskpracti@94-255-217-215.cust.bredband2.com)
2021-12-07 10:38:50 +0100hskpractice(~hskpracti@94-255-217-215.cust.bredband2.com) (Remote host closed the connection)
2021-12-07 10:39:02 +0100Guest89(~Guest89@103.159.184.187)
2021-12-07 10:39:08 +0100hskpractice(~hskpracti@94-255-217-215.cust.bredband2.com)
2021-12-07 10:39:12 +0100Guest89(~Guest89@103.159.184.187) (Client Quit)
2021-12-07 10:39:40 +0100 <merijn> Weirdly I found today and yesterday's puzzles much easier than day 4-5
2021-12-07 10:39:57 +0100danso(~danso@23-233-111-52.cpe.pppoe.ca) (Ping timeout: 256 seconds)
2021-12-07 10:42:11 +0100jakalx(~jakalx@base.jakalx.net) (Error from remote client)
2021-12-07 10:42:45 +0100 <int-e> merijn: This may be deliberate... either because 4th and 5th were on the weekend or an attempt to make https://adventofcode.com/2021/stats look more like a christmas tree.
2021-12-07 10:42:56 +0100tzh(~tzh@c-24-21-73-154.hsd1.or.comcast.net) (Quit: zzz)
2021-12-07 10:44:26 +0100emf(~emf@2620:10d:c091:480::1:1ebc)
2021-12-07 10:45:08 +0100 <merijn> :p
2021-12-07 10:49:05 +0100eggplantade(~Eggplanta@2600:1700:bef1:5e10:b5e5:6571:976d:7afc)
2021-12-07 10:50:31 +0100ubert(~Thunderbi@p200300ecdf0ba286bd3e231ce6977cbe.dip0.t-ipconnect.de) (Quit: ubert)
2021-12-07 10:52:56 +0100danso(~danso@23-233-111-52.cpe.pppoe.ca)
2021-12-07 10:54:37 +0100eggplantade(~Eggplanta@2600:1700:bef1:5e10:b5e5:6571:976d:7afc) (Ping timeout: 252 seconds)
2021-12-07 10:54:39 +0100perrierjouet(~perrier-j@modemcable012.251-130-66.mc.videotron.ca) (Quit: WeeChat 3.3)
2021-12-07 10:55:36 +0100synthmeat1synthmeat
2021-12-07 10:59:23 +0100shailangsa(~shailangs@host86-186-136-27.range86-186.btcentralplus.com) (Ping timeout: 252 seconds)
2021-12-07 10:59:47 +0100hskpractice(~hskpracti@94-255-217-215.cust.bredband2.com) (Remote host closed the connection)
2021-12-07 11:00:05 +0100hskpractice(~hskpracti@94-255-217-215.cust.bredband2.com)
2021-12-07 11:00:51 +0100emf(~emf@2620:10d:c091:480::1:1ebc) (Ping timeout: 252 seconds)
2021-12-07 11:02:07 +0100desantra(~skykanin@user/skykanin)
2021-12-07 11:02:44 +0100hskpractice(~hskpracti@94-255-217-215.cust.bredband2.com) (Remote host closed the connection)
2021-12-07 11:03:01 +0100hskpractice(~hskpracti@94-255-217-215.cust.bredband2.com)
2021-12-07 11:04:36 +0100jakalx(~jakalx@base.jakalx.net)
2021-12-07 11:07:03 +0100hskpractice(~hskpracti@94-255-217-215.cust.bredband2.com) (Remote host closed the connection)
2021-12-07 11:07:21 +0100hskpractice(~hskpracti@94-255-217-215.cust.bredband2.com)
2021-12-07 11:09:46 +0100Lord_of_Life(~Lord@user/lord-of-life/x-2819915) (Ping timeout: 265 seconds)
2021-12-07 11:12:31 +0100Lord_of_Life(~Lord@user/lord-of-life/x-2819915)
2021-12-07 11:15:29 +0100zaquest(~notzaques@5.130.79.72) (Remote host closed the connection)
2021-12-07 11:15:34 +0100genieliu_(~genieliu@103.37.140.24) (Ping timeout: 265 seconds)
2021-12-07 11:16:57 +0100desantra(~skykanin@user/skykanin) (Quit: WeeChat 3.3)
2021-12-07 11:18:10 +0100desantra(~skykanin@user/skykanin)
2021-12-07 11:20:05 +0100hskpractice(~hskpracti@94-255-217-215.cust.bredband2.com) (Remote host closed the connection)
2021-12-07 11:20:23 +0100hskpractice(~hskpracti@94-255-217-215.cust.bredband2.com)
2021-12-07 11:20:51 +0100zaquest(~notzaques@5.130.79.72)
2021-12-07 11:29:35 +0100simendsjo(~user@84.211.91.241) (Ping timeout: 265 seconds)
2021-12-07 11:32:33 +0100CiaoSen(~Jura@p200300c9570204002a3a4dfffe84dbd5.dip0.t-ipconnect.de)
2021-12-07 11:35:23 +0100hskpractice(~hskpracti@94-255-217-215.cust.bredband2.com) (Remote host closed the connection)
2021-12-07 11:35:41 +0100hskpractice(~hskpracti@94-255-217-215.cust.bredband2.com)
2021-12-07 11:37:21 +0100hskpractice(~hskpracti@94-255-217-215.cust.bredband2.com) (Remote host closed the connection)
2021-12-07 11:37:39 +0100hskpractice(~hskpracti@94-255-217-215.cust.bredband2.com)
2021-12-07 11:38:55 +0100xkuru(~xkuru@user/xkuru)
2021-12-07 11:41:06 +0100shailangsa(~shailangs@host86-186-136-27.range86-186.btcentralplus.com)
2021-12-07 11:43:07 +0100johnw(~johnw@2607:f6f0:3004:1:c8b4:50ff:fef8:6bf0) (Quit: ZNC - http://znc.in)
2021-12-07 11:43:43 +0100johnw(~johnw@2607:f6f0:3004:1:c8b4:50ff:fef8:6bf0)
2021-12-07 11:44:29 +0100Erutuon(~Erutuon@user/erutuon) (Ping timeout: 252 seconds)
2021-12-07 11:46:09 +0100hskpractice(~hskpracti@94-255-217-215.cust.bredband2.com) (Remote host closed the connection)
2021-12-07 11:46:26 +0100hskpractice(~hskpracti@94-255-217-215.cust.bredband2.com)
2021-12-07 11:47:37 +0100__monty__(~toonn@user/toonn)
2021-12-07 11:49:47 +0100raehik(~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net)
2021-12-07 11:52:23 +0100hskpractice(~hskpracti@94-255-217-215.cust.bredband2.com) (Remote host closed the connection)
2021-12-07 11:52:41 +0100hskpractice(~hskpracti@94-255-217-215.cust.bredband2.com)
2021-12-07 11:53:03 +0100merijn(~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 256 seconds)
2021-12-07 11:53:25 +0100jrm(~jrm@156.34.249.199)
2021-12-07 11:54:33 +0100merijn(~merijn@83-160-49-249.ip.xs4all.nl)
2021-12-07 11:54:43 +0100dschrempf(~dominik@070-207.dynamic.dsl.fonira.net) (Ping timeout: 265 seconds)
2021-12-07 11:58:38 +0100teo(~teo@user/teo)
2021-12-07 12:00:19 +0100whatsupdoc(uid509081@id-509081.hampstead.irccloud.com) (Quit: Connection closed for inactivity)
2021-12-07 12:03:44 +0100hskpractice(~hskpracti@94-255-217-215.cust.bredband2.com) (Remote host closed the connection)
2021-12-07 12:04:01 +0100hskpractice(~hskpracti@94-255-217-215.cust.bredband2.com)
2021-12-07 12:04:52 +0100merijn(~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 265 seconds)
2021-12-07 12:05:47 +0100merijn(~merijn@83-160-49-249.ip.xs4all.nl)
2021-12-07 12:06:37 +0100machinedgod(~machinedg@142.169.78.167) (Ping timeout: 240 seconds)
2021-12-07 12:08:17 +0100hskpractice(~hskpracti@94-255-217-215.cust.bredband2.com) (Remote host closed the connection)
2021-12-07 12:08:32 +0100machinedgod(~machinedg@135-23-192-217.cpe.pppoe.ca)
2021-12-07 12:08:35 +0100hskpractice(~hskpracti@94-255-217-215.cust.bredband2.com)
2021-12-07 12:09:16 +0100[itchyjunk](~itchyjunk@user/itchyjunk/x-7353470)
2021-12-07 12:11:01 +0100merijn(~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 240 seconds)
2021-12-07 12:11:30 +0100merijn(~merijn@83-160-49-249.ip.xs4all.nl)
2021-12-07 12:13:59 +0100burnsidesLlama(~burnsides@dhcp168-017.wadham.ox.ac.uk)
2021-12-07 12:15:37 +0100bollu(uid233390@id-233390.helmsley.irccloud.com) (Quit: Connection closed for inactivity)
2021-12-07 12:19:30 +0100hskpractice(~hskpracti@94-255-217-215.cust.bredband2.com) (Remote host closed the connection)
2021-12-07 12:19:47 +0100hskpractice(~hskpracti@94-255-217-215.cust.bredband2.com)
2021-12-07 12:21:27 +0100hskpractice(~hskpracti@94-255-217-215.cust.bredband2.com) (Remote host closed the connection)
2021-12-07 12:21:45 +0100hskpractice(~hskpracti@94-255-217-215.cust.bredband2.com)
2021-12-07 12:22:12 +0100merijn(~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 268 seconds)
2021-12-07 12:22:34 +0100Vajb(~Vajb@hag-jnsbng11-58c3a8-176.dhcp.inet.fi) (Read error: Connection reset by peer)
2021-12-07 12:22:52 +0100Vajb(~Vajb@nalkaylds2h97nzof-2.v6.elisa-mobile.fi)
2021-12-07 12:22:54 +0100merijn(~merijn@83-160-49-249.ip.xs4all.nl)
2021-12-07 12:24:08 +0100darchitect(~darchitec@2a00:23c6:3584:df00:7dec:bf13:8fa:748c)
2021-12-07 12:24:43 +0100pfurla(~pfurla@2804:14d:5c81:4104:91cd:1543:8918:bc14)
2021-12-07 12:26:23 +0100hskpractice(~hskpracti@94-255-217-215.cust.bredband2.com) (Remote host closed the connection)
2021-12-07 12:26:41 +0100hskpractice(~hskpracti@94-255-217-215.cust.bredband2.com)
2021-12-07 12:27:44 +0100geekosaur(~geekosaur@xmonad/geekosaur) (Remote host closed the connection)
2021-12-07 12:27:49 +0100merijn(~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 240 seconds)
2021-12-07 12:28:32 +0100ph88(~ph88@ip5f5af068.dynamic.kabel-deutschland.de)
2021-12-07 12:28:36 +0100merijn(~merijn@83-160-49-249.ip.xs4all.nl)
2021-12-07 12:28:36 +0100lavaman(~lavaman@98.38.249.169)
2021-12-07 12:29:35 +0100geekosaur(~geekosaur@xmonad/geekosaur)
2021-12-07 12:31:33 +0100perrierjouet(~perrier-j@modemcable012.251-130-66.mc.videotron.ca)
2021-12-07 12:33:13 +0100hskpractice(~hskpracti@94-255-217-215.cust.bredband2.com) (Remote host closed the connection)
2021-12-07 12:33:17 +0100lavaman(~lavaman@98.38.249.169) (Ping timeout: 256 seconds)
2021-12-07 12:33:30 +0100hskpractice(~hskpracti@94-255-217-215.cust.bredband2.com)
2021-12-07 12:33:46 +0100InternetCitizen(~fuzzypixe@eth-west-pareq2-46-193-4-100.wb.wifirst.net)
2021-12-07 12:33:52 +0100merijn(~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 265 seconds)
2021-12-07 12:34:08 +0100merijn(~merijn@83-160-49-249.ip.xs4all.nl)
2021-12-07 12:37:09 +0100hskpractice(~hskpracti@94-255-217-215.cust.bredband2.com) (Remote host closed the connection)
2021-12-07 12:37:27 +0100hskpractice(~hskpracti@94-255-217-215.cust.bredband2.com)
2021-12-07 12:39:25 +0100merijn(~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 240 seconds)
2021-12-07 12:39:51 +0100merijn(~merijn@83-160-49-249.ip.xs4all.nl)
2021-12-07 12:41:31 +0100hskpractice(~hskpracti@94-255-217-215.cust.bredband2.com) (Remote host closed the connection)
2021-12-07 12:41:48 +0100hskpractice(~hskpracti@94-255-217-215.cust.bredband2.com)
2021-12-07 12:42:10 +0100pfurla(~pfurla@2804:14d:5c81:4104:91cd:1543:8918:bc14) (Quit: gone to sleep. ZZZzzz…)
2021-12-07 12:42:27 +0100cosimone(~user@2001:b07:ae5:db26:c24a:d20:4d91:1e20)
2021-12-07 12:42:32 +0100thevishy(~Nishant@2405:201:f005:c007:a5d7:38b:39cd:e2ae)
2021-12-07 12:45:39 +0100hskpractice(~hskpracti@94-255-217-215.cust.bredband2.com) (Remote host closed the connection)
2021-12-07 12:45:57 +0100hskpractice(~hskpracti@94-255-217-215.cust.bredband2.com)
2021-12-07 12:47:01 +0100InternetCitizen(~fuzzypixe@eth-west-pareq2-46-193-4-100.wb.wifirst.net) (Ping timeout: 240 seconds)
2021-12-07 12:49:37 +0100hskpractice(~hskpracti@94-255-217-215.cust.bredband2.com) (Remote host closed the connection)
2021-12-07 12:49:55 +0100hskpractice(~hskpracti@94-255-217-215.cust.bredband2.com)
2021-12-07 12:50:18 +0100merijn(~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 265 seconds)
2021-12-07 12:50:56 +0100merijn(~merijn@83-160-49-249.ip.xs4all.nl)
2021-12-07 12:51:26 +0100Morrow(~quassel@bzq-110-168-31-106.red.bezeqint.net)
2021-12-07 12:52:10 +0100pfurla(~pfurla@2804:14d:5c81:4104:91cd:1543:8918:bc14)
2021-12-07 12:52:46 +0100jakalx(~jakalx@base.jakalx.net) ()
2021-12-07 12:53:02 +0100pfurla(~pfurla@2804:14d:5c81:4104:91cd:1543:8918:bc14) (Client Quit)
2021-12-07 12:53:46 +0100yauhsien(~yauhsien@61-231-32-247.dynamic-ip.hinet.net)
2021-12-07 12:53:49 +0100CiaoSen(~Jura@p200300c9570204002a3a4dfffe84dbd5.dip0.t-ipconnect.de) (Ping timeout: 240 seconds)
2021-12-07 12:55:49 +0100merijn(~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 240 seconds)
2021-12-07 12:56:39 +0100merijn(~merijn@83-160-49-249.ip.xs4all.nl)
2021-12-07 12:58:31 +0100yauhsien(~yauhsien@61-231-32-247.dynamic-ip.hinet.net) (Ping timeout: 265 seconds)
2021-12-07 12:59:51 +0100jakalx(~jakalx@base.jakalx.net)
2021-12-07 13:01:21 +0100pfurla(~pfurla@2804:14d:5c81:4104:91cd:1543:8918:bc14)
2021-12-07 13:07:11 +0100hskpractice(~hskpracti@94-255-217-215.cust.bredband2.com) (Remote host closed the connection)
2021-12-07 13:07:30 +0100hskpractice(~hskpracti@94-255-217-215.cust.bredband2.com)
2021-12-07 13:07:42 +0100merijn(~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 265 seconds)
2021-12-07 13:07:56 +0100merijn(~merijn@83-160-49-249.ip.xs4all.nl)
2021-12-07 13:08:03 +0100hskpractice(~hskpracti@94-255-217-215.cust.bredband2.com) (Remote host closed the connection)
2021-12-07 13:08:20 +0100hskpractice(~hskpracti@94-255-217-215.cust.bredband2.com)
2021-12-07 13:10:31 +0100pretty_dumm_guy(trottel@gateway/vpn/protonvpn/prettydummguy/x-88029655)
2021-12-07 13:12:07 +0100pavonia(~user@user/siracusa) (Quit: Bye!)
2021-12-07 13:12:53 +0100hskpractice(~hskpracti@94-255-217-215.cust.bredband2.com) (Ping timeout: 256 seconds)
2021-12-07 13:13:01 +0100merijn(~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 240 seconds)
2021-12-07 13:13:04 +0100 <phaazon> jle`: :D
2021-12-07 13:13:28 +0100 <phaazon> today’s AoC was interesting because my text solution for part 2 had an error :)
2021-12-07 13:13:36 +0100merijn(~merijn@83-160-49-249.ip.xs4all.nl)
2021-12-07 13:13:41 +0100 <phaazon> I still validated my output and it worked, so I know something was wrong with the text :D
2021-12-07 13:14:10 +0100 <hpc> AoC is just reaching new levels of programming authenticity
2021-12-07 13:18:43 +0100merijn(~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 252 seconds)
2021-12-07 13:19:09 +0100merijn(~merijn@83-160-49-249.ip.xs4all.nl)
2021-12-07 13:20:19 +0100 <phaazon> https://github.com/phaazon/advent-of-code-2021/blob/master/day07/src/main.rs today was quite boring actually
2021-12-07 13:20:27 +0100 <phaazon> I should rewrite it in Haskell for more fun!
2021-12-07 13:22:00 +0100pfurla(~pfurla@2804:14d:5c81:4104:91cd:1543:8918:bc14) (Quit: gone to sleep. ZZZzzz…)
2021-12-07 13:22:42 +0100LiaoTao(~LiaoTao@gateway/tor-sasl/liaotao) (Ping timeout: 276 seconds)
2021-12-07 13:25:06 +0100yaroot(~yaroot@2409:12:ac0:2300:680e:dbff:fe1e:4953) (Ping timeout: 268 seconds)
2021-12-07 13:26:01 +0100yaroot(~yaroot@175.0.30.125.dy.iij4u.or.jp)
2021-12-07 13:27:41 +0100nfd(~nfd@user/nfd) (Ping timeout: 256 seconds)
2021-12-07 13:28:18 +0100CiaoSen(~Jura@p200300c9570204002a3a4dfffe84dbd5.dip0.t-ipconnect.de)
2021-12-07 13:29:24 +0100yaroot(~yaroot@175.0.30.125.dy.iij4u.or.jp) (Remote host closed the connection)
2021-12-07 13:29:27 +0100merijn(~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 265 seconds)
2021-12-07 13:30:06 +0100yaroot(~yaroot@175.0.30.125.dy.iij4u.or.jp)
2021-12-07 13:30:26 +0100merijn(~merijn@83-160-49-249.ip.xs4all.nl)
2021-12-07 13:35:25 +0100merijn(~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 240 seconds)
2021-12-07 13:36:12 +0100merijn(~merijn@83-160-49-249.ip.xs4all.nl)
2021-12-07 13:36:27 +0100 <aplainzetakind> phaazon: I think today's problem is very interesting.
2021-12-07 13:40:10 +0100pfurla(~pfurla@2804:14d:5c81:4104:91cd:1543:8918:bc14)
2021-12-07 13:40:15 +0100hskpractice(~hskpracti@94-255-217-215.cust.bredband2.com)
2021-12-07 13:41:27 +0100merijn(~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 252 seconds)
2021-12-07 13:41:28 +0100tromp(~textual@dhcp-077-249-230-040.chello.nl) (Quit: Textual IRC Client: www.textualapp.com)
2021-12-07 13:41:51 +0100merijn(~merijn@83-160-49-249.ip.xs4all.nl)
2021-12-07 13:44:01 +0100juhp(~juhp@128.106.188.82) (Quit: juhp)
2021-12-07 13:44:14 +0100juhp(~juhp@128.106.188.82)
2021-12-07 13:44:37 +0100hskpractice(~hskpracti@94-255-217-215.cust.bredband2.com) (Ping timeout: 256 seconds)
2021-12-07 13:48:25 +0100mvk(~mvk@2607:fea8:5cdd:f000::9788) (Ping timeout: 252 seconds)
2021-12-07 13:50:07 +0100hltk(~hltk@hltk.fi)
2021-12-07 13:50:49 +0100 <phaazon> aplainzetakind: for quadratic, it’s not
2021-12-07 13:51:00 +0100 <phaazon> for the linear solution, yeah, probably
2021-12-07 13:51:05 +0100 <fendor[m]> Shout-out to aeson-combinators, I love this library
2021-12-07 13:51:09 +0100 <phaazon> but I haven’t really looked into it
2021-12-07 13:52:02 +0100yauhsien(~yauhsien@61-231-32-247.dynamic-ip.hinet.net)
2021-12-07 13:52:10 +0100merijn(~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 265 seconds)
2021-12-07 13:52:15 +0100 <aplainzetakind> Yes, to solve it somehow is boring. But I'm hung up on thinking about part 2.
2021-12-07 13:52:39 +0100 <hltk> hi guys, i was solving today's advent of code problem with my friend, and we were wondering whether it would be possible to avoid some of the lambdas used in the following code
2021-12-07 13:52:42 +0100 <hltk> ja emmä Roopea voita :E
2021-12-07 13:52:48 +0100 <hltk> solve dist = foldl1 min $ map (\i -> sum $ map (\x -> dist $ abs $ x-i) l) [0..1000]
2021-12-07 13:53:04 +0100merijn(~merijn@83-160-49-249.ip.xs4all.nl)
2021-12-07 13:53:47 +0100 <aplainzetakind> hltk -> #adventofcode-spoilers
2021-12-07 13:54:37 +0100xkuru(~xkuru@user/xkuru) (Remote host closed the connection)
2021-12-07 13:55:23 +0100xkuru(~xkuru@user/xkuru)
2021-12-07 13:56:37 +0100yauhsien(~yauhsien@61-231-32-247.dynamic-ip.hinet.net) (Ping timeout: 240 seconds)
2021-12-07 13:56:38 +0100 <aplainzetakind> :t minimum
2021-12-07 13:56:39 +0100 <lambdabot> (Foldable t, Ord a) => t a -> a
2021-12-07 13:58:17 +0100merijn(~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 256 seconds)
2021-12-07 13:58:39 +0100merijn(~merijn@83-160-49-249.ip.xs4all.nl)
2021-12-07 13:58:57 +0100pfurla(~pfurla@2804:14d:5c81:4104:91cd:1543:8918:bc14) (Quit: gone to sleep. ZZZzzz…)
2021-12-07 14:01:26 +0100max22-(~maxime@lfbn-ren-1-762-224.w81-53.abo.wanadoo.fr) (Ping timeout: 252 seconds)
2021-12-07 14:01:41 +0100user0(~aj@129.205.7.82)
2021-12-07 14:02:05 +0100burnsidesLlama(~burnsides@dhcp168-017.wadham.ox.ac.uk) (Remote host closed the connection)
2021-12-07 14:02:08 +0100tromp(~textual@dhcp-077-249-230-040.chello.nl)
2021-12-07 14:02:48 +0100user01(~aj@154.0.137.32) (Ping timeout: 265 seconds)
2021-12-07 14:04:31 +0100hskpractice(~hskpracti@94-255-217-215.cust.bredband2.com)
2021-12-07 14:05:58 +0100dschrempf(~dominik@070-207.dynamic.dsl.fonira.net)
2021-12-07 14:07:45 +0100mc47(~mc47@xmonad/TheMC47)
2021-12-07 14:07:51 +0100dschrempf(~dominik@070-207.dynamic.dsl.fonira.net) (Client Quit)
2021-12-07 14:08:59 +0100hskpractice(~hskpracti@94-255-217-215.cust.bredband2.com) (Ping timeout: 256 seconds)
2021-12-07 14:09:05 +0100merijn(~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 265 seconds)
2021-12-07 14:10:00 +0100merijn(~merijn@83-160-49-249.ip.xs4all.nl)
2021-12-07 14:15:11 +0100merijn(~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 252 seconds)
2021-12-07 14:15:51 +0100merijn(~merijn@83-160-49-249.ip.xs4all.nl)
2021-12-07 14:19:15 +0100pfurla(~pfurla@2804:14d:5c81:4104:91cd:1543:8918:bc14)
2021-12-07 14:21:10 +0100merijn(~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 265 seconds)
2021-12-07 14:21:26 +0100merijn(~merijn@83-160-49-249.ip.xs4all.nl)
2021-12-07 14:22:06 +0100hskpractice(~hskpracti@94-255-217-215.cust.bredband2.com)
2021-12-07 14:22:46 +0100timCF(~timCF@m91-129-100-224.cust.tele2.ee)
2021-12-07 14:25:53 +0100Kaipi(~Kaiepi@156.34.44.192)
2021-12-07 14:27:22 +0100hskpractice(~hskpracti@94-255-217-215.cust.bredband2.com) (Remote host closed the connection)
2021-12-07 14:27:25 +0100Kaiepi(~Kaiepi@156.34.44.192) (Ping timeout: 240 seconds)
2021-12-07 14:27:27 +0100user01(~aj@154.0.137.32)
2021-12-07 14:27:40 +0100hskpractice(~hskpracti@94-255-217-215.cust.bredband2.com)
2021-12-07 14:28:31 +0100 <timCF> Hello! Is there some easy/standard way to unlift type to a value level? For something like `data Role = Maker | Taker` and `newtype Fee (role :: Role) = Fee Rational` I want a function like `roleOf :: a (role :: Role) -> Role`. First idea is just to have a class `RoleOf` and implement it for `Fee 'Maker` and `Fee 'Taker` but it does not look very ergonomic, maybe there is easier or more generic way?
2021-12-07 14:28:54 +0100user0(~aj@129.205.7.82) (Ping timeout: 265 seconds)
2021-12-07 14:28:55 +0100 <dminuoso> timCF: Welcome to `singletons`
2021-12-07 14:29:13 +0100 <timCF> :)
2021-12-07 14:29:16 +0100desantra(~skykanin@user/skykanin) (Quit: WeeChat 3.3)
2021-12-07 14:29:23 +0100slowButPresent(~slowButPr@user/slowbutpresent)
2021-12-07 14:29:37 +0100 <timCF> dminuoso: probably I can't ignore existence of this library anymore)
2021-12-07 14:30:46 +0100 <dminuoso> timCF: In singletons you'd just use `fromSing` or `demote`
2021-12-07 14:30:47 +0100Vajb(~Vajb@nalkaylds2h97nzof-2.v6.elisa-mobile.fi) (Read error: Connection reset by peer)
2021-12-07 14:32:02 +0100Vajb(~Vajb@hag-jnsbng11-58c3a8-176.dhcp.inet.fi)
2021-12-07 14:32:24 +0100 <tomsmeding> though you can do the same thing by hand
2021-12-07 14:32:50 +0100 <dminuoso> Yeah. I mean at the end the ergonomics in singletons comes with a typeclass and an associated tyfam
2021-12-07 14:33:12 +0100 <dminuoso> class SingKind k where type Demote k = (r :: Type) | r -> k; fromSing :: Sing (a :: k) -> Demote k; toSing :: Demote k -> SomeSing k
2021-12-07 14:33:23 +0100 <dminuoso> You may not even need the `toSing` part
2021-12-07 14:33:23 +0100 <tomsmeding> you can use a class as you wrote, or if you want to pass around the evidence manually, "data RoleS a where MakerS :: RoleS 'Maker ; TakerS :: RoleS 'Taker", then pass that around
2021-12-07 14:33:31 +0100 <merijn> timCF: RIP your mental health xD
2021-12-07 14:33:32 +0100 <tomsmeding> that GADT is a link between type-level and value-level
2021-12-07 14:33:33 +0100Pickchea(~private@user/pickchea)
2021-12-07 14:33:54 +0100 <merijn> If I never have to use singletons again, I'll be so happy :p
2021-12-07 14:34:15 +0100mmhat(~mmh@55d4422a.access.ecotel.net)
2021-12-07 14:34:49 +0100 <dminuoso> How do I make lambdabot recite remembered quotes?
2021-12-07 14:35:07 +0100burnsidesLlama(~burnsides@dhcp168-017.wadham.ox.ac.uk)
2021-12-07 14:35:31 +0100 <merijn> @quote
2021-12-07 14:35:32 +0100 <lambdabot> taktoa says: "OOP is pseudoscience"
2021-12-07 14:35:42 +0100 <merijn> optionall with a name and substring
2021-12-07 14:35:45 +0100 <merijn> @quote merijn
2021-12-07 14:35:45 +0100 <lambdabot> merijn says: I like how C-beginners is "I wanna read a file from disk" and #haskell-beginers is all "Yeah, I don't quite understand higher abstract mathematics" ;)
2021-12-07 14:35:57 +0100 <merijn> @quote merijn standard.time
2021-12-07 14:35:57 +0100 <lambdabot> merijn says: I run on HST (Hacker Standard Time) which is essentially current time zone -3
2021-12-07 14:36:08 +0100 <dminuoso> @quote awpr
2021-12-07 14:36:09 +0100 <lambdabot> awpr says: when I write idris, I just write my bugs at the type level instead
2021-12-07 14:36:18 +0100 <dminuoso> This came to mind when thinking about singletons.
2021-12-07 14:36:58 +0100 <tomsmeding> merijn: is the dot a glob *, or something else?
2021-12-07 14:37:26 +0100 <merijn> tomsmeding: no clue
2021-12-07 14:37:35 +0100 <merijn> I think it's just a space?
2021-12-07 14:37:38 +0100 <merijn> @quote merijn standard time
2021-12-07 14:37:38 +0100 <lambdabot> merijn says: I run on HST (Hacker Standard Time) which is essentially current time zone -3
2021-12-07 14:37:53 +0100 <timCF> Hmm, I still have no idea are singletons good or bad, before avoided this library because of big readme, kinda learning this feels like investment)
2021-12-07 14:37:57 +0100 <merijn> might just be historical reasons that was necessary and no obsolete
2021-12-07 14:38:24 +0100 <merijn> timCF: It's not that singletons is bad. It's that "singletons" implies you're trying to do way too much on the type level and *that* is bad
2021-12-07 14:38:51 +0100 <merijn> because IMO it's almost never worth it in Haskell
2021-12-07 14:40:01 +0100burnsidesLlama(~burnsides@dhcp168-017.wadham.ox.ac.uk) (Ping timeout: 265 seconds)
2021-12-07 14:40:16 +0100FinnElija(~finn_elij@user/finn-elija/x-0085643) (Remote host closed the connection)
2021-12-07 14:40:40 +0100FinnElija(~finn_elij@user/finn-elija/x-0085643)
2021-12-07 14:41:01 +0100 <tomsmeding> @quote merijn wanna.*beg.*abs
2021-12-07 14:41:02 +0100 <lambdabot> merijn says: I like how C-beginners is "I wanna read a file from disk" and #haskell-beginers is all "Yeah, I don't quite understand higher abstract mathematics" ;)
2021-12-07 14:41:05 +0100 <tomsmeding> it's a regex
2021-12-07 14:41:19 +0100 <tomsmeding> https://github.com/lambdabot/lambdabot/blob/master/lambdabot-novelty-plugins/src/Lambdabot/Plugin/…
2021-12-07 14:41:29 +0100 <merijn> I don't recall saying that, tbh. but then it's not the only quote of mine I don't recall :p
2021-12-07 14:42:48 +0100 <timCF> merijn: I've heard exactly the same when I was introducing typed-like compile-time computations in Elixir with macros, at some point my co-workers mostly stopped understanding my code :)
2021-12-07 14:43:41 +0100shriekingnoise(~shrieking@186.137.144.80)
2021-12-07 14:44:42 +0100 <merijn> timCF: The thing is that doing stuff at the type level in Haskell is often tedious and makes code overly rigid, which means refactoring becomes a pain. Often you can get, like, 80-90% of the benefit with some focus on "make illegal values irrepresentible" and some minimal error checking/reporting
2021-12-07 14:46:22 +0100hskpractice(~hskpracti@94-255-217-215.cust.bredband2.com) (Remote host closed the connection)
2021-12-07 14:46:39 +0100hskpractice(~hskpracti@94-255-217-215.cust.bredband2.com)
2021-12-07 14:48:19 +0100hskpractice(~hskpracti@94-255-217-215.cust.bredband2.com) (Remote host closed the connection)
2021-12-07 14:48:37 +0100hskpractice(~hskpracti@94-255-217-215.cust.bredband2.com)
2021-12-07 14:49:21 +0100 <dminuoso> Never forget the maintenance cost and readability cost of fancy tricks.
2021-12-07 14:49:55 +0100AndreasK(sid320732@id-320732.uxbridge.irccloud.com)
2021-12-07 14:50:37 +0100 <merijn> You can have a statically enforced invariant at the type level! Or you can just write 1 function that checks preconditions and converts to a safe datatype with type "... -> Either MyError Result"
2021-12-07 14:51:04 +0100 <dminuoso> The difficult thing is, this is a gradual road. At first you start with DataKinds and phantom types, and this seems like a brilliant idea. Then you realize, you might want higher kinded data types with tyfams that translate those phantom types into say functors, and gradually you increase complexity without even noticing it.
2021-12-07 14:51:21 +0100bitdex(~bitdex@gateway/tor-sasl/bitdex) (Quit: = "")
2021-12-07 14:51:47 +0100 <merijn> And before you know it compilation takes 1 hour and refactoring is near impossible, because it breaks all type level invariants :p
2021-12-07 14:52:00 +0100 <dminuoso> timCF: And remember, every additional type-level trick you introduce is going to drastically reduce the quality of compiler errors if you or anyone else either trips a bug, or trips something you didn't think of before.
2021-12-07 14:52:18 +0100 <dminuoso> With Haskell, type level programming requires a wizard to understand what error messages mean
2021-12-07 14:52:34 +0100Pickchea(~private@user/pickchea) (Quit: Leaving)
2021-12-07 14:53:12 +0100 <dminuoso> Here's the latest result from `optics`, which is a version of `lens` that tries to hide the type level machinery and expose human readable type errors... using type level machinery:
2021-12-07 14:53:16 +0100yauhsien(~yauhsien@61-231-32-247.dynamic-ip.hinet.net)
2021-12-07 14:53:33 +0100 <dminuoso> • A_Lens cannot be composed with A_Lens
2021-12-07 14:54:11 +0100 <dminuoso> There you have a bug in the type level machinery that tries to hide the other, way more complicated, type level machinery, from the user. What am I to make of this?
2021-12-07 14:55:14 +0100Kauto(~Kauto@wireless-student-pt10-183-60.lut.ac.uk)
2021-12-07 14:55:27 +0100 <merijn> I mean, a lot of these tricks *are* useful. But type level hackery are like spices. A little can go a long way and the trick is learning which you need and when :p
2021-12-07 14:56:04 +0100 <dminuoso> Yeah, and its hard to know when you crossed that river.
2021-12-07 14:56:27 +0100 <dminuoso> My rule has been to avoid the temptation of type level tricks.
2021-12-07 14:58:13 +0100yauhsien(~yauhsien@61-231-32-247.dynamic-ip.hinet.net) (Ping timeout: 268 seconds)
2021-12-07 14:59:53 +0100hskpractice(~hskpracti@94-255-217-215.cust.bredband2.com) (Remote host closed the connection)
2021-12-07 15:00:10 +0100hskpractice(~hskpracti@94-255-217-215.cust.bredband2.com)
2021-12-07 15:00:36 +0100Kauto(~Kauto@wireless-student-pt10-183-60.lut.ac.uk) (Quit: Client closed)
2021-12-07 15:02:50 +0100max22-(~maxime@2a01cb08833598007c67d5d567ef7941.ipv6.abo.wanadoo.fr)
2021-12-07 15:04:30 +0100hskpractice(~hskpracti@94-255-217-215.cust.bredband2.com) (Remote host closed the connection)
2021-12-07 15:04:47 +0100hskpractice(~hskpracti@94-255-217-215.cust.bredband2.com)
2021-12-07 15:06:27 +0100hskpractice(~hskpracti@94-255-217-215.cust.bredband2.com) (Remote host closed the connection)
2021-12-07 15:06:45 +0100hskpractice(~hskpracti@94-255-217-215.cust.bredband2.com)
2021-12-07 15:07:16 +0100burnsidesLlama(~burnsides@dhcp168-017.wadham.ox.ac.uk)
2021-12-07 15:07:44 +0100Super11(~Super11@wireless-student-pt10-183-60.lut.ac.uk)
2021-12-07 15:08:25 +0100stef204(~stef204@user/stef204)
2021-12-07 15:10:42 +0100timCF(~timCF@m91-129-100-224.cust.tele2.ee) (Quit: leaving)
2021-12-07 15:12:59 +0100hskpractice(~hskpracti@94-255-217-215.cust.bredband2.com) (Remote host closed the connection)
2021-12-07 15:13:17 +0100hskpractice(~hskpracti@94-255-217-215.cust.bredband2.com)
2021-12-07 15:14:30 +0100kronicmage(user91577@neotame.csclub.uwaterloo.ca)
2021-12-07 15:19:13 +0100hskpractice(~hskpracti@94-255-217-215.cust.bredband2.com) (Remote host closed the connection)
2021-12-07 15:19:31 +0100hskpractice(~hskpracti@94-255-217-215.cust.bredband2.com)
2021-12-07 15:23:11 +0100hskpractice(~hskpracti@94-255-217-215.cust.bredband2.com) (Remote host closed the connection)
2021-12-07 15:23:11 +0100max22-(~maxime@2a01cb08833598007c67d5d567ef7941.ipv6.abo.wanadoo.fr) (Remote host closed the connection)
2021-12-07 15:23:28 +0100max22-(~maxime@2a01cb08833598005e821d007c542121.ipv6.abo.wanadoo.fr)
2021-12-07 15:23:29 +0100hskpractice(~hskpracti@94-255-217-215.cust.bredband2.com)
2021-12-07 15:24:24 +0100slack1256(~slack1256@191.125.99.210)
2021-12-07 15:25:33 +0100kennyd(~bc8165b6@cerf.good1.com)
2021-12-07 15:27:13 +0100hskpractice(~hskpracti@94-255-217-215.cust.bredband2.com) (Remote host closed the connection)
2021-12-07 15:27:31 +0100hskpractice(~hskpracti@94-255-217-215.cust.bredband2.com)
2021-12-07 15:28:00 +0100 <boxscape> % -1 `mod` 3
2021-12-07 15:28:01 +0100 <yahb> boxscape: -1
2021-12-07 15:28:33 +0100quickquack(~quickquac@190.18.214.197)
2021-12-07 15:28:34 +0100systemhalted(~systemhal@130.51.137.77)
2021-12-07 15:28:41 +0100boxscape_(~boxscape_@p4ff0bb6c.dip0.t-ipconnect.de)
2021-12-07 15:29:03 +0100 <boxscape_> % :set -XLexicalNegation
2021-12-07 15:29:03 +0100 <yahb> boxscape_:
2021-12-07 15:29:10 +0100 <boxscape_> % -1 mod 3
2021-12-07 15:29:10 +0100 <yahb> boxscape_: ; <interactive>:10:1: error:; * Could not deduce (Integral a0); from the context: (Integral a, Num t, Num ((a -> a -> a) -> t -> t1)); bound by the inferred type for `it':; forall {a} {t} {t1}. (Integral a, Num t, Num ((a -> a -> a) -> t -> t1)) => t1; at <interactive>:10:1-8; The type variable `a0' is ambiguous; * In the ambiguity check for the infer
2021-12-07 15:29:15 +0100 <boxscape_> % -1 `mod` 3
2021-12-07 15:29:15 +0100 <yahb> boxscape_: 2
2021-12-07 15:29:33 +0100 <boxscape_> pop quiz: With LexicalNegation, what has higher precedence - record updates or negation?
2021-12-07 15:32:09 +0100systemhalted(~systemhal@130.51.137.77) (Remote host closed the connection)
2021-12-07 15:33:03 +0100waleee(~waleee@2001:9b0:216:8200:d457:9189:7843:1dbd)
2021-12-07 15:35:33 +0100 <Super11> hello everyone, haskell beginner here. I'm trying to create a function that would take 2 string and for when they have the same letters they would be replaced with asterixes, for example findReplace "abc" "abcd" = "***" here is my code so far https://paste.tomsmeding.com/tLcdDDLD any help would be great
2021-12-07 15:35:35 +0100lavaman(~lavaman@98.38.249.169)
2021-12-07 15:36:08 +0100wroathe(~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
2021-12-07 15:36:08 +0100wroathe(~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Changing host)
2021-12-07 15:36:08 +0100wroathe(~wroathe@user/wroathe)
2021-12-07 15:37:55 +0100hskpractice(~hskpracti@94-255-217-215.cust.bredband2.com) (Remote host closed the connection)
2021-12-07 15:38:12 +0100hskpractice(~hskpracti@94-255-217-215.cust.bredband2.com)
2021-12-07 15:39:52 +0100hskpractice(~hskpracti@94-255-217-215.cust.bredband2.com) (Remote host closed the connection)
2021-12-07 15:40:10 +0100hskpractice(~hskpracti@94-255-217-215.cust.bredband2.com)
2021-12-07 15:40:11 +0100doyougnu(~doyougnu@c-73-25-202-122.hsd1.or.comcast.net)
2021-12-07 15:40:26 +0100lavaman(~lavaman@98.38.249.169) (Ping timeout: 265 seconds)
2021-12-07 15:40:52 +0100 <geekosaur> boxscape_, since LexicalNegation is done in the lexer, I'd expect it to have highest "precedence"
2021-12-07 15:41:47 +0100 <geekosaur> (more correctly, precedence doesn't apply: the number is actually lexed as negative instead of a "negate" being inserted into the token stream)
2021-12-07 15:42:47 +0100 <boxscape> geekosaur: Nope, -x {a = 100} is parsed as -(x {a = 100}). Which is nice actually, because that means it also makes sense for record creation, i.e. -A {a = 100} is parsed the same way
2021-12-07 15:42:54 +0100 <boxscape> wait
2021-12-07 15:43:02 +0100 <boxscape> let me make sure I actually had -XLexicalNegation enabled :)
2021-12-07 15:43:15 +0100 <boxscape> yes
2021-12-07 15:43:19 +0100 <geekosaur> that's not LexicalNegation though, as I understand it
2021-12-07 15:43:24 +0100 <geekosaur> it's still a negate token
2021-12-07 15:44:06 +0100 <boxscape> oh, so LexicalNegation only affects literals?
2021-12-07 15:44:13 +0100 <geekosaur> as I understand it, yes
2021-12-07 15:44:20 +0100 <boxscape> I see
2021-12-07 15:44:21 +0100 <geekosaur> I may be wrong but that's my impression
2021-12-07 15:45:14 +0100 <boxscape> % let x = 1 in -x `mod` 3
2021-12-07 15:45:14 +0100 <yahb> boxscape: -1
2021-12-07 15:45:29 +0100lbseale(~ep1ctetus@user/ep1ctetus)
2021-12-07 15:45:45 +0100 <boxscape> % :set -XLexicalNegation
2021-12-07 15:45:46 +0100 <yahb> boxscape:
2021-12-07 15:45:57 +0100 <boxscape> % let x = 1 in -x `mod` 3
2021-12-07 15:45:57 +0100 <yahb> boxscape: -1
2021-12-07 15:46:01 +0100 <boxscape> hmm
2021-12-07 15:46:09 +0100 <boxscape> I'm getting a different result in ghc 9.2.1
2021-12-07 15:46:39 +0100 <geekosaur> mm, I'mtrying to decipher what the manual actually says. "NegativeLiterals is a subset of LexicalNegation such that enabling both is the same as LexicalNegation" (from the 9.2.1 manual)
2021-12-07 15:48:12 +0100 <boxscape> it seems to apply to non-literals in 9.2.1, in any case
2021-12-07 15:48:14 +0100 <geekosaur> ok, so rereading all of this, negative *literals* are in fact handled the way I said but LexicalNegation changes how negation is lexed. so I guess what I said is still true
2021-12-07 15:48:36 +0100kennyd(~bc8165b6@cerf.good1.com) (Quit: CGI:IRC (Ping timeout))
2021-12-07 15:48:47 +0100 <geekosaur> still inbserts a negate token for nonliterals, it just changes the rules for doing so
2021-12-07 15:48:55 +0100 <boxscape> I see
2021-12-07 15:49:20 +0100 <geekosaur> and negate will still have its usual precedence
2021-12-07 15:49:49 +0100kennyd(~bc8165b6@cerf.good1.com)
2021-12-07 15:50:32 +0100bollu(uid233390@id-233390.helmsley.irccloud.com)
2021-12-07 15:51:17 +0100 <cigsender> et serviceTypeForm :: Form ServiceType
2021-12-07 15:51:17 +0100 <cigsender> serviceTypeForm csrf = do
2021-12-07 15:51:17 +0100 <cigsender> ServiceType{..} <- lift $ getServiceType w
2021-12-07 15:51:17 +0100 <cigsender> tadServiceTypes <-
2021-12-07 15:51:17 +0100 <cigsender> lift . fmap mkOptionList . keyOptions $ [ Training , LanguageInstruction
2021-12-07 15:51:37 +0100wroathe(~wroathe@user/wroathe) (Ping timeout: 252 seconds)
2021-12-07 15:51:39 +0100 <Hecate> cigsender: nice
2021-12-07 15:51:41 +0100 <boxscape> yeah, okay, `-4 {a = 12}` is parsed differently from `-A {a = 12}`
2021-12-07 15:52:23 +0100zer0bitz(~zer0bitz@dsl-hkibng32-54fbfb-173.dhcp.inet.fi)
2021-12-07 15:52:31 +0100mcgroin(~mcgroin@roc37-h01-176-170-197-243.dsl.sta.abo.bbox.fr) (Ping timeout: 265 seconds)
2021-12-07 15:53:05 +0100ezzieyguywuf(~Unknown@user/ezzieyguywuf) (Read error: Connection reset by peer)
2021-12-07 15:53:21 +0100ezzieyguywuf(~Unknown@user/ezzieyguywuf)
2021-12-07 15:54:48 +0100eggplantade(~Eggplanta@2600:1700:bef1:5e10:b5e5:6571:976d:7afc)
2021-12-07 15:54:57 +0100 <cigsender> ugh, sorry
2021-12-07 15:57:22 +0100 <fizbin> Hey, does anyone know a nicer name for / nicer way to write this function? {someFunc :: (a -> a -> a) -> Maybe a -> Maybe a -> Maybe a; someFunc _ Nothing x = x; someFunc _ x Nothing = x; someFunc f a b = f <$> a <*> b}
2021-12-07 15:58:13 +0100 <merijn> liftA2 f? :p
2021-12-07 15:58:17 +0100 <aplainzetakind> f <$> ma <*> mb
2021-12-07 15:58:18 +0100 <merijn> :t liftA2
2021-12-07 15:58:19 +0100 <lambdabot> Applicative f => (a -> b -> c) -> f a -> f b -> f c
2021-12-07 15:58:29 +0100 <fizbin> If 'a' has a Semigroup instance, then 'someFunc (<>)' is just (<>) in 'Maybe a'
2021-12-07 15:58:52 +0100 <merijn> oh, wait
2021-12-07 15:59:21 +0100 <fizbin> Yeah, that does the wrong thing with Nothing values.
2021-12-07 15:59:38 +0100 <merijn> How about: 'someFunc f x y = (f <$> x <*> y) <|> x <|> y'
2021-12-07 15:59:48 +0100 <fizbin> It's a bit like 'unionWith' that you find on many container types.
2021-12-07 15:59:53 +0100eggplantade(~Eggplanta@2600:1700:bef1:5e10:b5e5:6571:976d:7afc) (Ping timeout: 268 seconds)
2021-12-07 16:00:19 +0100 <merijn> Alternately: 'asum [ f <$> x <*> y, x, y ]'
2021-12-07 16:01:06 +0100 <geekosaur> meanwhile Super11 is still waiting for help…
2021-12-07 16:01:19 +0100MoC(~moc@user/moc)
2021-12-07 16:01:36 +0100 <fizbin> Hrm. I wonder, is (\f x y -> (f <$> x <*> y) <|> x <|> y) the same as "unionWith" on those map-like containers that define "unionWith"?
2021-12-07 16:01:46 +0100 <merijn> geekosaur: If it's not in my scrollback when I switch to my terminal, it doesn't exist :)
2021-12-07 16:02:27 +0100 <cigsender> Super11: do they need to be in the same position, same order, or just show up?
2021-12-07 16:02:52 +0100 <Super11> Just show up (y)
2021-12-07 16:03:39 +0100 <cigsender> have you seen Data.List.elem ?
2021-12-07 16:03:42 +0100 <cigsender> :t elem
2021-12-07 16:03:43 +0100 <lambdabot> (Foldable t, Eq a) => a -> t a -> Bool
2021-12-07 16:03:54 +0100 <cigsender> :t elem @[]
2021-12-07 16:03:55 +0100 <lambdabot> error:
2021-12-07 16:03:55 +0100 <lambdabot> Pattern syntax in expression context: elem@[]
2021-12-07 16:03:55 +0100 <lambdabot> Did you mean to enable TypeApplications?
2021-12-07 16:03:56 +0100 <Super11> I'm not allowed to use any modules like data.list unfortunately
2021-12-07 16:04:02 +0100 <Super11> I did read about it
2021-12-07 16:04:24 +0100 <Super11> hence I've tried to make my own function
2021-12-07 16:04:36 +0100 <cigsender> how did you define isIn?
2021-12-07 16:04:56 +0100 <geekosaur> @index elem
2021-12-07 16:04:56 +0100 <lambdabot> Data.Foldable, Data.List, Prelude, GHC.OldList, Data.ByteString.Lazy.Char8, Data.ByteString.Lazy, Data.ByteString.Char8, Data.ByteString
2021-12-07 16:05:03 +0100 <geekosaur> it's in the Prelude
2021-12-07 16:05:22 +0100 <Super11> isIn :: Char -> String -> Bool as it will be a True or false
2021-12-07 16:05:47 +0100 <fizbin> Okay, that's the type of isIn. What's the definition?
2021-12-07 16:07:07 +0100 <raehik> % zipWith (\a b -> if a == b then '*' then b) "abc "abcd"
2021-12-07 16:07:07 +0100 <yahb> raehik: ; <interactive>:18:37: error: parse error on input `then'
2021-12-07 16:07:14 +0100 <raehik> % zipWith (\a b -> if a == b then '*' then b) "abc" "abcd"
2021-12-07 16:07:14 +0100 <yahb> raehik: ; <interactive>:19:37: error: parse error on input `then'
2021-12-07 16:07:24 +0100 <Super11> Oh, I haven't written it since I didn't think I had to as it would just be within the function. I tried to pattern match it if there was an empty list underneath but it didnt work so sorry if thats made me look a bit silly
2021-12-07 16:07:32 +0100 <raehik> % zipWith (\a b -> if a == b then '*' else b) "abc" "abcd"
2021-12-07 16:07:33 +0100 <yahb> raehik: "***"
2021-12-07 16:07:52 +0100 <raehik> sry for spam. Super11 , is that close to what you asked for before?
2021-12-07 16:08:00 +0100wroathe(~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
2021-12-07 16:08:00 +0100wroathe(~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Changing host)
2021-12-07 16:08:00 +0100wroathe(~wroathe@user/wroathe)
2021-12-07 16:08:01 +0100 <fizbin> Super11: Also, you're going to need a base case for your findReplace function; something like "findReplace [] _ = somestuffhere"
2021-12-07 16:08:04 +0100polezaivsani(~polezaivs@orangeshoelaces.net)
2021-12-07 16:08:07 +0100 <cigsender> raehik, they specifically said order didn't matter
2021-12-07 16:08:30 +0100 <raehik> ohh thank you cigsender I had focused on the example
2021-12-07 16:08:42 +0100 <cigsender> <3
2021-12-07 16:08:44 +0100 <Super11> fizbin yeah I did have one but forgot to copy it
2021-12-07 16:08:58 +0100 <Super11> since I just put the function in my paste
2021-12-07 16:09:24 +0100 <fizbin> Okay, so if you define "isIn" properly, and have a base case for when the first argument is [], that should work.
2021-12-07 16:10:28 +0100 <fizbin> So now, how to define isIn. First, if I were doing this I would spell "isIn" as "elem", since "elem" is a function in the haskell Prelude as basic as "head" or "last".
2021-12-07 16:10:45 +0100 <Super11> ok
2021-12-07 16:10:50 +0100 <Super11> I'll get to that then so
2021-12-07 16:11:24 +0100 <Super11> so elem :: Char -> String -> Bool
2021-12-07 16:12:44 +0100 <fizbin> It's more general than that, but yes. (it applies to any list, and in fact to any "Traversable"; lists are just one kind of Traversable)
2021-12-07 16:12:49 +0100wroathe(~wroathe@user/wroathe) (Ping timeout: 265 seconds)
2021-12-07 16:13:00 +0100 <Super11> since I have elem taking the Char and String within findReplace, how would I go about defining it then? sorry for being a bit confused
2021-12-07 16:13:24 +0100 <cigsender> elem thisOne [] = _; elem thisOne (x : xs) = _
2021-12-07 16:13:38 +0100 <fizbin> Oh, what I'm saying is that you don't need to define "elem" since it's built-in.
2021-12-07 16:13:44 +0100 <Super11> oh right
2021-12-07 16:13:45 +0100 <cigsender> pattern matching on lists, a list is either empty or has a head and another list
2021-12-07 16:14:18 +0100 <Super11> so if elem is built in, how would i use it within my function?
2021-12-07 16:14:31 +0100 <fizbin> But if you *had* to define it, you would start the way cigsender said.
2021-12-07 16:14:38 +0100 <Super11> right
2021-12-07 16:15:04 +0100 <fizbin> Instead of "if isIn x ys then" you'd say "if elem x ys then"
2021-12-07 16:15:22 +0100 <Super11> gotcha
2021-12-07 16:16:08 +0100 <Super11> so it seems elem is a quite powerful built in function from reading this
2021-12-07 16:16:34 +0100geekosaur(~geekosaur@xmonad/geekosaur) (Ping timeout: 256 seconds)
2021-12-07 16:17:26 +0100 <fizbin> Eh. If you have "a" and a list of "b"s, elem is just doing a simple "a == b" check on every element of the "b"s list.
2021-12-07 16:18:50 +0100 <Super11> right, but from when doing other exercises, I've seen it used quite a lot a lot more than other functions. But then again it might be because I've been working with lists quite a lot
2021-12-07 16:19:19 +0100 <fizbin> It's useful, but quite possible to build from scratch, at least the version that only covers lists: elem _ [] = False; elem x (y:ys) = (x == y) || elem x ys
2021-12-07 16:21:32 +0100 <Super11> (y)  thanks for explaining to me i appreciate it
2021-12-07 16:21:50 +0100pfurla(~pfurla@2804:14d:5c81:4104:91cd:1543:8918:bc14) (Quit: gone to sleep. ZZZzzz…)
2021-12-07 16:22:11 +0100cosimone(~user@2001:b07:ae5:db26:c24a:d20:4d91:1e20) (Remote host closed the connection)
2021-12-07 16:24:47 +0100cosimone(~user@2001:b07:ae5:db26:c24a:d20:4d91:1e20)
2021-12-07 16:27:25 +0100stef204(~stef204@user/stef204) (Ping timeout: 240 seconds)
2021-12-07 16:27:59 +0100burnsidesLlama(~burnsides@dhcp168-017.wadham.ox.ac.uk) (Remote host closed the connection)
2021-12-07 16:28:10 +0100 <dsal> @src elem
2021-12-07 16:28:10 +0100 <lambdabot> elem x = any (== x)
2021-12-07 16:31:45 +0100hskpractice(~hskpracti@94-255-217-215.cust.bredband2.com) (Remote host closed the connection)
2021-12-07 16:32:02 +0100hskpractice(~hskpracti@94-255-217-215.cust.bredband2.com)
2021-12-07 16:35:18 +0100curiousgay_(~curiousga@77-120-141-90.kha.volia.net)
2021-12-07 16:36:38 +0100geekosaur(~geekosaur@xmonad/geekosaur)
2021-12-07 16:37:01 +0100curiousgay(~curiousga@77-120-141-90.kha.volia.net) (Ping timeout: 240 seconds)
2021-12-07 16:41:20 +0100acidjnk_new(~acidjnk@p200300d0c7271e6304137ec8947839cf.dip0.t-ipconnect.de) (Ping timeout: 265 seconds)
2021-12-07 16:43:00 +0100hskpractice(~hskpracti@94-255-217-215.cust.bredband2.com) (Remote host closed the connection)
2021-12-07 16:43:17 +0100hskpractice(~hskpracti@94-255-217-215.cust.bredband2.com)
2021-12-07 16:43:52 +0100Super11(~Super11@wireless-student-pt10-183-60.lut.ac.uk) (Quit: Client closed)
2021-12-07 16:47:03 +0100hskpractice(~hskpracti@94-255-217-215.cust.bredband2.com) (Remote host closed the connection)
2021-12-07 16:47:20 +0100hskpractice(~hskpracti@94-255-217-215.cust.bredband2.com)
2021-12-07 16:49:00 +0100hskpractice(~hskpracti@94-255-217-215.cust.bredband2.com) (Remote host closed the connection)
2021-12-07 16:49:18 +0100hskpractice(~hskpracti@94-255-217-215.cust.bredband2.com)
2021-12-07 16:50:58 +0100hskpractice(~hskpracti@94-255-217-215.cust.bredband2.com) (Remote host closed the connection)
2021-12-07 16:51:16 +0100hskpractice(~hskpracti@94-255-217-215.cust.bredband2.com)
2021-12-07 16:52:22 +0100shapr(~user@pool-100-36-247-68.washdc.fios.verizon.net)
2021-12-07 16:53:22 +0100dschrempf(~dominik@070-207.dynamic.dsl.fonira.net)
2021-12-07 16:56:47 +0100mikoto-chan(~mikoto-ch@esm-84-240-99-143.netplaza.fi) (Ping timeout: 256 seconds)
2021-12-07 16:57:07 +0100dschrempf(~dominik@070-207.dynamic.dsl.fonira.net) (Client Quit)
2021-12-07 16:57:39 +0100mikoto-chan(~mikoto-ch@esm-84-240-99-143.netplaza.fi)
2021-12-07 16:59:31 +0100hskpractice(~hskpracti@94-255-217-215.cust.bredband2.com) (Remote host closed the connection)
2021-12-07 16:59:48 +0100hskpractice(~hskpracti@94-255-217-215.cust.bredband2.com)
2021-12-07 17:01:24 +0100burnsidesLlama(~burnsides@dhcp168-017.wadham.ox.ac.uk)
2021-12-07 17:01:42 +0100pfurla(~pfurla@2804:14d:5c81:4104:91cd:1543:8918:bc14)
2021-12-07 17:03:15 +0100[itchyjunk](~itchyjunk@user/itchyjunk/x-7353470) (Read error: Connection reset by peer)
2021-12-07 17:05:49 +0100burnsidesLlama(~burnsides@dhcp168-017.wadham.ox.ac.uk) (Ping timeout: 240 seconds)
2021-12-07 17:08:01 +0100hskpractice(~hskpracti@94-255-217-215.cust.bredband2.com) (Remote host closed the connection)
2021-12-07 17:08:19 +0100hskpractice(~hskpracti@94-255-217-215.cust.bredband2.com)
2021-12-07 17:10:12 +0100hskpractice(~hskpracti@94-255-217-215.cust.bredband2.com) (Remote host closed the connection)
2021-12-07 17:10:30 +0100hskpractice(~hskpracti@94-255-217-215.cust.bredband2.com)
2021-12-07 17:12:48 +0100polezaivsani(~polezaivs@orangeshoelaces.net) (Remote host closed the connection)
2021-12-07 17:15:20 +0100quickquack(~quickquac@190.18.214.197) (Remote host closed the connection)
2021-12-07 17:16:09 +0100chele(~chele@user/chele) (Remote host closed the connection)
2021-12-07 17:17:38 +0100myShoggoth(~myShoggot@97-120-85-195.ptld.qwest.net)
2021-12-07 17:18:34 +0100boxscape_(~boxscape_@p4ff0bb6c.dip0.t-ipconnect.de) (Quit: Connection closed)
2021-12-07 17:19:09 +0100boxscape_(~boxscape_@p4ff0bb6c.dip0.t-ipconnect.de)
2021-12-07 17:21:03 +0100hskpractice(~hskpracti@94-255-217-215.cust.bredband2.com) (Remote host closed the connection)
2021-12-07 17:21:20 +0100hskpractice(~hskpracti@94-255-217-215.cust.bredband2.com)
2021-12-07 17:23:00 +0100hskpractice(~hskpracti@94-255-217-215.cust.bredband2.com) (Remote host closed the connection)
2021-12-07 17:23:17 +0100hskpractice(~hskpracti@94-255-217-215.cust.bredband2.com)
2021-12-07 17:23:49 +0100Guest89(~Guest89@2601:483:4101:2350::d66d)
2021-12-07 17:25:29 +0100hskpractice(~hskpracti@94-255-217-215.cust.bredband2.com) (Remote host closed the connection)
2021-12-07 17:25:46 +0100hskpractice(~hskpracti@94-255-217-215.cust.bredband2.com)
2021-12-07 17:26:30 +0100 <yin> is foldr' more appropriate than foldr in `size = foldr' (const succ) 0` ?
2021-12-07 17:27:57 +0100 <merijn> yin: There is no foldr' ?
2021-12-07 17:28:10 +0100 <yin> (i know foldl' (flip $ const succ) 0 is better)
2021-12-07 17:28:18 +0100 <yin> merijn: there is
2021-12-07 17:28:53 +0100 <merijn> oh, heh
2021-12-07 17:29:05 +0100 <merijn> When'd that appear >.>
2021-12-07 17:29:35 +0100 <maerwald> does that do anything different from foldl'?
2021-12-07 17:29:51 +0100 <merijn> well foldl' is mostly useful to avoid thunk build up
2021-12-07 17:30:02 +0100 <merijn> but foldr (usually) doesn't really have that issue anyway
2021-12-07 17:30:33 +0100 <maerwald> that's why it seems rather redundant?
2021-12-07 17:31:56 +0100 <yin> i don't think it's redundant, i'm just trying to make sure i'm understanding the nuance correctly
2021-12-07 17:31:57 +0100pfurla(~pfurla@2804:14d:5c81:4104:91cd:1543:8918:bc14) (Quit: gone to sleep. ZZZzzz…)
2021-12-07 17:32:29 +0100 <merijn> yin: To be fair, even the docs agree with me and maerwald :p
2021-12-07 17:32:39 +0100 <merijn> yin: "Right-associative fold of a structure, strict in the accumulator. This is rarely what you want."
2021-12-07 17:32:43 +0100 <merijn> Note the final sentence :p
2021-12-07 17:33:11 +0100 <merijn> As opposed to foldl and foldl' where foldl is marked as "rarely what you want"
2021-12-07 17:33:36 +0100 <yin> the docs should describe how things work, not tell people that "this is rarely want they want"
2021-12-07 17:33:49 +0100 <merijn> Hard disagree
2021-12-07 17:33:51 +0100 <geekosaur> it did. "strict in the accumulator"
2021-12-07 17:33:52 +0100 <yin> yep p
2021-12-07 17:34:06 +0100 <maerwald> Prelude stuff is read by beginners too
2021-12-07 17:34:08 +0100 <maerwald> guidance is ok
2021-12-07 17:34:15 +0100 <merijn> Pointing out that something is almost certainly something you don't want is very useful
2021-12-07 17:34:29 +0100Guest89(~Guest89@2601:483:4101:2350::d66d) ()
2021-12-07 17:34:33 +0100 <merijn> People who know enough to want rarely useful things, also know enough to disregard warnings
2021-12-07 17:34:56 +0100 <yin> guidance would be explaining why it's not useful in situation x and why it's more useful in situation y
2021-12-07 17:35:00 +0100 <merijn> > foldr' (const f) 0 [a,b,c,d]
2021-12-07 17:35:02 +0100 <lambdabot> error:
2021-12-07 17:35:02 +0100 <lambdabot> • Ambiguous type variable ‘a0’ arising from a use of ‘show_M108104109454...
2021-12-07 17:35:02 +0100 <lambdabot> prevents the constraint ‘(Show a0)’ from being solved.
2021-12-07 17:35:07 +0100 <merijn> aww
2021-12-07 17:35:35 +0100 <merijn> > foldr' (const f) z [a,b,c,d]
2021-12-07 17:35:37 +0100 <lambdabot> f (f (f (f z)))
2021-12-07 17:36:11 +0100 <merijn> beccause for foldr being lazy in the accumulator is *good*, it avoid computing the accumulator at all, unless necessary
2021-12-07 17:36:14 +0100 <geekosaur> it works with "(0::Expr)"
2021-12-07 17:36:37 +0100 <merijn> For foldl, being lazy is bad, because it *always* has to compute the accumulator and doing so lazily accumulates a whole bunch of useless thunks
2021-12-07 17:36:45 +0100 <merijn> > foldl' (const f) z [a,b,c,d]
2021-12-07 17:36:46 +0100 <yin> lambdabot is great!
2021-12-07 17:36:47 +0100 <lambdabot> f d
2021-12-07 17:36:57 +0100hskpractice(~hskpracti@94-255-217-215.cust.bredband2.com) (Remote host closed the connection)
2021-12-07 17:37:04 +0100cosimone(~user@2001:b07:ae5:db26:c24a:d20:4d91:1e20) (Remote host closed the connection)
2021-12-07 17:37:10 +0100zebrag(~chris@user/zebrag)
2021-12-07 17:37:14 +0100hskpractice(~hskpracti@94-255-217-215.cust.bredband2.com)
2021-12-07 17:37:16 +0100 <merijn> Actually, clearer
2021-12-07 17:37:22 +0100 <merijn> > foldl f z [a,b,c,d]
2021-12-07 17:37:23 +0100 <lambdabot> f (f (f (f z a) b) c) d
2021-12-07 17:37:30 +0100cosimone(~user@2001:b07:ae5:db26:c24a:d20:4d91:1e20)
2021-12-07 17:37:39 +0100 <merijn> > foldr f z [a,b,c,d]
2021-12-07 17:37:40 +0100 <lambdabot> f a (f b (f c (f d z)))
2021-12-07 17:38:09 +0100 <merijn> Note how, for foldl, the outer call can only return after the whole list is traversed
2021-12-07 17:38:31 +0100 <yin> oh i know how foldl and foldr work
2021-12-07 17:38:35 +0100 <merijn> And how for foldr the outer call can immediately return, unless 'f' somehow forces the accumulator
2021-12-07 17:39:26 +0100 <merijn> yin: foldl' solves the problem of having a massive "f (f (f z a) b) c" thunk (if your list is a million elements, that becomes *big*)
2021-12-07 17:39:43 +0100 <merijn> foldr never creates such a build up, so making it strict usually doesn't do anything
2021-12-07 17:40:13 +0100 <EvanR> is this whole diatribe relative to List foldlr' stuff
2021-12-07 17:40:26 +0100 <EvanR> because some foldables have nice ways to begin at the end so to speak
2021-12-07 17:40:50 +0100 <EvanR> unlike list
2021-12-07 17:41:08 +0100 <merijn> EvanR: Practically speaking it applies to *most* Foldable people use regularly (list, nonempty, containers, vector)
2021-12-07 17:41:16 +0100 <EvanR> vector?
2021-12-07 17:41:29 +0100hskpractice(~hskpracti@94-255-217-215.cust.bredband2.com) (Ping timeout: 256 seconds)
2021-12-07 17:41:30 +0100 <merijn> EvanR: So, there are exceptions (as the docs note), but those are, well, exceptions
2021-12-07 17:41:32 +0100 <EvanR> i can imagine foldr' working
2021-12-07 17:41:56 +0100 <merijn> EvanR: Vector is Foldable
2021-12-07 17:42:04 +0100 <EvanR> that's what I'm talking about
2021-12-07 17:42:19 +0100 <EvanR> is there something wrong with foldr' in that case xD
2021-12-07 17:42:30 +0100 <merijn> Oh, you mean, foldr' might be efficient for vector too
2021-12-07 17:42:38 +0100 <EvanR> s/too//
2021-12-07 17:42:54 +0100 <EvanR> or other foldables that have good ways to start at the end, Sequence
2021-12-07 17:42:54 +0100 <merijn> EvanR: Vector's foldr' is implemented with foldl', so... :p
2021-12-07 17:43:00 +0100 <geekosaur> does this matter enough to be worth using?
2021-12-07 17:43:18 +0100 <EvanR> really well that disqualifies my theory
2021-12-07 17:43:36 +0100 <merijn> EvanR: Right, but the question was "if foldl' is good, does that mean I should use foldr'?", to which "no" is a decent enough approximation/heuristic
2021-12-07 17:43:48 +0100 <merijn> EvanR: It's because of vector's streaming optimisations
2021-12-07 17:44:02 +0100 <EvanR> I think the question was should I use foldl' for this answer yes
2021-12-07 17:44:09 +0100 <merijn> EvanR: streams are processed left-to-right
2021-12-07 17:44:09 +0100ubert(~Thunderbi@2a02:8109:9880:303c:31e5:443a:aa23:d51a)
2021-12-07 17:44:29 +0100 <geekosaur> [07 16:26:31] <yin> is foldr' more appropriate than foldr in `size = foldr' (const succ) 0` ?
2021-12-07 17:44:34 +0100 <geekosaur> the actual question
2021-12-07 17:44:43 +0100 <merijn> EvanR: Then you should probably revisit the question ;)
2021-12-07 17:44:52 +0100 <EvanR> K I didn't make it past this is foldr' more appropriate than foldr in `size = foldr' (const succ) 0` ?
2021-12-07 17:44:55 +0100waleee(~waleee@2001:9b0:216:8200:d457:9189:7843:1dbd) (Ping timeout: 252 seconds)
2021-12-07 17:44:56 +0100 <EvanR> what
2021-12-07 17:45:00 +0100 <EvanR> I can't read
2021-12-07 17:45:19 +0100 <merijn> EvanR: :D
2021-12-07 17:45:28 +0100 <EvanR> I cast summon L6 coffee
2021-12-07 17:46:13 +0100boxscape_(~boxscape_@p4ff0bb6c.dip0.t-ipconnect.de) (Quit: Connection closed)
2021-12-07 17:46:16 +0100 <merijn> I guess foldr' would be good for snoc lists? Maybe? It's too much thinking to decide whether that's true
2021-12-07 17:46:43 +0100 <EvanR> isn't a snoc list just a list basically
2021-12-07 17:46:50 +0100eggplantade(~Eggplanta@2600:1700:bef1:5e10:b5e5:6571:976d:7afc)
2021-12-07 17:47:12 +0100 <geekosaur> yes, it just works from the right instead of the left
2021-12-07 17:47:15 +0100 <merijn> EvanR: Yes, but append instead of prepend. But I can't be arsed to think how that should affect recursion order
2021-12-07 17:47:23 +0100 <EvanR> ehm left and right...
2021-12-07 17:47:36 +0100 <EvanR> the x86 manual is telling me that the grows from top to bottom
2021-12-07 17:47:42 +0100 <EvanR> I just nod and agree
2021-12-07 17:47:47 +0100 <EvanR> the stack*
2021-12-07 17:47:57 +0100 <merijn> yin: Anyway, in summary, except for a handful of niche data structures, it's safe to assume foldr' is worse for most data structures in common use
2021-12-07 17:48:52 +0100 <merijn> including, but not limited to, lists, nonempty, all things in vector and containers, etc.
2021-12-07 17:49:40 +0100 <maerwald> well, `foldr (const succ) 0 [1..11111111111111111111111]` causes a stack overflow here and `foldr' (const succ) 0 [1..11111111111111111111111]` doesn't (I'm still waiting for it to finish)
2021-12-07 17:50:09 +0100 <maerwald> I think it's gonna kill my machine though
2021-12-07 17:50:11 +0100 <AndreasK> Let us know when it finishes ;D
2021-12-07 17:50:35 +0100 <maerwald> barely managed to kill the process :D
2021-12-07 17:50:40 +0100tromp(~textual@dhcp-077-249-230-040.chello.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
2021-12-07 17:50:59 +0100 <maerwald> so: better use foldr if you value your memory
2021-12-07 17:51:33 +0100 <EvanR> foldr doesn't always work though
2021-12-07 17:51:46 +0100 <EvanR> only if what you're doing is sufficiently lazy:tm:
2021-12-07 17:52:50 +0100boxscape_(~boxscape_@p4ff0bb6c.dip0.t-ipconnect.de)
2021-12-07 17:54:58 +0100jakalx(~jakalx@base.jakalx.net) (Error from remote client)
2021-12-07 17:59:38 +0100cheater(~Username@user/cheater) (Ping timeout: 265 seconds)
2021-12-07 17:59:41 +0100slack1256(~slack1256@191.125.99.210) (Ping timeout: 256 seconds)
2021-12-07 18:00:18 +0100pfurla(~pfurla@2804:14d:5c81:4104:91cd:1543:8918:bc14)
2021-12-07 18:02:16 +0100 <yin> maerwald: that was the answer i was looking for, thanks
2021-12-07 18:02:27 +0100Cajun(~Cajun@user/cajun) (Ping timeout: 256 seconds)
2021-12-07 18:02:43 +0100jakalx(~jakalx@base.jakalx.net)
2021-12-07 18:02:44 +0100 <yin> i wonder how these things get optimized
2021-12-07 18:02:48 +0100cheater(~Username@user/cheater)
2021-12-07 18:02:53 +0100 <maerwald> I used ghci
2021-12-07 18:02:57 +0100 <maerwald> so probably no optimization
2021-12-07 18:03:04 +0100 <EvanR> ok the foldable laws on hackage are kind of illuminating
2021-12-07 18:03:36 +0100gensyst(gensyst@user/gensyst)
2021-12-07 18:04:20 +0100 <gensyst> What is your opinion of calling a private function "funcName_" (ending underscore) to make absolutely clear to everybody that it should never be exported?
2021-12-07 18:04:45 +0100 <maerwald> gensyst: the convention is rather using Foo.Internal modules
2021-12-07 18:04:51 +0100 <maerwald> and expose everything
2021-12-07 18:04:53 +0100 <gensyst> Thanks!
2021-12-07 18:04:59 +0100 <gensyst> I forgot about that one
2021-12-07 18:05:03 +0100 <Rembane> gensyst: Or put it in a where-expression if it's a very local function
2021-12-07 18:05:05 +0100 <dminuoso> gensyst: I use underscore names as module-internal names.
2021-12-07 18:05:17 +0100 <maerwald> if your users depend on internal modules, it's their problem... you don't need to follow PVP for those
2021-12-07 18:05:18 +0100 <geekosaur> trailing _ already has a meaning, anyway: ignore lack of use
2021-12-07 18:05:59 +0100 <dminuoso> geekosaur: The GHC codebase sometimes uses trailing underscores to denote module-internal, or sometimes internal-implementation for some wrapper function.
2021-12-07 18:05:59 +0100 <maerwald> if you don't expose internal modules, you will make some use cases harder (e.g. semi-fork packages, that re-implement only parts)
2021-12-07 18:06:27 +0100 <gensyst> yeah i've ran into unmaintained libraries in the past with useful stuff not exposed, not even in internal modules. PITA.
2021-12-07 18:06:49 +0100 <dminuoso> otoh it really forces people onto using interfaces, it creates less breakage on updates.
2021-12-07 18:06:58 +0100_ht(~quassel@82-169-194-8.biz.kpn.net)
2021-12-07 18:07:10 +0100 <gensyst> prefix underscores don't work for type names :S
2021-12-07 18:07:22 +0100 <dminuoso> If you expose internal modules, people will use it. Especially nowadays, when HLS creates a low barrier for importing internal modules.
2021-12-07 18:08:20 +0100cfricke(~cfricke@user/cfricke) (Ping timeout: 265 seconds)
2021-12-07 18:08:29 +0100hskpractice(~hskpracti@94-255-217-215.cust.bredband2.com)
2021-12-07 18:08:44 +0100 <EvanR> then let them use it
2021-12-07 18:08:47 +0100 <maerwald> streamly even uses the Internal module approach for modules that are not really internal, but "in flux"
2021-12-07 18:09:06 +0100 <maerwald> so beta API, so to speak
2021-12-07 18:09:26 +0100 <dminuoso> Does streamly otherwise pretend to follow PVP?
2021-12-07 18:09:27 +0100 <EvanR> yeah, if everyone understands that aspect it sounds like it works well
2021-12-07 18:09:34 +0100 <maerwald> dminuoso: I think so
2021-12-07 18:09:44 +0100 <dminuoso> Then that's fairly misleading.
2021-12-07 18:09:53 +0100 <gensyst> EvanR exactly, let them me use it at my own risk! imo it's great. i'm responsible then to not upgrade packages suddenly and expect everything to work 100%
2021-12-07 18:10:01 +0100 <maerwald> dminuoso: why?
2021-12-07 18:10:04 +0100 <dminuoso> You cant commit to PVP with minor bumps but have a brittle/constantly changing API.
2021-12-07 18:10:04 +0100kristjansson_(sid126207@id-126207.tinside.irccloud.com) ()
2021-12-07 18:10:35 +0100 <maerwald> internal API is the only that changes in those cases
2021-12-07 18:10:39 +0100 <dminuoso> This is one of those modern misbehaviors you see in software often, where software is not designed with stable APIs in mind. Ship fast and break often is the motto of this century.
2021-12-07 18:10:39 +0100kristjansson(sid126207@id-126207.tinside.irccloud.com)
2021-12-07 18:10:52 +0100 <maerwald> it's very clearly separated
2021-12-07 18:11:00 +0100 <dminuoso> maerwald: As you pointed out, if its not really internal, its public API.
2021-12-07 18:11:00 +0100 <maerwald> the non-internal modules follow PVP
2021-12-07 18:11:12 +0100 <dminuoso> Internal means not for public use.
2021-12-07 18:11:24 +0100 <dminuoso> Not "here be dragons and PVP does not apply"
2021-12-07 18:11:27 +0100 <maerwald> I have no problem with this approach
2021-12-07 18:11:55 +0100 <gensyst> nothing breaks if you keep packages the same and don't run "cabal update"!
2021-12-07 18:11:59 +0100 <gensyst> ;)
2021-12-07 18:12:15 +0100 <dminuoso> gensyst: The entire point of PVP is that `cabal update` should not break your builds.
2021-12-07 18:12:26 +0100 <gensyst> true lol
2021-12-07 18:13:13 +0100hskpractice(~hskpracti@94-255-217-215.cust.bredband2.com) (Ping timeout: 256 seconds)
2021-12-07 18:13:23 +0100famubu(~famubu@user/famubu)
2021-12-07 18:13:33 +0100 <dminuoso> Some packages go to extraordinary length to accomplish this. Snoyman has a cute convention of not exporting data constructors, but rather smart constructors and then individual field accessors. This lets him add new fields without causing major PVP bumps.
2021-12-07 18:14:24 +0100Successus(~Successus@gateway/tor-sasl/successus)
2021-12-07 18:15:42 +0100kristjansson(sid126207@id-126207.tinside.irccloud.com) ()
2021-12-07 18:16:04 +0100 <c_wraith> the problem is he exports actual record accessors, and GHC knows they're record accessors. So you can still use record update syntax with them
2021-12-07 18:16:34 +0100 <c_wraith> the obviously should be lenses instead. Then the field doesn't even need to exist!
2021-12-07 18:16:40 +0100pfurla(~pfurla@2804:14d:5c81:4104:91cd:1543:8918:bc14) (Quit: gone to sleep. ZZZzzz…)
2021-12-07 18:16:46 +0100 <dminuoso> I dont see this as a problem
2021-12-07 18:16:58 +0100tromp(~textual@dhcp-077-249-230-040.chello.nl)
2021-12-07 18:17:20 +0100 <c_wraith> You're stuck supporting fields that can't be changed to a better internal representation
2021-12-07 18:17:41 +0100 <c_wraith> It only helps with adding fields, not changing ones that could be improved
2021-12-07 18:17:56 +0100 <dminuoso> I see your point
2021-12-07 18:18:53 +0100 <c_wraith> It's a small point. But I think worrying about changing the major version when changing an exported constructor is also a small point. :)
2021-12-07 18:19:18 +0100 <famubu> Hi. I was trying to make a functor for a simple success/error type. The functor definition executes without error but when I try using fmap on it, ghci throws error. This is what I tried: https://paste.tomsmeding.com/lQhpXcTw
2021-12-07 18:19:24 +0100 <famubu> What am I doing wrong here?
2021-12-07 18:19:50 +0100kristjansson(sid126207@id-126207.tinside.irccloud.com)
2021-12-07 18:20:05 +0100 <c_wraith> did you reload the file in ghci?
2021-12-07 18:20:33 +0100 <c_wraith> alternatively, did you remember to save your changes? Or did you save to the file that ghci has loaded?
2021-12-07 18:20:39 +0100 <EvanR> if I want to break open the internal module of ByteString to do more efficient conversion to storable vector, then I'll take responsibility for compatibility problems dammit
2021-12-07 18:20:40 +0100 <c_wraith> those are the most common causes for that
2021-12-07 18:21:15 +0100 <c_wraith> ie, your code is fine. ghci just isn't aware of it, for some reason. Those three are the most common
2021-12-07 18:21:19 +0100 <dminuoso> EvanR: Absolutely. My issue is not with breakage in internal modules, but if streamly exposes API that is *intended* for public usage, but not commits to PVP - then the entire package is not PVP compatible.
2021-12-07 18:21:44 +0100mcgroin(~mcgroin@roc37-h01-176-170-197-243.dsl.sta.abo.bbox.fr)
2021-12-07 18:22:12 +0100 <famubu> c_wraith: No I just copy pasted the code.. 😬
2021-12-07 18:22:14 +0100 <dminuoso> Seems like a cheap excuse to not be properly PVP compatible. Either get stable APIs out, or ship them via separate packages.
2021-12-07 18:22:32 +0100 <EvanR> if none of the api is stable, that's another issue
2021-12-07 18:22:42 +0100 <EvanR> or it's unknown which part is stable / unstable
2021-12-07 18:23:05 +0100 <dminuoso> Granted, if streamly explicitly names them ".Internal" module, or some such, at least there's some sort of warning.
2021-12-07 18:23:13 +0100 <c_wraith> famubu: happens to all of us. No worries. :)
2021-12-07 18:23:16 +0100MoC(~moc@user/moc) (Quit: Konversation terminated!)
2021-12-07 18:24:17 +0100ubert(~Thunderbi@2a02:8109:9880:303c:31e5:443a:aa23:d51a) (Remote host closed the connection)
2021-12-07 18:24:22 +0100 <c_wraith> famubu: or wait, did you mean there's no file at all? In that case - I recommend having a file. It's just easier to work with.
2021-12-07 18:24:49 +0100 <geekosaur> yes, if you simply copy-pasted that into ghci then many things will go wrong
2021-12-07 18:25:17 +0100 <geekosaur> ghci does not handle multi-line things like instance definitions at all well
2021-12-07 18:25:47 +0100 <dminuoso> Would that explain that issue though?
2021-12-07 18:26:14 +0100 <dminuoso> % data Result a = Okay a String | Error
2021-12-07 18:26:14 +0100 <yahb> dminuoso:
2021-12-07 18:26:19 +0100 <dminuoso> % instance Functor Result where
2021-12-07 18:26:19 +0100 <yahb> dminuoso: ; <interactive>:23:10: warning: [-Wmissing-methods]; * No explicit implementation for; `fmap'; * In the instance declaration for `Functor Result'
2021-12-07 18:26:25 +0100 <geekosaur> mm, depends. if -Werror then the empty instance definition would throw an error
2021-12-07 18:26:37 +0100merijn(~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 240 seconds)
2021-12-07 18:26:54 +0100 <dminuoso> Mmm, yeah I guess
2021-12-07 18:28:10 +0100 <geekosaur> but -Werror wouldn't be the default
2021-12-07 18:28:38 +0100merijn(~merijn@83-160-49-249.ip.xs4all.nl)
2021-12-07 18:29:39 +0100kronicmage(user91577@neotame.csclub.uwaterloo.ca) (Ping timeout: 252 seconds)
2021-12-07 18:30:12 +0100bollu(uid233390@id-233390.helmsley.irccloud.com) (Quit: Connection closed for inactivity)
2021-12-07 18:30:33 +0100 <geekosaur> rr, actualy no you wouldn't even get that error. it'd work because fmap would be replaced by a non-Functor one specific to Result
2021-12-07 18:30:45 +0100 <geekosaur> so no error about not finding a Functor instance
2021-12-07 18:31:43 +0100kronicmage(user55138@neotame.csclub.uwaterloo.ca)
2021-12-07 18:33:00 +0100hskpractice(~hskpracti@94-255-217-215.cust.bredband2.com)
2021-12-07 18:33:57 +0100merijn(~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 265 seconds)
2021-12-07 18:34:03 +0100boxscape_(~boxscape_@p4ff0bb6c.dip0.t-ipconnect.de) (Ping timeout: 268 seconds)
2021-12-07 18:34:20 +0100nfd(~nfd@user/nfd)
2021-12-07 18:34:37 +0100merijn(~merijn@83-160-49-249.ip.xs4all.nl)
2021-12-07 18:35:41 +0100 <famubu> c_wraith: Yeah I didn't load from a file. I mean, I had a file but instead of loading with `:l` I just pasted the code into the interpreter.. 😅
2021-12-07 18:36:39 +0100 <dsal> famubu: Did you put ghci into multi-line mode to receive the paste?
2021-12-07 18:36:41 +0100emf(~emf@2620:10d:c091:480::1:102a)
2021-12-07 18:36:57 +0100 <famubu> Yeah multi line mode means `:{` right?
2021-12-07 18:37:05 +0100 <dsal> Yeah
2021-12-07 18:37:06 +0100 <famubu> That's what I used.
2021-12-07 18:37:22 +0100 <dsal> OK. Then our guesses may have mislead us and we don't actually know what you've done.
2021-12-07 18:38:17 +0100Successus(~Successus@gateway/tor-sasl/successus) (Remote host closed the connection)
2021-12-07 18:38:29 +0100Successus(~Successus@gateway/tor-sasl/successus)
2021-12-07 18:39:49 +0100merijn(~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 240 seconds)
2021-12-07 18:40:27 +0100merijn(~merijn@83-160-49-249.ip.xs4all.nl)
2021-12-07 18:41:36 +0100mbuf(~Shakthi@223.178.74.194) (Quit: Leaving)
2021-12-07 18:42:06 +0100emf_(~emf@2620:10d:c091:480::1:102a)
2021-12-07 18:42:07 +0100hskpractice(~hskpracti@94-255-217-215.cust.bredband2.com) (Ping timeout: 256 seconds)
2021-12-07 18:42:10 +0100thevishy(~Nishant@2405:201:f005:c007:a5d7:38b:39cd:e2ae) (Quit: Leaving)
2021-12-07 18:42:53 +0100pfurla(~pfurla@2804:14d:5c81:4104:91cd:1543:8918:bc14)
2021-12-07 18:43:13 +0100emf(~emf@2620:10d:c091:480::1:102a) (Ping timeout: 252 seconds)
2021-12-07 18:44:28 +0100 <famubu> My program works okay. Just had to restart ghci. I think the lines that I ran before was interfering..
2021-12-07 18:44:32 +0100 <tom__> Am I right in saying that you should always default to newtyping everything instead of using String or Int?
2021-12-07 18:45:02 +0100 <geekosaur> newtyping is often a good idea. I don't know that I would say "always", though
2021-12-07 18:45:09 +0100 <famubu> Is it a bad idea to place the type of `fmap` explicitly in a functor definition?
2021-12-07 18:45:37 +0100madjestic(~madjestic@88-159-247-120.fixed.kpn.net) (Remote host closed the connection)
2021-12-07 18:45:38 +0100 <tom__> What is an example of a time when it would not be a good idea?
2021-12-07 18:45:47 +0100merijn(~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 252 seconds)
2021-12-07 18:45:48 +0100 <geekosaur> it may limit your compatibility with older versions of ghc, but otherwise I'd say it's a good sanity check on what you are doing
2021-12-07 18:46:19 +0100 <EvanR> if you newtype an Int that would have usefully interacting with a lot of other Int APIs, now you have carple tunnel syndrome
2021-12-07 18:46:20 +0100sander(~sander@user/sander) (Ping timeout: 252 seconds)
2021-12-07 18:46:26 +0100 <EvanR> interacted*
2021-12-07 18:46:30 +0100merijn(~merijn@83-160-49-249.ip.xs4all.nl)
2021-12-07 18:46:37 +0100 <geekosaur> *carpal
2021-12-07 18:46:44 +0100 <EvanR> yes
2021-12-07 18:47:10 +0100 <tom__> So if you find yourself continually wrapping and unwrapping it
2021-12-07 18:47:11 +0100 <EvanR> large amounts of newtype unwrapping can make the code harder to read
2021-12-07 18:47:14 +0100 <geekosaur> and yes, newtyping Age would prevent you from adding two Ages together but would be painful in adding an Int to an Age
2021-12-07 18:47:23 +0100 <geekosaur> or subtracting Ages to get an Int
2021-12-07 18:47:25 +0100CiaoSen(~Jura@p200300c9570204002a3a4dfffe84dbd5.dip0.t-ipconnect.de) (Ping timeout: 240 seconds)
2021-12-07 18:47:55 +0100sander(~sander@user/sander)
2021-12-07 18:48:22 +0100 <famubu> When I tried `fmap :: (a -> b) -> Result a -> Result b` at https://paste.tomsmeding.com/lQhpXcTw, I got 'Illegal type signature in instance declaration. Use InstanceSigs to allow this.
2021-12-07 18:48:26 +0100 <famubu> Found in this post https://stackoverflow.com/questions/34699716/illegal-type-signature-in-instance-declaration
2021-12-07 18:48:43 +0100 <EvanR> that's a great error message
2021-12-07 18:48:46 +0100 <famubu> that type signature is illegal in instance declarations
2021-12-07 18:49:04 +0100 <EvanR> ok maybe not
2021-12-07 18:49:16 +0100 <EvanR> makes it sound like there's something wrong with that particular sig
2021-12-07 18:49:37 +0100 <EvanR> enable extension InstanceSigs to use it
2021-12-07 18:50:20 +0100tzh(~tzh@c-24-21-73-154.hsd1.or.comcast.net)
2021-12-07 18:50:27 +0100 <tom__> Thanks for the answers. As usual there is no "always" in software.
2021-12-07 18:50:31 +0100 <EvanR> or enable DeriveFunctor
2021-12-07 18:51:03 +0100 <oats> I have a newtype wrapper over a Map so I can define my own monoid intance, is there a nice way I can still use lenses on the contained Map?
2021-12-07 18:51:04 +0100econo(uid147250@user/econo)
2021-12-07 18:51:29 +0100 <famubu> When writing definitions do people usually use this extension? Just curious :) Writing the type makes it easier to understand.
2021-12-07 18:51:50 +0100merijn(~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 265 seconds)
2021-12-07 18:52:18 +0100merijn(~merijn@83-160-49-249.ip.xs4all.nl)
2021-12-07 18:52:18 +0100 <geekosaur> right. I think the only reason this wants an extension is that it's not permitted in the (creaky-old) standard
2021-12-07 18:52:49 +0100 <EvanR> you can implement the instance as a normal function somewhere else with a type sig and just name it in the instance def itself
2021-12-07 18:52:50 +0100 <geekosaur> but as I said earlier, it's generally a good sanity check
2021-12-07 18:53:53 +0100 <famubu> Okay. Thanks guys.
2021-12-07 18:53:57 +0100 <EvanR> like instance Monoid [a] where mappend = concat
2021-12-07 18:54:00 +0100 <dminuoso> famubu: I dont see it often. The primary reason I'd expect to see this, if combined with ScopedTypeVariables and either Proxy pattern or TypeApplications.
2021-12-07 18:54:15 +0100 <oats> EvanR, are you responding to me?
2021-12-07 18:54:22 +0100 <EvanR> nope
2021-12-07 18:54:26 +0100 <dminuoso> That isn't to say its bad, it seems like a very benign and useful extension.
2021-12-07 18:54:35 +0100 <EvanR> oats, what about GeneralizedNewtypeDeriving
2021-12-07 18:54:42 +0100yauhsien(~yauhsien@61-231-32-247.dynamic-ip.hinet.net)
2021-12-07 18:54:43 +0100 <oats> I'm not familiar with it
2021-12-07 18:54:45 +0100oatslooks
2021-12-07 18:55:01 +0100 <EvanR> oh lens...
2021-12-07 18:55:06 +0100fizbin(~fizbin@c-73-33-197-160.hsd1.nj.comcast.net) (Remote host closed the connection)
2021-12-07 18:55:10 +0100 <dminuoso> Its still the correct answer.
2021-12-07 18:55:24 +0100 <dminuoso> Use GeneralizedNewtypeDeriving to get both an Ixed and At instance
2021-12-07 18:55:35 +0100 <dminuoso> And then you can use `at` through your newtype
2021-12-07 18:55:49 +0100hskpractice(~hskpracti@94-255-217-215.cust.bredband2.com)
2021-12-07 18:56:08 +0100fizbin(~fizbin@c-73-33-197-160.hsd1.nj.comcast.net)
2021-12-07 18:56:10 +0100 <oats> hrm, I feel like I could've figured that out if I understood how lens works better
2021-12-07 18:56:26 +0100 <oats> are there any good resources for understanding its implementation?
2021-12-07 18:56:28 +0100 <dminuoso> oats: What kind of optic are you trying to construct?
2021-12-07 18:56:37 +0100nfd(~nfd@user/nfd) (Ping timeout: 240 seconds)
2021-12-07 18:56:41 +0100 <awpr> probably also need `type instance Index (MapNewtype k a) = k` and similarly for the value type (I forget what that type family is called)
2021-12-07 18:56:44 +0100 <dminuoso> Traversal over a map? Or some lens `at` an value?
2021-12-07 18:56:46 +0100 <oats> dminuoso, I'm trying to filter on the values in the map
2021-12-07 18:57:02 +0100nfd(~nfd@user/nfd)
2021-12-07 18:57:31 +0100merijn(~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 252 seconds)
2021-12-07 18:57:35 +0100 <dminuoso> oats: That's even simpler then
2021-12-07 18:57:50 +0100 <geekosaur> https://en.wikibooks.org/wiki/Haskell/Lenses_and_functional_references
2021-12-07 18:57:56 +0100 <geekosaur> oats ^
2021-12-07 18:57:57 +0100merijn(~merijn@83-160-49-249.ip.xs4all.nl)
2021-12-07 18:57:59 +0100 <dminuoso> oats: What are you using to consume the optic at the end? toListOf?
2021-12-07 18:58:10 +0100 <oats> lengthOf
2021-12-07 18:59:21 +0100 <dminuoso> oats: Presumably you are using `folded`?
2021-12-07 18:59:21 +0100yauhsien(~yauhsien@61-231-32-247.dynamic-ip.hinet.net) (Ping timeout: 252 seconds)
2021-12-07 18:59:28 +0100 <dminuoso> Or `filtered`?
2021-12-07 18:59:55 +0100 <sm> I like that: there's no "always" in software. No "just", either.
2021-12-07 19:00:11 +0100 <oats> lengthOf (folded . filtered (> 1))
2021-12-07 19:00:15 +0100 <oats> my first attempt
2021-12-07 19:00:38 +0100 <oats> but I'm not sure it'd filter on values, and it's definitely not getting through my newtype :P
2021-12-07 19:00:50 +0100 <dminuoso> oats: Yeah, just get a Foldable instance on your newtype (either manually or via GND)
2021-12-07 19:00:52 +0100 <dminuoso> That's it.
2021-12-07 19:01:01 +0100 <dminuoso> % :t folded
2021-12-07 19:01:02 +0100 <yahb> dminuoso: (Indexable Int p, Contravariant f1, Foldable f2, Applicative f1) => p a (f1 a) -> f2 a -> f1 (f2 a)
2021-12-07 19:01:06 +0100 <dminuoso> uh
2021-12-07 19:01:38 +0100 <dminuoso> So its not very obvious, but that `Foldable f2` is demanded on you.
2021-12-07 19:01:52 +0100wroathe(~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
2021-12-07 19:01:52 +0100wroathe(~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Changing host)
2021-12-07 19:01:52 +0100wroathe(~wroathe@user/wroathe)
2021-12-07 19:01:58 +0100 <dminuoso> The optics version is more clear on this: `folded :: Foldable f => Fold (f a) a`
2021-12-07 19:02:36 +0100 <dminuoso> % :set -XGeneralizedNewtypeDeriving
2021-12-07 19:02:36 +0100 <yahb> dminuoso:
2021-12-07 19:02:38 +0100 <dminuoso> % newtype List a = List { runList :: [a] }
2021-12-07 19:02:38 +0100 <yahb> dminuoso:
2021-12-07 19:02:54 +0100 <dminuoso> % newtype List a = List { runList :: [a] } deriving Foldable
2021-12-07 19:02:54 +0100 <yahb> dminuoso:
2021-12-07 19:03:14 +0100 <dminuoso> % lengthOf (folded . filtered (>1)) (List [1,2,3,4])
2021-12-07 19:03:15 +0100 <yahb> dminuoso: 3
2021-12-07 19:03:32 +0100 <oats> ah, I'd need to add a type param to my newtype
2021-12-07 19:03:41 +0100 <dminuoso> For Foldable to work, yes.
2021-12-07 19:05:18 +0100 <oats> geekosaur, thanks for the reference :)
2021-12-07 19:06:13 +0100cfricke(~cfricke@user/cfricke)
2021-12-07 19:07:14 +0100FinnElija(~finn_elij@user/finn-elija/x-0085643) (Killed (NickServ (Forcing logout FinnElija -> finn_elija)))
2021-12-07 19:07:14 +0100finn_elija(~finn_elij@user/finn-elija/x-0085643)
2021-12-07 19:07:14 +0100finn_elijaFinnElija
2021-12-07 19:08:03 +0100MoC(~moc@user/moc)
2021-12-07 19:08:18 +0100curiousgay_(~curiousga@77-120-141-90.kha.volia.net) (Read error: Connection reset by peer)
2021-12-07 19:08:43 +0100curiousgay(~curiousga@77-120-141-90.kha.volia.net)
2021-12-07 19:09:56 +0100boxscape_(~boxscape_@p4ff0bb6c.dip0.t-ipconnect.de)
2021-12-07 19:10:08 +0100 <awpr> there's always MonoFoldable if you must have a classy name for folding the map under the newtype; otherwise you can just write a traversal like `traverseMyNewtype f (MyNewtype m) = MyNewtype <$> traverse f m`
2021-12-07 19:10:53 +0100 <awpr> (I'd expect there's a MonoFoldable version of `folded` somewhere, but perhaps not in `lens` or `mono-traversable` themselves)
2021-12-07 19:12:51 +0100Midjak(~Midjak@may53-1-78-226-116-92.fbx.proxad.net)
2021-12-07 19:13:02 +0100hskpractice(~hskpracti@94-255-217-215.cust.bredband2.com)
2021-12-07 19:14:24 +0100hololeap(~hololeap@user/hololeap)
2021-12-07 19:16:39 +0100hskpractice(~hskpracti@94-255-217-215.cust.bredband2.com) (Remote host closed the connection)
2021-12-07 19:17:04 +0100gensyst(gensyst@user/gensyst) (Quit: Leaving)
2021-12-07 19:21:03 +0100eggplantade(~Eggplanta@2600:1700:bef1:5e10:b5e5:6571:976d:7afc) (Remote host closed the connection)
2021-12-07 19:21:19 +0100eggplantade(~Eggplanta@2600:1700:bef1:5e10:b5e5:6571:976d:7afc)
2021-12-07 19:23:25 +0100wroathe(~wroathe@user/wroathe) (Ping timeout: 240 seconds)
2021-12-07 19:24:37 +0100Techcable(~Techcable@168.235.93.147) (Ping timeout: 240 seconds)
2021-12-07 19:25:17 +0100stef204(~stef204@user/stef204)
2021-12-07 19:25:44 +0100lavaman(~lavaman@98.38.249.169)
2021-12-07 19:27:23 +0100tromp(~textual@dhcp-077-249-230-040.chello.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
2021-12-07 19:28:42 +0100Successus(~Successus@gateway/tor-sasl/successus) ()
2021-12-07 19:29:55 +0100 <EvanR> so ghc supports many lightweight threads running "efficiently" interleaved. Does it somehow save the registers used by each thread or is everything relevant not in registers at any given suspendable moment
2021-12-07 19:32:17 +0100 <monochrom> It saves and reloads registers, yes.
2021-12-07 19:32:30 +0100eggplantade(~Eggplanta@2600:1700:bef1:5e10:b5e5:6571:976d:7afc) (Remote host closed the connection)
2021-12-07 19:32:40 +0100nattiestnate(~nate@2001:448a:20a0:4134:25e:715f:d637:5263)
2021-12-07 19:32:55 +0100 <monochrom> Err, maybe I'm wrong.
2021-12-07 19:33:06 +0100 <EvanR> there's a lot of registers xD
2021-12-07 19:33:23 +0100 <monochrom> But https://github.com/takenobu-hs/haskell-ghc-illustrated is very likely to have the correct answer.
2021-12-07 19:33:52 +0100 <dminuoso> % :t foldring
2021-12-07 19:33:53 +0100 <yahb> dminuoso: (Contravariant f, Applicative f) => ((a -> f a -> f a) -> f a -> s -> f a) -> LensLike f s t a b
2021-12-07 19:34:37 +0100 <monochrom> There is at least a stack pointer to save and reload.
2021-12-07 19:34:47 +0100 <geekosaur> I think it only suspends at a yield point when it's already saved regs and jumped into the runtime?
2021-12-07 19:35:01 +0100hololeap(~hololeap@user/hololeap) (Remote host closed the connection)
2021-12-07 19:36:18 +0100hololeap(~hololeap@user/hololeap)
2021-12-07 19:36:26 +0100 <EvanR> nice a slideshow
2021-12-07 19:36:27 +0100 <monochrom> There is another register for the heap pointer. This one is unproblematic. Threads share the same heap.
2021-12-07 19:37:54 +0100InternetCitizen(~fuzzypixe@ensi-libre-service-019.ensimag.fr)
2021-12-07 19:38:36 +0100 <monochrom> Only a few registers are still relevant at suspendable moment.
2021-12-07 19:38:37 +0100hskpractice(~hskpracti@94-255-217-215.cust.bredband2.com)
2021-12-07 19:40:24 +0100 <dminuoso> awpr: It actually works quite trivially, without MonoFoldable
2021-12-07 19:40:29 +0100 <monochrom> GHC cleverly hijacks heap allocation points as suspendable moments. This is why very few registers are relevant at those points.
2021-12-07 19:40:31 +0100 <dminuoso> % newtype CharMap = CharMap { runCharMap :: IM.IntMap Char }
2021-12-07 19:40:31 +0100 <yahb> dminuoso:
2021-12-07 19:40:39 +0100 <dminuoso> % myFoldr :: (Char -> b -> b) -> b -> CharMap -> b; myFoldr f i (CharMap m) = foldr f i m
2021-12-07 19:40:39 +0100 <yahb> dminuoso:
2021-12-07 19:40:45 +0100 <dminuoso> % myFolded = foldring myFoldr
2021-12-07 19:40:46 +0100 <yahb> dminuoso:
2021-12-07 19:40:52 +0100 <dminuoso> % toListOf (myFolded . to ord) (CharMap (IM.fromList [(1, 'a'), (2, 'c')])) -- ^ oats
2021-12-07 19:40:52 +0100 <yahb> dminuoso: [97,99]
2021-12-07 19:41:17 +0100 <dminuoso> awpr: So all you have to do is implement this `myFoldr` for your data type, then you can use `foldring myFoldr`
2021-12-07 19:41:22 +0100 <oats> interesting
2021-12-07 19:41:23 +0100 <dminuoso> Or sorry. I meant oats.
2021-12-07 19:41:29 +0100 <oats> I ended up deriving Foldable :)
2021-12-07 19:41:59 +0100 <awpr> sure, similar idea to wrapping the underlying `traverse`. I just mentioned `MonoFoldable` because sometimes people just _really want_ to use things from a class and can't bear the thought of a separate name
2021-12-07 19:42:21 +0100 <dminuoso> Mono* typeclasses are only useful for people writing code polymorphic over it.
2021-12-07 19:42:45 +0100 <awpr> personally I'd probably add the MonoX instances if in a codebase that already had a dependency on it, but definitely not add the dependency just for that
2021-12-07 19:42:54 +0100nattiestnate(~nate@2001:448a:20a0:4134:25e:715f:d637:5263) (Quit: WeeChat 3.3)
2021-12-07 19:43:26 +0100 <awpr> I'd definitely add a named traversal though
2021-12-07 19:43:27 +0100 <monochrom> Hrm, I may be wrong again. At an allocation point, any number of registers may be relevant, the whole point of allocation being that there are data in registers waiting to be off-loaded into memory!
2021-12-07 19:44:19 +0100 <EvanR> the TSO seems to have no 'register' data, and STG registers seems to be unrelated to threads
2021-12-07 19:45:16 +0100 <EvanR> it may just be that registers are not used for what an assembly language programmer would use them for
2021-12-07 19:45:35 +0100hskpractice(~hskpracti@94-255-217-215.cust.bredband2.com) (Ping timeout: 256 seconds)
2021-12-07 19:46:22 +0100 <EvanR> they're for engine purposes and not application purposes
2021-12-07 19:46:28 +0100 <EvanR> spitballing
2021-12-07 19:46:47 +0100n3t(n3t@user/n3t) (Read error: Connection reset by peer)
2021-12-07 19:48:33 +0100eggplantade(~Eggplanta@2600:1700:bef1:5e10:b5e5:6571:976d:7afc)
2021-12-07 19:49:52 +0100kjak(~kjak@pool-108-45-56-21.washdc.fios.verizon.net)
2021-12-07 19:51:16 +0100n3t(n3t@s45.mydevil.net)
2021-12-07 19:51:46 +0100merijn(~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 265 seconds)
2021-12-07 19:56:28 +0100hippoid(~hippoid@c-98-220-13-8.hsd1.il.comcast.net)
2021-12-07 19:56:46 +0100hippoid(~hippoid@c-98-220-13-8.hsd1.il.comcast.net) ()
2021-12-07 19:57:43 +0100pfurla(~pfurla@2804:14d:5c81:4104:91cd:1543:8918:bc14) (Quit: gone to sleep. ZZZzzz…)
2021-12-07 19:58:08 +0100fizbin(~fizbin@c-73-33-197-160.hsd1.nj.comcast.net) (Remote host closed the connection)
2021-12-07 19:58:18 +0100fizbin(~fizbin@c-73-33-197-160.hsd1.nj.comcast.net)
2021-12-07 20:00:10 +0100hskpractice(~hskpracti@94-255-217-215.cust.bredband2.com)
2021-12-07 20:01:41 +0100max22-(~maxime@2a01cb08833598005e821d007c542121.ipv6.abo.wanadoo.fr) (Ping timeout: 252 seconds)
2021-12-07 20:02:44 +0100 <kennyd> -
2021-12-07 20:03:13 +0100 <[exa]> much negation.
2021-12-07 20:07:07 +0100hskpractice(~hskpracti@94-255-217-215.cust.bredband2.com) (Ping timeout: 256 seconds)
2021-12-07 20:08:03 +0100 <EvanR> so there is a timer to preempt the runtime but there's no switching threads unless it's in a state that's convenient to suspend
2021-12-07 20:08:40 +0100 <EvanR> did see a slide that suggest it's saving "registers" in the TSO
2021-12-07 20:08:58 +0100wroathe(~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
2021-12-07 20:08:58 +0100wroathe(~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Changing host)
2021-12-07 20:08:58 +0100wroathe(~wroathe@user/wroathe)
2021-12-07 20:11:35 +0100eggplantade(~Eggplanta@2600:1700:bef1:5e10:b5e5:6571:976d:7afc) (Remote host closed the connection)
2021-12-07 20:13:01 +0100mcgroin(~mcgroin@roc37-h01-176-170-197-243.dsl.sta.abo.bbox.fr) (Ping timeout: 240 seconds)
2021-12-07 20:15:07 +0100tromp(~textual@dhcp-077-249-230-040.chello.nl)
2021-12-07 20:17:36 +0100MoC(~moc@user/moc) (Quit: Konversation terminated!)
2021-12-07 20:18:36 +0100 <monochrom> It's very clever. The time's-up handler simply fakes a heap-full condition and let the thread run normally until it tries to allocation. >:)
2021-12-07 20:19:04 +0100kmein(~weechat@user/kmein) (Quit: ciao kakao)
2021-12-07 20:19:21 +0100 <EvanR> oh oh
2021-12-07 20:19:23 +0100kmein(~weechat@user/kmein)
2021-12-07 20:19:31 +0100 <EvanR> very tricky
2021-12-07 20:20:00 +0100Erutuon(~Erutuon@user/erutuon)
2021-12-07 20:20:32 +0100 <EvanR> so if the thread is not doing any allocation or I/O for a long time that locks up the entire runtime? or just the capability
2021-12-07 20:20:44 +0100 <monochrom> The capability.
2021-12-07 20:22:56 +0100hskpractice(~hskpracti@94-255-217-215.cust.bredband2.com)
2021-12-07 20:23:49 +0100wroathe(~wroathe@user/wroathe) (Ping timeout: 268 seconds)
2021-12-07 20:24:53 +0100merijn(~merijn@83-160-49-249.ip.xs4all.nl)
2021-12-07 20:27:31 +0100hskpractice(~hskpracti@94-255-217-215.cust.bredband2.com) (Ping timeout: 256 seconds)
2021-12-07 20:29:01 +0100eggplantade(~Eggplanta@2600:1700:bef1:5e10:b5e5:6571:976d:7afc)
2021-12-07 20:29:33 +0100merijn(~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 252 seconds)
2021-12-07 20:30:34 +0100kupi(uid212005@id-212005.hampstead.irccloud.com)
2021-12-07 20:31:37 +0100tromp(~textual@dhcp-077-249-230-040.chello.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
2021-12-07 20:33:37 +0100fizbin(~fizbin@c-73-33-197-160.hsd1.nj.comcast.net) (Remote host closed the connection)
2021-12-07 20:35:07 +0100 <dminuoso> % data Foo = Foo { foo :: Int, bar :: Int }
2021-12-07 20:35:08 +0100 <yahb> dminuoso:
2021-12-07 20:35:17 +0100 <dminuoso> % x :: Applicative f => f Foo; x = do foo <- pure 1; let b = 1 in pure Foo{..}
2021-12-07 20:35:17 +0100 <yahb> dminuoso: ; <interactive>:63:37: error:; * Could not deduce (Monad f) arising from a do statement; from the context: Applicative f; bound by the type signature for:; x :: forall (f :: * -> *). Applicative f => f Foo; at <interactive>:63:1-27; Possible fix:; add (Monad f) to the context of; the type signature for:; x :: forall (f :: * ->
2021-12-07 20:35:23 +0100 <dminuoso> What is this. I cant even use let-in? :(
2021-12-07 20:35:30 +0100 <dminuoso> I mean I can just `<- pure` my way out of this
2021-12-07 20:35:36 +0100 <dminuoso> But this is really bizarre
2021-12-07 20:35:39 +0100max22-(~maxime@2a01cb08833598007f53408425037c9d.ipv6.abo.wanadoo.fr)
2021-12-07 20:36:03 +0100 <dminuoso> As far as I can tell, this could be some interaction with RecordWildCards
2021-12-07 20:36:13 +0100 <dminuoso> % x :: Applicative f => f Int; x = do foo <- pure 1; let b = 1 in pure 10
2021-12-07 20:36:14 +0100 <yahb> dminuoso: ; <interactive>:64:37: error:; * Could not deduce (Monad f) arising from a do statement; from the context: Applicative f; bound by the type signature for:; x :: forall (f :: * -> *). Applicative f => f Int; at <interactive>:64:1-27; Possible fix:; add (Monad f) to the context of; the type signature for:; x :: forall (f :: * ->
2021-12-07 20:36:18 +0100 <dminuoso> Mmm, no its not that either
2021-12-07 20:36:21 +0100 <geekosaur> or just the ApplicativeDo stuff being dukmb
2021-12-07 20:36:25 +0100fizbin(~fizbin@c-73-33-197-160.hsd1.nj.comcast.net)
2021-12-07 20:36:29 +0100 <geekosaur> I thought it only handled certain patterns
2021-12-07 20:36:54 +0100 <dminuoso> Well it can do let-in in principle:
2021-12-07 20:36:56 +0100 <dminuoso> % x :: Applicative f => f Foo; x = do let b = 1 in pure Foo{..}
2021-12-07 20:36:56 +0100 <yahb> dminuoso: ; <interactive>:66:55: warning: [-Wmissing-fields]; * Fields of `Foo' not initialised: foo, bar; * In the first argument of `pure', namely `Foo {..}'; In the expression: pure Foo {..}; In a stmt of a 'do' block: let b = 1 in pure Foo {..}
2021-12-07 20:37:30 +0100gehmehgeh(~user@user/gehmehgeh)
2021-12-07 20:37:46 +0100 <dminuoso> % x :: Applicative f => f Foo; x = do let foo = 1; bar = 1; in pure Foo{..}
2021-12-07 20:37:46 +0100 <yahb> dminuoso:
2021-12-07 20:38:24 +0100 <dminuoso> geekosaur: Perhaps you're right. I mean this seems like it would require more than a mechanical process.
2021-12-07 20:38:46 +0100 <janus> what is it that is bizarre? isn't this the motivation for ApplicativeDo?
2021-12-07 20:38:59 +0100 <dminuoso> janus: That extension is enabled.
2021-12-07 20:39:23 +0100 <janus> ooooh ok
2021-12-07 20:39:44 +0100geekosaur(~geekosaur@xmonad/geekosaur) (Remote host closed the connection)
2021-12-07 20:39:52 +0100 <dminuoso> Originally I thought the monad let bindings were bad, but it seems regulat let-in force Monad back in.
2021-12-07 20:40:36 +0100 <dminuoso> Maybe this is because in principle let bindings could refer to `a <-` type of variables?
2021-12-07 20:40:48 +0100 <dminuoso> That would definitely thwart a mechanical translation
2021-12-07 20:40:58 +0100tromp(~textual@dhcp-077-249-230-040.chello.nl)
2021-12-07 20:42:31 +0100cheater(~Username@user/cheater) (Ping timeout: 265 seconds)
2021-12-07 20:42:34 +0100geekosaur(~geekosaur@xmonad/geekosaur)
2021-12-07 20:43:04 +0100dhouthoo(~dhouthoo@178-117-36-167.access.telenet.be) (Quit: WeeChat 3.3)
2021-12-07 20:44:46 +0100zer0bitz(~zer0bitz@dsl-hkibng32-54fbfb-173.dhcp.inet.fi) (Read error: Connection reset by peer)
2021-12-07 20:47:19 +0100slack1256(~slack1256@191.125.99.210)
2021-12-07 20:47:35 +0100 <monochrom> "let x = e in return x" is one of the forms that the user guide names as unsupported.
2021-12-07 20:47:49 +0100 <janus> :t do let b = 1 in pure b
2021-12-07 20:47:50 +0100 <lambdabot> (Applicative f, Num a) => f a
2021-12-07 20:48:35 +0100 <monochrom> OTOH, "do ..." that doesn't contain any "<-" is simply undo'ed.
2021-12-07 20:48:37 +0100 <janus> :t do a <- pure (); let b = a in pure b
2021-12-07 20:48:38 +0100 <lambdabot> Monad m => m ()
2021-12-07 20:48:41 +0100 <monochrom> :t do 'a'
2021-12-07 20:48:42 +0100 <lambdabot> Char
2021-12-07 20:48:43 +0100cheater(~Username@user/cheater)
2021-12-07 20:49:04 +0100 <monochrom> This is known as PurityDo >:)
2021-12-07 20:49:30 +0100 <geekosaur> :t do a <- pure (); let {b = a}; pure b
2021-12-07 20:49:31 +0100 <lambdabot> Monad m => m ()
2021-12-07 20:50:02 +0100 <janus> :t do let {b=()}; pure b
2021-12-07 20:50:04 +0100 <lambdabot> Applicative f => f ()
2021-12-07 20:50:18 +0100 <janus> so it seems to me that it is not the let forcing it to be monad, it is really the monadic bind?
2021-12-07 20:50:50 +0100 <monochrom> :t do {let {b='a'}; b}
2021-12-07 20:50:51 +0100 <janus> or rather, monadic bind in combination with a let afterwards?
2021-12-07 20:50:52 +0100 <lambdabot> Char
2021-12-07 20:50:53 +0100 <geekosaur> :t do a <- pure (); pure b
2021-12-07 20:50:54 +0100 <lambdabot> Monad m => m Expr
2021-12-07 20:51:10 +0100 <geekosaur> derp
2021-12-07 20:51:11 +0100 <monochrom> do {let {b='a'}; b} is still under PurityDo
2021-12-07 20:51:14 +0100 <geekosaur> :t do a <- pure (); pure a
2021-12-07 20:51:15 +0100 <lambdabot> Monad m => m ()
2021-12-07 20:51:52 +0100 <janus> but why isn't the last one applicative if my first one was?
2021-12-07 20:52:14 +0100 <janus> does lambdabot not have ApplicativeDo ?
2021-12-07 20:52:35 +0100 <janus> % :t do a <- pure (); pure a
2021-12-07 20:52:36 +0100 <yahb> janus: Applicative f => f ()
2021-12-07 20:52:47 +0100cosimone(~user@2001:b07:ae5:db26:c24a:d20:4d91:1e20) (Remote host closed the connection)
2021-12-07 20:52:51 +0100 <EvanR> PurityDo is a thing?
2021-12-07 20:53:07 +0100 <monochrom> Ah lambdabot doesn't have ApplicativeDo
2021-12-07 20:53:09 +0100 <janus> oooh ok, so i was confused. i wrote 'let..in' before, so it is PurityDo as monochrom mentions
2021-12-07 20:53:29 +0100 <geekosaur> @let {-# Language ApplicativeDo #-}
2021-12-07 20:53:30 +0100 <lambdabot> Defined.
2021-12-07 20:53:30 +0100 <monochrom> PurityDo is my made-up name for Haskell2010
2021-12-07 20:53:38 +0100 <geekosaur> :t do a <- pure (); pure a
2021-12-07 20:53:39 +0100 <lambdabot> Monad m => m ()
2021-12-07 20:53:45 +0100cosimone(~user@2001:b07:ae5:db26:c24a:d20:4d91:1e20)
2021-12-07 20:54:27 +0100 <janus> % :t do let {b = 1}; pure b
2021-12-07 20:54:27 +0100 <yahb> janus: (Applicative f, Num a) => f a
2021-12-07 20:54:53 +0100 <janus> dminuoso: here you can see that even if using monadic let, it isn't necessarily Monad. and this is yah
2021-12-07 20:54:56 +0100 <janus> b
2021-12-07 20:55:49 +0100eggplantade(~Eggplanta@2600:1700:bef1:5e10:b5e5:6571:976d:7afc) (Remote host closed the connection)
2021-12-07 20:55:50 +0100 <janus> s/monadic let/let in do notation (i.e. without in)/
2021-12-07 20:57:30 +0100yauhsien(~yauhsien@61-231-32-247.dynamic-ip.hinet.net)
2021-12-07 20:58:01 +0100 <janus> let-in shouldn't mess with whether it is Applicative/Monad at all, since that syntax goes every where a pure expression goes, if I understand correctly
2021-12-07 20:58:16 +0100 <janus> does that sound correct?
2021-12-07 20:58:31 +0100 <geekosaur> unless the stuff that translates ApplicativeDo is dumb about it
2021-12-07 20:58:48 +0100 <geekosaur> but "do notation" let just translates directly into let … in do
2021-12-07 20:59:44 +0100gehmehgeh_(~user@user/gehmehgeh)
2021-12-07 21:00:39 +0100merijn(~merijn@83-160-49-249.ip.xs4all.nl)
2021-12-07 21:01:01 +0100 <janus> but if "do notation" with ApplicativeDo translated that directly, then how can it change which constraint is inferred? it seems like if i write a manual 'let..in do' it won't change the constraint
2021-12-07 21:01:16 +0100 <monochrom> It takes more work to support "let", in particular work to explain the fine prints.
2021-12-07 21:01:26 +0100retroid_(~retro@97e2ba2e.skybroadband.com) (Ping timeout: 268 seconds)
2021-12-07 21:01:30 +0100retro_(~retro@97e2ba2e.skybroadband.com)
2021-12-07 21:01:36 +0100gehmehgeh(~user@user/gehmehgeh) (Ping timeout: 276 seconds)
2021-12-07 21:02:29 +0100whatsupdoc(uid509081@id-509081.hampstead.irccloud.com)
2021-12-07 21:03:10 +0100 <monochrom> For example, "do x <- m; let { y = x }; z <- f y; ... " incurs Monad. "do x <- m; let { y = x }; z <- n; pure (y,z)" incurs Applicative.
2021-12-07 21:03:36 +0100lagash(lagash@lagash.shelltalk.net) (Quit: ZNC - https://znc.in)
2021-12-07 21:03:45 +0100 <monochrom> It is a bit of a rabbit hole to explain the difference.
2021-12-07 21:03:49 +0100yauhsien(~yauhsien@61-231-32-247.dynamic-ip.hinet.net) (Ping timeout: 240 seconds)
2021-12-07 21:04:16 +0100lagash(lagash@lagash.shelltalk.net)
2021-12-07 21:05:14 +0100juhp(~juhp@128.106.188.82) (Ping timeout: 265 seconds)
2021-12-07 21:05:25 +0100merijn(~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 240 seconds)
2021-12-07 21:05:42 +0100 <EvanR> wait what
2021-12-07 21:05:47 +0100 <janus> % :t :t do x <- pure (); let { y = x }; z <- pure (); pure (y,z)
2021-12-07 21:05:47 +0100 <yahb> janus: ; <interactive>:1:1: error: parse error on input `:'
2021-12-07 21:05:52 +0100 <janus> % :t do x <- pure (); let { y = x }; z <- pure (); pure (y,z)
2021-12-07 21:05:52 +0100 <yahb> janus: Monad f => f ((), ())
2021-12-07 21:06:05 +0100 <janus> monochrom: isn't that similar to your second example? it infers monad, not applicative
2021-12-07 21:06:19 +0100 <monochrom> But perhaps "let ... in pure E" as the very last clause should be supported and it is easy to check.
2021-12-07 21:06:45 +0100 <dsal> I'm slightly confused about how thunks resolve. If I have a lazy map, can I force it to WHNF?
2021-12-07 21:06:46 +0100juhp(~juhp@128.106.188.82)
2021-12-07 21:06:53 +0100 <dsal> er, can I force a value inside of it.
2021-12-07 21:07:03 +0100 <monochrom> I was saying, if "let" were to be supported, then someone would have to write an algorithm that could tell the difference, and also write the user guide.
2021-12-07 21:07:10 +0100 <geekosaur> there is no lazy Map as such
2021-12-07 21:07:11 +0100 <dsal> i.e., I want to ask for a value twice and do the work once.
2021-12-07 21:07:28 +0100 <geekosaur> the operations are lazy or strict, the Map itself is the same in either case
2021-12-07 21:07:37 +0100 <geekosaur> so you can force values as you wish
2021-12-07 21:08:27 +0100lagash(lagash@lagash.shelltalk.net) (Client Quit)
2021-12-07 21:08:34 +0100 <dsal> geekosaur: Yeah, I kind of understand that, just not quite sure how to think about whether I can resolve a value and have it stay in the map.
2021-12-07 21:08:35 +0100 <geekosaur> (and iirc is spine-strict regardless)
2021-12-07 21:08:48 +0100lagash(lagash@lagash.shelltalk.net)
2021-12-07 21:09:06 +0100 <janus> monochrom: ok, so when you said "incur" you mean what the typechecker should ideally infer, not what it actually does?
2021-12-07 21:09:15 +0100 <monochrom> Right.
2021-12-07 21:09:55 +0100 <dsal> Data.Map.Strict.lookup doesn't seem to care about whether the value itself has been evaluated, so it doesn't seem to happen *there*.
2021-12-07 21:10:41 +0100 <geekosaur> right, using the resulting value would force it, why would that remove it from the Map? it should simply be already evaluated at that point
2021-12-07 21:10:53 +0100 <monochrom> Yes you can resolve a value and it stays in the map.
2021-12-07 21:11:01 +0100notzmv(~zmv@user/notzmv) (Ping timeout: 240 seconds)
2021-12-07 21:11:19 +0100 <dsal> I'm thinking about my local binding as being resolved, but that wouldn't necessarily resolve the value in the map, would it?
2021-12-07 21:11:21 +0100 <monochrom> Including the memoization you have in mind.
2021-12-07 21:11:29 +0100 <dsal> i.e., if I asked for the same value again, it'd do the work again, right?
2021-12-07 21:11:42 +0100 <janus> ok i guess i understand why there was so much contention around ApplicativeDo in the survey. it sounds great but seems to be problematic in practise
2021-12-07 21:11:49 +0100 <geekosaur> why wouldn't it? under the hood it gives you a pointer to the value inside the Map
2021-12-07 21:11:56 +0100 <geekosaur> purity means this is safe
2021-12-07 21:12:21 +0100 <dsal> Sure, I know that it *can* do that, I just don't know what it *will* do or what I should assume will happen.
2021-12-07 21:12:41 +0100 <geekosaur> lookup would have to do extra work for that not to happen
2021-12-07 21:13:06 +0100 <dsal> It's not obvious to me that `!a = b` would affect b.
2021-12-07 21:13:07 +0100 <geekosaur> it would have to specifically copy the value itself, which is not particularly easy
2021-12-07 21:13:55 +0100 <monochrom> This is why byorgey says to use Data.Map for dynamic programming.
2021-12-07 21:14:16 +0100 <dsal> OK, so it sounds like I actually get the reference that's in the map. That part wasn't clear to me. I guess I was thinking I'd have another thunk somehow.
2021-12-07 21:15:16 +0100dschrempf(~dominik@070-207.dynamic.dsl.fonira.net)
2021-12-07 21:15:43 +0100 <geekosaur> that again would require it to do more work
2021-12-07 21:16:04 +0100 <geekosaur> the obvious implementations of lookup would simply produce the reference in the map
2021-12-07 21:16:45 +0100 <dsal> I'm not exactly sure how. My mental model assumed it would just copy the box that includes either the value or the thunk.
2021-12-07 21:17:32 +0100lagash(lagash@lagash.shelltalk.net) (Quit: ZNC - https://znc.in)
2021-12-07 21:18:32 +0100 <monochrom> "It's pointers all the way down."
2021-12-07 21:19:26 +0100 <dsal> It's nice that I can assume it'd do the thing that's helpful, I guess. :)
2021-12-07 21:19:48 +0100 <geekosaur> that's kinda the point of haskell being pure
2021-12-07 21:20:04 +0100 <monochrom> If you do a "Map.insert k 5 d", a heap object containing 5 is created on the heap, a pointer to that heap object is store in your dictionary.
2021-12-07 21:20:19 +0100 <monochrom> If you do a lookup, you get that pointer.
2021-12-07 21:20:44 +0100 <dsal> Well that sounds simple.
2021-12-07 21:21:15 +0100 <dsal> Every time I think something is complicated, it ends up I'm just dumb and things are more simple than I expected.
2021-12-07 21:21:18 +0100 <monochrom> If you use a debugger to change that 5 to 6 behind your back, then do a lookup, you get that pointer but now it points to 6.
2021-12-07 21:21:46 +0100ftzm(~ftzm@085081036237.dynamic.telenor.dk)
2021-12-07 21:22:44 +0100burnsidesLlama(~burnsides@dhcp168-017.wadham.ox.ac.uk)
2021-12-07 21:22:47 +0100kmein(~weechat@user/kmein) (Quit: ciao kakao)
2021-12-07 21:23:04 +0100kmein(~weechat@user/kmein)
2021-12-07 21:23:15 +0100 <monochrom> This is why Haskell is not ready for space travel. Too much cosmic rays that ruin the referential transparency.
2021-12-07 21:23:45 +0100 <monochrom> C fare much better because you just have to say "volatile int x". >:)
2021-12-07 21:25:56 +0100kmein(~weechat@user/kmein) (Client Quit)
2021-12-07 21:26:15 +0100kmein(~weechat@user/kmein)
2021-12-07 21:26:56 +0100famubu(~famubu@user/famubu) (Remote host closed the connection)
2021-12-07 21:27:53 +0100 <nfd> i think our guidance systems are going to continue to look the same way they've looked since the 80s, until they can't source the parts from all the vendors
2021-12-07 21:28:12 +0100 <nfd> like... radiation-hardened pacemakers
2021-12-07 21:28:26 +0100burnsidesLlama(~burnsides@dhcp168-017.wadham.ox.ac.uk) (Ping timeout: 265 seconds)
2021-12-07 21:28:57 +0100xff0x(~xff0x@port-92-193-200-89.dynamic.as20676.net) (Ping timeout: 252 seconds)
2021-12-07 21:29:12 +0100lagash(lagash@lagash.shelltalk.net)
2021-12-07 21:29:19 +0100raehik(~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net) (Ping timeout: 252 seconds)
2021-12-07 21:31:51 +0100Techcable(~Techcable@168.235.93.147)
2021-12-07 21:32:09 +0100ftzm(~ftzm@085081036237.dynamic.telenor.dk) (Quit: Client closed)
2021-12-07 21:32:47 +0100deadmarshal(~deadmarsh@95.38.118.214) (Ping timeout: 265 seconds)
2021-12-07 21:34:54 +0100 <nfd> (and, of course, if you're using `volatile` to do much other than device memory mapping/some very particular synchronization stuff, You're Doing It Wrong. computer systems for space travel actually use two different guidance systems from different vendors, cleanroom separated in their development, tied to the same clock, and then the results are checked for agreement. if one chip's wrong, they turn it off
2021-12-07 21:35:00 +0100 <nfd> and keep flying with the rest. or at least this is what i recall from my concurrency class in uni)
2021-12-07 21:35:55 +0100 <EvanR> ah the byzantine dynamic duo problem
2021-12-07 21:36:29 +0100gehmehgeh_(~user@user/gehmehgeh) (Remote host closed the connection)
2021-12-07 21:36:37 +0100cfricke(~cfricke@user/cfricke) (Quit: WeeChat 3.3)
2021-12-07 21:36:39 +0100 <nfd> so i guess haskell *could* be ready for space travel in one of the HDL/embedded behavior-style DSLs, in principle. you're gonna use a supervisor anyway :D
2021-12-07 21:36:50 +0100xacktm(xacktm@user/xacktm) (Ping timeout: 252 seconds)
2021-12-07 21:36:59 +0100eggplantade(~Eggplanta@2600:1700:bef1:5e10:b5e5:6571:976d:7afc)
2021-12-07 21:37:08 +0100gehmehgeh_(~user@user/gehmehgeh)
2021-12-07 21:37:14 +0100 <monochrom> I was joking!
2021-12-07 21:37:20 +0100 <nfd> small systems like that shouldn't be messing with stuff like heaps when there's strict realtime constraints so your joke wasn't wrong
2021-12-07 21:37:29 +0100dschrempf(~dominik@070-207.dynamic.dsl.fonira.net) (Quit: WeeChat 3.3)
2021-12-07 21:38:12 +0100 <geekosaur> there is at least one haskell compiler that would work well for such systems (jhc)
2021-12-07 21:38:28 +0100 <dsal> Apparently haskell is used for Tesla car stuff.
2021-12-07 21:38:35 +0100 <dsal> Just not the runtime.
2021-12-07 21:39:25 +0100andreas303(andreas303@ip227.orange.bnc4free.com) (Quit: fBNC - https://bnc4free.com)
2021-12-07 21:39:33 +0100 <geekosaur> there's a fair amount of haskell *producing* runtimes via clash or atm or etc.
2021-12-07 21:39:41 +0100 <nfd> Hume hasn't seen any attention for a while iirc but it seemed like a fun concept to me
2021-12-07 21:39:51 +0100 <geekosaur> *atom
2021-12-07 21:48:31 +0100bollu(uid233390@id-233390.helmsley.irccloud.com)
2021-12-07 21:51:25 +0100xff0x(~xff0x@2001:1a81:52ad:7f00:863f:6855:4758:14df)
2021-12-07 21:52:42 +0100 <oats> yay day 5 https://github.com/oatberry/aoc2021-haskell/blob/main/src/Day5.hs
2021-12-07 21:53:18 +0100 <oats> not very fast, takes about a second on my system
2021-12-07 21:53:46 +0100 <oats> I still don't really have a great sense for predicting performance of my haskel lcode
2021-12-07 21:53:51 +0100 <tomsmeding> should have used an array
2021-12-07 21:53:52 +0100 <EvanR> I macguyvered some pretty click bingo parsers using only a basic split
2021-12-07 21:54:05 +0100 <tomsmeding> https://git.tomsmeding.com/AOC/tree/2021/5.hs 31ms on my system
2021-12-07 21:54:06 +0100Pickchea(~private@user/pickchea)
2021-12-07 21:54:16 +0100 <EvanR> yeah vector rocks
2021-12-07 21:54:18 +0100 <tomsmeding> (code quality is less though :p )
2021-12-07 21:54:32 +0100 <oats> tomsmeding, ah yeh, I didn't take into consideration that it might be bounded-size
2021-12-07 21:54:33 +0100 <EvanR> when switching from list to vector I didn't really have to change much
2021-12-07 21:54:37 +0100 <oats> the diagram
2021-12-07 21:54:59 +0100user01(~aj@154.0.137.32) (Quit: Leaving.)
2021-12-07 21:55:00 +0100slac85734(~slack1256@191.125.99.72)
2021-12-07 21:55:04 +0100 <tomsmeding> oats: I just made the array from minimum coordinates through maximum coordinates, after observing that the numbers weren't _too_ far out
2021-12-07 21:55:54 +0100eggplantade(~Eggplanta@2600:1700:bef1:5e10:b5e5:6571:976d:7afc) (Remote host closed the connection)
2021-12-07 21:56:08 +0100eggplantade(~Eggplanta@2600:1700:bef1:5e10:b5e5:6571:976d:7afc)
2021-12-07 21:57:01 +0100slack1256(~slack1256@191.125.99.210) (Ping timeout: 240 seconds)
2021-12-07 21:57:23 +0100x88x88x(~x88x88x@149.28.53.172) (Remote host closed the connection)
2021-12-07 21:57:43 +0100x88x88x(~x88x88x@149.28.53.172)
2021-12-07 21:58:15 +0100x88x88x(~x88x88x@149.28.53.172) (Remote host closed the connection)
2021-12-07 21:59:00 +0100vicfred(~vicfred@user/vicfred)
2021-12-07 22:00:14 +0100 <kennyd> this is some cool shit.. self learning table tennis robot https://www.youtube.com/watch?v=u3L8vGMDYD8
2021-12-07 22:00:41 +0100 <dsal> oats: We have some big inputs. I'm doing 5ms on one the larger ones.
2021-12-07 22:00:50 +0100 <dminuoso> monochrom: Ah thanks for the pointers.
2021-12-07 22:00:52 +0100hskpractice(~hskpracti@94-255-217-215.cust.bredband2.com)
2021-12-07 22:01:05 +0100InternetCitizen(~fuzzypixe@ensi-libre-service-019.ensimag.fr) (Ping timeout: 256 seconds)
2021-12-07 22:01:14 +0100 <dsal> oats: want to learn a couple new weird things? :)
2021-12-07 22:01:30 +0100 <oats> dsal, hell yeah, do your worst
2021-12-07 22:01:36 +0100_ht(~quassel@82-169-194-8.biz.kpn.net) (Remote host closed the connection)
2021-12-07 22:01:54 +0100 <dsal> oats: So, the big inputs are here: https://the-tk.com/project/aoc2021-bigboys.html
2021-12-07 22:01:54 +0100 <dminuoso> I guess at the end I can use `<- pure` as a poor mans let-binding in ApplicativeDo
2021-12-07 22:02:48 +0100 <oats> dsal, haha, this is great
2021-12-07 22:02:48 +0100mcgroin(~mcgroin@roc37-h01-176-170-197-243.dsl.sta.abo.bbox.fr)
2021-12-07 22:03:17 +0100x88x88x(~x88x88x@2001:19f0:5:39a8:5400:3ff:feb6:73cb)
2021-12-07 22:03:23 +0100 <dsal> Oh no, I lost my benches for the big ones...
2021-12-07 22:04:15 +0100 <EvanR> this is funny and spoilery for day 7
2021-12-07 22:04:33 +0100 <EvanR> the right location for part 1 is the median and part 2 is average?
2021-12-07 22:04:43 +0100andreas303(andreas303@ip227.orange.bnc4free.com)
2021-12-07 22:05:00 +0100xacktm(xacktm@user/xacktm)
2021-12-07 22:05:33 +0100hskpractice(~hskpracti@94-255-217-215.cust.bredband2.com) (Ping timeout: 256 seconds)
2021-12-07 22:06:18 +0100eggplantade(~Eggplanta@2600:1700:bef1:5e10:b5e5:6571:976d:7afc) (Remote host closed the connection)
2021-12-07 22:06:21 +0100 <EvanR> lies damn lies and statistics
2021-12-07 22:06:27 +0100 <dsal> EvanR: approximately, yeah.
2021-12-07 22:06:49 +0100acidjnk_new(~acidjnk@p200300d0c7271e23ace56c846c004ca7.dip0.t-ipconnect.de)
2021-12-07 22:06:50 +0100 <juri_> where do unit tests come in on that benchmark?
2021-12-07 22:07:02 +0100 <dsal> oats: Never mind, I'm off by a couple orders of magnitude. The 20k is taking me 3-4s not ms.
2021-12-07 22:07:21 +0100 <oats> hehe
2021-12-07 22:07:27 +0100merijn(~merijn@83-160-49-249.ip.xs4all.nl)
2021-12-07 22:08:19 +0100 <dsal> Anyway, a couple interesting things: One: I made my input a functor which I parse into an `Input [(Point, Point)]` and then expand that into an `Input [Int]` where the points are completely flattened.
2021-12-07 22:08:29 +0100 <dsal> There are two very different algorithms for solving this. I'm still discussing the dumb one.
2021-12-07 22:09:08 +0100 <dsal> So, first neat thing: If you have an arbitrary bounded thing, you can bidirectionally map it to Int pretty easily with Data.Ix
2021-12-07 22:10:27 +0100 <dsal> This is how stuff like Array works. But it gives you a thing that's a lot easier to think about indexing. It's just 0-N instead of (x,y) - (x',y').
2021-12-07 22:10:53 +0100 <dsal> The first thing I did was put that in an IntMap. Then I just got rid of the IntMap.
2021-12-07 22:11:31 +0100 <dsal> The question degrades to "how many duplicate numbers are in this list?"
2021-12-07 22:13:17 +0100 <dsal> I did that by just sorting them and counting how often the same thing occurs more than once (approximately (length . filter ((> 0) . length) . group . sort), though my "obviously better" version isn't actually that much faster).
2021-12-07 22:13:26 +0100 <dsal> Next up: Do it without sorting at all.
2021-12-07 22:13:39 +0100InternetCitizen(~fuzzypixe@eth-west-pareq2-46-193-4-100.wb.wifirst.net)
2021-12-07 22:14:17 +0100LiaoTao(~LiaoTao@gateway/tor-sasl/liaotao)
2021-12-07 22:15:26 +0100 <dsal> If you want to go hard, you can do it without expanding all of the points. The largest input would require more than a computer's worth of RAM to remember all the points on all the lines.
2021-12-07 22:28:37 +0100lavaman(~lavaman@98.38.249.169) (Remote host closed the connection)
2021-12-07 22:28:54 +0100eggplantade(~Eggplanta@2600:1700:bef1:5e10:b5e5:6571:976d:7afc)
2021-12-07 22:31:36 +0100jkaye(~jkaye@2601:281:8300:7530:6e92:54cb:12e7:3fa1)
2021-12-07 22:32:22 +0100hskpractice(~hskpracti@94-255-217-215.cust.bredband2.com)
2021-12-07 22:35:05 +0100fizbin(~fizbin@c-73-33-197-160.hsd1.nj.comcast.net) (Remote host closed the connection)
2021-12-07 22:35:33 +0100fizbin(~fizbin@c-73-33-197-160.hsd1.nj.comcast.net)
2021-12-07 22:35:57 +0100 <oats> maybe I'll give it a shot in the far future lol
2021-12-07 22:36:05 +0100 <oats> it's a lot to take in
2021-12-07 22:37:42 +0100jgeerds(~jgeerds@55d4ac73.access.ecotel.net)
2021-12-07 22:39:21 +0100wroathe(~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
2021-12-07 22:39:21 +0100wroathe(~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Changing host)
2021-12-07 22:39:21 +0100wroathe(~wroathe@user/wroathe)
2021-12-07 22:39:43 +0100fizbin(~fizbin@c-73-33-197-160.hsd1.nj.comcast.net) (Ping timeout: 252 seconds)
2021-12-07 22:40:27 +0100merijn(~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 252 seconds)
2021-12-07 22:40:47 +0100senoraraton(~senorarat@192-195-83-130.static.monkeybrains.net)
2021-12-07 22:42:23 +0100n3t(n3t@s45.mydevil.net) (Changing host)
2021-12-07 22:42:23 +0100n3t(n3t@user/n3t)
2021-12-07 22:44:44 +0100 <dsal> Ix makes it pretty easy to use ST as well. :)
2021-12-07 22:46:23 +0100tromp(~textual@dhcp-077-249-230-040.chello.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
2021-12-07 22:46:57 +0100x88x88x(~x88x88x@2001:19f0:5:39a8:5400:3ff:feb6:73cb) (Remote host closed the connection)
2021-12-07 22:47:12 +0100 <EvanR> apparently the sort is the slowest part and so vector algorithms destroys that question
2021-12-07 22:48:03 +0100x88x88x(~x88x88x@149.28.53.172)
2021-12-07 22:49:11 +0100tromp(~textual@dhcp-077-249-230-040.chello.nl)
2021-12-07 22:49:40 +0100x88x88x(~x88x88x@149.28.53.172) (Remote host closed the connection)
2021-12-07 22:50:37 +0100wroathe(~wroathe@user/wroathe) (Ping timeout: 240 seconds)
2021-12-07 22:50:52 +0100curiousgay(~curiousga@77-120-141-90.kha.volia.net) (Remote host closed the connection)
2021-12-07 22:51:19 +0100curiousgay(~curiousga@77-120-141-90.kha.volia.net)
2021-12-07 22:51:45 +0100x88x88x(~x88x88x@2001:19f0:5:39a8:5400:3ff:feb6:73cb)
2021-12-07 22:52:54 +0100lavaman(~lavaman@98.38.249.169)
2021-12-07 22:55:01 +0100burnsidesLlama(~burnsides@dhcp168-017.wadham.ox.ac.uk)
2021-12-07 22:56:28 +0100burnsidesLlama(~burnsides@dhcp168-017.wadham.ox.ac.uk) (Remote host closed the connection)
2021-12-07 22:57:22 +0100burnsidesLlama(~burnsides@dhcp168-017.wadham.ox.ac.uk)
2021-12-07 22:57:36 +0100burnsidesLlama(~burnsides@dhcp168-017.wadham.ox.ac.uk) (Remote host closed the connection)
2021-12-07 22:58:05 +0100burnsidesLlama(~burnsides@dhcp168-017.wadham.ox.ac.uk)
2021-12-07 22:59:04 +0100Morrow(~quassel@bzq-110-168-31-106.red.bezeqint.net) (Remote host closed the connection)
2021-12-07 23:00:08 +0100Morrow(~quassel@bzq-110-168-31-106.red.bezeqint.net)
2021-12-07 23:00:16 +0100mcgroin(~mcgroin@roc37-h01-176-170-197-243.dsl.sta.abo.bbox.fr) (Ping timeout: 265 seconds)
2021-12-07 23:02:41 +0100burnsidesLlama(~burnsides@dhcp168-017.wadham.ox.ac.uk) (Ping timeout: 265 seconds)
2021-12-07 23:03:10 +0100eggplantade(~Eggplanta@2600:1700:bef1:5e10:b5e5:6571:976d:7afc) (Remote host closed the connection)
2021-12-07 23:03:12 +0100raehik(~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net)
2021-12-07 23:05:01 +0100Erutuon(~Erutuon@user/erutuon) (Ping timeout: 240 seconds)
2021-12-07 23:07:16 +0100wroathe(~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
2021-12-07 23:07:16 +0100wroathe(~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Changing host)
2021-12-07 23:07:16 +0100wroathe(~wroathe@user/wroathe)
2021-12-07 23:08:59 +0100Widget(~widget@2a04:ee41:6:70cd:e189:3667:bb4:f6ac)
2021-12-07 23:10:19 +0100kupi(uid212005@id-212005.hampstead.irccloud.com) (Quit: Connection closed for inactivity)
2021-12-07 23:11:25 +0100wroathe(~wroathe@user/wroathe) (Ping timeout: 240 seconds)
2021-12-07 23:15:12 +0100hskpractice(~hskpracti@94-255-217-215.cust.bredband2.com) (Remote host closed the connection)
2021-12-07 23:15:28 +0100hskpractice(~hskpracti@94-255-217-215.cust.bredband2.com)
2021-12-07 23:15:50 +0100 <maerwald> is there an Either with a 3rd constructor?
2021-12-07 23:16:17 +0100 <[exa]> Left, Center, Right?
2021-12-07 23:16:21 +0100 <dminuoso> Do you mean These?
2021-12-07 23:16:24 +0100 <maerwald> no, not These
2021-12-07 23:16:28 +0100 <maerwald> that has different meaning
2021-12-07 23:16:32 +0100 <maerwald> [exa]: yeah
2021-12-07 23:16:34 +0100 <dminuoso> I dont know what meaning you are looking for
2021-12-07 23:17:10 +0100 <maerwald> These has 2 type variables
2021-12-07 23:17:17 +0100takuan(~takuan@178-116-218-225.access.telenet.be) (Remote host closed the connection)
2021-12-07 23:17:32 +0100 <maerwald> I want 3
2021-12-07 23:17:45 +0100 <dminuoso> You didn't state that in the initial question. :P
2021-12-07 23:17:50 +0100 <[exa]> maerwald: so Center should be "neutral middle choice that acts as a kinda default when nothing interesting happened" right?
2021-12-07 23:17:55 +0100 <maerwald> dminuoso: it's more mysterious that way
2021-12-07 23:18:04 +0100 <[exa]> s/right/checks/ :D
2021-12-07 23:18:08 +0100 <dminuoso> maerwald: Okay. Then the answer is yes.
2021-12-07 23:18:18 +0100 <slac85734> I want to corroborate something about the LLVM backend on linux. It seems to me that when using the `-fllvm` option, we compile with `llc` but we link with the gnu linker. Is that right?
2021-12-07 23:18:22 +0100 <maerwald> [exa]: not sure... I have 3 alternatives and am too lazy to think up names that make sense
2021-12-07 23:18:23 +0100 <dminuoso> For mystery reasons I will keep details to myself.
2021-12-07 23:18:23 +0100slac85734slack1256
2021-12-07 23:18:28 +0100 <dminuoso> :o)
2021-12-07 23:18:31 +0100 <[exa]> maerwald: jain logic?
2021-12-07 23:18:42 +0100 <maerwald> it's a mystery, really
2021-12-07 23:19:49 +0100 <[exa]> maerwald: would it be isomorphic to`Either (Either l r) center` ?
2021-12-07 23:19:53 +0100 <AndreasK> slack1256: Doesn't ghc use the gold linker by now on linux?
2021-12-07 23:20:08 +0100 <hpc> maerwald: just write your dependent sum on Ordering instead of Bool :D
2021-12-07 23:20:20 +0100 <maerwald> [exa]: obviously
2021-12-07 23:20:29 +0100 <[exa]> hpc: +1
2021-12-07 23:20:59 +0100senoraraton(~senorarat@192-195-83-130.static.monkeybrains.net) (Ping timeout: 256 seconds)
2021-12-07 23:21:00 +0100 <slack1256> AndreasK: Right. The gold linker is included in binutils thought.
2021-12-07 23:21:15 +0100 <slack1256> But on MacOs it should use the LLVM linker right?
2021-12-07 23:21:17 +0100notzmv(~zmv@user/notzmv)
2021-12-07 23:21:25 +0100 <AndreasK> slack1256: You can check what exactly is invoked by passing -v to ghc iirc
2021-12-07 23:21:29 +0100 <hpc> one of these days i want to write a type-level math package where 2 = Bool, 3 = Ordering, 4 = IOMode, etc
2021-12-07 23:21:54 +0100 <slack1256> AndreasK: :-O
2021-12-07 23:21:55 +0100 <geekosaur> it uses the mach-o linker, I believe
2021-12-07 23:22:21 +0100 <geekosaur> are you looking for something in particular?
2021-12-07 23:23:17 +0100michalz(~michalz@185.246.204.62) (Remote host closed the connection)
2021-12-07 23:23:32 +0100 <slack1256> Yeah. On the company I work a partner uses an M1 macbook and he is having problems compiling our project.
2021-12-07 23:24:05 +0100 <slack1256> He uses the llvm backend but gets an error like: `pixura-indexer> [ 4 of 72] Compiling Pixura.Indexer.Index
2021-12-07 23:24:08 +0100 <slack1256> pixura-indexer> <command line>: dlopen(/Users/koloz/Documents/superrare/repos/pixura-backend/.stack-work/install/x86_64-osx/25cc8bfe483a5d26226136b4f70e481c7477be16d3f0d6d7c8837fd6cbc8e641/8.10.7/lib/x86_64-osx-ghc-8.10.7/libHSpixura-models-0.1.0.0-85icpJLsgeHGfI1Ygzp720-ghc8.10.7.dylib, 0x0005): symbol not found in flat namespace '_rarestzmcontractszm0zi1zi0zi0zmKX2iXgyAgAwAOvKj5Nv0rzz_RarestContractsziContractsziSuperRareBazzaar_zdfToJSONAuctionBidzu
2021-12-07 23:24:08 +0100 <slack1256> zdctoJSON_closure'.
2021-12-07 23:24:35 +0100 <slack1256> That looked like an linker issue to me!
2021-12-07 23:24:41 +0100 <janus> hpc: isn't that just `Vec n Unit` ?
2021-12-07 23:24:50 +0100 <slack1256> Sorry for the warped paste.
2021-12-07 23:25:06 +0100mvk(~mvk@2607:fea8:5cdd:f000::9788)
2021-12-07 23:25:15 +0100 <janus> :P
2021-12-07 23:25:21 +0100 <geekosaur> that's the dynamic linker built into the bytecode backend, failing to load a shared object needed for Template Haskell
2021-12-07 23:25:24 +0100 <hpc> janus: yes, but not as awesome
2021-12-07 23:25:31 +0100 <hpc> don't forget i am the author of acme-php :D
2021-12-07 23:26:00 +0100 <geekosaur> not using either gold nor lld nor MacOS ld
2021-12-07 23:26:21 +0100 <geekosaur> "dlopen" is the key here
2021-12-07 23:26:31 +0100 <slack1256> :-O That is weird!
2021-12-07 23:27:33 +0100 <slack1256> It seems his machine is case insensitive. That can be it.
2021-12-07 23:28:11 +0100tromp(~textual@dhcp-077-249-230-040.chello.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
2021-12-07 23:28:13 +0100 <geekosaur> hr. thought Apple refused to support case-insensitive installs these days
2021-12-07 23:28:28 +0100 <geekosaur> (since 10.3 or thenabouts)
2021-12-07 23:29:36 +0100 <raehik> Can I write/export a "kind synonym"? I have Type1 and Type2 which are both TypeLikes in their kind signature, and I want to ease referring to TypeLikes
2021-12-07 23:30:10 +0100 <raehik> I tried standalone kind sigs, but I misunderstood its use -- it's for defining the kind of an accompanying type. not a sort of reusable synonym
2021-12-07 23:31:05 +0100 <geekosaur> I think you need ConstraintKinds to do that?
2021-12-07 23:32:29 +0100 <yin> why am i geting an error on a simple [MyCustomDataConstructor..AnotherAndYesIDerivedEnum]
2021-12-07 23:32:45 +0100 <raehik> geekosaur: yes that looks likely by a glance. looking at how I could use it
2021-12-07 23:32:59 +0100 <geekosaur> because it's parsed as (MyCustomDataConstructor..)
2021-12-07 23:33:04 +0100 <geekosaur> use spaces
2021-12-07 23:33:13 +0100 <yin> oh no
2021-12-07 23:33:24 +0100 <geekosaur> (that is, it's looking for operator . in package MyCustomDataConstructor)
2021-12-07 23:33:41 +0100 <yin> i hate dot syntaxes :(
2021-12-07 23:33:47 +0100 <yin> thank you
2021-12-07 23:33:49 +0100 <yin> my bad
2021-12-07 23:34:21 +0100 <raehik> wait actually, I *was* just writing a type synonym! lol
2021-12-07 23:34:46 +0100 <raehik> ConstraintKinds would solve a similar problem tho
2021-12-07 23:35:18 +0100 <geekosaur> I think it enables type synonym syntax to also represent kind synonyms
2021-12-07 23:35:39 +0100stef204(~stef204@user/stef204) (Quit: WeeChat 3.3)
2021-12-07 23:37:49 +0100 <raehik> I'm probably mixing up my terminology. I did type TypeLike = A -> B -> C and can use it like `class UseTypeLike (a :: TypeLike) ...` :)
2021-12-07 23:39:55 +0100 <geekosaur> the first is the one I think needs ConstraintKinds; the second I think is KindSignatures
2021-12-07 23:40:39 +0100 <raehik> haha I can't tell, I have KindSigs on by default but not ConstraintKinds buuut it's probably implied by my 20 defaults.
2021-12-07 23:41:04 +0100jakalx(~jakalx@base.jakalx.net) (Error from remote client)
2021-12-07 23:41:35 +0100jakalx(~jakalx@base.jakalx.net)
2021-12-07 23:46:41 +0100hskpractice(~hskpracti@94-255-217-215.cust.bredband2.com) (Remote host closed the connection)
2021-12-07 23:46:59 +0100hskpractice(~hskpracti@94-255-217-215.cust.bredband2.com)
2021-12-07 23:48:39 +0100hskpractice(~hskpracti@94-255-217-215.cust.bredband2.com) (Remote host closed the connection)
2021-12-07 23:48:57 +0100hskpractice(~hskpracti@94-255-217-215.cust.bredband2.com)
2021-12-07 23:49:15 +0100gehmehgeh_(~user@user/gehmehgeh) (Quit: Leaving)
2021-12-07 23:50:55 +0100hskpractice(~hskpracti@94-255-217-215.cust.bredband2.com) (Remote host closed the connection)
2021-12-07 23:51:13 +0100hskpractice(~hskpracti@94-255-217-215.cust.bredband2.com)
2021-12-07 23:52:53 +0100hskpractice(~hskpracti@94-255-217-215.cust.bredband2.com) (Remote host closed the connection)
2021-12-07 23:53:11 +0100hskpractice(~hskpracti@94-255-217-215.cust.bredband2.com)
2021-12-07 23:54:46 +0100eggplantade(~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net)
2021-12-07 23:57:54 +0100sciencentistguy(~sciencent@hacksoc/ordinary-member)
2021-12-07 23:59:57 +0100hskpractice(~hskpracti@94-255-217-215.cust.bredband2.com) (Remote host closed the connection)