2021/12/29

2021-12-29 00:00:31 +0100 <monochrom> If you want to dive into the theory, that's a rabbit hole of doing formal differentiation on type expressions >:)
2021-12-29 00:00:39 +0100shapr(~user@pool-100-36-247-68.washdc.fios.verizon.net) (Remote host closed the connection)
2021-12-29 00:00:50 +0100 <EvanR> "the zipper design pattern" chapter by gang of λ
2021-12-29 00:00:53 +0100shapr(~user@pool-100-36-247-68.washdc.fios.verizon.net)
2021-12-29 00:01:32 +0100hiato(~op_4@user/op-4/x-9116473) (Quit: ZNC 1.8.2+deb2+b1 - https://znc.in)
2021-12-29 00:02:11 +0100op_4(~op_4@user/op-4/x-9116473)
2021-12-29 00:02:50 +0100 <dsal> It's more tedious than I'd like.
2021-12-29 00:04:59 +0100 <dsal> In particular, I can't randomly jump between points.
2021-12-29 00:05:22 +0100 <EvanR> if it's a static structure, you can put all possible zippers in a map
2021-12-29 00:06:01 +0100 <dsal> The problem is that I need to modify a few different parts.
2021-12-29 00:06:10 +0100biberu\(~biberu@user/biberu)
2021-12-29 00:06:35 +0100 <dsal> I started by making an iterator that would do the thing, which was pretty easy, but if I replace a hole, I get a new zipper and can't just replace holes in others and have it do something meaningful.
2021-12-29 00:06:44 +0100 <EvanR> then zippering around seems absolutely necessary given how haskell data works
2021-12-29 00:06:58 +0100 <EvanR> rather, how it gets modified
2021-12-29 00:07:11 +0100 <monochrom> Zipper jumps to adjacent places only, yeah.
2021-12-29 00:07:26 +0100 <monochrom> For random access, consider lenses and optics.
2021-12-29 00:07:48 +0100 <dsal> The problem is that I want a logically adjacent node in a tree.
2021-12-29 00:08:58 +0100 <dsal> When iterating, it's pretty easy because I can just keep recursing down and right and eventually visit everything. But if I find something interesting and want to find the previous value, I have to go up until I can go left and then go down and right to find the value just to the left.
2021-12-29 00:09:18 +0100 <EvanR> find something interesting and the previous value
2021-12-29 00:09:24 +0100 <EvanR> screams "zip ap tail"
2021-12-29 00:09:57 +0100biberu(~biberu@user/biberu) (Ping timeout: 256 seconds)
2021-12-29 00:09:57 +0100biberu\biberu
2021-12-29 00:10:01 +0100geekosaurwonders about comonad
2021-12-29 00:10:03 +0100 <dsal> Yeah, it was easy to do this when I flattened things into a list, but then I can't modify both values.
2021-12-29 00:10:06 +0100 <EvanR> that too
2021-12-29 00:10:08 +0100 <dsal> (three values in this case)
2021-12-29 00:10:26 +0100 <glguy> I did a version of https://adventofcode.com/2021/day/18 with zippers (just on the topic of things to do with them)
2021-12-29 00:10:49 +0100 <dsal> glguy: Yeah, that's what reminded me that they existed. :) I'm trying to do the thing with a uniplate zipper and it mostly just seems more tedious.
2021-12-29 00:11:15 +0100 <dsal> "trying" in this case is mostly a concern of effort and motivation and less on possibility. It just doesn't seem easier.
2021-12-29 00:11:20 +0100 <EvanR> i used a zipper for the guts of a command line text buffer
2021-12-29 00:11:24 +0100 <EvanR> worked
2021-12-29 00:11:29 +0100zincy(~zincy@2a00:23c8:970c:4801:c17f:9983:e5a5:ab71)
2021-12-29 00:11:48 +0100gehmehgeh(~user@user/gehmehgeh) (Quit: Leaving)
2021-12-29 00:11:55 +0100 <dsal> zipper was super easy for split on day 18, though.
2021-12-29 00:14:09 +0100 <glguy> How that aoc is over for the year I've been updating all the past years to use my current aoc library and get more and more haddocks written https://glguy.net/advent/
2021-12-29 00:14:54 +0100 <dsal> I should do that. My aoc library has some gross parts I keep reusing that could be a lot better. I'm still not done with all the years.
2021-12-29 00:15:54 +0100tromp(~textual@dhcp-077-249-230-040.chello.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
2021-12-29 00:26:14 +0100lavaman(~lavaman@98.38.249.169)
2021-12-29 00:27:36 +0100 <dsal> I guess I'm going to stop with this zipper for exploding. I can't seem to make it not be a lot more code that just numbering. This is one of those cases where the problem is so small it doesn't really matter. but it's tedious to find the right spot, fix it up, then wander up until I can wander left and then wander down and to the right to find the left thing. And then from there wander back up twice to get to the next spot.
2021-12-29 00:28:10 +0100 <EvanR> just numbering... or wrapping in the relevant exploding data
2021-12-29 00:29:39 +0100 <dsal> Numbering was a one-liner. The splitting was smaller with a zipper than the original thing I did. That could've also been smaller, but the zipper was really nice there.
2021-12-29 00:30:32 +0100lavaman(~lavaman@98.38.249.169) (Ping timeout: 240 seconds)
2021-12-29 00:30:32 +0100 <EvanR> wrapped in the relevant split data, which was a bool
2021-12-29 00:30:46 +0100CiaoSen(~Jura@p200300c957347b002a3a4dfffe84dbd5.dip0.t-ipconnect.de) (Ping timeout: 245 seconds)
2021-12-29 00:31:12 +0100zincy(~zincy@2a00:23c8:970c:4801:c17f:9983:e5a5:ab71) (Ping timeout: 268 seconds)
2021-12-29 00:32:10 +0100 <otherwise> ghci let me do g s@(x:xs) = x:s. but if I let that be a function in main.hs, it is not allowed. weird...
2021-12-29 00:33:07 +0100 <EvanR> that's funny
2021-12-29 00:33:09 +0100 <geekosaur> "not allowed" in what way?
2021-12-29 00:34:11 +0100 <EvanR> > let g ones@(x:xs) = x:ones in g (1:undefined)
2021-12-29 00:34:12 +0100 <lambdabot> [1,1*Exception: Prelude.undefined
2021-12-29 00:34:19 +0100cosimone(~user@93-47-231-248.ip115.fastwebnet.it) (Ping timeout: 256 seconds)
2021-12-29 00:34:45 +0100 <EvanR> 🤡
2021-12-29 00:35:50 +0100 <otherwise> https://paste.tomsmeding.com/lkQj1j5f
2021-12-29 00:36:25 +0100 <EvanR> what else is in that file
2021-12-29 00:36:55 +0100 <geekosaur> ^
2021-12-29 00:36:58 +0100Sgeo(~Sgeo@user/sgeo)
2021-12-29 00:37:10 +0100 <geekosaur> looks like the real problem is on the line of code immediately before that definition
2021-12-29 00:38:01 +0100 <otherwise> i wrote file.hs, but i'm reloading modules.hs
2021-12-29 00:38:19 +0100Sgeo_(~Sgeo@user/sgeo) (Ping timeout: 250 seconds)
2021-12-29 00:41:42 +0100dan-so(~danso@2001:1970:52e7:d000:96b8:6dff:feb3:c009) (Ping timeout: 268 seconds)
2021-12-29 00:42:33 +0100 <monochrom> This is why tech support is hard without remote rootkit.
2021-12-29 00:43:37 +0100 <otherwise> okay so it did work when I put it into its own file..
2021-12-29 00:44:12 +0100 <EvanR> probably messed up indentation or mismatched parentheses
2021-12-29 00:44:19 +0100 <EvanR> (earlier in the file)
2021-12-29 00:44:43 +0100 <monochrom> http://www.vex.net/~trebla/humour/tautologies.html #4
2021-12-29 00:45:32 +0100xsperry(~xs@user/xsperry)
2021-12-29 00:47:02 +0100Jing(~hedgehog@2604:a840:3::1067) (Remote host closed the connection)
2021-12-29 00:47:37 +0100Jing(~hedgehog@2604:a840:3::1067)
2021-12-29 00:49:32 +0100 <otherwise> okay, it as just a missed parentheses, thats embarrassing. Also it means haskell works, so thats good!
2021-12-29 00:49:57 +0100ksqsf(~user@134.209.106.31)
2021-12-29 00:51:26 +0100__monty__(~toonn@user/toonn) (Quit: leaving)
2021-12-29 00:52:53 +0100 <EvanR> yeah someone probably would have noticed if correct parentheses gave that error
2021-12-29 00:53:11 +0100 <EvanR> (and indentation)
2021-12-29 00:54:09 +0100dan-so(~danso@2001:1970:52e7:d000:96b8:6dff:feb3:c009)
2021-12-29 00:56:58 +0100jgeerds(~jgeerds@55d4ac73.access.ecotel.net) (Ping timeout: 260 seconds)
2021-12-29 00:58:03 +0100 <otherwise> monochrom: yes, I was the cause to why the code I wrote caused an error. :)
2021-12-29 00:58:36 +0100madjestic(~madjestic@88-159-247-120.fixed.kpn.net)
2021-12-29 00:58:42 +0100n3rdy1(~n3rdy1@2601:281:c780:a510:9005:8349:e7c7:a7ad)
2021-12-29 00:58:44 +0100zincy(~zincy@2a00:23c8:970c:4801:c17f:9983:e5a5:ab71)
2021-12-29 01:01:37 +0100max22-(~maxime@2a01cb088335980068088847c57fd3ba.ipv6.abo.wanadoo.fr) (Remote host closed the connection)
2021-12-29 01:07:16 +0100 <monochrom> Well, it is always important to consider the whole file.
2021-12-29 01:07:43 +0100 <monochrom> Equivalently, if other people can't reproduce the error, no one can diagnose it.
2021-12-29 01:09:26 +0100rito_(~rito_gh@45.112.243.151) (Ping timeout: 268 seconds)
2021-12-29 01:09:46 +0100stef204(~stef204@user/stef204)
2021-12-29 01:11:06 +0100sirlensalot(~sirlensal@ool-44c5f8c9.dyn.optonline.net) (Quit: sirlensalot)
2021-12-29 01:11:45 +0100dan-sodanso
2021-12-29 01:11:50 +0100sirlensalot(~sirlensal@ool-44c5f8c9.dyn.optonline.net)
2021-12-29 01:17:28 +0100zincy(~zincy@2a00:23c8:970c:4801:c17f:9983:e5a5:ab71) (Ping timeout: 268 seconds)
2021-12-29 01:19:39 +0100ksqsf(~user@134.209.106.31) (Ping timeout: 256 seconds)
2021-12-29 01:20:47 +0100Gurkenglas(~Gurkengla@dslb-002-203-144-204.002.203.pools.vodafone-ip.de) (Ping timeout: 256 seconds)
2021-12-29 01:22:51 +0100 <madjestic> edwardk: do you know a code example, using Capretta's iterative monad? https://hackage.haskell.org/package/free-5.1.7/docs/Control-Monad-Trans-Iter.html#g:2
2021-12-29 01:25:35 +0100wroathe(~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
2021-12-29 01:25:35 +0100wroathe(~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Changing host)
2021-12-29 01:25:35 +0100wroathe(~wroathe@user/wroathe)
2021-12-29 01:26:24 +0100vicfred(~vicfred@user/vicfred) (Quit: Leaving)
2021-12-29 01:26:32 +0100justsomeguy(~justsomeg@user/justsomeguy) (Quit: WeeChat 3.3)
2021-12-29 01:28:57 +0100otherwise(~otherwise@c-71-231-39-206.hsd1.wa.comcast.net) (Ping timeout: 240 seconds)
2021-12-29 01:29:23 +0100superstar64(~superstar@2600:1700:ed80:50a0:d250:99ff:fe2c:53c4) (Quit: Leaving)
2021-12-29 01:33:54 +0100merijn(~merijn@83-160-49-249.ip.xs4all.nl)
2021-12-29 01:34:23 +0100otherwise(~otherwise@2601:602:880:90f0:a9ed:d903:65ec:579d)
2021-12-29 01:40:32 +0100ksqsf(~user@134.209.106.31)
2021-12-29 01:41:02 +0100 <edwardk> madjestic: interleaving computations is always a winner
2021-12-29 01:41:33 +0100 <edwardk> also running 'divergent' computations with a fixed amount of gas.
2021-12-29 01:41:42 +0100 <edwardk> er potentially divergent
2021-12-29 01:45:02 +0100 <madjestic> edwardk: that sounds cool. I noticed that there's a link to a paper on the topic, is that the best source of relevant code examples?
2021-12-29 01:47:38 +0100zincy(~zincy@host86-151-99-97.range86-151.btcentralplus.com)
2021-12-29 01:52:02 +0100zincy(~zincy@host86-151-99-97.range86-151.btcentralplus.com) (Ping timeout: 240 seconds)
2021-12-29 01:56:57 +0100YoungFrog(~youngfrog@39.129-180-91.adsl-dyn.isp.belgacom.be) (Ping timeout: 240 seconds)
2021-12-29 01:57:21 +0100eggplantade(~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Remote host closed the connection)
2021-12-29 02:00:23 +0100eggplantade(~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net)
2021-12-29 02:02:11 +0100 <ksqsf> just discovered #haskell-in-depth, but it does not appear to have any public logging?
2021-12-29 02:04:16 +0100 <geekosaur> only #haskell ever has
2021-12-29 02:04:46 +0100 <geekosaur> it could probably be added but it doesn't get used much, was basically copied over from freenode where it also wasn't used much
2021-12-29 02:05:09 +0100 <ksqsf> :(
2021-12-29 02:05:18 +0100 <geekosaur> it was an attempt to get the category theory / dependent types / etc. folks to leave #haskell alone, which failed
2021-12-29 02:08:15 +0100zincy(~zincy@2a00:23c8:970c:4801:c17f:9983:e5a5:ab71)
2021-12-29 02:08:38 +0100merijn(~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 268 seconds)
2021-12-29 02:08:57 +0100raehik(~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net) (Ping timeout: 256 seconds)
2021-12-29 02:11:54 +0100albet70(~xxx@2400:8902::f03c:92ff:fe60:98d8) (Remote host closed the connection)
2021-12-29 02:12:03 +0100waleee(~waleee@2001:9b0:21d:fc00:398f:b003:b90d:acf4) (Quit: WeeChat 3.3)
2021-12-29 02:12:31 +0100waleee(~waleee@2001:9b0:21d:fc00:398f:b003:b90d:acf4)
2021-12-29 02:13:13 +0100acidjnk(~acidjnk@p200300d0c7271e865819ff1869a0a668.dip0.t-ipconnect.de) (Ping timeout: 250 seconds)
2021-12-29 02:17:02 +0100nattiestnate(~nate@114.122.107.61) (Quit: WeeChat 3.4)
2021-12-29 02:17:23 +0100nattiestnate(~nate@114.122.107.61)
2021-12-29 02:17:35 +0100 <davean> Oooh, this is where we can talk about Linear Haskell?
2021-12-29 02:17:55 +0100 <monochrom> Yeah! :)
2021-12-29 02:18:01 +0100albet70(~xxx@2400:8902::f03c:92ff:fe60:98d8)
2021-12-29 02:18:16 +0100 <albet70> how to split a list [1..6] to [[1,2], [3,4]...]
2021-12-29 02:18:36 +0100 <geekosaur> > chunksOf 2 [1..6]
2021-12-29 02:18:38 +0100 <lambdabot> [[1,2],[3,4],[5,6]]
2021-12-29 02:18:54 +0100 <geekosaur> (Data.List/Split in the split package)
2021-12-29 02:19:04 +0100 <geekosaur> er. Data.List.Split
2021-12-29 02:21:39 +0100 <albet70> thanks
2021-12-29 02:22:49 +0100zincy(~zincy@2a00:23c8:970c:4801:c17f:9983:e5a5:ab71) (Ping timeout: 268 seconds)
2021-12-29 02:26:06 +0100 <dsal> > let chunky n = unfoldr (\b -> if null b then Nothing else let (x,xs) = splitAt n b in Just (x,xs)) in chunk 2 [1..9]
2021-12-29 02:26:08 +0100 <lambdabot> [[1,2],[3,4],[5,6],[7,8],[9]]
2021-12-29 02:26:30 +0100 <dsal> :t chunk
2021-12-29 02:26:31 +0100 <lambdabot> Int -> [e] -> [[e]]
2021-12-29 02:26:33 +0100 <dsal> ha. weird
2021-12-29 02:26:42 +0100 <dsal> > let chunky n = unfoldr (\b -> if null b then Nothing else let (x,xs) = splitAt n b in Just (x,xs)) in chunky 2 [1..9]
2021-12-29 02:26:44 +0100 <lambdabot> [[1,2],[3,4],[5,6],[7,8],[9]]
2021-12-29 02:27:47 +0100 <dsal> > let chunky n = unfoldr (\b -> if null b then Nothing else Just (splitAt n b)) in chunky 2 [1..9]
2021-12-29 02:27:48 +0100 <lambdabot> [[1,2],[3,4],[5,6],[7,8],[9]]
2021-12-29 02:29:34 +0100 <dsal> That if is not very satisfying.
2021-12-29 02:29:46 +0100Midjak(~Midjak@may53-1-78-226-116-92.fbx.proxad.net) (Quit: Leaving)
2021-12-29 02:31:15 +0100nattiestnate(~nate@114.122.107.61) (Quit: WeeChat 3.4)
2021-12-29 02:31:38 +0100nattiestnate(~nate@114.122.107.61)
2021-12-29 02:33:29 +0100 <albet70> > let _ arr = foldl1 (<>) $ (\x -> [x,x]) <$> [1..6] in (chunksOf 2) . init . tail $ _arr
2021-12-29 02:33:31 +0100 <lambdabot> <hint>:1:5: error: Parse error in pattern: _
2021-12-29 02:34:04 +0100 <albet70> > let _arr = foldl1 (<>) $ (\x -> [x,x]) <$> [1..6] in (chunksOf 2) . init . tail $ _arr
2021-12-29 02:34:06 +0100 <lambdabot> [[1,2],[2,3],[3,4],[4,5],[5,6]]
2021-12-29 02:35:09 +0100 <dsal> > let l = [1..6] in zipWith (\a b -> [a,b]) l (tail l)
2021-12-29 02:35:11 +0100 <lambdabot> [[1,2],[2,3],[3,4],[4,5],[5,6]]
2021-12-29 02:35:30 +0100 <dsal> > let l = [1..6] in zip l (tail l) -- I'd just do this, though.
2021-12-29 02:35:31 +0100 <lambdabot> [(1,2),(2,3),(3,4),(4,5),(5,6)]
2021-12-29 02:37:14 +0100 <ksqsf> smth like well-founded recursion will probably be useful
2021-12-29 02:37:21 +0100 <ksqsf> chunksOf n = wf_recurse (take n) (drop n)
2021-12-29 02:37:43 +0100 <dsal> @hoogle wf_recurse
2021-12-29 02:37:44 +0100 <lambdabot> No results found
2021-12-29 02:37:52 +0100 <ksqsf> i just made it up
2021-12-29 02:38:04 +0100 <dsal> heh. I assumed, because who'd put a _ in a function name? :)
2021-12-29 02:38:45 +0100 <dsal> The anamorphism that I initially thought of above seems like a good starting point. That's basically splitAt.
2021-12-29 02:41:31 +0100 <dsal> > let wf_recurse f1 f2 = unfoldr (\b -> if null b then Nothing else Just (f1 b, f2 b)) ; cwf n = wf_recurse (take n) (drop n) in cwf 2 [1..6]
2021-12-29 02:41:33 +0100 <lambdabot> [[1,2],[3,4],[5,6]]
2021-12-29 02:42:38 +0100 <albet70> zip is better
2021-12-29 02:43:49 +0100 <dsal> Sure, zip will do the exact pairings thing, but this is more a series of thought experiments on reusable abstractions. :)
2021-12-29 02:46:02 +0100 <albet70> zip l (tail l) could express by <=< ?
2021-12-29 02:46:15 +0100 <albet70> :t (<=<)
2021-12-29 02:46:16 +0100 <lambdabot> Monad m => (b -> m c) -> (a -> m b) -> a -> m c
2021-12-29 02:47:15 +0100 <albet70> or >>=
2021-12-29 02:50:31 +0100 <dsal> > let l = [1..6] in [(a,b) | (a:xs) <- l, b <- xs]
2021-12-29 02:50:32 +0100 <lambdabot> error:
2021-12-29 02:50:32 +0100 <lambdabot> • No instance for (Num [()]) arising from a use of ‘e_116’
2021-12-29 02:50:32 +0100 <lambdabot> • In the expression: e_116
2021-12-29 02:50:35 +0100 <dsal> doh.
2021-12-29 02:50:46 +0100zincy(~zincy@2a00:23c8:970c:4801:c17f:9983:e5a5:ab71)
2021-12-29 02:51:27 +0100ksqsf(~user@134.209.106.31) (Ping timeout: 256 seconds)
2021-12-29 02:51:50 +0100 <dsal> That requires listing the list elements.
2021-12-29 02:52:50 +0100 <albet70> (tail >>= zip) l == zip (tail l) l, how to change it to zip l (tail l)? flip (tail >>= zip) l?
2021-12-29 02:53:01 +0100ksqsf(~user@134.209.106.31)
2021-12-29 02:54:23 +0100 <pfurla-matrix> `(a:xs) <- l` is the same as `(a:xs) <- [1..6]`, do you see the problem here?
2021-12-29 02:54:35 +0100 <otherwise> is it possible to collapse comment blocks in .hs file? by this I mean, make them expandable and collapsable (like in Matlab) ?
2021-12-29 02:54:57 +0100zincy(~zincy@2a00:23c8:970c:4801:c17f:9983:e5a5:ab71) (Ping timeout: 240 seconds)
2021-12-29 02:55:21 +0100 <pfurla-matrix> otherwise: this on the editor not the language
2021-12-29 02:55:28 +0100 <otherwise> im using vim, so maybe that would be a feature in vim, rather than haskell specific?
2021-12-29 02:56:04 +0100 <pfurla-matrix> yep
2021-12-29 02:56:05 +0100 <otherwise> pfurla-matrix: aww, you beat me to it. yeah that makes sense.
2021-12-29 02:56:17 +0100 <albet70> f >>= g = \a -> g (f a) a, is there a function do \a -> g a (f a)?
2021-12-29 03:02:52 +0100 <ksqsf> :t (<*>) @((->) _)
2021-12-29 03:02:53 +0100 <lambdabot> error: parse error on input ‘->’
2021-12-29 03:04:26 +0100 <dsal> @pl \a -> g a (f a)
2021-12-29 03:04:27 +0100 <lambdabot> ap g f
2021-12-29 03:04:37 +0100 <ksqsf> but it should parse though :(
2021-12-29 03:04:58 +0100 <ksqsf> this is the S combinator from SKI, and it corresponds to Applicative's (<*>)
2021-12-29 03:05:02 +0100 <otherwise> if you had to decide what the math prerequisites are for learning haskell, what would be your decree?
2021-12-29 03:05:20 +0100 <dsal> otherwise: I can barely add
2021-12-29 03:05:46 +0100 <dsal> :t ap
2021-12-29 03:05:47 +0100 <lambdabot> Monad m => m (a -> b) -> m a -> m b
2021-12-29 03:05:53 +0100 <otherwise> dsal says addition, fair enough.
2021-12-29 03:05:59 +0100 <dsal> :t (<@>)
2021-12-29 03:06:00 +0100 <lambdabot> error:
2021-12-29 03:06:00 +0100 <lambdabot> • Variable not in scope: <@>
2021-12-29 03:06:00 +0100 <lambdabot> • Perhaps you meant one of these:
2021-12-29 03:06:08 +0100 <monochrom> otherwise: My http://www.vex.net/~trebla/haskell/prerequisite.xhtml
2021-12-29 03:06:12 +0100 <dsal> Argh. Phone coding is hard
2021-12-29 03:06:28 +0100 <monochrom> "You can barely type." >:)
2021-12-29 03:06:36 +0100 <dsal> :t (<$>)
2021-12-29 03:06:37 +0100 <lambdabot> Functor f => (a -> b) -> f a -> f b
2021-12-29 03:06:43 +0100 <dsal> monochrom: ++
2021-12-29 03:09:36 +0100zincy(~zincy@2a00:23c8:970c:4801:c17f:9983:e5a5:ab71)
2021-12-29 03:11:32 +0100[itchyjunk](~itchyjunk@user/itchyjunk/x-7353470) (Ping timeout: 240 seconds)
2021-12-29 03:13:32 +0100mmhat(~mmh@55d4c35d.access.ecotel.net) (Ping timeout: 240 seconds)
2021-12-29 03:14:29 +0100 <albet70> dsl, what is ap? applicative?
2021-12-29 03:15:49 +0100[itchyjunk](~itchyjunk@user/itchyjunk/x-7353470)
2021-12-29 03:17:05 +0100aplainze1akind(~johndoe@captainludd.powered.by.lunarbnc.net) (Quit: Free ZNC ~ Powered by LunarBNC: https://LunarBNC.net)
2021-12-29 03:21:06 +0100Tuplanolla(~Tuplanoll@91-159-68-119.elisa-laajakaista.fi) (Quit: Leaving.)
2021-12-29 03:22:31 +0100 <otherwise> > rand(1)
2021-12-29 03:22:32 +0100 <lambdabot> error:
2021-12-29 03:22:32 +0100 <lambdabot> • Variable not in scope: rand :: t0 -> t
2021-12-29 03:22:32 +0100 <lambdabot> • Perhaps you meant ‘and’ (imported from Data.List)
2021-12-29 03:25:49 +0100sirlensalot(~sirlensal@ool-44c5f8c9.dyn.optonline.net) (Quit: sirlensalot)
2021-12-29 03:26:32 +0100zincy(~zincy@2a00:23c8:970c:4801:c17f:9983:e5a5:ab71) (Ping timeout: 240 seconds)
2021-12-29 03:27:11 +0100mmhat(~mmh@55d4bdde.access.ecotel.net)
2021-12-29 03:37:37 +0100ksqsf(~user@134.209.106.31) (Ping timeout: 240 seconds)
2021-12-29 03:39:57 +0100neurocyte0132889(~neurocyte@user/neurocyte) (Ping timeout: 240 seconds)
2021-12-29 03:46:57 +0100sirlensalot(~sirlensal@ool-44c5f8c9.dyn.optonline.net)
2021-12-29 03:47:14 +0100zebrag(~chris@user/zebrag) (Quit: Konversation terminated!)
2021-12-29 03:47:18 +0100xff0x(~xff0x@2001:1a81:5206:b200:83f6:7a30:b822:7720) (Ping timeout: 268 seconds)
2021-12-29 03:47:45 +0100nattiestnate(~nate@114.122.107.61) (Quit: WeeChat 3.4)
2021-12-29 03:48:06 +0100nattiestnate(~nate@114.122.107.61)
2021-12-29 03:48:38 +0100jinsun(~quassel@user/jinsun)
2021-12-29 03:48:46 +0100xff0x(~xff0x@2001:1a81:5243:1200:5225:5648:394c:3e8f)
2021-12-29 03:55:41 +0100lbseale(~ep1ctetus@user/ep1ctetus) (Read error: Connection reset by peer)
2021-12-29 03:55:47 +0100zincy(~zincy@2a00:23c8:970c:4801:c17f:9983:e5a5:ab71)
2021-12-29 03:58:02 +0100 <dsal> albet70: It's related, but the constraint is Monad
2021-12-29 03:58:50 +0100aplainzetakind(~johndoe@captainludd.powered.by.lunarbnc.net)
2021-12-29 04:00:22 +0100zincy(~zincy@2a00:23c8:970c:4801:c17f:9983:e5a5:ab71) (Ping timeout: 260 seconds)
2021-12-29 04:01:04 +0100_xor(~xor@dsl-50-5-233-169.fuse.net) (Read error: Connection reset by peer)
2021-12-29 04:01:29 +0100_xor(~xor@dsl-50-5-233-169.fuse.net)
2021-12-29 04:01:55 +0100danso(~danso@2001:1970:52e7:d000:96b8:6dff:feb3:c009) (Quit: WeeChat 3.3)
2021-12-29 04:04:27 +0100merijn(~merijn@83-160-49-249.ip.xs4all.nl)
2021-12-29 04:06:17 +0100JimL(~quassel@89-162-2-132.fiber.signal.no) (Ping timeout: 240 seconds)
2021-12-29 04:09:45 +0100danso(~danso@2001:1970:52e7:d000:96b8:6dff:feb3:c009)
2021-12-29 04:14:22 +0100zincy(~zincy@2a00:23c8:970c:4801:c17f:9983:e5a5:ab71)
2021-12-29 04:20:59 +0100kaph_(~kaph@net-2-38-107-19.cust.vodafonedsl.it) (Ping timeout: 256 seconds)
2021-12-29 04:21:34 +0100mmhat(~mmh@55d4bdde.access.ecotel.net) (Quit: WeeChat 3.4)
2021-12-29 04:21:39 +0100zaquest(~notzaques@5.130.79.72) (Remote host closed the connection)
2021-12-29 04:23:00 +0100zaquest(~notzaques@5.130.79.72)
2021-12-29 04:23:09 +0100nattiestnate(~nate@114.122.107.61) (Quit: WeeChat 3.4)
2021-12-29 04:25:06 +0100nattiestnate(~nate@114.122.104.173)
2021-12-29 04:26:01 +0100kaph(~kaph@net-2-38-107-19.cust.vodafonedsl.it)
2021-12-29 04:27:38 +0100lavaman(~lavaman@98.38.249.169)
2021-12-29 04:31:17 +0100zincy(~zincy@2a00:23c8:970c:4801:c17f:9983:e5a5:ab71) (Ping timeout: 240 seconds)
2021-12-29 04:32:08 +0100 <albet70> dsal, ap is related to >>=?
2021-12-29 04:32:12 +0100FinnElija(~finn_elij@user/finn-elija/x-0085643) (Killed (NickServ (Forcing logout FinnElija -> finn_elija)))
2021-12-29 04:32:12 +0100finn_elija(~finn_elij@user/finn-elija/x-0085643)
2021-12-29 04:32:12 +0100finn_elijaFinnElija
2021-12-29 04:32:19 +0100lavaman(~lavaman@98.38.249.169) (Ping timeout: 256 seconds)
2021-12-29 04:33:22 +0100ksqsf(~user@134.209.106.31)
2021-12-29 04:36:43 +0100mbuf(~Shakthi@27.58.131.180)
2021-12-29 04:38:33 +0100merijn(~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 256 seconds)
2021-12-29 04:43:17 +0100ksqsf(~user@134.209.106.31) (Ping timeout: 240 seconds)
2021-12-29 04:44:44 +0100zebrag(~chris@user/zebrag)
2021-12-29 04:45:39 +0100 <dsal> albet70: ap is <*> with different constraints.
2021-12-29 04:47:02 +0100jinsun(~quassel@user/jinsun) (Ping timeout: 240 seconds)
2021-12-29 04:47:15 +0100ksqsf(~user@134.209.106.31)
2021-12-29 04:49:19 +0100werneta(~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net) (Ping timeout: 256 seconds)
2021-12-29 04:51:02 +0100werneta(~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net)
2021-12-29 04:52:40 +0100ksqsf(~user@134.209.106.31) (Ping timeout: 268 seconds)
2021-12-29 04:56:20 +0100 <albet70> dsal, ap g f = \a -> g a (f a), f >>= g = \a -> g (f a) a, how similar
2021-12-29 04:57:15 +0100td_(~td@muedsl-82-207-238-177.citykom.de) (Ping timeout: 256 seconds)
2021-12-29 04:57:40 +0100 <albet70> g a (f a) = flip g (f a) a
2021-12-29 04:58:01 +0100jinsun(~quassel@user/jinsun)
2021-12-29 04:58:37 +0100 <albet70> wonder if >>= can be expressed with ap
2021-12-29 04:58:50 +0100td_(~td@muedsl-82-207-238-009.citykom.de)
2021-12-29 04:59:54 +0100yauhsien(~yauhsien@118-167-42-25.dynamic-ip.hinet.net)
2021-12-29 05:00:27 +0100zincy(~zincy@2a00:23c8:970c:4801:c17f:9983:e5a5:ab71)
2021-12-29 05:01:18 +0100waleee(~waleee@2001:9b0:21d:fc00:398f:b003:b90d:acf4) (Ping timeout: 268 seconds)
2021-12-29 05:03:53 +0100nattiestnate(~nate@114.122.104.173) (Quit: WeeChat 3.4)
2021-12-29 05:08:42 +0100machinedgod(~machinedg@24.105.81.50) (Ping timeout: 268 seconds)
2021-12-29 05:09:13 +0100ksqsf(~user@134.209.106.31)
2021-12-29 05:12:15 +0100 <dsal> albet70: monadic binding is more restrictive than applicative applicatating.
2021-12-29 05:14:52 +0100ksqsf(~user@134.209.106.31) (Ping timeout: 268 seconds)
2021-12-29 05:16:57 +0100notzmv(~zmv@user/notzmv) (Ping timeout: 240 seconds)
2021-12-29 05:18:41 +0100zincy(~zincy@2a00:23c8:970c:4801:c17f:9983:e5a5:ab71) (Ping timeout: 250 seconds)
2021-12-29 05:25:33 +0100pretty_dumm_guy(trottel@gateway/vpn/protonvpn/prettydummguy/x-88029655) (Quit: WeeChat 3.4)
2021-12-29 05:26:27 +0100ksqsf(~user@134.209.106.31)
2021-12-29 05:28:05 +0100kotshie(~kotshie@68.72.208.140)
2021-12-29 05:29:26 +0100ksqsf(~user@134.209.106.31) (Remote host closed the connection)
2021-12-29 05:29:51 +0100ksqsf(~user@134.209.106.31)
2021-12-29 05:29:57 +0100jle`(~jle`@cpe-23-240-75-236.socal.res.rr.com) (Ping timeout: 240 seconds)
2021-12-29 05:32:14 +0100jle`(~jle`@cpe-23-240-75-236.socal.res.rr.com)
2021-12-29 05:38:55 +0100zebrag(~chris@user/zebrag) (Quit: Konversation terminated!)
2021-12-29 05:39:33 +0100 <mjrosenb> what's the relationship between haskell-language-server and ghcide?
2021-12-29 05:40:11 +0100hud(~hud@uwyo-129-72-161-67.uwyo.edu) (Ping timeout: 256 seconds)
2021-12-29 05:40:45 +0100 <mjrosenb> I'm asking in the context of bugs on hls discussing if something should go into ghcide or hls.
2021-12-29 05:47:35 +0100zincy(~zincy@2a00:23c8:970c:4801:c17f:9983:e5a5:ab71)
2021-12-29 05:52:30 +0100zincy(~zincy@2a00:23c8:970c:4801:c17f:9983:e5a5:ab71) (Ping timeout: 268 seconds)
2021-12-29 05:57:38 +0100dolio(~dolio@130.44.130.54)
2021-12-29 06:00:17 +0100yauhsien(~yauhsien@118-167-42-25.dynamic-ip.hinet.net) (Ping timeout: 240 seconds)
2021-12-29 06:00:22 +0100machinedgod(~machinedg@24.105.81.50)
2021-12-29 06:01:14 +0100bliminse(~bliminse@host86-186-4-210.range86-186.btcentralplus.com) (Ping timeout: 260 seconds)
2021-12-29 06:03:06 +0100bliminse(~bliminse@host86-186-17-7.range86-186.btcentralplus.com)
2021-12-29 06:04:27 +0100zincy(~zincy@host86-151-99-97.range86-151.btcentralplus.com)
2021-12-29 06:05:04 +0100lavaman(~lavaman@98.38.249.169)
2021-12-29 06:13:21 +0100geekosaur(~geekosaur@xmonad/geekosaur) (Remote host closed the connection)
2021-12-29 06:15:54 +0100spaceseller(~spacesell@31.147.205.13)
2021-12-29 06:16:14 +0100geekosaur(~geekosaur@xmonad/geekosaur)
2021-12-29 06:23:35 +0100 <otherwise> can we make type declarations in prelude?
2021-12-29 06:25:40 +0100 <dsal> otherwise: sure, but things are going to get painful
2021-12-29 06:26:06 +0100 <dsal> (although… what do you mean by "prelude" here?")
2021-12-29 06:26:14 +0100 <dsal> Do you mean you want to modify Prelude?
2021-12-29 06:26:29 +0100 <otherwise> as in, with no .hs file loaded
2021-12-29 06:26:35 +0100 <dsal> You mean ghci?
2021-12-29 06:27:15 +0100 <otherwise> yes, in ghci
2021-12-29 06:27:38 +0100 <dsal> I assumed that's what you meant. You can do it, but you really shouldn't. Just do things in files. If you try to do things in ghci, it starts getting painful really quickly.
2021-12-29 06:27:40 +0100 <otherwise> I'm thinking "what else is there?", cause i'm a noob
2021-12-29 06:28:38 +0100 <dsal> ghci is just the interactive environment for messing around. It works similarly to what you might expect from a real program, but it's not the same, and it's not how you write useful programs.
2021-12-29 06:29:23 +0100 <otherwise> isnt ghci also what runs the real program? as in, the .hs file
2021-12-29 06:30:51 +0100zincy(~zincy@host86-151-99-97.range86-151.btcentralplus.com) (Ping timeout: 250 seconds)
2021-12-29 06:31:00 +0100 <dsal> No, none of my programs run using ghci.
2021-12-29 06:31:41 +0100 <dsal> A .hs file just defines a module. A program may consist of many modules which are compiled and tied together with a Main module which has a main function where execution begins.
2021-12-29 06:32:53 +0100 <otherwise> ... so do you execute you programs directly in terminal?
2021-12-29 06:32:57 +0100n3rdy1(~n3rdy1@2601:281:c780:a510:9005:8349:e7c7:a7ad) (Ping timeout: 240 seconds)
2021-12-29 06:33:14 +0100 <monochrom> Are you asking the equivalent of: If you are learning C, you ask "can I modify my copy of /usr/include/stdio.h to add my own declarations so that every time I #include <stdio.h> I get my own additional declarations too so that I don't have to create my own .h file in my own directory and add a 2nd #include for it"
2021-12-29 06:33:57 +0100 <monochrom> The answer would be "it's your computer, but why such a fragile method" in the case of C.
2021-12-29 06:34:29 +0100 <monochrom> In the case of GHC, not easily.
2021-12-29 06:35:35 +0100merijn(~merijn@83-160-49-249.ip.xs4all.nl)
2021-12-29 06:37:01 +0100 <otherwise> Hmm, I didn't really understand that to be honest. i figured since :t it shows the last value, there must be a similar memory bank in ghci that I can update with a type declaration for the sole purpose of practicing writing type declarartions.
2021-12-29 06:37:20 +0100 <otherwise> But it is easy enough to just make a new .hs file and mess around that way.
2021-12-29 06:37:43 +0100 <monochrom> You can enter "data F = G1 | G2 Int" into ghci.
2021-12-29 06:37:57 +0100 <monochrom> That is still not adding to Prelude.
2021-12-29 06:38:03 +0100 <monochrom> What an XY problem.
2021-12-29 06:38:06 +0100wroathe(~wroathe@user/wroathe) (Ping timeout: 260 seconds)
2021-12-29 06:38:17 +0100 <otherwise> I'm afraid to based on dsals warning. haha
2021-12-29 06:38:42 +0100 <monochrom> Oh, I don't like to suggest it either. It doesn't scale.
2021-12-29 06:39:57 +0100 <otherwise> although data f = ... doesnt look like a type declaration that I recognize. I would have expected it to be data f :: ...
2021-12-29 06:40:02 +0100xff0x(~xff0x@2001:1a81:5243:1200:5225:5648:394c:3e8f) (Ping timeout: 240 seconds)
2021-12-29 06:40:57 +0100xff0x(~xff0x@2001:1a81:5243:1200:1c6b:9a74:5f29:30c0)
2021-12-29 06:41:42 +0100 <otherwise> i'm abandoning that idea for now. haha. There are better things to work on than that
2021-12-29 06:43:01 +0100mvk(~mvk@2607:fea8:5cdd:f000::917a)
2021-12-29 06:44:41 +0100zincy(~zincy@2a00:23c8:970c:4801:c17f:9983:e5a5:ab71)
2021-12-29 06:46:15 +0100deadmarshal(~deadmarsh@95.38.229.126)
2021-12-29 06:49:13 +0100zincy(~zincy@2a00:23c8:970c:4801:c17f:9983:e5a5:ab71) (Ping timeout: 268 seconds)
2021-12-29 06:49:23 +0100 <dsal> otherwise: You just want to do it in a file. Same as other language with repls. You can do a lot of stuff in a python repl, but you don't run your program in a python repl.
2021-12-29 06:50:53 +0100 <dsal> But when you actually want to run a program, you'll compile it and have a normal binary like any other compiled language.
2021-12-29 06:51:53 +0100sirlensalot(~sirlensal@ool-44c5f8c9.dyn.optonline.net) (Quit: sirlensalot)
2021-12-29 06:55:01 +0100xff0x(~xff0x@2001:1a81:5243:1200:1c6b:9a74:5f29:30c0) (Ping timeout: 240 seconds)
2021-12-29 06:55:24 +0100wroathe(~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
2021-12-29 06:55:24 +0100wroathe(~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Changing host)
2021-12-29 06:55:24 +0100wroathe(~wroathe@user/wroathe)
2021-12-29 06:56:09 +0100xff0x(~xff0x@2001:1a81:5243:1200:5779:89a5:a3f8:38a5)
2021-12-29 07:00:13 +0100wroathe(~wroathe@user/wroathe) (Ping timeout: 256 seconds)
2021-12-29 07:02:27 +0100zincy(~zincy@2a00:23c8:970c:4801:c17f:9983:e5a5:ab71)
2021-12-29 07:05:29 +0100alfonsox(~quassel@103.92.42.90)
2021-12-29 07:08:11 +0100 <otherwise> weird, I just did ghc file.hs. then ./file to run the executable, but I wasnt able to interact with it at all, it just printed a single line of text and I couldn't call any of the functions.
2021-12-29 07:08:43 +0100 <dsal> otherwise: What did you write your program to do?
2021-12-29 07:08:46 +0100 <dsal> Did you write a repl?
2021-12-29 07:08:57 +0100merijn(~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 268 seconds)
2021-12-29 07:10:29 +0100 <otherwise> https://paste.tomsmeding.com/ZDhJxIVt
2021-12-29 07:10:41 +0100 <otherwise> just a print line and a quicksort function
2021-12-29 07:10:49 +0100 <dsal> > putStrLn "Hello World"
2021-12-29 07:10:50 +0100 <lambdabot> <IO ()>
2021-12-29 07:10:55 +0100 <dsal> % putStrLn "Hello World"
2021-12-29 07:10:56 +0100 <yahb> dsal: Hello World
2021-12-29 07:11:02 +0100 <dsal> That's all your program is instructed to do.
2021-12-29 07:11:17 +0100 <dsal> It's not going to do things you don't tell it to do. :)
2021-12-29 07:11:53 +0100 <otherwise> Why doesn't it know what I want!
2021-12-29 07:11:57 +0100 <otherwise> j/k
2021-12-29 07:12:12 +0100 <dsal> If you want to write a repl for something, that's a harder problem.
2021-12-29 07:12:21 +0100 <dsal> Even ghci doesn't work correctly on my machine right now. :)
2021-12-29 07:18:42 +0100zincy(~zincy@2a00:23c8:970c:4801:c17f:9983:e5a5:ab71) (Ping timeout: 260 seconds)
2021-12-29 07:31:33 +0100 <ksqsf> otherwise: It's much easier to use ghci in a properly configured editor. Like in Emacs, you can open a .hs file anywhere and press C-c C-l to start a ghci session.
2021-12-29 07:31:36 +0100KvL(~KvL@user/KvL)
2021-12-29 07:32:07 +0100 <otherwise> well, I tried to use emacs, yesterday, but now it is perpetually frozen open
2021-12-29 07:32:17 +0100 <otherwise> so my first impressions of emacs are not good
2021-12-29 07:32:23 +0100stef204(~stef204@user/stef204) (Ping timeout: 268 seconds)
2021-12-29 07:32:40 +0100 <otherwise> I homebrew installed it, opened it, and then it was frozen
2021-12-29 07:33:50 +0100 <otherwise> ksqsf: despite my complaining, I'll certainly give a try what you explained, that sounds useful.
2021-12-29 07:34:28 +0100notzmv(~zmv@user/notzmv)
2021-12-29 07:35:10 +0100takuan(~takuan@178-116-218-225.access.telenet.be)
2021-12-29 07:35:32 +0100 <otherwise> for now I have Emacs minimized and I act like its not there, frozen...
2021-12-29 07:39:41 +0100jtomas(~jtomas@153.red-83-53-252.dynamicip.rima-tde.net)
2021-12-29 07:42:25 +0100spaceseller(~spacesell@31.147.205.13) (Quit: Leaving)
2021-12-29 07:47:12 +0100zincy(~zincy@2a00:23c8:970c:4801:c17f:9983:e5a5:ab71)
2021-12-29 07:49:27 +0100whatsupdoc(uid509081@id-509081.hampstead.irccloud.com)
2021-12-29 07:52:07 +0100zincy(~zincy@2a00:23c8:970c:4801:c17f:9983:e5a5:ab71) (Ping timeout: 268 seconds)
2021-12-29 07:54:47 +0100 <mjrosenb> otherwise: I've found graphical emacs on MacOS to be a bit fiddly.
2021-12-29 07:54:57 +0100 <mjrosenb> otherwise: it works great in the terminal though.
2021-12-29 07:55:42 +0100wroathe(~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
2021-12-29 07:55:42 +0100wroathe(~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Changing host)
2021-12-29 07:55:42 +0100wroathe(~wroathe@user/wroathe)
2021-12-29 07:58:21 +0100 <otherwise> oh I didnt know I could load in terminal. thanks! :)
2021-12-29 08:00:45 +0100wroathe(~wroathe@user/wroathe) (Ping timeout: 268 seconds)
2021-12-29 08:02:22 +0100 <mjrosenb> emacs -nw will open it in the terminal.
2021-12-29 08:02:26 +0100burnsidesLlama(~burnsides@dhcp168-010.wadham.ox.ac.uk) (Remote host closed the connection)
2021-12-29 08:02:28 +0100shriekingnoise(~shrieking@186.137.144.80) (Quit: Quit)
2021-12-29 08:02:58 +0100burnsidesLlama(~burnsides@client-8-79.eduroam.oxuni.org.uk)
2021-12-29 08:04:44 +0100slowButPresent(~slowButPr@user/slowbutpresent) (Quit: leaving)
2021-12-29 08:06:26 +0100zincy(~zincy@2a00:23c8:970c:4801:c17f:9983:e5a5:ab71)
2021-12-29 08:07:32 +0100burnsidesLlama(~burnsides@client-8-79.eduroam.oxuni.org.uk) (Ping timeout: 268 seconds)
2021-12-29 08:11:37 +0100 <otherwise> mjrosenb: it works! :)
2021-12-29 08:11:53 +0100 <mjrosenb> Is there a way to "tweak" the show instance auto-generated by deriving Show? I have a datatype with like 20 cases, 19 of which I want the default, and the other one, I need some custom logic.
2021-12-29 08:12:47 +0100YoungFrog(~youngfrog@2a02:a03f:c21b:f900:75de:a4d8:aac6:c5de)
2021-12-29 08:16:45 +0100 <cheater> deriving via?
2021-12-29 08:22:21 +0100zincy(~zincy@2a00:23c8:970c:4801:c17f:9983:e5a5:ab71) (Ping timeout: 268 seconds)
2021-12-29 08:23:38 +0100coot(~coot@89-64-85-93.dynamic.chello.pl)
2021-12-29 08:24:00 +0100mjrosenbinvestigates deriving via
2021-12-29 08:24:36 +0100coot(~coot@89-64-85-93.dynamic.chello.pl) (Client Quit)
2021-12-29 08:31:17 +0100ksqsf(~user@134.209.106.31) (Ping timeout: 240 seconds)
2021-12-29 08:35:42 +0100jle`(~jle`@cpe-23-240-75-236.socal.res.rr.com) (Ping timeout: 260 seconds)
2021-12-29 08:37:31 +0100jle`(~jle`@cpe-23-240-75-236.socal.res.rr.com)
2021-12-29 08:39:30 +0100falafel(~falafel@2603-8000-d800-688c-6db4-c125-f693-41cb.res6.spectrum.com)
2021-12-29 08:44:09 +0100 <alfonsox> what is correct way to load read say first 10 lines from txt file in ghci ?
2021-12-29 08:44:32 +0100 <alfonsox> im <- readFile "hello.txt"
2021-12-29 08:44:38 +0100 <alfonsox> above line works
2021-12-29 08:44:56 +0100 <xerox> :t \filename -> take 10 . lines <$> readFile filename
2021-12-29 08:44:56 +0100 <alfonsox> take 10 $ lines im
2021-12-29 08:44:57 +0100 <lambdabot> FilePath -> IO [String]
2021-12-29 08:45:00 +0100 <alfonsox> this also works
2021-12-29 08:45:40 +0100 <alfonsox> but the moment I try to assign it to some var using let, I get error.
2021-12-29 08:45:58 +0100Gurkenglas(~Gurkengla@dslb-002-203-144-204.002.203.pools.vodafone-ip.de)
2021-12-29 08:46:16 +0100 <alfonsox> let ilines = take 10 $ lines im
2021-12-29 08:46:21 +0100 <alfonsox> then I get parse error
2021-12-29 08:47:05 +0100 <xerox> alfonsox: something like this? https://pastebin.com/raw/wHZSYdVB
2021-12-29 08:49:28 +0100jtomas(~jtomas@153.red-83-53-252.dynamicip.rima-tde.net) (Ping timeout: 268 seconds)
2021-12-29 08:49:52 +0100alan[m]1(~alangmatr@2001:470:69fc:105::b489)
2021-12-29 08:50:48 +0100 <alfonsox> thanks. that works.
2021-12-29 08:53:54 +0100_ht(~quassel@82-169-194-8.biz.kpn.net)
2021-12-29 08:54:03 +0100amk(~amk@109.255.169.126) (Ping timeout: 250 seconds)
2021-12-29 08:54:50 +0100 <xerox> wonder what was going wrong for you, I did the same thing you said
2021-12-29 08:56:12 +0100amk(~amk@109.255.169.126)
2021-12-29 08:56:54 +0100coolnickname(uid531864@user/coolnickname)
2021-12-29 08:58:29 +0100 <alfonsox> running ghci in emacs
2021-12-29 08:58:42 +0100 <alfonsox> was not working first time
2021-12-29 08:59:29 +0100paolino(~paolo@5.157.115.53)
2021-12-29 09:00:17 +0100paolino(~paolo@5.157.115.53) (Client Quit)
2021-12-29 09:02:12 +0100tromp(~textual@dhcp-077-249-230-040.chello.nl)
2021-12-29 09:02:20 +0100alan[m]1grabb0id[m]
2021-12-29 09:02:43 +0100KvL(~KvL@user/KvL) (Ping timeout: 250 seconds)
2021-12-29 09:05:44 +0100merijn(~merijn@83-160-49-249.ip.xs4all.nl)
2021-12-29 09:07:29 +0100zmt01(~zmt00@user/zmt00) (Ping timeout: 250 seconds)
2021-12-29 09:09:50 +0100Akiva(~Akiva@user/Akiva) (Ping timeout: 268 seconds)
2021-12-29 09:12:04 +0100zincy(~zincy@2a00:23c8:970c:4801:c17f:9983:e5a5:ab71)
2021-12-29 09:27:05 +0100kaph(~kaph@net-2-38-107-19.cust.vodafonedsl.it) (Read error: Connection reset by peer)
2021-12-29 09:27:17 +0100zincy(~zincy@2a00:23c8:970c:4801:c17f:9983:e5a5:ab71) (Ping timeout: 240 seconds)
2021-12-29 09:27:22 +0100 <albet70> f >>= g = \a -> g (f a) a, is there \a -> g a (f a)
2021-12-29 09:29:52 +0100ksqsf(~user@134.209.106.31)
2021-12-29 09:30:05 +0100 <albet70> ap f g = \a -> f a (g a), is there \a -> f (g a) a?
2021-12-29 09:31:13 +0100 <ksqsf> @pl \a -> f (g a) a
2021-12-29 09:31:13 +0100 <lambdabot> f =<< g
2021-12-29 09:32:22 +0100 <albet70> @pl \a -> g a (f a)
2021-12-29 09:32:22 +0100 <lambdabot> ap g f
2021-12-29 09:32:24 +0100kaph(~kaph@net-2-38-107-19.cust.vodafonedsl.it)
2021-12-29 09:32:37 +0100Sgeo(~Sgeo@user/sgeo) (Read error: Connection reset by peer)
2021-12-29 09:39:25 +0100 <dibblego> f <*> g
2021-12-29 09:39:49 +0100merijn(~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 240 seconds)
2021-12-29 09:40:00 +0100zincy(~zincy@2a00:23c8:970c:4801:c17f:9983:e5a5:ab71)
2021-12-29 09:43:17 +0100falafel(~falafel@2603-8000-d800-688c-6db4-c125-f693-41cb.res6.spectrum.com) (Ping timeout: 240 seconds)
2021-12-29 09:43:40 +0100zincy(~zincy@2a00:23c8:970c:4801:c17f:9983:e5a5:ab71) (Remote host closed the connection)
2021-12-29 09:43:51 +0100zincy(~zincy@host86-151-99-97.range86-151.btcentralplus.com)
2021-12-29 09:45:27 +0100merijn(~merijn@83-160-49-249.ip.xs4all.nl)
2021-12-29 09:49:38 +0100nhatanh02(~satori@123.24.172.30)
2021-12-29 09:55:49 +0100econo(uid147250@user/econo) (Quit: Connection closed for inactivity)
2021-12-29 09:56:29 +0100wroathe(~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
2021-12-29 09:56:29 +0100wroathe(~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Changing host)
2021-12-29 09:56:29 +0100wroathe(~wroathe@user/wroathe)
2021-12-29 10:00:53 +0100acidjnk(~acidjnk@p200300d0c7271e865819ff1869a0a668.dip0.t-ipconnect.de)
2021-12-29 10:01:33 +0100wroathe(~wroathe@user/wroathe) (Ping timeout: 256 seconds)
2021-12-29 10:02:10 +0100zincy(~zincy@host86-151-99-97.range86-151.btcentralplus.com) (Remote host closed the connection)
2021-12-29 10:02:27 +0100zincy(~zincy@2a00:23c8:970c:4801:c17f:9983:e5a5:ab71)
2021-12-29 10:02:31 +0100tromp(~textual@dhcp-077-249-230-040.chello.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
2021-12-29 10:03:17 +0100tromp(~textual@dhcp-077-249-230-040.chello.nl)
2021-12-29 10:08:55 +0100vglfr(~vglfr@46.96.129.172) (Ping timeout: 256 seconds)
2021-12-29 10:14:35 +0100jtomas(~jtomas@153.red-83-53-252.dynamicip.rima-tde.net)
2021-12-29 10:14:59 +0100lavaman(~lavaman@98.38.249.169) (Remote host closed the connection)
2021-12-29 10:17:42 +0100allbery_b(~geekosaur@xmonad/geekosaur)
2021-12-29 10:17:42 +0100geekosaur(~geekosaur@xmonad/geekosaur) (Killed (NickServ (GHOST command used by allbery_b)))
2021-12-29 10:17:45 +0100allbery_bgeekosaur
2021-12-29 10:19:11 +0100pavonia(~user@user/siracusa) (Quit: Bye!)
2021-12-29 10:23:17 +0100jonathanx(~jonathan@h-178-174-176-109.A357.priv.bahnhof.se) (Ping timeout: 240 seconds)
2021-12-29 10:25:11 +0100Vajb(~Vajb@hag-jnsbng11-58c3a8-176.dhcp.inet.fi) (Read error: Connection reset by peer)
2021-12-29 10:25:24 +0100Vajb(~Vajb@hag-jnsbng11-58c3a8-176.dhcp.inet.fi)
2021-12-29 10:28:17 +0100machinedgod(~machinedg@24.105.81.50) (Ping timeout: 240 seconds)
2021-12-29 10:29:41 +0100Vajb(~Vajb@hag-jnsbng11-58c3a8-176.dhcp.inet.fi) (Read error: Connection reset by peer)
2021-12-29 10:30:27 +0100deadmarshal(~deadmarsh@95.38.229.126) (Ping timeout: 256 seconds)
2021-12-29 10:30:40 +0100SoF(~skius@user/skius) (Remote host closed the connection)
2021-12-29 10:30:50 +0100gehmehgeh(~user@user/gehmehgeh)
2021-12-29 10:30:53 +0100deadmarshal(~deadmarsh@95.38.116.44)
2021-12-29 10:41:17 +0100ksqsf(~user@134.209.106.31) (Ping timeout: 240 seconds)
2021-12-29 10:45:33 +0100lavaman(~lavaman@98.38.249.169)
2021-12-29 10:46:36 +0100max22-(~maxime@2a01cb08833598005a91b2768a285f6e.ipv6.abo.wanadoo.fr)
2021-12-29 10:49:19 +0100spaceseller(~spacesell@31.147.205.13)
2021-12-29 10:49:24 +0100spaceseller(~spacesell@31.147.205.13) (Remote host closed the connection)
2021-12-29 10:49:42 +0100[itchyjunk](~itchyjunk@user/itchyjunk/x-7353470) (Quit: Leaving)
2021-12-29 10:50:17 +0100lavaman(~lavaman@98.38.249.169) (Ping timeout: 256 seconds)
2021-12-29 10:55:43 +0100zincy(~zincy@2a00:23c8:970c:4801:c17f:9983:e5a5:ab71) (Remote host closed the connection)
2021-12-29 10:56:51 +0100MoC(~moc@user/moc)
2021-12-29 11:00:11 +0100cosimone(~user@2001:b07:ae5:db26:c24a:d20:4d91:1e20)
2021-12-29 11:00:53 +0100jgeerds(~jgeerds@55d4ac73.access.ecotel.net)
2021-12-29 11:03:23 +0100eggplantade(~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Remote host closed the connection)
2021-12-29 11:06:57 +0100joo-_(~joo-_@fsf/member/joo--) (Ping timeout: 240 seconds)
2021-12-29 11:07:44 +0100tzh(~tzh@c-24-21-73-154.hsd1.wa.comcast.net) (Quit: zzz)
2021-12-29 11:09:08 +0100joo-_(~joo-_@80-62-117-1-mobile.dk.customer.tdc.net)
2021-12-29 11:09:08 +0100joo-_(~joo-_@80-62-117-1-mobile.dk.customer.tdc.net) (Changing host)
2021-12-29 11:09:08 +0100joo-_(~joo-_@fsf/member/joo--)
2021-12-29 11:11:41 +0100mikoto-chan(~mikoto-ch@esm-84-240-99-143.netplaza.fi)
2021-12-29 11:18:42 +0100merijn(~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 268 seconds)
2021-12-29 11:19:13 +0100jgeerds(~jgeerds@55d4ac73.access.ecotel.net) (Ping timeout: 250 seconds)
2021-12-29 11:25:59 +0100Lord_of_Life_(~Lord@user/lord-of-life/x-2819915)
2021-12-29 11:26:32 +0100cfricke(~cfricke@user/cfricke)
2021-12-29 11:26:32 +0100Lord_of_Life(~Lord@user/lord-of-life/x-2819915) (Ping timeout: 240 seconds)
2021-12-29 11:26:55 +0100tromp(~textual@dhcp-077-249-230-040.chello.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
2021-12-29 11:27:16 +0100Lord_of_Life_Lord_of_Life
2021-12-29 11:28:50 +0100nhatanh02(~satori@123.24.172.30) (Ping timeout: 260 seconds)
2021-12-29 11:29:13 +0100nhatanh02(~satori@123.24.172.30)
2021-12-29 11:35:36 +0100__monty__(~toonn@user/toonn)
2021-12-29 11:38:46 +0100neurocyte0132889(~neurocyte@user/neurocyte)
2021-12-29 11:43:46 +0100rito_(~rito_gh@45.112.243.151)
2021-12-29 11:43:52 +0100otherwise(~otherwise@2601:602:880:90f0:a9ed:d903:65ec:579d) ()
2021-12-29 11:45:58 +0100coolnickname(uid531864@user/coolnickname) (Quit: Connection closed for inactivity)
2021-12-29 11:46:06 +0100cstml(~cstml@2a02:a58:8561:af00:11b5:cd98:e383:e8bd)
2021-12-29 11:47:12 +0100cstml(~cstml@2a02:a58:8561:af00:11b5:cd98:e383:e8bd) (Client Quit)
2021-12-29 11:48:09 +0100jinsun(~quassel@user/jinsun) (Read error: Connection reset by peer)
2021-12-29 11:50:23 +0100tromp(~textual@dhcp-077-249-230-040.chello.nl)
2021-12-29 11:51:15 +0100coolnickname(uid531864@user/coolnickname)
2021-12-29 11:53:15 +0100jinsun(~quassel@user/jinsun)
2021-12-29 11:55:40 +0100cstml(~cstml@2a02:a58:8561:af00:11b5:cd98:e383:e8bd)
2021-12-29 11:57:16 +0100wroathe(~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
2021-12-29 11:57:16 +0100wroathe(~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Changing host)
2021-12-29 11:57:16 +0100wroathe(~wroathe@user/wroathe)
2021-12-29 12:01:12 +0100cstml(~cstml@2a02:a58:8561:af00:11b5:cd98:e383:e8bd) (Quit: WeeChat 2.9)
2021-12-29 12:01:32 +0100foul_owl(~kerry@212.102.47.57) (Ping timeout: 252 seconds)
2021-12-29 12:02:15 +0100wroathe(~wroathe@user/wroathe) (Ping timeout: 256 seconds)
2021-12-29 12:02:44 +0100otherwise(~otherwise@2601:602:880:90f0:a9ed:d903:65ec:579d)
2021-12-29 12:03:59 +0100eggplantade(~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net)
2021-12-29 12:04:34 +0100Tuplanolla(~Tuplanoll@91-159-68-119.elisa-laajakaista.fi)
2021-12-29 12:05:49 +0100otherwise(~otherwise@2601:602:880:90f0:a9ed:d903:65ec:579d) (Client Quit)
2021-12-29 12:08:21 +0100ProfSimm(~ProfSimm@87.227.196.109)
2021-12-29 12:08:30 +0100eggplantade(~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Ping timeout: 260 seconds)
2021-12-29 12:09:46 +0100SoF(~skius@user/skius)
2021-12-29 12:18:36 +0100coot(~coot@89-64-85-93.dynamic.chello.pl)
2021-12-29 12:22:34 +0100arjun(~arjun@user/arjun)
2021-12-29 12:23:58 +0100 <arjun> is there a prefered library to make http(s) requests? i see a bunch on hackage
2021-12-29 12:27:01 +0100Erutuon(~Erutuon@user/erutuon) (Ping timeout: 240 seconds)
2021-12-29 12:28:04 +0100wroathe(~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
2021-12-29 12:28:04 +0100wroathe(~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Changing host)
2021-12-29 12:28:04 +0100wroathe(~wroathe@user/wroathe)
2021-12-29 12:31:39 +0100jgeerds(~jgeerds@55d4ac73.access.ecotel.net)
2021-12-29 12:32:51 +0100wroathe(~wroathe@user/wroathe) (Ping timeout: 256 seconds)
2021-12-29 12:33:50 +0100vglfr(~vglfr@88.155.24.19)
2021-12-29 12:35:30 +0100foul_owl(~kerry@212.102.47.57)
2021-12-29 12:36:15 +0100darkstardevx(~darkstard@50.39.115.145) (Remote host closed the connection)
2021-12-29 12:37:39 +0100darkstardevx(~darkstard@50.39.115.145)
2021-12-29 12:37:53 +0100acidjnk(~acidjnk@p200300d0c7271e865819ff1869a0a668.dip0.t-ipconnect.de) (Ping timeout: 250 seconds)
2021-12-29 12:39:08 +0100darkstardevx(~darkstard@50.39.115.145) (Remote host closed the connection)
2021-12-29 12:40:37 +0100madjestic(~madjestic@88-159-247-120.fixed.kpn.net) (Ping timeout: 240 seconds)
2021-12-29 12:40:43 +0100vglfr(~vglfr@88.155.24.19) (Ping timeout: 268 seconds)
2021-12-29 12:41:31 +0100vglfr(~vglfr@88.155.24.19)
2021-12-29 12:41:49 +0100darkstardevx(~darkstard@50.39.115.145)
2021-12-29 12:43:59 +0100 <Taneb> arjun: probably http-client/http-client-tls
2021-12-29 12:44:19 +0100darkstardevx(~darkstard@50.39.115.145) (Max SendQ exceeded)
2021-12-29 12:46:06 +0100 <arjun> i see, thx Taneb
2021-12-29 12:46:58 +0100timCF(~timCF@m91-129-100-224.cust.tele2.ee) (Quit: leaving)
2021-12-29 12:48:40 +0100fef(~thedawn@user/thedawn)
2021-12-29 12:49:02 +0100arjun(~arjun@user/arjun) (Remote host closed the connection)
2021-12-29 12:49:37 +0100jco(~jco@90-228-194-139-no542.tbcn.telia.com)
2021-12-29 12:52:32 +0100 <maerwald[m]> arjun: https://hackage.haskell.org/package/http-client-openssl
2021-12-29 12:52:44 +0100 <maerwald[m]> I'd not use http-client-tls
2021-12-29 12:53:17 +0100 <maerwald[m]> haskell tls is not audited and there's not enough research whether it's even an appropriate language for that
2021-12-29 12:53:53 +0100syrkis(~syrkis@82.192.167.70) (Quit: Client closed)
2021-12-29 12:54:00 +0100 <jco> Hello, trying to learn some basics about GADTs, and I'm running into a problem when trying to add a type class constraint. It works when adding a type class constraint like `(Eq a =>)` or `(Show a =>)`, but when trying to use my own type class, it gives a compilation error that I don't really understand. Gist here: https://gist.github.com/joncol/50461ec618fe1fb7b7245c5d7869e3ed
2021-12-29 12:58:52 +0100wroathe(~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
2021-12-29 12:58:52 +0100wroathe(~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Changing host)
2021-12-29 12:58:52 +0100wroathe(~wroathe@user/wroathe)
2021-12-29 13:01:05 +0100 <jco> Oh, it seems to be related to my `(a :: Subject)` restriction in the type class itself... Interesting.
2021-12-29 13:02:07 +0100mmhat(~mmh@55d4bdde.access.ecotel.net)
2021-12-29 13:02:07 +0100shriekingnoise(~shrieking@186.137.144.80)
2021-12-29 13:02:35 +0100Jing(~hedgehog@2604:a840:3::1067) (Remote host closed the connection)
2021-12-29 13:03:10 +0100tromp(~textual@dhcp-077-249-230-040.chello.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
2021-12-29 13:03:36 +0100biberu\(~biberu@user/biberu)
2021-12-29 13:03:37 +0100biberu(~biberu@user/biberu) (Ping timeout: 240 seconds)
2021-12-29 13:03:39 +0100wroathe(~wroathe@user/wroathe) (Ping timeout: 250 seconds)
2021-12-29 13:03:40 +0100Jing(~hedgehog@125.105.9.103)
2021-12-29 13:04:13 +0100Vajb(~Vajb@2001:999:62:e042:be01:afcc:85c5:1e46)
2021-12-29 13:04:33 +0100biberu\biberu
2021-12-29 13:04:45 +0100tromp(~textual@dhcp-077-249-230-040.chello.nl)
2021-12-29 13:05:04 +0100DNH(~DNH@2a02:8108:1100:16d8:7898:e7cb:a448:daff)
2021-12-29 13:05:29 +0100Jing(~hedgehog@125.105.9.103) (Client Quit)
2021-12-29 13:05:50 +0100forell(~forell@user/forell) (Quit: ZNC - https://znc.in)
2021-12-29 13:06:11 +0100shriekingnoise(~shrieking@186.137.144.80) (Client Quit)
2021-12-29 13:06:45 +0100forell(~forell@user/forell)
2021-12-29 13:08:51 +0100shriekingnoise(~shrieking@186.137.144.80)
2021-12-29 13:11:30 +0100Tuplanolla(~Tuplanoll@91-159-68-119.elisa-laajakaista.fi) (Ping timeout: 260 seconds)
2021-12-29 13:13:10 +0100phma(phma@2001:5b0:211c:1148:bf01:ab8f:863f:c9a8) (Read error: Connection reset by peer)
2021-12-29 13:14:37 +0100phma(~phma@2001:5b0:211f:d0f8:a0d5:904f:4002:7904)
2021-12-29 13:15:41 +0100merijn(~merijn@83-160-49-249.ip.xs4all.nl)
2021-12-29 13:19:01 +0100cfricke(~cfricke@user/cfricke) (Ping timeout: 240 seconds)
2021-12-29 13:20:54 +0100tv1(~tv@user/tv)
2021-12-29 13:21:01 +0100tv(~tv@user/tv) (Ping timeout: 256 seconds)
2021-12-29 13:24:36 +0100Tuplanolla(~Tuplanoll@91-159-69-90.elisa-laajakaista.fi)
2021-12-29 13:25:02 +0100nhatanh02(~satori@123.24.172.30) (Ping timeout: 260 seconds)
2021-12-29 13:29:39 +0100wroathe(~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
2021-12-29 13:29:39 +0100wroathe(~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Changing host)
2021-12-29 13:29:39 +0100wroathe(~wroathe@user/wroathe)
2021-12-29 13:30:08 +0100Rum(~bourbon@user/rum)
2021-12-29 13:30:52 +0100cfricke(~cfricke@user/cfricke)
2021-12-29 13:31:56 +0100pretty_dumm_guy(trottel@gateway/vpn/protonvpn/prettydummguy/x-88029655)
2021-12-29 13:34:50 +0100wroathe(~wroathe@user/wroathe) (Ping timeout: 260 seconds)
2021-12-29 13:34:59 +0100mikoto-chan(~mikoto-ch@esm-84-240-99-143.netplaza.fi) (Ping timeout: 268 seconds)
2021-12-29 13:38:20 +0100Rum(~bourbon@user/rum) (Quit: WeeChat 3.4)
2021-12-29 13:41:17 +0100mvk(~mvk@2607:fea8:5cdd:f000::917a) (Ping timeout: 240 seconds)
2021-12-29 13:44:40 +0100CiaoSen(~Jura@p200300c957347b002a3a4dfffe84dbd5.dip0.t-ipconnect.de)
2021-12-29 13:49:35 +0100max22-(~maxime@2a01cb08833598005a91b2768a285f6e.ipv6.abo.wanadoo.fr) (Ping timeout: 250 seconds)
2021-12-29 13:49:37 +0100merijn(~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 240 seconds)
2021-12-29 13:51:47 +0100hololeap(~hololeap@user/hololeap) (Remote host closed the connection)
2021-12-29 13:53:21 +0100hololeap(~hololeap@user/hololeap)
2021-12-29 14:05:50 +0100coot(~coot@89-64-85-93.dynamic.chello.pl) (Quit: coot)
2021-12-29 14:06:27 +0100eggplantade(~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net)
2021-12-29 14:07:20 +0100nunggu(~q@gateway/tor-sasl/nunggu)
2021-12-29 14:09:32 +0100ubert(~Thunderbi@p200300ecdf099447b83e75261410a8dd.dip0.t-ipconnect.de)
2021-12-29 14:09:39 +0100jinsun__(~quassel@user/jinsun)
2021-12-29 14:10:53 +0100jinsun(~quassel@user/jinsun) (Ping timeout: 256 seconds)
2021-12-29 14:11:21 +0100spaceseller(~spacesell@31.147.205.13)
2021-12-29 14:11:22 +0100eggplantade(~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Ping timeout: 268 seconds)
2021-12-29 14:12:50 +0100coot(~coot@89-64-85-93.dynamic.chello.pl)
2021-12-29 14:16:31 +0100wroathe(~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
2021-12-29 14:16:31 +0100wroathe(~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Changing host)
2021-12-29 14:16:31 +0100wroathe(~wroathe@user/wroathe)
2021-12-29 14:21:01 +0100nhatanh02(~satori@123.24.172.30)
2021-12-29 14:21:51 +0100wroathe(~wroathe@user/wroathe) (Ping timeout: 268 seconds)
2021-12-29 14:25:43 +0100spaceseller(~spacesell@31.147.205.13) (Quit: Leaving)
2021-12-29 14:28:01 +0100tv1(~tv@user/tv) (Quit: derp)
2021-12-29 14:28:15 +0100tv(~tv@user/tv)
2021-12-29 14:30:27 +0100 <albet70> what Reader Applicative is used for? like fmap is function compose about Reader, what <*> mean?
2021-12-29 14:35:11 +0100 <int-e> Hmm, it's the S combinator.
2021-12-29 14:36:42 +0100 <int-e> > ((-) <$> (`div` 100) <*> (`mod` 100)) 4223
2021-12-29 14:36:43 +0100 <lambdabot> 19
2021-12-29 14:37:53 +0100lavaman(~lavaman@98.38.249.169)
2021-12-29 14:39:12 +0100nunggu(~q@gateway/tor-sasl/nunggu) (Remote host closed the connection)
2021-12-29 14:39:33 +0100nunggu(~q@gateway/tor-sasl/nunggu)
2021-12-29 14:41:29 +0100alx741(~alx741@157.100.93.160) (Read error: Connection reset by peer)
2021-12-29 14:42:08 +0100lavaman(~lavaman@98.38.249.169) (Ping timeout: 252 seconds)
2021-12-29 14:42:32 +0100ubert(~Thunderbi@p200300ecdf099447b83e75261410a8dd.dip0.t-ipconnect.de) (Remote host closed the connection)
2021-12-29 14:43:17 +0100kupi(uid212005@id-212005.hampstead.irccloud.com)
2021-12-29 14:45:08 +0100stef204(~stef204@user/stef204)
2021-12-29 14:46:28 +0100 <jco> > ((\x y -> x + y) <*> (\x -> x*10)) 100
2021-12-29 14:46:29 +0100 <lambdabot> 1100
2021-12-29 14:47:23 +0100 <jco> S combinator = fusion function that reduces the number of occurrences of a variable from several to a single one: S f g x = (f x) (g x)
2021-12-29 14:48:37 +0100tv(~tv@user/tv) (Ping timeout: 240 seconds)
2021-12-29 14:50:14 +0100 <geekosaur> not that I'd say it's used often
2021-12-29 14:50:31 +0100 <geekosaur> sometimes a type or typeclass instance is just a stepping stone to something else
2021-12-29 14:50:57 +0100 <geekosaur> the Reader Monad is widely used, but you have to define the Applicative to get there
2021-12-29 14:52:25 +0100max22-(~maxime@2a01cb0883359800fee411993e60211d.ipv6.abo.wanadoo.fr)
2021-12-29 14:54:43 +0100machinedgod(~machinedg@24.105.81.50)
2021-12-29 14:56:01 +0100tv(~tv@user/tv)
2021-12-29 14:58:42 +0100alx741(~alx741@157.100.93.160)
2021-12-29 15:03:19 +0100alx741(~alx741@157.100.93.160) (Read error: Connection reset by peer)
2021-12-29 15:03:23 +0100yauhsien(~yauhsien@118-167-42-25.dynamic-ip.hinet.net)
2021-12-29 15:03:54 +0100fef(~thedawn@user/thedawn) (Remote host closed the connection)
2021-12-29 15:05:45 +0100stiell(~stiell@gateway/tor-sasl/stiell) (Ping timeout: 276 seconds)
2021-12-29 15:06:08 +0100stiell(~stiell@gateway/tor-sasl/stiell)
2021-12-29 15:06:21 +0100fef(~thedawn@user/thedawn)
2021-12-29 15:08:43 +0100yauhsien(~yauhsien@118-167-42-25.dynamic-ip.hinet.net) (Ping timeout: 268 seconds)
2021-12-29 15:09:47 +0100waleee(~waleee@h-98-128-229-110.NA.cust.bahnhof.se)
2021-12-29 15:13:09 +0100 <alfonsox> any one using this setting in emacs > -- To disable popups, customize `haskell-interactive-popup-errors' ?
2021-12-29 15:13:14 +0100slowButPresent(~slowButPr@user/slowbutpresent)
2021-12-29 15:14:00 +0100 <alfonsox> new buffer opens up in emacs when there is error in emacs ghci shell
2021-12-29 15:14:18 +0100xsperry(~xs@user/xsperry) (Remote host closed the connection)
2021-12-29 15:20:23 +0100stef204(~stef204@user/stef204) (Quit: WeeChat 3.4)
2021-12-29 15:21:14 +0100alx741(~alx741@157.100.93.160)
2021-12-29 15:26:36 +0100alx741(~alx741@157.100.93.160) (Read error: Connection reset by peer)
2021-12-29 15:27:15 +0100madjestic(~madjestic@88-159-247-120.fixed.kpn.net)
2021-12-29 15:30:32 +0100qwedfg(~qwedfg@user/qwedfg) (Ping timeout: 240 seconds)
2021-12-29 15:30:42 +0100coot(~coot@89-64-85-93.dynamic.chello.pl) (Quit: coot)
2021-12-29 15:32:01 +0100jumper149(~jumper149@static.6.71.203.116.clients.your-server.de)
2021-12-29 15:32:44 +0100qwedfg(~qwedfg@user/qwedfg)
2021-12-29 15:33:45 +0100ksqsf(~user@134.209.106.31)
2021-12-29 15:36:34 +0100epolanski(uid312403@id-312403.helmsley.irccloud.com)
2021-12-29 15:43:32 +0100madjestic(~madjestic@88-159-247-120.fixed.kpn.net) (Quit: Reconnecting)
2021-12-29 15:43:44 +0100madjestic(~madjestic@88-159-247-120.fixed.kpn.net)
2021-12-29 15:44:21 +0100mmhat(~mmh@55d4bdde.access.ecotel.net) (Quit: WeeChat 3.4)
2021-12-29 15:44:25 +0100wroathe(~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
2021-12-29 15:44:25 +0100wroathe(~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Changing host)
2021-12-29 15:44:25 +0100wroathe(~wroathe@user/wroathe)
2021-12-29 15:44:47 +0100mmhat(~mmh@55d4bdde.access.ecotel.net)
2021-12-29 15:44:54 +0100alx741(~alx741@157.100.93.160)
2021-12-29 15:45:41 +0100mmhat(~mmh@55d4bdde.access.ecotel.net) (Client Quit)
2021-12-29 15:46:00 +0100mmhat(~mmh@55d4bdde.access.ecotel.net)
2021-12-29 15:46:12 +0100mmhat(~mmh@55d4bdde.access.ecotel.net) (Client Quit)
2021-12-29 15:46:38 +0100merijn(~merijn@83-160-49-249.ip.xs4all.nl)
2021-12-29 15:46:43 +0100doyougnu(~doyougnu@c-73-25-202-122.hsd1.or.comcast.net)
2021-12-29 15:47:37 +0100shriekingnoise(~shrieking@186.137.144.80) (Ping timeout: 240 seconds)
2021-12-29 15:49:11 +0100max22-(~maxime@2a01cb0883359800fee411993e60211d.ipv6.abo.wanadoo.fr) (Quit: Leaving)
2021-12-29 15:53:35 +0100alx741(~alx741@157.100.93.160) (Read error: Connection reset by peer)
2021-12-29 15:53:39 +0100ProfSimm(~ProfSimm@87.227.196.109) (Remote host closed the connection)
2021-12-29 15:53:58 +0100ProfSimm(~ProfSimm@87.227.196.109)
2021-12-29 15:54:08 +0100 <tomsmeding> jco: in your example, what's going wrong is that the constraint 'MathOrEnglish a' means that the kind of 'a' is 'Subject', but you're also taking an argument of type 'a' -- which means that 'a' has kind 'Type'. Type is not Subject, hence kind error.
2021-12-29 15:54:28 +0100 <tomsmeding> in other words, if 'a' is MathOrEnglish, then the type 'a' doesn't have any values!
2021-12-29 15:56:26 +0100 <tomsmeding> even without the argument of type 'a', it still won't work if you don't remove the existing Student constructor, since the kind of the type variable 'a' of 'User' is not polymorphic: it's either Type or Subject, and then two constructors let ghc infer two different kinds. Writing 'data User (a :: k) where' fixes that, because now 'a' is poly-kinded!
2021-12-29 16:02:31 +0100 <albet70> "jco :S combinator = fusion function that reduces the number of occurrences of a variable from several to a single one: S f g x = (f x) (g x)", S f g = \x -> f x (g x)
2021-12-29 16:02:51 +0100 <tomsmeding> same thing, different notation :)
2021-12-29 16:02:59 +0100Kaiepi(~Kaiepi@216.208.243.198)
2021-12-29 16:03:23 +0100 <tomsmeding> @pl \f g x -> f x (g x)
2021-12-29 16:03:23 +0100 <lambdabot> ap
2021-12-29 16:04:20 +0100 <albet70> so ap is <*> like (.) is <$>?
2021-12-29 16:04:21 +0100 <int-e> @pl heralds from the monadic age
2021-12-29 16:04:41 +0100 <int-e> so it knows about `ap` but not `<*>` ;)
2021-12-29 16:05:19 +0100 <int-e> ap = <*> should hold for law-abiding Monad instances
2021-12-29 16:06:11 +0100 <albet70> @pl \x -> f (g x) x
2021-12-29 16:06:11 +0100 <lambdabot> f =<< g
2021-12-29 16:08:00 +0100 <tomsmeding> albet70: ap = <*> is actually true for law-abiding Monad/Applicative instances as int-e says; (.) is the implementation of (<$>) = fmap for the reader monad (r ->)
2021-12-29 16:08:12 +0100eggplantade(~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net)
2021-12-29 16:11:31 +0100alx741(~alx741@157.100.93.160)
2021-12-29 16:12:52 +0100eggplantade(~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Ping timeout: 268 seconds)
2021-12-29 16:13:03 +0100Sgeo(~Sgeo@user/sgeo)
2021-12-29 16:15:43 +0100 <albet70> 42 - (42 +1) == (-) <*> (+1) $ 42
2021-12-29 16:16:16 +0100 <albet70> (42 +1) - 42 == (+1) >>= (-) $ 42
2021-12-29 16:16:35 +0100alx741(~alx741@157.100.93.160) (Read error: Connection reset by peer)
2021-12-29 16:16:47 +0100shapr`(~user@pool-100-36-247-68.washdc.fios.verizon.net)
2021-12-29 16:16:57 +0100waleee(~waleee@h-98-128-229-110.NA.cust.bahnhof.se) (Ping timeout: 240 seconds)
2021-12-29 16:17:17 +0100 <xerox> . being an fmap is also the basis for lens
2021-12-29 16:17:38 +0100shapr(~user@pool-100-36-247-68.washdc.fios.verizon.net) (Read error: Connection reset by peer)
2021-12-29 16:18:18 +0100max22-(~maxime@2a01cb0883359800f9d8f30ac05a4f67.ipv6.abo.wanadoo.fr)
2021-12-29 16:19:37 +0100jco(~jco@90-228-194-139-no542.tbcn.telia.com) (Ping timeout: 240 seconds)
2021-12-29 16:19:49 +0100 <tomsmeding> :t fmap fmap fmap
2021-12-29 16:19:51 +0100 <lambdabot> (Functor f1, Functor f2) => (a -> b) -> f1 (f2 a) -> f1 (f2 b)
2021-12-29 16:19:51 +0100xsperry(~xs@user/xsperry)
2021-12-29 16:20:15 +0100merijn(~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 268 seconds)
2021-12-29 16:21:14 +0100shapr`shapr
2021-12-29 16:22:14 +0100wroathe(~wroathe@user/wroathe) (Ping timeout: 252 seconds)
2021-12-29 16:22:47 +0100jgeerds(~jgeerds@55d4ac73.access.ecotel.net) (Ping timeout: 252 seconds)
2021-12-29 16:26:40 +0100 <albet70> (42 + 21) - 21 == ((+) >=> (-)) 42 $ 21
2021-12-29 16:26:53 +0100 <albet70> this seems pointless...
2021-12-29 16:32:39 +0100tromp(~textual@dhcp-077-249-230-040.chello.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
2021-12-29 16:35:11 +0100alx741(~alx741@157.100.93.160)
2021-12-29 16:35:32 +0100shapr(~user@pool-100-36-247-68.washdc.fios.verizon.net) (Remote host closed the connection)
2021-12-29 16:35:56 +0100shapr(~user@pool-100-36-247-68.washdc.fios.verizon.net)
2021-12-29 16:37:12 +0100wroathe(~wroathe@user/wroathe)
2021-12-29 16:37:51 +0100 <albet70> what's wrong with (-) <*> ((-2) <$> (+1)) $ 42?
2021-12-29 16:39:32 +0100alx741(~alx741@157.100.93.160) (Read error: Connection reset by peer)
2021-12-29 16:40:10 +0100curiousgay(~curiousga@77-120-141-90.kha.volia.net)
2021-12-29 16:43:27 +0100zincy(~zincy@2a00:23c8:970c:4801:c17f:9983:e5a5:ab71)
2021-12-29 16:46:37 +0100CiaoSen(~Jura@p200300c957347b002a3a4dfffe84dbd5.dip0.t-ipconnect.de) (Ping timeout: 240 seconds)
2021-12-29 16:48:34 +0100zer0bitz(~zer0bitz@196.244.192.57)
2021-12-29 16:49:53 +0100 <albet70> oh flip
2021-12-29 16:52:03 +0100tromp(~textual@dhcp-077-249-230-040.chello.nl)
2021-12-29 16:52:42 +0100acidjnk(~acidjnk@p200300d0c7271e865819ff1869a0a668.dip0.t-ipconnect.de)
2021-12-29 16:54:59 +0100 <tomsmeding> albet70: the point is not that this is more readable than the direct alternative, but that the reader monad is useful and induces (<*>) = ap :p
2021-12-29 16:56:21 +0100alx741(~alx741@157.100.93.160)
2021-12-29 16:56:55 +0100ksqsf(~user@134.209.106.31) (Ping timeout: 256 seconds)
2021-12-29 16:57:31 +0100ProfSimm(~ProfSimm@87.227.196.109) (Remote host closed the connection)
2021-12-29 16:57:49 +0100ProfSimm(~ProfSimm@87.227.196.109)
2021-12-29 17:01:03 +0100 <albet70> ok
2021-12-29 17:04:39 +0100wroathe(~wroathe@user/wroathe) (Ping timeout: 268 seconds)
2021-12-29 17:06:04 +0100wroathe(~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
2021-12-29 17:06:04 +0100wroathe(~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Changing host)
2021-12-29 17:06:04 +0100wroathe(~wroathe@user/wroathe)
2021-12-29 17:06:04 +0100alx741(~alx741@157.100.93.160) (Read error: Connection reset by peer)
2021-12-29 17:09:09 +0100ksqsf(~user@134.209.106.31)
2021-12-29 17:09:51 +0100mc47(~mc47@xmonad/TheMC47)
2021-12-29 17:10:50 +0100nschoe(~quassel@178.251.84.79)
2021-12-29 17:10:58 +0100sirlensalot(~sirlensal@ool-44c5f8c9.dyn.optonline.net)
2021-12-29 17:11:05 +0100wroathe(~wroathe@user/wroathe) (Ping timeout: 256 seconds)
2021-12-29 17:11:32 +0100zebrag(~chris@user/zebrag)
2021-12-29 17:11:44 +0100wroathe(~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
2021-12-29 17:11:44 +0100wroathe(~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Changing host)
2021-12-29 17:11:44 +0100wroathe(~wroathe@user/wroathe)
2021-12-29 17:15:03 +0100ksqsf(~user@134.209.106.31) (Ping timeout: 256 seconds)
2021-12-29 17:16:59 +0100Morrow(~quassel@bzq-110-168-31-106.red.bezeqint.net) (Ping timeout: 268 seconds)
2021-12-29 17:17:01 +0100wroathe(~wroathe@user/wroathe) (Ping timeout: 240 seconds)
2021-12-29 17:20:40 +0100gdd(~gdd@129.199.146.230)
2021-12-29 17:23:54 +0100alx741(~alx741@157.100.93.160)
2021-12-29 17:27:23 +0100shriekingnoise(~shrieking@186.137.144.80)
2021-12-29 17:28:37 +0100alx741(~alx741@157.100.93.160) (Read error: Connection reset by peer)
2021-12-29 17:29:58 +0100[itchyjunk](~itchyjunk@user/itchyjunk/x-7353470)
2021-12-29 17:33:01 +0100kupi(uid212005@id-212005.hampstead.irccloud.com) (Quit: Connection closed for inactivity)
2021-12-29 17:41:22 +0100jco(~jco@90-228-194-139-no542.tbcn.telia.com)
2021-12-29 17:42:56 +0100eggplantade(~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net)
2021-12-29 17:43:07 +0100nattiestnate(~nate@2001:448a:20a0:4134:25e:715f:d637:5263)
2021-12-29 17:45:03 +0100alx741(~alx741@157.100.93.160)
2021-12-29 17:47:57 +0100madjestic(~madjestic@88-159-247-120.fixed.kpn.net) (Ping timeout: 240 seconds)
2021-12-29 17:48:21 +0100ksqsf(~user@134.209.106.31)
2021-12-29 17:49:41 +0100vglfr(~vglfr@88.155.24.19) (Ping timeout: 252 seconds)
2021-12-29 17:49:52 +0100zmt00(~zmt00@user/zmt00)
2021-12-29 17:50:10 +0100kmein(~weechat@user/kmein) (Quit: ciao kakao)
2021-12-29 17:50:13 +0100vglfr(~vglfr@88.155.24.19)
2021-12-29 17:50:29 +0100kmein(~weechat@user/kmein)
2021-12-29 17:51:12 +0100nattiestnate(~nate@2001:448a:20a0:4134:25e:715f:d637:5263) (Quit: WeeChat 3.4)
2021-12-29 17:51:34 +0100nattiestnate(~nate@2001:448a:20a0:4134:25e:715f:d637:5263)
2021-12-29 17:51:48 +0100lavaman(~lavaman@98.38.249.169)
2021-12-29 17:52:09 +0100ChaiTRex(~ChaiTRex@user/chaitrex) (Ping timeout: 276 seconds)
2021-12-29 17:53:29 +0100Morrow(~quassel@5.28.131.86)
2021-12-29 17:53:59 +0100euandreh(~euandreh@2804:14c:33:9fe5:5d5c:8c41:79c4:9b80) (Ping timeout: 250 seconds)
2021-12-29 17:54:06 +0100ksqsf(~user@134.209.106.31) (Ping timeout: 245 seconds)
2021-12-29 17:54:53 +0100ChaiTRex(~ChaiTRex@user/chaitrex)
2021-12-29 17:55:17 +0100alx741(~alx741@157.100.93.160) (Read error: Connection reset by peer)
2021-12-29 17:55:57 +0100lavaman(~lavaman@98.38.249.169) (Ping timeout: 240 seconds)
2021-12-29 17:56:30 +0100nattiestnate(~nate@2001:448a:20a0:4134:25e:715f:d637:5263) (Quit: WeeChat 3.4)
2021-12-29 17:57:16 +0100euandreh(~euandreh@191.181.59.160)
2021-12-29 17:58:18 +0100zebrag(~chris@user/zebrag) (Remote host closed the connection)
2021-12-29 18:01:57 +0100zebrag(~chris@user/zebrag)
2021-12-29 18:04:10 +0100burnsidesLlama(~burnsides@dhcp168-010.wadham.ox.ac.uk)
2021-12-29 18:06:32 +0100Vajb(~Vajb@2001:999:62:e042:be01:afcc:85c5:1e46) (Ping timeout: 240 seconds)
2021-12-29 18:07:00 +0100Vajb(~Vajb@nabiicwveotvxswi5-2.v6.elisa-mobile.fi)
2021-12-29 18:13:24 +0100spaceseller(~spacesell@31.147.205.13)
2021-12-29 18:13:30 +0100alx741(~alx741@157.100.93.160)
2021-12-29 18:14:00 +0100alfonsox(~quassel@103.92.42.90) (Remote host closed the connection)
2021-12-29 18:16:09 +0100Akiva(~Akiva@user/Akiva)
2021-12-29 18:16:45 +0100 <glguy> For anyone who did AoC 2021 day 22 (the one with commands that turned on/off cuboids of lights) I think I've got a solution that breaks it down into pretty simple steps: https://glguy.net/advent/sln_2021_22/Main.html (I've just been hammering on this one and I'm pretty happy with where it's gotten to)
2021-12-29 18:16:52 +0100merijn(~merijn@83-160-49-249.ip.xs4all.nl)
2021-12-29 18:18:15 +0100alx741(~alx741@157.100.93.160) (Read error: Connection reset by peer)
2021-12-29 18:18:16 +0100spaceseller(~spacesell@31.147.205.13) (Client Quit)
2021-12-29 18:21:19 +0100cfricke(~cfricke@user/cfricke) (Quit: WeeChat 3.3)
2021-12-29 18:23:40 +0100mvk(~mvk@2607:fea8:5cdd:f000::917a)
2021-12-29 18:28:00 +0100 <int-e> glguy: Hmm, how hard would it be to modify that to produce at most 2 extra pieces per dimension when cutting boxes? (after splitting in one dimension, only one of the resulting parts will overlap with the `overlap`)
2021-12-29 18:29:14 +0100eggplantade(~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Remote host closed the connection)
2021-12-29 18:29:27 +0100 <int-e> (not really hard, but I think it doesn't quite fit the `traverseBox2` abstraction)
2021-12-29 18:30:25 +0100nschoe(~quassel@178.251.84.79) (Ping timeout: 256 seconds)
2021-12-29 18:30:34 +0100eggplantade(~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net)
2021-12-29 18:31:40 +0100tromp(~textual@dhcp-077-249-230-040.chello.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
2021-12-29 18:32:37 +0100 <g> I'll have to think about it, maybe I can treat the first dimension specially
2021-12-29 18:34:06 +0100 <lechner> Thanks to whomever worked on the UTF-8 implementation of Data::Text! I'm sure it was a tough thing to do. https://discourse.haskell.org/t/text-2-0-with-utf8-is-finally-released/3840
2021-12-29 18:36:01 +0100alx741(~alx741@157.100.93.160)
2021-12-29 18:36:09 +0100 <g> int-e: it runs in 70ms so I haven't tried any optimizations yet
2021-12-29 18:37:46 +0100coot(~coot@89-64-85-93.dynamic.chello.pl)
2021-12-29 18:38:27 +0100ksqsf(~user@134.209.106.31)
2021-12-29 18:42:09 +0100Lycurgus(~juan@98.4.112.204)
2021-12-29 18:42:38 +0100waleee(~waleee@2001:9b0:21d:fc00:398f:b003:b90d:acf4)
2021-12-29 18:44:01 +0100ksqsf(~user@134.209.106.31) (Ping timeout: 256 seconds)
2021-12-29 18:44:49 +0100ksqsf(~user@134.209.106.31)
2021-12-29 18:45:16 +0100kmein(~weechat@user/kmein) (Quit: ciao kakao)
2021-12-29 18:45:34 +0100kmein(~weechat@user/kmein)
2021-12-29 18:45:52 +0100alx741(~alx741@157.100.93.160) (Read error: Connection reset by peer)
2021-12-29 18:48:17 +0100xff0x(~xff0x@2001:1a81:5243:1200:5779:89a5:a3f8:38a5) (Ping timeout: 240 seconds)
2021-12-29 18:48:21 +0100Lycurgus(~juan@98.4.112.204) (Quit: Exeunt)
2021-12-29 18:49:17 +0100ksqsf(~user@134.209.106.31) (Ping timeout: 240 seconds)
2021-12-29 18:49:20 +0100xff0x(~xff0x@2001:1a81:5243:1200:68a2:b42f:5a9a:d157)
2021-12-29 18:49:20 +0100wroathe(~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
2021-12-29 18:49:20 +0100wroathe(~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Changing host)
2021-12-29 18:49:20 +0100wroathe(~wroathe@user/wroathe)
2021-12-29 18:50:09 +0100tromp(~textual@dhcp-077-249-230-040.chello.nl)
2021-12-29 18:50:39 +0100lavaman(~lavaman@98.38.249.169)
2021-12-29 18:50:45 +0100cosimone(~user@2001:b07:ae5:db26:c24a:d20:4d91:1e20) (Ping timeout: 250 seconds)
2021-12-29 18:51:23 +0100merijn(~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 256 seconds)
2021-12-29 18:51:46 +0100 <int-e> g: completely untested: https://paste.tomsmeding.com/EMK8rNF0
2021-12-29 18:53:01 +0100 <glguy> int-e: Time (mean ± σ): 41.3 ms ± 3.1 ms [User: 25.1 ms, System: 5.2 ms]
2021-12-29 18:53:07 +0100 <glguy> (and the answer is preserved
2021-12-29 18:53:28 +0100 <int-e> g: Yeah it doesn't really make a difference for the task... in my input, I got only about 3x more boxes from splitting in all dimensions simultaneously. When generalizing to more dimensions though this should pay off quickly
2021-12-29 18:54:07 +0100 <glguy> Oh, I was thinking it makes a noticable difference, not that it made none :)
2021-12-29 18:54:30 +0100 <int-e> well it's both "instantaneous"
2021-12-29 18:54:37 +0100wroathe(~wroathe@user/wroathe) (Ping timeout: 240 seconds)
2021-12-29 18:54:56 +0100lavaman(~lavaman@98.38.249.169) (Ping timeout: 245 seconds)
2021-12-29 18:55:59 +0100 <mjrosenb> is this the AoC cube problem?
2021-12-29 18:56:06 +0100 <int-e> yes
2021-12-29 18:56:32 +0100 <int-e> well, cuboid... unless you mean the Dirac dice one ;)
2021-12-29 18:59:19 +0100 <mjrosenb> a coworker of mine was actually on the leaderboard for that problem, he didn't really do splitting.
2021-12-29 19:01:17 +0100 <int-e> I did wonder whether inclusion/exclusion would work out well (because it only needs intersections, no splitting), but the presence of both deletions and additions put me off.
2021-12-29 19:01:38 +0100 <glguy> inclusion/exclusion ends up being more complicated and slower, from what I've seen people do
2021-12-29 19:02:44 +0100acidjnk(~acidjnk@p200300d0c7271e865819ff1869a0a668.dip0.t-ipconnect.de) (Remote host closed the connection)
2021-12-29 19:03:07 +0100acidjnk(~acidjnk@p200300d0c7271e860dd3763164487397.dip0.t-ipconnect.de)
2021-12-29 19:03:35 +0100alx741(~alx741@157.100.93.160)
2021-12-29 19:04:02 +0100 <monochrom> Ugh Dirac dice, is that like dice that is uniformly random almost everywhere under a Dirac measure? >:)
2021-12-29 19:04:15 +0100 <int-e> The stupidest thing I've got to work is http://paste.debian.net/1225160/ (which starts with a [-2^20...2^20]^3 box and subdivides it evenly until the box is added and deleted uniformly by the sequence of operations
2021-12-29 19:04:32 +0100 <int-e> And it's slow, takes several minutes to finish.
2021-12-29 19:05:07 +0100mbuf(~Shakthi@27.58.131.180) (Quit: Leaving)
2021-12-29 19:05:14 +0100 <int-e> monochrom: no, it just spawns parallel universes for each outcome
2021-12-29 19:05:53 +0100 <monochrom> That's like a pop sci version of a quantum interpretation >_>
2021-12-29 19:06:18 +0100 <int-e> we like our wave functions discrete
2021-12-29 19:07:49 +0100acidjnk(~acidjnk@p200300d0c7271e860dd3763164487397.dip0.t-ipconnect.de) (Ping timeout: 240 seconds)
2021-12-29 19:08:45 +0100alx741(~alx741@157.100.93.160) (Read error: Connection reset by peer)
2021-12-29 19:08:49 +0100jinsun__jinsun
2021-12-29 19:10:37 +0100Megant(megant@user/megant) (Ping timeout: 240 seconds)
2021-12-29 19:11:39 +0100 <mjrosenb> I may have over-optimized my dirac dice.
2021-12-29 19:12:01 +0100 <monochrom> It now always gives 4 as per the xkcd? :)
2021-12-29 19:12:16 +0100 <mjrosenb> it was able to handle games that lasted until score 500 in a reasonable amount of time
2021-12-29 19:12:44 +0100Megant(megant@user/megant)
2021-12-29 19:12:47 +0100mikoto-chan(~mikoto-ch@esm-84-240-99-143.netplaza.fi)
2021-12-29 19:17:27 +0100Akiva(~Akiva@user/Akiva) (Ping timeout: 256 seconds)
2021-12-29 19:19:35 +0100 <int-e> mjrosenb: Is that dynamic programming with about (500*10)^2 values?
2021-12-29 19:21:30 +0100 <mjrosenb> it is not super dynamic, and it uss (500*10)*2 values
2021-12-29 19:22:35 +0100 <int-e> I did something weird that effectively adds the current turn number to the state space.
2021-12-29 19:22:41 +0100tzh(~tzh@c-24-21-73-154.hsd1.or.comcast.net)
2021-12-29 19:22:55 +0100 <int-e> And unsurprisingly that causes it to scale worse :)
2021-12-29 19:23:37 +0100 <glguy> int-e: minor tweak that threads the intersection cube through (it's not faster, but it's fewer tokens) https://gist.github.com/glguy/c51bb1e01e964f780e9255eaad77ca69
2021-12-29 19:24:26 +0100 <int-e> Ah, no min/max anymore. makes sense.
2021-12-29 19:25:38 +0100alx741(~alx741@157.100.93.160)
2021-12-29 19:25:45 +0100fef(~thedawn@user/thedawn) (Ping timeout: 276 seconds)
2021-12-29 19:25:46 +0100 <EvanR> I tried to solve the cuboids of lights with algebra
2021-12-29 19:26:08 +0100 <EvanR> but it's too slow
2021-12-29 19:27:10 +0100 <EvanR> figured the superfast method I ended up with is what everyone else did
2021-12-29 19:29:56 +0100tromp(~textual@dhcp-077-249-230-040.chello.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
2021-12-29 19:30:19 +0100alx741(~alx741@157.100.93.160) (Read error: Connection reset by peer)
2021-12-29 19:30:51 +0100 <int-e> mjrosenb: Oh can you exploit the independence of the two players? Hmmmmm. Of course you can.
2021-12-29 19:32:51 +0100 <EvanR> monochrom, the dice only result in 1 2 or 3...
2021-12-29 19:33:06 +0100 <EvanR> 3 sided dice
2021-12-29 19:33:13 +0100ksqsf(~user@134.209.106.31)
2021-12-29 19:33:23 +0100 <EvanR> plato would like a word
2021-12-29 19:33:24 +0100 <int-e> KISS resulted in [d1,d2,d3] <- replicateM 3 [1..3] for me
2021-12-29 19:33:30 +0100geekosaurwonders what kind of geometry leads to that
2021-12-29 19:33:53 +0100 <int-e> (3^3 is 27, that's a small constant factor ;-) )
2021-12-29 19:34:24 +0100 <int-e> > M.assocs $ M.fromListWith (+) [(d1+d2+d3, 1) | [d1,d2,d3] <- replicateM 3 [1..3]]
2021-12-29 19:34:25 +0100 <lambdabot> [(3,1),(4,3),(5,6),(6,7),(7,6),(8,3),(9,1)]
2021-12-29 19:34:38 +0100 <int-e> > 27/7
2021-12-29 19:34:39 +0100 <lambdabot> 3.857142857142857
2021-12-29 19:34:40 +0100 <EvanR> nice bell curve
2021-12-29 19:36:06 +0100 <glguy> int-e: OH, I wasn't even *using* the first argument to subtractBox'
2021-12-29 19:36:30 +0100 <int-e> oh, hehe
2021-12-29 19:36:52 +0100 <int-e> (I missed that too, despite checking the code)
2021-12-29 19:37:20 +0100 <glguy> updated gist
2021-12-29 19:37:26 +0100 <int-e> But it makes sense, since the overlap is all we're really removing, so who cares about the original box at that point
2021-12-29 19:39:26 +0100 <monochrom> In Flatland you can have 3-sided dice. :)
2021-12-29 19:39:30 +0100 <EvanR> the three cases for applying a cuboid to the existing cuboids are "totally outside" "totally inside" and "it's complicated", it's complicate is the only one where any real work happens
2021-12-29 19:40:01 +0100qwedfg(~qwedfg@user/qwedfg) (Quit: ZNC - https://znc.in)
2021-12-29 19:40:41 +0100 <EvanR> a subset b, b subset a, or neither
2021-12-29 19:40:50 +0100 <EvanR> wait no
2021-12-29 19:40:52 +0100qwedfg(~qwedfg@user/qwedfg)
2021-12-29 19:41:24 +0100 <EvanR> subset, empty intersection, or other
2021-12-29 19:42:23 +0100ksqsf(~user@134.209.106.31) (Ping timeout: 256 seconds)
2021-12-29 19:46:34 +0100alx741(~alx741@157.100.93.160)
2021-12-29 19:48:33 +0100 <glguy> int-e: thanks. updated https://glguy.net/advent/sln_2021_22/Main.html and credited your insight in the commit
2021-12-29 19:50:44 +0100econo(uid147250@user/econo)
2021-12-29 19:51:09 +0100mikoto-chan(~mikoto-ch@esm-84-240-99-143.netplaza.fi) (Ping timeout: 268 seconds)
2021-12-29 19:51:21 +0100alx741(~alx741@157.100.93.160) (Read error: Connection reset by peer)
2021-12-29 19:52:17 +0100waleee(~waleee@2001:9b0:21d:fc00:398f:b003:b90d:acf4) (Ping timeout: 240 seconds)
2021-12-29 19:54:42 +0100waleee(~waleee@2001:9b0:21d:fc00:398f:b003:b90d:acf4)
2021-12-29 19:55:27 +0100 <lechner> Hi, what do the words "in anger" mean on this website, please? https://github.com/haskell-works/avro#native-haskell-implementation-of-avro
2021-12-29 19:56:08 +0100 <dsal> lechner: it's a colloquialism that means "I needed this in a real situation"
2021-12-29 19:56:12 +0100 <geekosaur> it's a britishism. originally7 "used in anger" meant "used in battle", now it's somewhat more general
2021-12-29 19:56:49 +0100 <EvanR> needed in a real situation? hmmmm not how I read it
2021-12-29 19:57:17 +0100 <geekosaur> seems a sensible interpretation to me
2021-12-29 19:57:28 +0100 <dsal> It's the opposite of using it in an exercise just to try it out.
2021-12-29 19:57:54 +0100 <geekosaur> https://www.google.com/search?q=used+in+anger&oq=used+in+anger&aqs=chrome.0.0i512l2j0i22i30l7j0i22…
2021-12-29 19:58:06 +0100 <dsal> Like, I got angry trying to use a zipper to solve part of an AoC thing, but I've never used a zipper in anger.
2021-12-29 19:58:08 +0100 <lechner> tfd lists "Obs. grief; trouble." https://www.thefreedictionary.com/anger
2021-12-29 19:58:33 +0100 <geekosaur> that's just the word anger, though. the phrase "used in anger" has a colloquial meaning
2021-12-29 19:58:55 +0100 <EvanR> ah britishisms stackoverflow
2021-12-29 19:59:03 +0100 <lechner> dsal got it http://onlineslangdictionary.com/meaning-definition-of/use-in-anger
2021-12-29 19:59:28 +0100kupi(uid212005@id-212005.hampstead.irccloud.com)
2021-12-29 20:02:03 +0100 <lechner> thanks so much, everyone! you made me feel a lot better
2021-12-29 20:03:00 +0100justsomeguy(~justsomeg@user/justsomeguy)
2021-12-29 20:03:30 +0100neurocyte0132889(~neurocyte@user/neurocyte) (Quit: The Lounge - https://thelounge.chat)
2021-12-29 20:04:32 +0100Akiva(~Akiva@user/Akiva)
2021-12-29 20:04:34 +0100 <int-e> mjrosenb: that's pretty cool, https://paste.tomsmeding.com/9wVXFc8h runs in under 10 seconds for me compiled
2021-12-29 20:07:27 +0100 <int-e> (for day 21)
2021-12-29 20:07:37 +0100neurocyte0132889(~neurocyte@94.46.64.245)
2021-12-29 20:07:37 +0100neurocyte0132889(~neurocyte@94.46.64.245) (Changing host)
2021-12-29 20:07:37 +0100neurocyte0132889(~neurocyte@user/neurocyte)
2021-12-29 20:09:06 +0100alx741(~alx741@157.100.93.160)
2021-12-29 20:09:18 +0100azimut(~azimut@gateway/tor-sasl/azimut) (Ping timeout: 276 seconds)
2021-12-29 20:12:47 +0100CiaoSen(~Jura@p200300c957347b002a3a4dfffe84dbd5.dip0.t-ipconnect.de)
2021-12-29 20:13:47 +0100 <int-e> oh line 19 isn't needed
2021-12-29 20:13:54 +0100alx741(~alx741@157.100.93.160) (Read error: Connection reset by peer)
2021-12-29 20:15:20 +0100 <mjrosenb> that is way more compact than mine was :-O
2021-12-29 20:20:26 +0100tromp(~textual@dhcp-077-249-230-040.chello.nl)
2021-12-29 20:20:57 +0100mvk(~mvk@2607:fea8:5cdd:f000::917a) (Ping timeout: 240 seconds)
2021-12-29 20:22:37 +0100deadmarshal(~deadmarsh@95.38.116.44) (Ping timeout: 256 seconds)
2021-12-29 20:27:17 +0100Morrow(~quassel@5.28.131.86) (Ping timeout: 240 seconds)
2021-12-29 20:29:11 +0100 <Henson> I'm encountering a problem with a Haskell program I'm writing that interfaces with a camera. The images are captured by the camera and placed in a doubly-linked list I made that uses TVars. The images are then read from this list and information is printed. The cameras time out 7 times out of 10 when operating with this TVar buffer. However, when I print information about the image size...
2021-12-29 20:30:03 +0100alx741(~alx741@157.100.93.160)
2021-12-29 20:30:19 +0100 <Henson> BEFORE adding it to the TVar linked list, it works perfectly and times out 0 out of 10 times. There is something happening with Haskell's laziness that is causing a problem here. Does anybody have any suggestions? I've tried using BangPatterns to evaluate the camera image data type, and using "seq" to evaluate the image size, but that doesn't help. Printing the size to the screen does help.
2021-12-29 20:31:14 +0100 <geekosaur> note that seq only helps if the value on the right is evaluated in a timely way
2021-12-29 20:31:20 +0100 <Henson> but obviously I don't want to print information to the screen just to resolve this problem, there's something else that I'm missing that will have the same effect
2021-12-29 20:31:24 +0100 <geekosaur> so we'd have to see some code
2021-12-29 20:33:21 +0100 <sm> the dumb workaround: print the length to /dev/null :)
2021-12-29 20:33:41 +0100 <EvanR> I'm sure a doubly linked list of TVars is possible but I'm skeptical it's worth it
2021-12-29 20:33:47 +0100 <Henson> geekosaur: unfortunately the code is proprietary, so I can't share it. I thought seq forced the evaluation to HWNF of whatever variable was its first argument.
2021-12-29 20:34:21 +0100 <EvanR> a `seq` b will at best only evaluate a if a `seq` b itself is evaluated
2021-12-29 20:34:33 +0100 <Henson> EvanR: the purpose for the double-linked TVar list is to allow concurrent readers to a list that is being written to, and for searching forward and backward in a potentially large list.
2021-12-29 20:34:33 +0100alx741(~alx741@157.100.93.160) (Read error: Connection reset by peer)
2021-12-29 20:34:53 +0100 <EvanR> you can do that with a Data.Sequence
2021-12-29 20:34:59 +0100 <EvanR> or other structure in a single TVar
2021-12-29 20:36:23 +0100epolanski(uid312403@id-312403.helmsley.irccloud.com) (Quit: Connection closed for inactivity)
2021-12-29 20:38:46 +0100 <Henson> are there any other options other than seq, or suggestions of the kinds of things I should be looking for to track down this problem?
2021-12-29 20:39:57 +0100 <Henson> anything equivalent to evaluating a variable for printing that doesn't involve printing it?
2021-12-29 20:40:23 +0100xb0o2(~xb0o2@user/xb0o2)
2021-12-29 20:40:41 +0100 <EvanR> another way to evaluate something is to use evaluate from Control.Exception
2021-12-29 20:41:03 +0100 <EvanR> it has no other side effect
2021-12-29 20:41:29 +0100 <monochrom> Control.DeepSeq has rnf and friends. Combine with Control.Exception's evaluate if necessary.
2021-12-29 20:41:55 +0100 <EvanR> DeepSeq seems especially inappropriate here since everything is linked through TVar contents
2021-12-29 20:42:06 +0100 <EvanR> force can't see that
2021-12-29 20:42:29 +0100 <monochrom> Perhaps the content is a huge lazy expression.
2021-12-29 20:42:39 +0100 <EvanR> but yeah, too bad we can't get the code
2021-12-29 20:42:51 +0100 <monochrom> Perhaps I shouldn't answer.
2021-12-29 20:43:20 +0100 <monochrom> Nothing good comes out of answering a question that requires double blind answering.
2021-12-29 20:43:57 +0100justsomeguy(~justsomeg@user/justsomeguy) (Ping timeout: 240 seconds)
2021-12-29 20:45:17 +0100 <geekosaur> to expand on what EvanR said, a `seq` b means that a will be evaluated when b is. If b never gets evaluated, now you have *two* big thunks
2021-12-29 20:45:19 +0100qwedfg_(~qwedfg@user/qwedfg)
2021-12-29 20:45:51 +0100qwedfg(~qwedfg@user/qwedfg) (Ping timeout: 256 seconds)
2021-12-29 20:46:10 +0100 <Henson> geekosaur: ahh, I didn't know that
2021-12-29 20:46:19 +0100 <Henson> I'm trying to evaluate function now
2021-12-29 20:47:33 +0100merijn(~merijn@83-160-49-249.ip.xs4all.nl)
2021-12-29 20:47:45 +0100 <geekosaur> there are also sledgehammer approaches: you can try {-# LANGUAGE StrictData #-}
2021-12-29 20:48:12 +0100 <glguy> int-e: inlining "segments" into Box takes the runtime down from 41 to 33ms (and all the old segment definitions were used at exactly one place before, so there was no duplication from inlining
2021-12-29 20:48:35 +0100 <EvanR> in clojure they like to put entire databases into their equivalent of a tvar
2021-12-29 20:48:52 +0100 <EvanR> (rather than N TVars referencing each other)
2021-12-29 20:49:42 +0100 <monochrom> Most of us get close to doing that too. Not an entire database but certainly an entire Map for example.
2021-12-29 20:50:29 +0100 <monochrom> Atomicity comes for free if the content is an immutable data structure. (So, true of both Clojure users and Haskell users.)
2021-12-29 20:50:35 +0100 <Henson> EvanR: the Data.Sequence doesn't seem to be quite what I'm looking for. The purpose of the TVar doubly-linked list was to allow constant time appending, and constant time reading of items off the list from multiple concurrent readers.
2021-12-29 20:50:55 +0100 <EvanR> well, Sequence has constant time appending
2021-12-29 20:51:08 +0100 <EvanR> and constant time ... starting to read the list
2021-12-29 20:51:12 +0100alx741(~alx741@157.100.93.160)
2021-12-29 20:51:19 +0100 <EvanR> reading the whole thing depends on the size of the list of course
2021-12-29 20:51:22 +0100 <geekosaur> but it has only one focal point, not one per reader which seems implied
2021-12-29 20:52:45 +0100 <Henson> EvanR: it's similar to this library https://hackage.haskell.org/package/stm-linkedlist but for some reason I can't recall at the moment that library didn't do what I wanted, so I wrote my own.
2021-12-29 20:53:29 +0100 <EvanR> what are the exact features needed?
2021-12-29 20:53:46 +0100 <EvanR> append to the end and
2021-12-29 20:55:52 +0100 <int-e> glguy: "inlining"... oh you're changing the datatype, as in this? (:*) :: {-# UNPACK #-} !Seg -> Box n -> Box ('S n)
2021-12-29 20:55:57 +0100alx741(~alx741@157.100.93.160) (Read error: Connection reset by peer)
2021-12-29 20:56:54 +0100Erutuon(~Erutuon@user/erutuon)
2021-12-29 20:57:17 +0100 <int-e> glguy: Maybe I'll just wait for the inevitable commit to land :P
2021-12-29 20:57:54 +0100 <glguy> int-e: https://glguy.net/advent/sln_2021_22/Main.html
2021-12-29 20:59:34 +0100 <int-e> I guess I guessed correctly then
2021-12-29 21:00:32 +0100 <EvanR> that's really cool
2021-12-29 21:00:47 +0100 <EvanR> type level number for fun and profit
2021-12-29 21:01:00 +0100 <glguy> it made sense to me to split out segments when the logic was on segments that just "happened" to be stacked up into boxes
2021-12-29 21:01:12 +0100 <glguy> with with this more efficient box subtraction the value is lost
2021-12-29 21:01:50 +0100 <int-e> sorry :)
2021-12-29 21:03:32 +0100 <EvanR> to subdivide a 3D box I didn't end up using 2D support ... I wonder if you could so you can justify induction xD
2021-12-29 21:03:39 +0100Morrow(~quassel@bzq-110-168-31-106.red.bezeqint.net)
2021-12-29 21:04:11 +0100 <EvanR> my 2D code went unused
2021-12-29 21:05:02 +0100juhp(~juhp@128.106.188.82) (Ping timeout: 240 seconds)
2021-12-29 21:08:26 +0100juhp(~juhp@128.106.188.82)
2021-12-29 21:08:36 +0100 <glguy> I don't understand what you mean
2021-12-29 21:09:23 +0100lavaman(~lavaman@98.38.249.169)
2021-12-29 21:10:13 +0100 <EvanR> hmm maybe the subdivision could just work for any dimension
2021-12-29 21:10:18 +0100 <EvanR> like everything else
2021-12-29 21:10:49 +0100 <EvanR> still, keeping the dimensions straight with the type level number is cool
2021-12-29 21:12:51 +0100 <glguy> yeah, the subtraction works for any dimension, and tracking the dimension in the type ensures that only n-d things can be subtracted from n-d things
2021-12-29 21:13:05 +0100 <glguy> the recursive case happens at a lower dimension
2021-12-29 21:13:37 +0100lavaman(~lavaman@98.38.249.169) (Ping timeout: 240 seconds)
2021-12-29 21:13:44 +0100alx741(~alx741@157.100.93.160)
2021-12-29 21:14:00 +0100 <glguy> so subtracting cuboids is in terms of subtracting squares is in terms of subtracting segments is in terms of subtracting single points
2021-12-29 21:15:58 +0100 <EvanR> i avoided fencepost issues imagining only cuboids, in 1D they would be line segments centered on the index
2021-12-29 21:16:38 +0100 <EvanR> size = b - a + 1
2021-12-29 21:16:41 +0100 <glguy> I avoided fencepost issues by using an inclusive lower bound and exclusive upper bound
2021-12-29 21:16:46 +0100 <EvanR> i saw that
2021-12-29 21:16:53 +0100 <EvanR> sounds confusing xD
2021-12-29 21:17:46 +0100 <Henson> ugh, when I replace the complex TVar buffer with just a simple list inside a single TVar, the same problem happens.
2021-12-29 21:17:50 +0100 <glguy> it's the most common way to do ranges, really
2021-12-29 21:18:08 +0100 <glguy> note how Python does range(), how Rust does its .. enumeration
2021-12-29 21:18:34 +0100 <glguy> C arrays, etc
2021-12-29 21:18:34 +0100alx741(~alx741@157.100.93.160) (Read error: Connection reset by peer)
2021-12-29 21:19:43 +0100 <EvanR> makes sense for topology, you can juxtapose a doubly closed interval without overlapping
2021-12-29 21:19:47 +0100 <EvanR> can't*
2021-12-29 21:19:55 +0100 <int-e> EvanR: it's not confusing if you treat the boundaries as *real* coordinates of cuboids (composed from unit cubes)
2021-12-29 21:20:24 +0100 <EvanR> since we're not on the real line, it seems more like school blocks lined up
2021-12-29 21:20:28 +0100 <int-e> EvanR: which also means we're computing an actual volume rather than counting lattice points
2021-12-29 21:20:47 +0100 <EvanR> me too, b - a + 1
2021-12-29 21:21:03 +0100 <EvanR> I'm working with volumes xD
2021-12-29 21:21:09 +0100 <EvanR> not points
2021-12-29 21:21:31 +0100 <EvanR> (since the problem went out of their way to describe it like that)
2021-12-29 21:21:55 +0100 <int-e> EvanR: but you're doing it wrong :-D
2021-12-29 21:21:58 +0100merijn(~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 260 seconds)
2021-12-29 21:22:17 +0100jco(~jco@90-228-194-139-no542.tbcn.telia.com) (Ping timeout: 240 seconds)
2021-12-29 21:22:29 +0100 <int-e> (I added 1 to all upper bounds because I was afraid of fencepost errors. YMMV)
2021-12-29 21:22:35 +0100 <EvanR> > [0..10]
2021-12-29 21:22:37 +0100 <lambdabot> [0,1,2,3,4,5,6,7,8,9,10]
2021-12-29 21:22:49 +0100 <EvanR> I'm so glad haskell does it wrong, I hate the python way
2021-12-29 21:22:57 +0100 <int-e> I didn't do it for part 1 though
2021-12-29 21:23:12 +0100 <int-e> EvanR: have you seen the Rust way?
2021-12-29 21:23:15 +0100 <EvanR> no
2021-12-29 21:23:18 +0100zincy(~zincy@2a00:23c8:970c:4801:c17f:9983:e5a5:ab71) (Remote host closed the connection)
2021-12-29 21:23:40 +0100 <int-e> they have two types of ranges: a..b excludes b; a..=b includes b
2021-12-29 21:23:48 +0100 <int-e> awkward... well... until you get used to it
2021-12-29 21:23:50 +0100zincy(~zincy@2a00:23c8:970c:4801:c17f:9983:e5a5:ab71)
2021-12-29 21:25:01 +0100 <kuribas> > init [0..10]
2021-12-29 21:25:03 +0100 <lambdabot> [0,1,2,3,4,5,6,7,8,9]
2021-12-29 21:25:18 +0100 <EvanR> > [(-1) .. 1]
2021-12-29 21:25:19 +0100 <lambdabot> [-1,0,1]
2021-12-29 21:25:25 +0100 <EvanR> nicely symmetric
2021-12-29 21:25:43 +0100 <EvanR> IT JUST MAKES SENSE
2021-12-29 21:26:03 +0100 <int-e> > [-1..1]
2021-12-29 21:26:04 +0100 <lambdabot> [-1,0,1]
2021-12-29 21:26:18 +0100 <geekosaur> > [ 0.01 .. 0.1 ]
2021-12-29 21:26:20 +0100 <lambdabot> [1.0e-2]
2021-12-29 21:26:33 +0100 <EvanR> > [-(1..1)]
2021-12-29 21:26:33 +0100 <int-e> > [-2.. -1] -- this is the nasty case
2021-12-29 21:26:34 +0100 <geekosaur> > [ 0.01, 0.02 .. 0.1 ]
2021-12-29 21:26:34 +0100 <lambdabot> [-2,-1]
2021-12-29 21:26:34 +0100 <lambdabot> <hint>:1:5: error: parse error on input ‘..’
2021-12-29 21:26:36 +0100 <lambdabot> [1.0e-2,2.0e-2,3.0e-2,4.0e-2,5.0e-2,6.0000000000000005e-2,6.999999999999999e...
2021-12-29 21:26:48 +0100 <EvanR> -2 to -1 worked
2021-12-29 21:27:05 +0100 <int-e> > [-2..-1] -- well, consider this
2021-12-29 21:27:07 +0100 <lambdabot> error:
2021-12-29 21:27:07 +0100 <lambdabot> • Variable not in scope: (..-) :: t0 -> t1 -> a
2021-12-29 21:27:07 +0100 <lambdabot> • Perhaps you meant ‘...’ (imported from Control.Lens)
2021-12-29 21:27:13 +0100 <EvanR> oof
2021-12-29 21:27:17 +0100 <int-e> EvanR: I avoided the trap
2021-12-29 21:27:40 +0100 <glguy> > [2, 1 .. 1]
2021-12-29 21:27:42 +0100 <lambdabot> [2,1]
2021-12-29 21:27:47 +0100 <glguy> I wish we had a nicer syntax for counting down
2021-12-29 21:28:08 +0100 <geekosaur> even more fun is when you trip parsing of .. as qualified (.)
2021-12-29 21:28:11 +0100 <int-e> geekosaur: yeah the behavior on floats is kind of awful
2021-12-29 21:28:27 +0100 <glguy> I think I've only ever wanted to provide the delta rather than the next element forcing the code to then recompute the delta for me
2021-12-29 21:28:28 +0100 <geekosaur> > [False..True] -- ick
2021-12-29 21:28:30 +0100 <lambdabot> error:
2021-12-29 21:28:30 +0100 <lambdabot> Not in scope: ‘False..’
2021-12-29 21:28:30 +0100 <lambdabot> No module named ‘False’ is imported.error:
2021-12-29 21:28:43 +0100 <glguy> especially since I'm almost always computing the next element by adding the delta manually
2021-12-29 21:28:46 +0100 <int-e> geekosaur: yeah that one also gets me on occasion
2021-12-29 21:29:04 +0100 <glguy> [x, x+1, ..] --- and then the library has to do: x-(x+1) to get the 1 back when I had the 1 in the first place
2021-12-29 21:29:08 +0100 <EvanR> yes [1, 3, ..] is cool but gimmicky
2021-12-29 21:29:23 +0100 <glguy> I'd much rather write something like: [1, +2 ..]
2021-12-29 21:29:33 +0100 <int-e> too mant commas
2021-12-29 21:29:36 +0100 <int-e> *many
2021-12-29 21:29:38 +0100 <EvanR> yes
2021-12-29 21:29:42 +0100kuribas(~user@ptr-25vy0i81bhacxv5d2f4.18120a2.ip6.access.telenet.be) (Quit: ERC (IRC client for Emacs 26.3))
2021-12-29 21:29:43 +0100 <EvanR> caught too late
2021-12-29 21:29:48 +0100 <geekosaur> also with the float one I was hoping to trigger the overshoot behavior with floats, but lb chopped it off
2021-12-29 21:30:15 +0100 <int-e> > last [ 0.01, 0.02 .. 0.1 ]
2021-12-29 21:30:17 +0100 <lambdabot> 9.999999999999999e-2
2021-12-29 21:30:51 +0100 <int-e> > last [ 0.01, 0.03 .. 0.1 ]
2021-12-29 21:30:52 +0100 <lambdabot> 0.10999999999999997
2021-12-29 21:31:01 +0100 <EvanR> > showFFloat (Just 3) 9.999999999999999e-2 ""
2021-12-29 21:31:03 +0100 <lambdabot> "0.100"
2021-12-29 21:31:11 +0100 <EvanR> > showFFloat (Just 33) 9.999999999999999e-2 ""
2021-12-29 21:31:13 +0100 <lambdabot> "0.099999999999999990000000000000000"
2021-12-29 21:31:48 +0100lavaman(~lavaman@98.38.249.169)
2021-12-29 21:31:50 +0100 <EvanR> well that's basically 0.1
2021-12-29 21:32:03 +0100 <EvanR> ship it
2021-12-29 21:33:32 +0100waleee(~waleee@2001:9b0:21d:fc00:398f:b003:b90d:acf4) (Ping timeout: 252 seconds)
2021-12-29 21:34:59 +0100 <g> int-e: thinking in terms of lattice points makes sense to me for the size of a 0D box being 1. What's the interpretation for coordinates?
2021-12-29 21:35:37 +0100waleee(~waleee@2001:9b0:21d:fc00:398f:b003:b90d:acf4)
2021-12-29 21:36:15 +0100 <int-e> @check \a b -> let a' = fromIntegral (getPositive a); b' = fromIntegral (getPositive b) in last [0,a'/b'..a'] <= a'
2021-12-29 21:36:16 +0100alx741(~alx741@157.100.93.160)
2021-12-29 21:36:17 +0100 <lambdabot> *** Failed! Falsifiable (after 50 tests and 2 shrinks):
2021-12-29 21:36:17 +0100 <lambdabot> Positive {getPositive = 29} Positive {getPositive = 27}
2021-12-29 21:36:41 +0100 <int-e> g: product [] = 1
2021-12-29 21:36:57 +0100 <EvanR> for the 0D box of 1 you'd need the coordinates of both ends
2021-12-29 21:37:08 +0100 <EvanR> instead of coordinate of center
2021-12-29 21:37:24 +0100 <g> 0D boxes don't have coordinates
2021-12-29 21:37:25 +0100 <int-e> there are no coordinates
2021-12-29 21:37:33 +0100 <EvanR> oh, I mixed it up with 1D
2021-12-29 21:37:52 +0100 <g> int-e: I agree that it "is" 1. I'm trying to think of what that"means"
2021-12-29 21:38:16 +0100 <int-e> g: well, your measure is discrete here; the set containing the sole point has measure 1
2021-12-29 21:38:18 +0100 <g> The best I can do is that 1 is the identify element?
2021-12-29 21:38:24 +0100 <int-e> the empty set has measure 0
2021-12-29 21:38:25 +0100 <EvanR> it's because our cuboids of whatever dimension are all slices of an infinite dimensional space of hypercuboids
2021-12-29 21:38:26 +0100int-eshrugs
2021-12-29 21:38:49 +0100 <EvanR> and the smallest of any of them has size 1
2021-12-29 21:39:21 +0100 <EvanR> flatland
2021-12-29 21:39:41 +0100danso(~danso@2001:1970:52e7:d000:96b8:6dff:feb3:c009) (Ping timeout: 268 seconds)
2021-12-29 21:40:49 +0100azimut(~azimut@gateway/tor-sasl/azimut)
2021-12-29 21:41:17 +0100nhatanh02(~satori@123.24.172.30) (Ping timeout: 240 seconds)
2021-12-29 21:41:39 +0100 <int-e> g: it really comes down to the same thing that motivates product [] = 1: we want product (xs ++ ys) = product xs * product ys, and we want the same thing when we split the dimensions of a cuboid into two independent parts (ala R^(n+m) = R^n x R^m).
2021-12-29 21:41:55 +0100pavonia(~user@user/siracusa)
2021-12-29 21:42:18 +0100 <int-e> Counting is a bit easier for 0D, I agree.
2021-12-29 21:42:31 +0100 <int-e> (as intuition)
2021-12-29 21:45:38 +0100ph88(~ph88@2a02:8109:9e00:71d0::7e04)
2021-12-29 21:45:55 +0100shailangsa(~shailangs@host109-159-108-207.range109-159.btcentralplus.com) (Ping timeout: 256 seconds)
2021-12-29 21:47:17 +0100alx741(~alx741@157.100.93.160) (Read error: Connection reset by peer)
2021-12-29 21:48:26 +0100 <EvanR> given n D set of (size 1) cuboids, there's an n-1 D slice one for each 'i', each one still has size 1. The zero D slice ends up being like Bool, size 1 or size 0 (outside a cuboid)
2021-12-29 21:49:18 +0100 <EvanR> screw R^n xD
2021-12-29 21:49:48 +0100 <EvanR> banach tarski paradox not invited
2021-12-29 21:50:56 +0100danso(~danso@2001:1970:52e7:d000:96b8:6dff:feb3:c009)
2021-12-29 21:51:59 +0100 <g> I guess part of the confusion is that with counting the unit is the same; you're counting points
2021-12-29 21:52:47 +0100 <g> But under the other interpretation its lengths, areas, volumes, etc
2021-12-29 21:53:27 +0100 <g> So then with 0D it's not just 1, but it's 1 unit^0
2021-12-29 21:53:31 +0100 <int-e> yes, you get n-dimensional measures for various n
2021-12-29 21:54:16 +0100 <int-e> I feel it helps.
2021-12-29 21:54:19 +0100int-eshrugs
2021-12-29 21:56:02 +0100 <int-e> (As usual the thing about intuitions is that there's no right one... whatever works for you is best for you.)
2021-12-29 21:56:06 +0100 <g> So it's very literally a dimensionless number :)
2021-12-29 21:57:03 +0100 <EvanR> 3 m^2, 3 m^1, 3 xD
2021-12-29 21:57:37 +0100 <int-e> 3 rad, almost half a circle
2021-12-29 22:01:08 +0100InternetCitizen(~fuzzypixe@eth-west-pareq2-46-193-4-100.wb.wifirst.net)
2021-12-29 22:01:16 +0100 <InternetCitizen> ,lambda 1
2021-12-29 22:01:33 +0100 <InternetCitizen> how do I use the bot?
2021-12-29 22:02:07 +0100 <geekosaur> what are you trying to do with it?
2021-12-29 22:02:29 +0100 <InternetCitizen> write an example for my question :)
2021-12-29 22:03:04 +0100 <geekosaur> > (\x -> x+1) 3
2021-12-29 22:03:05 +0100 <lambdabot> 4
2021-12-29 22:03:26 +0100mikoto-chan(~mikoto-ch@esm-84-240-99-143.netplaza.fi)
2021-12-29 22:03:45 +0100 <int-e> (you can test these in private chat (/query lambdabot in a typical irc client))
2021-12-29 22:03:52 +0100 <ProfSimm> Consider how we humans interact with one another. We more often than not don't have clear input and output. We have a partially abstract input (i.e. with placeholders) and we're told to solve and fill-in the placeholders. We do this when given a paper form, or a test.
2021-12-29 22:04:05 +0100 <ProfSimm> Is this more fundamental than a function with input and output I wonder?
2021-12-29 22:04:13 +0100 <InternetCitizen> let lengthl' xs = foldl (const (+ 1)) 0 xs in lengthl' [1, 2, 3]
2021-12-29 22:04:27 +0100 <InternetCitizen> let lengthr' xs = foldr (const (+ 1)) 0 xs in lengthr' [1, 2, 3]
2021-12-29 22:04:44 +0100 <int-e> InternetCitizen: the prefix is '> '
2021-12-29 22:04:51 +0100 <geekosaur> more abstract, I'd say. humans are abstraction machines
2021-12-29 22:04:57 +0100CiaoSen(~Jura@p200300c957347b002a3a4dfffe84dbd5.dip0.t-ipconnect.de) (Ping timeout: 240 seconds)
2021-12-29 22:04:57 +0100 <InternetCitizen> >let lengthl' xs = foldl (const (+ 1)) 0 xs in lengthl' [1, 2, 3]
2021-12-29 22:05:06 +0100 <geekosaur> the space was not there for show
2021-12-29 22:05:06 +0100 <pragma-> I'm just a walking Chinese Room.
2021-12-29 22:05:07 +0100 <InternetCitizen> > let lengthl' xs = foldl (const (+ 1)) 0 xs in lengthl' [1, 2, 3]
2021-12-29 22:05:09 +0100 <lambdabot> 4
2021-12-29 22:05:14 +0100coot(~coot@89-64-85-93.dynamic.chello.pl) (Quit: coot)
2021-12-29 22:05:17 +0100 <InternetCitizen> > let lengthr' xs = foldr (const (+ 1)) 0 xs in lengthr' [1, 2, 3]
2021-12-29 22:05:19 +0100 <lambdabot> 3
2021-12-29 22:05:46 +0100 <InternetCitizen> I guess you know what my question is, why does one work and the other doesn't?
2021-12-29 22:05:50 +0100coot(~coot@89-64-85-93.dynamic.chello.pl)
2021-12-29 22:05:51 +0100alx741(~alx741@181.199.42.79)
2021-12-29 22:06:01 +0100 <int-e> InternetCitizen: look at the types?
2021-12-29 22:06:08 +0100 <InternetCitizen> the elements in the list shouldn't matter, let alone their order
2021-12-29 22:06:24 +0100 <int-e> well, one of the functions violates that expectations
2021-12-29 22:06:26 +0100 <int-e> -s
2021-12-29 22:06:45 +0100 <EvanR> that order matters is what distinguishes a list from a set
2021-12-29 22:07:07 +0100 <int-e> :t foldl (const (+ 1)) 0
2021-12-29 22:07:09 +0100 <lambdabot> (Foldable t, Num b) => t b -> b
2021-12-29 22:07:11 +0100 <int-e> :t foldr (const (+ 1)) 0
2021-12-29 22:07:12 +0100 <lambdabot> (Foldable t, Num b1) => t b2 -> b1
2021-12-29 22:07:14 +0100 <EvanR> that's not what causes the type error though
2021-12-29 22:07:32 +0100madjestic(~madjestic@88-159-247-120.fixed.kpn.net)
2021-12-29 22:07:46 +0100 <int-e> (oops... the former restricts the list type... that's a strong hint as to what's going on)
2021-12-29 22:08:28 +0100 <InternetCitizen> it's somehow adding the elements of the list into the acc
2021-12-29 22:08:41 +0100kritzefitz(~kritzefit@debian/kritzefitz) (Ping timeout: 268 seconds)
2021-12-29 22:08:45 +0100 <int-e> :t foldl
2021-12-29 22:08:45 +0100 <InternetCitizen> oh wait!
2021-12-29 22:08:46 +0100 <lambdabot> Foldable t => (b -> a -> b) -> b -> t a -> b
2021-12-29 22:08:47 +0100 <int-e> :t foldr
2021-12-29 22:08:48 +0100 <lambdabot> Foldable t => (a -> b -> b) -> b -> t a -> b
2021-12-29 22:09:03 +0100 <InternetCitizen> I just typed the same thing into my GHCi ...
2021-12-29 22:09:06 +0100 <int-e> note also that those two types are different, which provides further clues.
2021-12-29 22:09:23 +0100 <InternetCitizen> I thought the two were different in their order of traversal!
2021-12-29 22:09:28 +0100 <geekosaur> nope
2021-12-29 22:09:42 +0100 <geekosaur> common misapprehension
2021-12-29 22:09:51 +0100 <geekosaur> they're different in their order of *association*
2021-12-29 22:10:03 +0100 <geekosaur> a list can only be traversed in one direction
2021-12-29 22:10:21 +0100kritzefitz(~kritzefit@debian/kritzefitz)
2021-12-29 22:10:41 +0100 <geekosaur> > foldl f z [a,b,c]
2021-12-29 22:10:41 +0100alx741(~alx741@181.199.42.79) (Read error: Connection reset by peer)
2021-12-29 22:10:43 +0100 <lambdabot> f (f (f z a) b) c
2021-12-29 22:10:45 +0100 <InternetCitizen> this makes more sense now, I was mistaken to think one of them use tail recursion or some black magic
2021-12-29 22:10:47 +0100 <geekosaur> > foldr f z [a,b,c]
2021-12-29 22:10:49 +0100 <lambdabot> f a (f b (f c z))
2021-12-29 22:11:03 +0100 <EvanR> one of them does use tail recursion
2021-12-29 22:11:08 +0100 <EvanR> @src foldl
2021-12-29 22:11:08 +0100 <lambdabot> foldl f z [] = z
2021-12-29 22:11:08 +0100 <lambdabot> foldl f z (x:xs) = foldl f (f z x) xs
2021-12-29 22:11:21 +0100alx741(~alx741@157.100.93.160)
2021-12-29 22:11:57 +0100jgeerds(~jgeerds@55d4ac73.access.ecotel.net)
2021-12-29 22:12:00 +0100 <EvanR> make sure you use lazy evaluation to understand that
2021-12-29 22:14:17 +0100 <InternetCitizen> well in `f (f (f z a) b) c` `f z a` is evaluated first, I'm just not sure if it's evaluated before or after building the whole expression
2021-12-29 22:14:29 +0100 <InternetCitizen> after probably
2021-12-29 22:14:36 +0100 <InternetCitizen> @src foldr
2021-12-29 22:14:36 +0100 <lambdabot> foldr f z [] = z
2021-12-29 22:14:36 +0100 <lambdabot> foldr f z (x:xs) = f x (foldr f z xs)
2021-12-29 22:14:53 +0100 <EvanR> f z a may not even be evaluated, it depends
2021-12-29 22:15:16 +0100_ht(~quassel@82-169-194-8.biz.kpn.net) (Remote host closed the connection)
2021-12-29 22:15:31 +0100 <g> InternetCitizen: no, f z a isn't evaluated first in that expression
2021-12-29 22:16:05 +0100alx741(~alx741@157.100.93.160) (Read error: Connection reset by peer)
2021-12-29 22:16:36 +0100 <g> It's only evaluated if f (f z a) b needs to evaluate it
2021-12-29 22:17:07 +0100 <geekosaur> note that f may be lazy in its first parameter
2021-12-29 22:17:10 +0100 <EvanR> that expression by itself doesn't reflect foldl's limitation, that you even if you don't look at c, you can't do f _ c until going to the end of the list
2021-12-29 22:21:14 +0100 <EvanR> and the nested stuff in the first parameter has to be prepared in case you look at it, unlike foldr which can bypass all that
2021-12-29 22:21:35 +0100 <jackdk> http://data.tmorris.net/talks/list-folds/b30aa0fdff296c731bc5b1c824adf1d02b3b69d9/list-folds.pdf foldr performs constructor replacement, foldl is basically a loop
2021-12-29 22:21:49 +0100azimut_(~azimut@gateway/tor-sasl/azimut)
2021-12-29 22:22:33 +0100azimut(~azimut@gateway/tor-sasl/azimut) (Ping timeout: 276 seconds)
2021-12-29 22:25:06 +0100 <EvanR> after internalizing lazy evaluation you can tell from the code there for foldr that you can get instant gratification, since it applies your f immediately, and you're free to ignore or not the "accumulator" (is there a better name for that thing)
2021-12-29 22:25:26 +0100shailangsa_(~shailangs@host86-186-142-101.range86-186.btcentralplus.com)
2021-12-29 22:25:37 +0100 <EvanR> foldl is frustrated by looping to the end of the list first
2021-12-29 22:25:38 +0100 <geekosaur> I think of it as state, not an accumulator
2021-12-29 22:26:37 +0100 <InternetCitizen> > myFoldr f acc (x:xs) = myFoldr f (f x acc) xs
2021-12-29 22:26:39 +0100 <lambdabot> <hint>:1:22: error: parse error on input ‘=’
2021-12-29 22:26:49 +0100rito_(~rito_gh@45.112.243.151) (Quit: Leaving)
2021-12-29 22:26:56 +0100 <InternetCitizen> > let myFoldr f acc (x:xs) = myFoldr f (f x acc) xs
2021-12-29 22:26:58 +0100 <lambdabot> <no location info>: error:
2021-12-29 22:26:58 +0100 <lambdabot> not an expression: ‘let myFoldr f acc (x:xs) = myFoldr f (f x acc) xs’
2021-12-29 22:26:59 +0100 <EvanR> @let doesThisWork = 3
2021-12-29 22:27:01 +0100 <lambdabot> Defined.
2021-12-29 22:27:04 +0100 <EvanR> > doesThisWork
2021-12-29 22:27:06 +0100 <lambdabot> 3
2021-12-29 22:27:20 +0100 <InternetCitizen> @let myFoldr f acc (x:xs) = myFoldr f (f x acc) xs
2021-12-29 22:27:21 +0100 <lambdabot> Defined.
2021-12-29 22:27:29 +0100 <InternetCitizen> @let my_foldr f acc [] = acc
2021-12-29 22:27:30 +0100 <lambdabot> Defined.
2021-12-29 22:27:44 +0100 <InternetCitizen> couldn't foldr be implemented this way too?
2021-12-29 22:27:53 +0100 <EvanR> that's foldl
2021-12-29 22:28:40 +0100 <InternetCitizen> but f takes x first and acc second
2021-12-29 22:28:41 +0100 <EvanR> in myFoldr f (f x acc) xs, the f x acc is not evaluated first (potentially not at all)
2021-12-29 22:29:17 +0100 <EvanR> the order of arguments doesn't matter as much as your recursion
2021-12-29 22:29:35 +0100hololeap(~hololeap@user/hololeap) (Quit: Bye)
2021-12-29 22:33:37 +0100 <InternetCitizen> @let myFoldr f acc (x:xs) = f (myFoldr f acc xs) x
2021-12-29 22:33:38 +0100 <lambdabot> /sandbox/tmp/.L.hs:159:1: error: [-Woverlapping-patterns, -Werror=overlappin...
2021-12-29 22:33:38 +0100 <lambdabot> Pattern match is redundant
2021-12-29 22:33:38 +0100 <lambdabot> In an equation for ‘myFoldr’: myFoldr f acc (x : xs) = ...
2021-12-29 22:33:50 +0100alx741(~alx741@157.100.93.160)
2021-12-29 22:33:59 +0100 <EvanR> @undefine
2021-12-29 22:33:59 +0100 <lambdabot> Undefined.
2021-12-29 22:34:03 +0100 <EvanR> try again
2021-12-29 22:34:14 +0100 <InternetCitizen> @let myFoldr f acc (x:xs) = f (myFoldr f acc xs) x
2021-12-29 22:34:15 +0100 <lambdabot> Defined.
2021-12-29 22:34:23 +0100 <InternetCitizen> @let myFoldr f acc [] = []
2021-12-29 22:34:24 +0100 <lambdabot> Defined.
2021-12-29 22:34:53 +0100 <InternetCitizen> so we can define them both in both orders of f's arguments
2021-12-29 22:34:56 +0100 <EvanR> that doesn't seem right
2021-12-29 22:35:19 +0100 <InternetCitizen> > myFoldr (+) 0 [1, 2, 3]
2021-12-29 22:35:20 +0100 <EvanR> use ; to put both cases in the def at the same time
2021-12-29 22:35:21 +0100 <lambdabot> error:
2021-12-29 22:35:21 +0100 <lambdabot> • No instance for (Num [()]) arising from a use of ‘e_10123’
2021-12-29 22:35:21 +0100 <lambdabot> • In the expression: e_10123
2021-12-29 22:35:48 +0100 <InternetCitizen> @let myFoldr f acc [] = []; let myFoldr f acc (x:xs) = f (myFoldr f acc xs) x
2021-12-29 22:35:49 +0100 <lambdabot> Parse failed: Parse error: EOF
2021-12-29 22:35:54 +0100 <EvanR> i.e. foo 0 = 1; foo i = i + 1
2021-12-29 22:35:55 +0100 <InternetCitizen> @let myFoldr f acc [] = []; let myFoldr f acc (x:xs) = f (myFoldr f acc xs) x;
2021-12-29 22:35:55 +0100 <lambdabot> Parse failed: Parse error: EOF
2021-12-29 22:36:16 +0100 <EvanR> @undefine
2021-12-29 22:36:16 +0100 <lambdabot> Undefined.
2021-12-29 22:36:40 +0100 <EvanR> maybe try this in a source file first and get the bugs out
2021-12-29 22:37:37 +0100 <geekosaur> well, some of this is just not using the bot right. @let is not the same as "let", it just defines styuff at "top level" for lambdabot instead of being an expression. note that you never use "let" at top level in a file
2021-12-29 22:38:23 +0100_73(~user@pool-108-49-252-36.bstnma.fios.verizon.net)
2021-12-29 22:38:32 +0100 <InternetCitizen> > @let ah well it's `myFoldr :: ([a] -> t1 -> [a]) -> t2 -> [t1] -> [a]`
2021-12-29 22:38:34 +0100 <lambdabot> <hint>:1:1: error: parse error on input ‘@’
2021-12-29 22:38:46 +0100alx741(~alx741@157.100.93.160) (Read error: Connection reset by peer)
2021-12-29 22:38:50 +0100 <int-e> :t let myFoldr f acc [] = []; myFoldr f acc (x:xs) = f (myFoldr f acc xs) x in myFoldr
2021-12-29 22:38:51 +0100 <lambdabot> ([a] -> t1 -> [a]) -> t2 -> [t1] -> [a]
2021-12-29 22:39:13 +0100 <geekosaur> now it may be time to switch to /query until you figure out how the bot works
2021-12-29 22:39:21 +0100 <int-e> yeah that looks suspicious.
2021-12-29 22:39:41 +0100 <int-e> (the type, that is)
2021-12-29 22:39:49 +0100 <geekosaur> (and yet again I want to finish the documentation I wrote a decade ago minus the haskell plugins, but I still have nowhere to host it except maybe dropbox)
2021-12-29 22:40:25 +0100 <EvanR> InternetCitizen, foldr ought to return various types, not just lists
2021-12-29 22:40:26 +0100 <int-e> (note how there's a t2 in just one place... hmm...)
2021-12-29 22:40:26 +0100 <geekosaur> of course I could contribute it back and see if it ever shows up in a release…
2021-12-29 22:40:46 +0100 <InternetCitizen> :t let myFoldr f acc [] = acc; myFoldr f acc (x:xs) = f (myFoldr f acc xs) x in myFoldr
2021-12-29 22:40:47 +0100 <lambdabot> (t1 -> t2 -> t1) -> t1 -> [t2] -> t1
2021-12-29 22:40:53 +0100 <EvanR> better
2021-12-29 22:41:47 +0100 <InternetCitizen> > let myFoldr f acc [] = acc; myFoldr f acc (x:xs) = f (myFoldr f acc xs) x in myFoldr (+) 0 [1..3]
2021-12-29 22:41:49 +0100 <lambdabot> 6
2021-12-29 22:41:53 +0100 <int-e> :t foldr . flip
2021-12-29 22:41:54 +0100 <lambdabot> Foldable t => (b -> a -> b) -> b -> t a -> b
2021-12-29 22:42:16 +0100 <int-e> (it's not quite the standard foldr)
2021-12-29 22:42:33 +0100 <EvanR> same thing but takes arguments in another order
2021-12-29 22:42:44 +0100MoC(~moc@user/moc) (Quit: Konversation terminated!)
2021-12-29 22:43:06 +0100 <InternetCitizen> yes my question is why does prelude flip the arguments for foldr
2021-12-29 22:43:13 +0100 <InternetCitizen> or foldl depending on how you see it
2021-12-29 22:43:38 +0100 <int-e> > foldr f z [a,b,c] -- note how the order of the list is preserved in the expression
2021-12-29 22:43:40 +0100 <InternetCitizen> it's clearly just as easy to do it this way
2021-12-29 22:43:40 +0100 <lambdabot> f a (f b (f c z))
2021-12-29 22:43:46 +0100 <InternetCitizen> ah
2021-12-29 22:43:47 +0100 <int-e> > foldl f z [a,b,c] -- ditto
2021-12-29 22:43:49 +0100 <lambdabot> f (f (f z a) b) c
2021-12-29 22:44:41 +0100 <EvanR> in the foldr "callback" you can think of "the rest of the fold" being to the right, so it's second
2021-12-29 22:45:04 +0100 <EvanR> in foldl it's the opposite
2021-12-29 22:45:05 +0100 <_73> could the argument order have to do with making it easier to partially apply foldr?
2021-12-29 22:46:37 +0100 <EvanR> yeah it often is easier
2021-12-29 22:46:46 +0100 <int-e> _73: for the second and third argument you mean? yes, (a -> b -> b) -> [a] -> b -> b would be harder to partially apply when you want a function from lists
2021-12-29 22:46:50 +0100 <EvanR> but just as often my functions are backward xD
2021-12-29 22:47:39 +0100 <InternetCitizen> oh so the order the argument reflects the order of evaluation, it's genius
2021-12-29 22:47:41 +0100 <int-e> There's also foldr (:) [] = id to consider, I guess.
2021-12-29 22:48:07 +0100 <EvanR> I'm not sure about that theory
2021-12-29 22:48:50 +0100 <EvanR> it's more about which way the associativity leans than order of evaluation
2021-12-29 22:49:15 +0100 <EvanR> you should know, laziness lets you play around with evaluation order
2021-12-29 22:51:10 +0100 <InternetCitizen> oh right, well the associativity makes for a good mnemonic too
2021-12-29 22:51:14 +0100shailangsa_(~shailangs@host86-186-142-101.range86-186.btcentralplus.com) (Ping timeout: 268 seconds)
2021-12-29 22:52:09 +0100jtomas(~jtomas@153.red-83-53-252.dynamicip.rima-tde.net) (Remote host closed the connection)
2021-12-29 22:52:33 +0100jtomas(~jtomas@153.red-83-53-252.dynamicip.rima-tde.net)
2021-12-29 22:52:51 +0100 <EvanR> that slide show linked earlier by jackdk is really good for getting to the practical difference between them, carefully not mentioning any weirdness caused by haskell, and still being technically right xD
2021-12-29 22:55:54 +0100alx741(~alx741@181.199.42.79)
2021-12-29 23:03:46 +0100 <InternetCitizen> the order of the args makes it awkaward to define `reverse` using foldl and it's impossible to do it with foldr
2021-12-29 23:04:18 +0100 <EvanR> you should be able to do anything you can do with foldl with foldr
2021-12-29 23:04:22 +0100 <InternetCitizen> I consider `reverse = foldl (:) []` a missed opportunity
2021-12-29 23:04:40 +0100 <EvanR> > foldl (:) [] [1,2,3,4,5]
2021-12-29 23:04:41 +0100 <lambdabot> error:
2021-12-29 23:04:41 +0100 <lambdabot> • Occurs check: cannot construct the infinite type: a ~ [a]
2021-12-29 23:04:41 +0100 <lambdabot> Expected type: [a] -> [a] -> [a]
2021-12-29 23:05:00 +0100 <InternetCitizen> it needs a flipped cons
2021-12-29 23:05:00 +0100 <EvanR> > foldl (flip (:)) [] [1,2,3,4,5]
2021-12-29 23:05:03 +0100 <lambdabot> [5,4,3,2,1]
2021-12-29 23:05:17 +0100 <EvanR> honestly not a big deal
2021-12-29 23:05:41 +0100coot(~coot@89-64-85-93.dynamic.chello.pl) (Quit: coot)
2021-12-29 23:05:49 +0100alx741(~alx741@181.199.42.79) (Read error: Connection reset by peer)
2021-12-29 23:05:55 +0100 <geekosaur> it could have been defined that way, but keeping the order of parameters makes more sense (see earlier examples)
2021-12-29 23:05:59 +0100 <InternetCitizen> I'm joking :^)
2021-12-29 23:06:09 +0100 <geekosaur> I mena, it's not a real big opportunity to be missed
2021-12-29 23:06:25 +0100alx741(~alx741@181.199.42.79)
2021-12-29 23:07:03 +0100[itchyjunk](~itchyjunk@user/itchyjunk/x-7353470) (Remote host closed the connection)
2021-12-29 23:08:00 +0100acidjnk(~acidjnk@pd9e0bdc0.dip0.t-ipconnect.de)
2021-12-29 23:08:19 +0100Ankhers(~Ankhers@ec2-54-196-233-138.compute-1.amazonaws.com) (Quit: ZNC 1.8.2 - https://znc.in)
2021-12-29 23:11:56 +0100alx741(~alx741@181.199.42.79) (Read error: Connection reset by peer)
2021-12-29 23:12:13 +0100 <InternetCitizen> > let k x y = 0 in foldl k 0 [1..]
2021-12-29 23:12:19 +0100 <lambdabot> mueval-core: Time limit exceeded
2021-12-29 23:12:31 +0100lavaman(~lavaman@98.38.249.169) (Remote host closed the connection)
2021-12-29 23:12:45 +0100ProfSimm(~ProfSimm@87.227.196.109) (Remote host closed the connection)
2021-12-29 23:13:06 +0100 <InternetCitizen> hah well clearly I don't understand lazy evaluation
2021-12-29 23:13:24 +0100 <EvanR> that one doesn't depend on lazy evaluation actually
2021-12-29 23:13:40 +0100 <EvanR> > foldl' (\x y -> 0) 0 [1..]
2021-12-29 23:13:46 +0100 <lambdabot> mueval-core: Time limit exceeded
2021-12-29 23:14:08 +0100 <InternetCitizen> > let k x y = 0 in foldr k 0 [1..]
2021-12-29 23:14:10 +0100 <lambdabot> 0
2021-12-29 23:14:21 +0100 <EvanR> "foldl loops through the list" theory explains why it doesn't work on infinite lists
2021-12-29 23:14:53 +0100 <InternetCitizen> > let k x y = 0 in foldr' k 0 [1..]
2021-12-29 23:15:02 +0100 <lambdabot> mueval.real: ExitFailure 1
2021-12-29 23:15:22 +0100 <EvanR> i'll let someone else explain that one xD
2021-12-29 23:15:55 +0100 <InternetCitizen> I expect foldr to reach in for the end of the list and find nothing
2021-12-29 23:16:06 +0100 <InternetCitizen> s,foldr,foldr'
2021-12-29 23:16:27 +0100 <EvanR> at least understand foldr first, for real. Since it's way more important
2021-12-29 23:17:12 +0100 <geekosaur> foldr may never reach the end of the list
2021-12-29 23:18:00 +0100merijn(~merijn@83-160-49-249.ip.xs4all.nl)
2021-12-29 23:21:03 +0100 <InternetCitizen> > foldr (&&) True ([False] ++ repeat True)
2021-12-29 23:21:05 +0100 <lambdabot> False
2021-12-29 23:21:09 +0100 <InternetCitizen> like this?
2021-12-29 23:23:05 +0100 <EvanR> > False && (error "bomb")
2021-12-29 23:23:07 +0100 <lambdabot> False
2021-12-29 23:23:20 +0100 <EvanR> > False && (let x = x in x)
2021-12-29 23:23:21 +0100 <lambdabot> False
2021-12-29 23:23:52 +0100otherwise(~otherwise@c-73-221-44-172.hsd1.wa.comcast.net)
2021-12-29 23:24:19 +0100 <EvanR> that actually works in a lot of languages xD
2021-12-29 23:24:28 +0100 <EvanR> in haskell it's just lazy evaluation
2021-12-29 23:26:32 +0100ankhers(e99e97ef8e@2604:bf00:561:2000::2a2)
2021-12-29 23:27:43 +0100zincy(~zincy@2a00:23c8:970c:4801:c17f:9983:e5a5:ab71) (Remote host closed the connection)
2021-12-29 23:28:50 +0100alx741(~alx741@157.100.93.160)
2021-12-29 23:29:17 +0100FinnElija(~finn_elij@user/finn-elija/x-0085643) (Killed (NickServ (Forcing logout FinnElija -> finn_elija)))
2021-12-29 23:29:17 +0100finn_elija(~finn_elij@user/finn-elija/x-0085643)
2021-12-29 23:29:17 +0100finn_elijaFinnElija
2021-12-29 23:30:25 +0100shailangsa(~shailangs@host86-162-150-202.range86-162.btcentralplus.com)
2021-12-29 23:30:46 +0100 <dsal> It works in Haskell without having a special case in the language. :)
2021-12-29 23:30:56 +0100 <dsal> You can define your own booleans with your own `and` operator and do the same thing.
2021-12-29 23:31:03 +0100 <geekosaur> @src (&&)
2021-12-29 23:31:04 +0100 <lambdabot> True && x = x
2021-12-29 23:31:04 +0100 <lambdabot> False && _ = False
2021-12-29 23:35:55 +0100geekosaurwonders why the second case isn't _ && _ = False
2021-12-29 23:35:59 +0100deadmarshal(~deadmarsh@95.38.115.121)
2021-12-29 23:39:37 +0100 <monochrom> That's the religious war between two opposite interpretations of "future-proof".
2021-12-29 23:40:35 +0100deadmarshal(~deadmarsh@95.38.115.121) (Ping timeout: 252 seconds)
2021-12-29 23:40:35 +0100alx741(~alx741@157.100.93.160) (Read error: Connection reset by peer)
2021-12-29 23:41:35 +0100 <monochrom> Both camps begin with the premise "if, one day, we add one more constructor to Bool..." (OK Bool is a silly example but there are real examples.)
2021-12-29 23:41:51 +0100bitdex(~bitdex@gateway/tor-sasl/bitdex) (Ping timeout: 276 seconds)
2021-12-29 23:41:58 +0100mc47(~mc47@xmonad/TheMC47) (Remote host closed the connection)
2021-12-29 23:42:45 +0100 <monochrom> One camp concludes "the patterns list all known constructors, so that when I turn on -Wall -Werror, I now receive a full list of functions that have not handled the additional constructor".
2021-12-29 23:43:03 +0100lavaman(~lavaman@98.38.249.169)
2021-12-29 23:43:11 +0100 <geekosaur> ob FileNotFound
2021-12-29 23:43:50 +0100 <monochrom> The other camp concludes "there is always a wildcard pattern, so that there is always a fall-through case, the function is total forever and ever".
2021-12-29 23:45:22 +0100 <EvanR> putting False explicitly expresses the behavior of && as equational laws and doesn't rely on "case checking order"
2021-12-29 23:45:31 +0100 <EvanR> for what that's worth
2021-12-29 23:46:17 +0100zer0bitz(~zer0bitz@196.244.192.57) (Ping timeout: 250 seconds)
2021-12-29 23:47:17 +0100lavaman(~lavaman@98.38.249.169) (Ping timeout: 240 seconds)
2021-12-29 23:47:26 +0100takuan(~takuan@178-116-218-225.access.telenet.be) (Remote host closed the connection)
2021-12-29 23:51:57 +0100merijn(~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 240 seconds)
2021-12-29 23:52:02 +0100otherwise(~otherwise@c-73-221-44-172.hsd1.wa.comcast.net) (Remote host closed the connection)
2021-12-29 23:54:21 +0100gehmehgeh(~user@user/gehmehgeh) (Quit: Leaving)
2021-12-29 23:56:17 +0100xff0x(~xff0x@2001:1a81:5243:1200:68a2:b42f:5a9a:d157) (Ping timeout: 240 seconds)
2021-12-29 23:56:38 +0100tromp(~textual@dhcp-077-249-230-040.chello.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
2021-12-29 23:56:52 +0100alx741(~alx741@157.100.93.160)
2021-12-29 23:57:34 +0100xff0x(~xff0x@port-92-193-205-13.dynamic.as20676.net)