Home liberachat/#haskell: Logs Calendar

Logs on 2025-04-07 (liberachat/#haskell)

00:01:06 <EvanR> sometimes the lack of "apply f n number of times" function comes up, since it's missing from the standard library. So I came across this thing in a paper
00:01:11 <EvanR> :t let num 0 = \f -> \x -> x; num n = \f -> \x -> f (num (n - 1) f x) in num
00:01:11 <lambdabot> (Eq t1, Num t1) => t1 -> (t2 -> t2) -> t2 -> t2
00:01:40 <EvanR> which produces church numerals from a number
00:02:44 × jespada quits (~jespada@r179-25-210-114.dialup.adsl.anteldata.net.uy) (Ping timeout: 252 seconds)
00:03:31 <EvanR> that the type is that simple was apparently an achievement (at some point in history) because church's own type system rendered the numerals all in different bigger and bigger types
00:06:44 <EvanR> I'm not sure if using this thing literally for "apply f n number of times" in haskell would be smart or dumb
00:17:06 × Tuplanolla quits (~Tuplanoll@91-159-69-59.elisa-laajakaista.fi) (Quit: Leaving.)
00:17:50 <EvanR> > let num 0 = \f -> \x -> x; num n = \f -> \x -> f (num (n - 1) f x) in num 10.0 "" ("Ha"++)
00:17:51 <lambdabot> error:
00:17:51 <lambdabot> • Couldn't match expected type ‘([Char] -> [Char])
00:17:51 <lambdabot> -> [Char] -> [Char]’
00:18:17 <EvanR> > let num 0 = \f -> \x -> x; num n = \f -> \x -> f (num (n - 1) f x) in num 10.0 ("Ha"++) ""
00:18:19 <lambdabot> "HaHaHaHaHaHaHaHaHaHa"
00:18:48 <EvanR> that was lucky
00:19:20 <haskellbridge> <Bowuigi> Any way to call mkfifo without the FFI? Can't find it on hoogle
00:23:59 × acidjnk_new3 quits (~acidjnk@p200300d6e71c4f1484a8b96e5b185115.dip0.t-ipconnect.de) (Ping timeout: 252 seconds)
00:25:09 <haskellbridge> <Bowuigi> Found it, it's "createNamedPipe" on System.Posix.Files on the unix package
00:34:31 msa joins (msa@msa.planetofnix.com)
00:36:26 <monochrom> EvanR: Would you accept "num n f x = appEndo (stimesMonoid n (Endo f)) x" ?
00:39:51 dontdieych2 joins (~quassel@user/dontdieych2)
00:42:46 <monochrom> Oh! Now I see why they called it "num". What you said. :)
00:43:24 <monochrom> instance Num (Endo a) where bwhahahaha
00:43:54 <monochrom> Oooohhhh I can put that for a tutorial exercise!
00:53:30 × xff0x quits (~xff0x@2405:6580:b080:900:2d8c:c4f2:3458:8ce1) (Ping timeout: 246 seconds)
00:57:26 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 244 seconds)
01:01:09 × otto_s quits (~user@p5de2fb60.dip0.t-ipconnect.de) (Ping timeout: 248 seconds)
01:02:55 otto_s joins (~user@p5de2f09d.dip0.t-ipconnect.de)
01:04:09 <EvanR> yeah going through Endo is a bit verbose
01:05:26 × toby-bro quits (~toby-bro@user/toby-bro) (Ping timeout: 252 seconds)
01:08:23 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
01:12:46 × hgolden_ quits (~hgolden@2603:8000:9d00:3ed1:d319:57ed:d2cb:68a5) (Ping timeout: 272 seconds)
01:13:08 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 252 seconds)
01:24:10 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
01:32:56 × machinedgod quits (~machinedg@d108-173-18-100.abhsia.telus.net) (Ping timeout: 252 seconds)
01:39:38 xff0x joins (~xff0x@fsb6a9491c.tkyc517.ap.nuro.jp)
01:40:10 <EvanR> hindley 1969 contains two interpretations of applying types to combinators, the second of which "the alternative system" makes it easier to give a set theoretic interpretation to the combinators. Saying in the first system it's not so clear what the set theoretic meaning of applying K combinator to itself is
01:41:21 <EvanR> The Principal Type-Scheme of an Object in Combinatory Logic
01:42:24 × tremon quits (~tremon@83.80.159.219) (Quit: getting boxed in)
01:54:34 × dontdieych2 quits (~quassel@user/dontdieych2) (Ping timeout: 252 seconds)
02:05:09 × Square quits (~Square@user/square) (Ping timeout: 248 seconds)
02:09:08 dontdieych2 joins (~quassel@user/dontdieych2)
02:13:39 × igemnace quits (~igemnace@user/igemnace) (Quit: ZNC 1.9.0+deb2build3 - https://znc.in)
02:16:26 × dontdieych2 quits (~quassel@user/dontdieych2) (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.)
02:18:05 igemnace joins (~igemnace@user/igemnace)
02:18:38 <haskellbridge> <thirdofmay18081814goya> when people talk about phantom types, they're talking exactly about GADTs right?
02:19:34 <monochrom> Does "data Proxy a = Proxy" count as phantom type? Does it count as GADTs?
02:20:28 <Leary> monochrom: I think you want `Endo (Endo a)`, though that's still not polymorphic enough for some operations.
02:22:34 <haskellbridge> <dmjio> thirdofmay18081814goya: No
02:22:50 <monochrom> Oh!
02:24:08 <haskellbridge> <thirdofmay18081814goya> hm ok right ty all for comments, and strictly speaking, a type being a phantom type is not a type-theoretical property but an implementation detail of how syntax gets typechecked, right?
02:24:44 <haskellbridge> <thirdofmay18081814goya> or how a type gets inferred for a piece of syntax
02:26:37 <geekosaur> no. a phantom type is one that doesn't occur in the value
02:26:47 <geekosaur> it only affects typing
02:27:52 <geekosaur> so in `data Maybe a = Nothing | Just a`, `a` is phantom in `Nothing`
02:28:15 <haskellbridge> <thirdofmay18081814goya> ok I see that makes sense, ty!
02:31:09 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 252 seconds)
02:37:20 hgolden joins (~hgolden@2603:8000:9d00:3ed1:d5a9:8f67:3cb9:6399)
02:42:03 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
02:46:19 peterbecich joins (~Thunderbi@syn-047-229-123-186.res.spectrum.com)
02:46:54 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 246 seconds)
02:57:42 × peterbecich quits (~Thunderbi@syn-047-229-123-186.res.spectrum.com) (Quit: peterbecich)
02:58:05 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
03:10:04 × emmanuelux quits (~emmanuelu@user/emmanuelux) (Quit: au revoir)
03:12:24 × amadaluzia_ quits (~amadaluzi@user/amadaluzia) (Ping timeout: 252 seconds)
03:43:16 michalz joins (~michalz@185.246.207.222)
03:46:58 × dutchie quits (~dutchie@user/dutchie) (Remote host closed the connection)
03:48:02 dutchie joins (~dutchie@user/dutchie)
04:05:41 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 248 seconds)
04:11:50 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
04:14:55 peterbecich joins (~Thunderbi@syn-047-229-123-186.res.spectrum.com)
04:17:32 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 268 seconds)
04:27:46 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
04:32:42 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 252 seconds)
04:42:03 × peterbecich quits (~Thunderbi@syn-047-229-123-186.res.spectrum.com) (Ping timeout: 246 seconds)
04:43:32 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
04:43:41 <Axman6> thirdofmay18081814goya: newtype Tagged t a = Tagged a -- t is a phantom type, there are no values of type t in a value of type Tagged t a, but the types Tagged Bool Int and Tagged String Int are different (so you couldn't use Eq to check if the a values were the same, for example).
04:44:37 <Axman6> they allow you to add some extra type information for the compiler to check for you but it won't exist at runtime.
04:45:33 × j1n37- quits (~j1n37@user/j1n37) (Ping timeout: 265 seconds)
04:48:57 j1n37 joins (~j1n37@user/j1n37)
04:50:27 × adamCS quits (~adamCS@pool-100-33-104-162.nycmny.fios.verizon.net) (Ping timeout: 244 seconds)
04:50:31 Guest2 joins (~Guest2@2406:b400:b4:1391:acdf:3bba:fba7:e00a)
04:50:53 adamCS joins (~adamCS@pool-100-33-104-162.nycmny.fios.verizon.net)
04:57:06 × Guest2 quits (~Guest2@2406:b400:b4:1391:acdf:3bba:fba7:e00a) (Quit: Client closed)
05:10:24 machinedgod joins (~machinedg@d108-173-18-100.abhsia.telus.net)
05:12:04 tabaqui joins (~tabaqui@167.71.80.236)
05:30:23 × m5zs7k quits (aquares@web10.mydevil.net) (Ping timeout: 245 seconds)
05:35:04 m5zs7k joins (aquares@web10.mydevil.net)
05:43:49 × jmcantrell quits (~weechat@user/jmcantrell) (Quit: WeeChat 4.6.0)
05:43:49 jmcantrell_ is now known as jmcantrell
05:47:39 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 260 seconds)
05:53:28 aljazmc joins (~aljazmc@user/aljazmc)
05:59:59 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
06:01:05 Guest2 joins (~Guest2@49.204.7.12)
06:01:51 × Guest2 quits (~Guest2@49.204.7.12) (Client Quit)
06:06:55 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 244 seconds)
06:07:16 × inca quits (~inca@pool-96-255-212-224.washdc.fios.verizon.net) (Ping timeout: 272 seconds)
06:09:59 sord937 joins (~sord937@gateway/tor-sasl/sord937)
06:18:03 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
06:19:27 inca joins (~inca@pool-96-255-212-224.washdc.fios.verizon.net)
06:30:48 × inca quits (~inca@pool-96-255-212-224.washdc.fios.verizon.net) (Ping timeout: 245 seconds)
06:32:38 × Sgeo quits (~Sgeo@user/sgeo) (Read error: Connection reset by peer)
06:33:36 inca joins (~inca@pool-96-255-212-224.washdc.fios.verizon.net)
06:40:12 × inca quits (~inca@pool-96-255-212-224.washdc.fios.verizon.net) (Ping timeout: 272 seconds)
06:46:13 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 248 seconds)
06:49:47 × ft quits (~ft@p508db463.dip0.t-ipconnect.de) (Quit: leaving)
06:57:10 |cos| parts (~libera@loza.netizen.se) (WeeChat 4.4.2)
06:58:16 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
07:00:01 × caconym quits (~caconym@user/caconym) (Quit: bye)
07:00:46 acidjnk_new3 joins (~acidjnk@p200300d6e71c4f1484a8b96e5b185115.dip0.t-ipconnect.de)
07:01:29 caconym joins (~caconym@user/caconym)
07:05:35 tromp joins (~textual@2001:1c00:3487:1b00:1419:ab0:498a:2d0c)
07:06:32 inca joins (~inca@pool-96-255-212-224.washdc.fios.verizon.net)
07:07:48 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 252 seconds)
07:11:03 vidisha joins (~vidisha@117.222.95.178)
07:13:18 × inca quits (~inca@pool-96-255-212-224.washdc.fios.verizon.net) (Ping timeout: 252 seconds)
07:13:32 lortabac joins (~lortabac@2a01:e0a:541:b8f0:55ab:e185:7f81:54a4)
07:17:19 Lord_of_Life_ joins (~Lord@user/lord-of-life/x-2819915)
07:17:53 × Lord_of_Life quits (~Lord@user/lord-of-life/x-2819915) (Ping timeout: 245 seconds)
07:18:40 Lord_of_Life_ is now known as Lord_of_Life
07:21:18 × adamCS quits (~adamCS@pool-100-33-104-162.nycmny.fios.verizon.net) (Ping timeout: 268 seconds)
07:22:47 × sord937 quits (~sord937@gateway/tor-sasl/sord937) (Remote host closed the connection)
07:23:07 sord937 joins (~sord937@gateway/tor-sasl/sord937)
07:25:11 inca joins (~inca@pool-96-255-212-224.washdc.fios.verizon.net)
07:25:59 × vidisha quits (~vidisha@117.222.95.178) (Quit: Client closed)
07:27:30 × rawles quits (~rawles@user/rawles) (Quit: -)
07:29:42 × inca quits (~inca@pool-96-255-212-224.washdc.fios.verizon.net) (Ping timeout: 246 seconds)
07:30:37 × tzh quits (~tzh@c-76-115-131-146.hsd1.or.comcast.net) (Quit: zzz)
07:37:04 fp joins (~Thunderbi@2001:708:20:1406::1370)
07:38:34 tavare joins (~tavare@user/tavare)
07:42:56 lxsameer joins (~lxsameer@Serene/lxsameer)
07:47:59 inca joins (~inca@pool-96-255-212-224.washdc.fios.verizon.net)
07:54:19 merijn joins (~merijn@77.242.116.146)
07:58:50 × XZDX quits (~xzdx@user/XZDX) (Remote host closed the connection)
07:59:07 <haskellbridge> <thirdofmay18081814goya> ah helpful example, ty!
08:20:13 XZDX joins (~xzdx@2601:404:ce00:4e51:214:51ff:fe2b:e82e)
08:20:18 × werneta quits (~werneta@syn-071-083-160-242.res.spectrum.com) (Ping timeout: 252 seconds)
08:20:35 chele joins (~chele@user/chele)
08:21:12 comerijn joins (~merijn@77.242.116.146)
08:21:57 × XZDX quits (~xzdx@2601:404:ce00:4e51:214:51ff:fe2b:e82e) (Changing host)
08:21:57 XZDX joins (~xzdx@user/XZDX)
08:23:36 × merijn quits (~merijn@77.242.116.146) (Ping timeout: 252 seconds)
08:27:17 × fp quits (~Thunderbi@2001:708:20:1406::1370) (Ping timeout: 268 seconds)
08:32:16 AlexNoo_ joins (~AlexNoo@178.34.162.245)
08:32:16 × AlexNoo quits (~AlexNoo@178.34.162.245) (Read error: Connection reset by peer)
08:35:15 × mceresa quits (~mceresa@user/mceresa) (Ping timeout: 252 seconds)
08:46:50 polyphem joins (~rod@pd9fbf91a.dip0.t-ipconnect.de)
08:49:32 mceresa joins (~mceresa@user/mceresa)
08:51:16 <kqr> I have a Conduit stream that yields one line of ByteString at a time. I want to write a step that consumes these lines and produces a derived value every few lines. What would be the best way to do this? I have currently written one to be tail recursive, and it works, but I suspect it leads to a space leak due to introducing a new thunk for every recursive call, which is every line emitted by the
08:51:18 <kqr> stream.
08:51:27 <kqr> By tail recursive, I mean that it gradually populates a sequence of Maybe arguments, and once all are filled, it yields the derived object and calls itself with all Nothing arguments again. Every time it encounters a line that contains a value that should go in the derived object, it calls itself with that argument filled with a Just value.
08:57:25 × lortabac quits (~lortabac@2a01:e0a:541:b8f0:55ab:e185:7f81:54a4) (Ping timeout: 248 seconds)
09:00:18 × econo_ quits (uid147250@id-147250.tinside.irccloud.com) (Quit: Connection closed for inactivity)
09:01:39 __monty__ joins (~toonn@user/toonn)
09:04:29 forell joins (~forell@user/forell)
09:04:55 lortabac joins (~lortabac@2a01:e0a:541:b8f0:55ab:e185:7f81:54a4)
09:18:54 rit joins (~rit@2409:40e0:a:1a99:c94b:aeae:2b1a:e2c4)
09:19:11 fp joins (~Thunderbi@2001:708:20:1406::1370)
09:30:15 <kqr> Maybe something like concatMapAccumC would do the trick...
09:30:57 <kqr> Except that is still expected to produce an output each iteration. Though I suppose that output could be Nothing which would then be catMaybe'd out of the stream
09:33:06 × XZDX quits (~xzdx@user/XZDX) (Read error: Connection reset by peer)
09:33:29 XZDX joins (~xzdx@2601:404:ce00:4e51:214:51ff:fe2b:e82e)
09:35:32 <kqr> (or I suppose the more plain mapAccum in this case)
09:59:36 × weary-traveler quits (~user@user/user363627) (Remote host closed the connection)
10:09:27 × XZDX quits (~xzdx@2601:404:ce00:4e51:214:51ff:fe2b:e82e) (Remote host closed the connection)
10:11:23 <kqr> Maybe it's not a space leak after all. According to https://github.com/haskell-perf/dictionaries?tab=readme-ov-file#pure-maps-fromlist-space-use maybe I should not be surprised if the map consumes orders of magnitude more memory when created than when queried...
10:13:36 × xff0x quits (~xff0x@fsb6a9491c.tkyc517.ap.nuro.jp) (Ping timeout: 252 seconds)
10:14:51 <kqr> Although in my case it happens with a CuckooHashTable based implementation too. Strange.
10:15:12 × comerijn quits (~merijn@77.242.116.146) (Ping timeout: 268 seconds)
10:16:26 × rit quits (~rit@2409:40e0:a:1a99:c94b:aeae:2b1a:e2c4) (Remote host closed the connection)
10:16:56 merijn joins (~merijn@77.242.116.146)
10:19:58 × lortabac quits (~lortabac@2a01:e0a:541:b8f0:55ab:e185:7f81:54a4) (Ping timeout: 245 seconds)
10:20:38 rit joins (~rit@2409:40e0:a:1a99:c94b:aeae:2b1a:e2c4)
10:21:13 dhil joins (~dhil@2a0c:b381:52e:3600:7599:e3a2:8d31:477d)
10:21:33 × merijn quits (~merijn@77.242.116.146) (Ping timeout: 246 seconds)
10:32:42 merijn joins (~merijn@77.242.116.146)
10:33:03 × aljazmc quits (~aljazmc@user/aljazmc) (Quit: Leaving)
10:45:43 <Digit> smart people, help my brain stop exploding... i've just seen someone assert that 2 is the smallest prime number. not 1. how can 1 not be prime? divisable by itself, and 1, whole integer result... it's THE prime number, the primest prime number, right?
10:46:13 <__monty__> It only has one divisor, not exactly two.
10:46:15 XZDX joins (~xzdx@2601:404:ce00:4e51:214:51ff:fe2b:e82e)
10:51:01 <Digit> hrmm. i've been running on some crude incomplete definition of prime then. ... reading "integers greater than 1, with exactly 2 positive divisors: 1 and itself.", sounds contrived to me, so long thinking it was just " divisable by itself, and 1, whole integer result"... defining it specifically as "greater than 1", smells.
10:51:55 Digit carries on with life
10:53:48 <enikar> Digit: The problem with 1 is that it divides all the numbers, so including it in the prime numbers requires an exception to be made in the statement of theorems. So for simplicity's sake we've excluded 1 from the prime numbers.
10:57:05 <Digit> ah, that makes sense why, seeing it from that side.
10:58:04 <Digit> anyways, didnt mean to disrupt the chan with that silly aside. just enjoying notions around infinite lists (and wondering how applies in haskell), while watching https://www.youtube.com/watch?v=_cr46G2K5Fo
11:01:04 × ethantwardy quits (user@user/ethantwardy) (Quit: WeeChat 4.4.2)
11:02:05 jespada joins (~jespada@r179-25-210-114.dialup.adsl.anteldata.net.uy)
11:02:46 ethantwardy joins (user@user/ethantwardy)
11:02:59 adamCS joins (~adamCS@98.113.183.73)
11:07:31 lortabac joins (~lortabac@2a01:e0a:541:b8f0:55ab:e185:7f81:54a4)
11:10:42 × hellwolf quits (~user@d446-ae4d-8e8d-4d2f-0f00-4d40-07d0-2001.sta.estpak.ee) (Ping timeout: 268 seconds)
11:13:13 hellwolf joins (~user@39b5-985a-dddf-4331-0f00-4d40-07d0-2001.sta.estpak.ee)
11:14:05 xff0x joins (~xff0x@ai066236.d.east.v6connect.net)
11:21:13 secular91 joins (~secular@155.93.244.228)
11:21:31 × tromp quits (~textual@2001:1c00:3487:1b00:1419:ab0:498a:2d0c) (Quit: My iMac has gone to sleep. ZZZzzz…)
11:27:27 × secular91 quits (~secular@155.93.244.228) (Quit: Client closed)
11:28:15 <__monty__> Digit: You don't need the "greater than 1" part of that definition though. The set containing 1 and 1 is of size 1, so 1 does *not* have *exactly two* divisors.
11:32:15 ubert joins (~Thunderbi@2a02:8109:ab8a:5a00:508f:565:5e73:917)
11:41:40 × Pozyomka quits (~pyon@user/pyon) (Quit: brb)
11:42:49 Pozyomka joins (~pyon@user/pyon)
11:51:36 <Digit> i think the wording's clearer with the greater than 1, as there's a hint of ambiguity as phrased there, not specifying they're distinct. at first glance, that's like, they two could be the same.
11:54:28 <__monty__> No, because then you only have one divisor. Or would you say all primes actually have infinite divisors? Themselves, and an infinite series of 1's.
12:02:32 tremon joins (~tremon@83.80.159.219)
12:09:28 <Digit> no.
12:10:34 toby-bro joins (~toby-bro@user/toby-bro)
12:14:24 × polyphem quits (~rod@pd9fbf91a.dip0.t-ipconnect.de) (Ping timeout: 260 seconds)
12:14:49 Square joins (~Square4@user/square)
12:40:06 × pointlessslippe1 quits (~pointless@62.106.85.17) (Ping timeout: 244 seconds)
12:50:49 pointlessslippe1 joins (~pointless@62.106.85.17)
13:06:50 tromp joins (~textual@2001:1c00:3487:1b00:1419:ab0:498a:2d0c)
13:16:01 <haskellbridge> <Liamzee> i should feel embarrassed
13:16:30 <haskellbridge> <Liamzee> i streamed an intro showing off gabriella gonzalez's simple twitter, but the code broke and i ended up demonstrating simple twitter that couldn't ttweet :(
13:24:48 × bitdex quits (~bitdex@gateway/tor-sasl/bitdex) (Quit: = "")
13:25:40 amadaluzia joins (~amadaluzi@2a00:23c7:ed8b:6701:fca7:4ddf:16d4:e0c7)
13:27:36 JuanDaugherty joins (~juan@user/JuanDaugherty)
13:31:38 weary-traveler joins (~user@user/user363627)
13:33:08 × tavare quits (~tavare@user/tavare) (Remote host closed the connection)
13:57:44 Unicorn_Princess joins (~Unicorn_P@user/Unicorn-Princess/x-3540542)
14:00:53 × pavonia quits (~user@user/siracusa) (Quit: Bye!)
14:04:36 × JuanDaugherty quits (~juan@user/JuanDaugherty) (Quit: praxis.meansofproduction.biz (juan@acm.org))
14:10:30 × lortabac quits (~lortabac@2a01:e0a:541:b8f0:55ab:e185:7f81:54a4) (Ping timeout: 272 seconds)
14:11:56 sabino joins (~sabino@user/sabino)
14:13:34 × remexre quits (~remexre@user/remexre) (Remote host closed the connection)
14:26:16 rekahsoft joins (~rekahsoft@bras-base-orllon1103w-grc-15-174-95-4-83.dsl.bell.ca)
14:30:54 × rit quits (~rit@2409:40e0:a:1a99:c94b:aeae:2b1a:e2c4) (Ping timeout: 240 seconds)
14:36:09 × acidjnk_new3 quits (~acidjnk@p200300d6e71c4f1484a8b96e5b185115.dip0.t-ipconnect.de) (Ping timeout: 260 seconds)
14:36:32 AlexNoo_ is now known as AlexNoo
14:40:35 × tromp quits (~textual@2001:1c00:3487:1b00:1419:ab0:498a:2d0c) (Quit: My iMac has gone to sleep. ZZZzzz…)
14:45:44 alx741 joins (~alx741@186.33.188.229)
14:47:01 × alx741 quits (~alx741@186.33.188.229) (Client Quit)
14:53:04 lortabac joins (~lortabac@2a01:e0a:541:b8f0:55ab:e185:7f81:54a4)
15:01:45 __jmcantrell__ joins (~weechat@user/jmcantrell)
15:02:04 tromp joins (~textual@2001:1c00:3487:1b00:1419:ab0:498a:2d0c)
15:02:20 <SrPx> hello, I think I'm reinventing the wheel here, so, let me ask to avoid that. suppose you have a tree of ints, defined as `data Tree = Node Tree Tree | Leaf Int`. let X be a source tree, and Y be a target tree, which is has the same node count and members as X (i.e., Y is a permutation of X)
15:03:09 × gorignak quits (~gorignak@user/gorignak) (Quit: quit)
15:03:20 × jmcantrell quits (644f1bed9a@user/jmcantrell) (Killed (zinc.libera.chat (Nickname regained by services)))
15:03:20 __jmcantrell__ is now known as jmcantrell
15:03:28 jmcantrell_ joins (644f1bed9a@user/jmcantrell)
15:04:28 <SrPx> our goal is to create a function `F : Tree → Tree` that transforms X into Y, except that a function is only allowed to 1. match and call an aux fn (as in: F (C a b) → (C (P a) (Q b)), 2. call a pre-determined combinator.
15:05:31 remexre joins (~remexre@user/remexre)
15:06:47 <SrPx> so, for example, `((1 2) (3 4))` could be transformed into `((4 3) (1 2))` by the following F:
15:06:58 <SrPx> F(xs) = map A B (swap xs) where A(xs) = swap xs ; B(xs) = xs
15:07:13 <SrPx> it would work as follows:
15:07:26 polyphem joins (~rod@pd9fbf91a.dip0.t-ipconnect.de)
15:07:51 <SrPx> F ((1,2),(3,4)) → (A(3,4),B(1,2)) → ((4,3),(1,2))
15:08:55 <SrPx> okay, that works. now, in this case, we used only one combinator: `swap`. my question is: what is the minimal set of combinators, that is expressive enough to perform any permutation, by constructing a suitable `F`?
15:09:29 <SrPx> obviously `swap` isn't enough, because we can't transform `((1,2),(3,4))` into `(1,(2,(3,4)))`. so we need more combinators, like comm-L, assoc-L...
15:10:36 <SrPx> I'm interested specifically in the minimal set of combinators. also remember that the "cursor" (i.e., the function we're calling) can only ever go down, so, just swap/comm/assoc isn't enough. counterexample: (((a b) c) d) → (c (b d))
15:10:50 <SrPx> and also, `((a b) (c d)) → ((a c) (b d))`
15:11:22 <SrPx> so is this an existing / known problem, and, if so, is there a minimal set of axioms / operations capable of expressing any permutation when composed?
15:15:14 acidjnk_new3 joins (~acidjnk@p200300d6e71c4f1839a5a90aae0b2850.dip0.t-ipconnect.de)
15:16:57 <SrPx> since this is a long question, I've also posted it on SE: https://cs.stackexchange.com/questions/171677/what-is-a-minimal-set-of-combinators-capable-of-performing-any-tree-permutation
15:17:58 × jespada quits (~jespada@r179-25-210-114.dialup.adsl.anteldata.net.uy) (Quit: My Mac has gone to sleep. ZZZzzz…)
15:19:23 fr33domlover joins (~fr33domlo@towards.vision)
15:20:34 jespada joins (~jespada@r179-25-210-114.dialup.adsl.anteldata.net.uy)
15:35:59 <EvanR> a foot note in the SICP section on logic programming points out a "flaw" in their query language, where repeated substitution sometimes gets the correct result and sometimes not
15:37:34 <EvanR> y = 1 - 2y has the solution 1/3, which is what you get after infinitely substituting the right side for y on the right side, if you add the infinite series normally
15:38:15 <EvanR> y = 1 + 2y has the solution -1, but if you tried substituting infinitely you'd get -1 = 1 + 2 + 4 + 8 + ... which it points out is wrong
15:38:26 <EvanR> another great idea goes out the window!
15:38:32 <EvanR> they discovered the negative unit type
15:44:30 <EvanR> data Y = Leaf | Branch Y Y
15:45:14 × lortabac quits (~lortabac@2a01:e0a:541:b8f0:55ab:e185:7f81:54a4) (Quit: WeeChat 4.5.2)
15:49:43 × jrm quits (~jrm@user/jrm) (Ping timeout: 244 seconds)
15:51:03 <haskellbridge> <Bowuigi> SrPx do these combinators have to specify exactly the permutations or can they be more powerful?
15:56:03 peterbecich joins (~Thunderbi@syn-047-229-123-186.res.spectrum.com)
16:10:00 × machinedgod quits (~machinedg@d108-173-18-100.abhsia.telus.net) (Ping timeout: 252 seconds)
16:14:33 × sabathan quits (~sabathan@amarseille-159-1-12-107.w86-203.abo.wanadoo.fr) (Quit: yolo)
16:17:12 × ubert quits (~Thunderbi@2a02:8109:ab8a:5a00:508f:565:5e73:917) (Remote host closed the connection)
16:17:22 j1n37- joins (~j1n37@user/j1n37)
16:17:39 × merijn quits (~merijn@77.242.116.146) (Ping timeout: 260 seconds)
16:18:26 × j1n37 quits (~j1n37@user/j1n37) (Ping timeout: 252 seconds)
16:19:36 sabathan2 joins (~sabathan@amarseille-159-1-12-107.w86-203.abo.wanadoo.fr)
16:22:24 <haskellbridge> <Bowuigi> Also can swapping "a" and "b" in a tree like "((((a ...) ...) ...) b)" be written without accumulating parameters?
16:23:27 × peterbecich quits (~Thunderbi@syn-047-229-123-186.res.spectrum.com) (Ping timeout: 246 seconds)
16:24:16 ft joins (~ft@p508db463.dip0.t-ipconnect.de)
16:25:33 tzh joins (~tzh@c-76-115-131-146.hsd1.or.comcast.net)
16:26:56 ph88 joins (~ph88@2a02:8109:9e26:c800:7176:23ec:c36b:f7da)
16:28:07 <haskellbridge> <Bowuigi> If you restrict everything to be used linearly, the number of nodes stays the same
16:30:35 <SrPx> Bowuigi: I've edited the SO question with an example. I think it will make it more clear
16:34:31 <haskellbridge> <Bowuigi> "(((i p) xs) ys) -> (xs (p ys))" is not a permutation tho, the "i" is removed
16:36:44 <haskellbridge> <Bowuigi> That's one less branch, not even the same number of constructors (4 leaves + 3 branches vs 3 leaves + 2 branches)
16:36:54 × acidjnk_new3 quits (~acidjnk@p200300d6e71c4f1839a5a90aae0b2850.dip0.t-ipconnect.de) (Ping timeout: 260 seconds)
16:40:02 <haskellbridge> <Bowuigi> If you want to consider deletions and duplications too, having "map" pass the two branches and using fst and snd should replace at least both drops, copying left, copying right and swap
16:40:36 × lxsameer quits (~lxsameer@Serene/lxsameer) (Ping timeout: 272 seconds)
16:40:42 <haskellbridge> <Bowuigi> Where copying left is "(a b) -> (a a)" and copying right is "(a b) -> (b b)"
16:43:06 guest4952 joins (~guest4952@94.7.208.44)
16:44:10 sprotte24 joins (~sprotte24@p200300d16f30f50054794865c50a74ee.dip0.t-ipconnect.de)
16:47:13 peterbecich joins (~Thunderbi@syn-047-229-123-186.res.spectrum.com)
16:51:42 × chele quits (~chele@user/chele) (Remote host closed the connection)
16:53:30 <ski> Digit : any natural number (non-negative / unsigned integer) can be written additively, as a sum of additive units (`1's), e.g. `3 = 1 + 1 + 1',`10 = 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1' (note that this also holds for `0', which is a sum of zero `1's)
16:56:10 <ski> Digit : otoh, `1' itself can not (talking only about natural numbers) be divided up further, any time we try, we get things like `1 = 0 + 0 + 1 + 0', where all but one term is `0', the neutral element of addition, which can always be added as another term to a sum, so we decide that this "doesn't count" (it's not interesting). so. regarding summing, `1' acts as an "atom", it's the smallest unit of addition,
16:56:16 <ski> which can't be further subdivided, apart from trivially (with the `0's), and every natural number is a sum of such units
16:57:34 <EvanR> 1 = -1 + 2
16:57:52 <ski> "talking only about natural numbers"
17:00:00 <ski> Digit : now, the question is what happens with multiplication (considering, say, positive integers, for the time being). well, we have things like `18 = 2 * 3 * 3', dividing up positive integers into prime numbers (and, again, `1' is the product of zero such primes, it is the "empty product"), but, just as we before could add any number of `0' terms to a sum, here we can add any number of `1' factors to a
17:00:06 <ski> product. `5 = 1 * 1 * 5 * 1' is not an interesting multiplicative decomposition of the prime `5', so "doesn't count". (this is, again, because `1' is the multiplicative neutral element, multiplying with it doesn't change the result, just as adding a `0' doesn't change the result of a sum, which is why `0' didn't "count" above)
17:00:27 <EvanR> oh, Digit is a user you're responding to
17:00:33 <ski> yes
17:00:58 × guest4952 quits (~guest4952@94.7.208.44) (Remote host closed the connection)
17:01:30 Square2 joins (~Square@user/square)
17:01:40 <ski> btw, it so happens that there's only way to additively decompose a natural number into `1's, you always get the same number of `1'. similarly, there's only one way to multiplicatively decompose a positive integer into prime numbers, if we disregard the ordering, we always get the same number of each constituent prime
17:04:58 × Square quits (~Square4@user/square) (Ping timeout: 245 seconds)
17:05:06 <ski> Digit : here's another way to think of it, related to divisibility (a number is a divisor of another number, if and only if the second number is a multiple of the first, is some integer times the first one). note that `5' divides `60 = 6 * 10', but `5' already divides one of the factors here (namely `10'). this is because `5' is "indivisible", we can't have one factor of `5' dividing `6' and the remaining
17:05:12 <ski> factor dividing `10' (apart from the trivial way `5 = 1 * 5', where `1' divides `6' and `5' divides `10' in `60 = 6 * 10', which "doesn't count", because this always holds)
17:07:59 <ski> Digit : otoh, `15' divides `60 = 6 * 10', but `15' doesn't divide either of `6' and `10', because `15 = 3 * 5', andd we have the first factor part, `3', dividing `6', and the second, `5', dividing `10'. because `6' is not a prime, if it divides a product, one factor part of it could divide one factor in the overall product, while another factor part of the non-prime could divide another factor of the overall
17:08:05 <ski> product
17:09:49 <ski> Digit : but this doesn't happen with primes. if `p' is a prime number, and it divides a product `a * b', then `p' has got to divide either `a', or `b'. you can easily see that this generalizes to a prime `p' dividing a product with any number of factors, `a * b * c * d' say, `p' must divide one of `a',`b',`c',`d'
17:11:42 <ski> Digit : now, the question is what happens for "degenerate products". what if we have a "product" of just one factor, so just `a'. if `p' divides this product, then it divides the (only) factor `a', so this works out fine. then, the "empty product", the product of a collection of zero factors, which is `1'. if `p' divides `1', then, if this above rule is to hold in this case, `p' has got to divide one of the
17:11:48 <ski> factors in this empty collection of factors .. which is impossible, it is empty !
17:12:28 × peterbecich quits (~Thunderbi@syn-047-229-123-186.res.spectrum.com) (Ping timeout: 245 seconds)
17:12:48 <ski> Digit : so .. if this rule "if a prime divides a product of factors, then it must divide one of the factors" is to hold in this "empty" product case, it must be that no prime `p' can divide the empty product, `1'. and because `1' divides itself, `1' can then not be a prime number
17:14:44 <ski> in the additive case, `5' can be further subdivided, as in e.g. `5 = 2 + 3'. and then `2 = 1 + 1' and `3 = 1 + 1 + 1', giving `5 = (1 + 1) + (1 + 1 + 1) = 1 + 1 + 1 + 1 + 1', going down to the "minimal units", the `1's. but `0' here is "nothing", it's the "empty sum", it's too small to be a unit to additively built numbers out of
17:15:40 <ski> similarly, in the multiplicative case, the prime numbers are the "units" which we can build up positive integers from, and `1' is "too small", is "nothing", is the "empty product", so it doesn't count
17:15:46 <ski> Digit : does this help ?
17:16:54 acidjnk_new3 joins (~acidjnk@p200300d6e71c4f1839a5a90aae0b2850.dip0.t-ipconnect.de)
17:17:57 ski idly ponders a formulation of group set theory, where `{1} = {}', `1' being the neutral element of the group in question
17:21:10 <EvanR> "group set theory"
17:21:34 × tromp quits (~textual@2001:1c00:3487:1b00:1419:ab0:498a:2d0c) (Quit: My iMac has gone to sleep. ZZZzzz…)
17:21:55 <EvanR> where sets are groups or groups are sets or
17:23:16 <EvanR> also good job proving that 1 is not prime via pure logic
17:23:27 × toby-bro quits (~toby-bro@user/toby-bro) (Quit: WeeChat 3.8)
17:30:08 wootehfoot joins (~wootehfoo@user/wootehfoot)
17:36:18 <ski> no, a kind of set theory specialized to talk about subgroups of groups. where union of two subgroups is automatically the closure of the union of their respective underlying subsets
17:36:44 <ski> well, it was more like motivation, than proof ..
17:38:14 × fp quits (~Thunderbi@2001:708:20:1406::1370) (Ping timeout: 272 seconds)
17:40:41 tromp joins (~textual@2001:1c00:3487:1b00:1419:ab0:498a:2d0c)
17:40:47 peterbecich joins (~Thunderbi@syn-047-229-123-186.res.spectrum.com)
17:42:02 <EvanR> cool
17:46:03 <kqr> I have a pet project where I
17:46:08 <kqr> Oops, pressed return too soon.
17:49:41 <kqr> I have a pet project where I'm trying to make a term–document index in Haskell. I.e. I'm building a map/dictionary from tokens to indices. I'm testing this out on a 250 MB subset of the real data, and the map needs a resident 1.5 GB while it's being built. I've spent a lot of time trying to optimise this but now I'm running out of ideas. Is this 6× overhead within the range of reasonable
17:49:43 <kqr> overhead I should expect?
17:50:08 lxsameer joins (~lxsameer@Serene/lxsameer)
17:52:22 <geekosaur> depends. iif you're using `String` then quite possibly yes. with `Text` you also need to use some care to avoid duplicating the entire input, I think (see https://downloads.haskell.org/ghc/latest/docs/libraries/text-2.1.2-84f9/Data-Text.html#v:copy)
17:53:20 <geekosaur> mm, no, that wouldn't cause extra copies of the backing `Text`, but it would keep the entire input alive unnecessarily
17:55:00 × tromp quits (~textual@2001:1c00:3487:1b00:1419:ab0:498a:2d0c) (Quit: My iMac has gone to sleep. ZZZzzz…)
17:55:33 × peterbecich quits (~Thunderbi@syn-047-229-123-186.res.spectrum.com) (Ping timeout: 248 seconds)
17:57:12 <kqr> I'm reading ByteStrings into (Document Int Text Text Text) values with Conduit. I /think/ that process is fairly efficient and constant in memory.
17:57:14 tromp joins (~textual@2001:1c00:3487:1b00:1419:ab0:498a:2d0c)
18:10:24 jrm joins (~jrm@user/jrm)
18:11:39 × shane quits (~shane@ana.rch.ist) (Ping timeout: 252 seconds)
18:13:07 × lxsameer quits (~lxsameer@Serene/lxsameer) (Ping timeout: 268 seconds)
18:17:12 × acidjnk_new3 quits (~acidjnk@p200300d6e71c4f1839a5a90aae0b2850.dip0.t-ipconnect.de) (Ping timeout: 246 seconds)
18:18:52 <EvanR> how many token keys do you end up with out of 250 MB
18:19:20 <EvanR> if it's order of 250 million, I say you got out luck with only 1.5 G
18:19:25 <EvanR> lucky
18:32:44 × amadaluzia quits (~amadaluzi@2a00:23c7:ed8b:6701:fca7:4ddf:16d4:e0c7) (Quit: Hi, this is Paul Allen. I'm being called away to London for a few days. Meredith, I'll call you when I get back. Hasta la vista, baby.)
18:33:44 amadaluzia joins (~amadaluzi@2a00:23c7:ed8b:6701:3858:3fc1:f625:edbc)
18:34:25 acidjnk_new3 joins (~acidjnk@p200300d6e71c4f1839a5a90aae0b2850.dip0.t-ipconnect.de)
18:35:25 Tuplanolla joins (~Tuplanoll@91-159-69-59.elisa-laajakaista.fi)
18:35:57 <kqr> EvanR, I don't know exactly, but I
18:36:01 <kqr> again!
18:36:13 × amadaluzia quits (~amadaluzi@2a00:23c7:ed8b:6701:3858:3fc1:f625:edbc) (Client Quit)
18:36:19 <kqr> EvanR, I don't know exactly, but I'm fairly certain it's less than 2.5 million
18:36:31 <EvanR> well if you print out the count in the end
18:36:33 <EvanR> you would know
18:37:08 <EvanR> a Map with 2 million keys would have a known lowerbound on memory
18:37:10 amadaluzia joins (~amadaluzi@host81-159-254-182.range81-159.btcentralplus.com)
18:37:16 <EvanR> 2 million times the heap size of a key
18:37:27 <EvanR> which will be several words
18:39:15 <kqr> Constructing the map from those 250 MB takes well over 30 minutes! So I'd rather not do that. But from a smaller subset (1/100th of that) I get 25 thousand, and a medium subset (1/10th) I get 95 thousand. so somewhere in the area of 1–2 million seems reasonable for the 250 MB
18:39:58 <EvanR> 30 minutes sounds like a bug
18:40:18 <EvanR> are you using strict Map
18:40:41 <EvanR> and forcing the evaluation of the latest Map at each step
18:41:42 <kqr> Strict map, yes. Forcing the evaluation, I think so.
18:42:08 × amadaluzia quits (~amadaluzi@host81-159-254-182.range81-159.btcentralplus.com) (Quit: Hi, this is Paul Allen. I'm being called away to London for a few days. Meredith, I'll call you when I get back. Hasta la vista, baby.)
18:42:55 <EvanR> there's probably ways to optimize your thing, but I don't want to suggest any until the base performance from doing it "the dumbest possible way" is under control
18:43:04 <EvanR> otherwise you're optimizing the wrong thing
18:43:37 amadaluzia joins (~amadaluzi@2a00:23c7:ed8b:6701:a768:391e:7525:9f74)
18:44:47 <kqr> https://entropicthoughts.com/pastes/Index-3fa9c2.hs.html
18:45:08 <kqr> That's the dumest possible implementation of the index that I've come up with.
18:45:33 pavonia joins (~user@user/siracusa)
18:46:07 <kqr> So it's converting each document to its own index and then foldMaps together them into one index, mainly resting on the monoid instances of Map, IntMap, and IntSet.
18:46:14 <kqr> The data types are strict, the maps are strict, and the folds are strict.
18:49:31 <EvanR> I see addTerm is inserting 1 term
18:49:55 <EvanR> but are you iterating the <> operation between Indexes anywhere
18:50:31 <kqr> I'm not sure I understand the question.
18:50:53 <EvanR> are you using the <> operation anywhere at all
18:51:38 <EvanR> ok
18:51:44 <EvanR> foldlC (<>) mempty
18:52:15 <kqr> Yes, which is supposed to be a strict fold. And then later on I'm looking up terms in the termdoc map, and getting the corresponding document indices back
18:52:33 <EvanR> so you're relying on the union of all these maps being efficient enough to glom on millions of entries
18:52:45 <EvanR> instead of iterating the insertion of 1 at a time
18:53:26 <EvanR> in the case of list, [x] ++ biglist would be ok, while biglist ++ [x] would be bad
18:53:47 <EvanR> union of Maps and IntSets ...
18:54:35 <EvanR> looks like the listed cost is also asymmetric there
18:54:43 <EvanR> so you'd at least want to make sure you're doing them in the right order
18:55:24 <EvanR> oh, no in this case it's symmetric
18:55:40 <kqr> Yeah, it's the min of two numbers, where they are swapped depending on size
18:55:51 <EvanR> but inserting 1 at a time rather than unioning a singleton is probably a better idea
18:56:05 <kqr> I have tried that, but it didn't change anything about space or time characteristics
18:56:25 <EvanR> well
18:57:05 <EvanR> did you profile to see where the time is being spent
18:57:12 <EvanR> is it the index itself, or the analysis or
19:00:01 × caconym quits (~caconym@user/caconym) (Quit: bye)
19:00:43 caconym joins (~caconym@user/caconym)
19:00:50 <kqr> I have tried, but I'm having trouble interpreting the profiling data. I'll generate a fresh profile and see if I can get something out of it with fresh eyes.
19:04:46 <kqr> The cost centre <> on lines 21–22 in Index.hs (this is the TermDoc monoid implementation) costs 22 % of the time. Analysis 20 %. Those are the two major costs. (Then comes single-digit percents for UTF coding, un-gzipping the source data, etc. But that happens before index building)
19:07:25 <kqr> Though some of the latest changes I've made seem like they've made a difference. I could now build an index for the 250 MB of data in just two minutes. This is such a large difference that I'm half-expecting I've done something wrong at this point.
19:07:57 JuanDaugherty joins (~juan@user/JuanDaugherty)
19:08:49 <kqr> This is done with a resident set of 1.4 GB, which is certainly acceptable. I'm going to be brave and just try running it on the full 1.5 GB of data.
19:17:21 × m5zs7k quits (aquares@web10.mydevil.net) (Ping timeout: 252 seconds)
19:20:47 m5zs7k joins (aquares@web10.mydevil.net)
19:24:21 <EvanR> dumb idea, do the indexing in stages by reading in 1.5 gigs, writing out a file of intermediate data, taking very little working memory to do so, repeat next stage, etc until you can read in the index itself
19:27:05 <EvanR> the less live memory the faster the ghc program runs
19:36:48 target_i joins (~target_i@user/target-i/x-6023099)
19:38:57 machinedgod joins (~machinedg@d108-173-18-100.abhsia.telus.net)
19:39:14 × m5zs7k quits (aquares@web10.mydevil.net) (Ping timeout: 265 seconds)
19:42:02 × wootehfoot quits (~wootehfoo@user/wootehfoot) (Read error: Connection reset by peer)
19:42:16 m5zs7k joins (aquares@web10.mydevil.net)
19:45:07 ljdarj1 joins (~Thunderbi@user/ljdarj)
19:47:04 rvalue- joins (~rvalue@user/rvalue)
19:47:23 × ljdarj quits (~Thunderbi@user/ljdarj) (Ping timeout: 244 seconds)
19:47:23 ljdarj1 is now known as ljdarj
19:47:33 × rvalue quits (~rvalue@user/rvalue) (Ping timeout: 248 seconds)
19:48:04 <[exa]> kqr: what's the type of the Map exactly? It really sounds a lot like a data retrieval approach could work, so that you'd have mergeable index segments like Lucene does. That doesn't cost any internal memory at all and gets stupidly fast.
19:50:09 <[exa]> kqr: btw check what happens if you compile with `-O2 -fspecialise-aggressively -fexpose-all-unfoldings`, it might be the case that the polymorphism is hurting your performance there.
19:50:27 <[exa]> (in my case this made like 20x speed difference)
19:53:35 <[exa]> (nvm, /me found the type of the Map
19:53:37 <[exa]> )
19:53:57 rvalue- is now known as rvalue
20:03:37 Square joins (~Square4@user/square)
20:06:36 × Square2 quits (~Square@user/square) (Ping timeout: 252 seconds)
20:07:58 × sabino quits (~sabino@user/sabino) (Quit: Lambda _ -> x)
20:19:59 × michalz quits (~michalz@185.246.207.222) (Remote host closed the connection)
20:20:23 × tabaqui quits (~tabaqui@167.71.80.236) (Ping timeout: 245 seconds)
20:28:06 × JuanDaugherty quits (~juan@user/JuanDaugherty) (Quit: praxis.meansofproduction.biz (juan@acm.org))
20:29:50 × sord937 quits (~sord937@gateway/tor-sasl/sord937) (Quit: sord937)
20:31:53 × Unicorn_Princess quits (~Unicorn_P@user/Unicorn-Princess/x-3540542) (Remote host closed the connection)
20:49:12 <chiselfuse> is `-5` a literal?
20:49:49 <EvanR> if you enable NegativeLiterals extension
20:50:12 <EvanR> otherwise it's negate 5
20:52:51 <haskellbridge> <ozkutuk> though if you consider enabling it, LexicalNegation is more generally applicable compared to NegativeLiterals if you are on GHC >9
20:57:51 × dhil quits (~dhil@2a0c:b381:52e:3600:7599:e3a2:8d31:477d) (Ping timeout: 246 seconds)
20:59:57 <EvanR> > 1 -5
20:59:58 <lambdabot> -4
21:00:01 <EvanR> I lied
21:03:33 × target_i quits (~target_i@user/target-i/x-6023099) (Quit: leaving)
21:13:36 hiredman joins (~hiredman@frontier1.downey.family)
21:15:12 <chiselfuse> So it's by default a unary function? if so then how can i check it's type? i tried `:t (-)` but it shows me the type of the binary function
21:17:22 <chiselfuse> does this mean that i can have two `foo`s? one defined as a binary function and another defined as a unary function. with the right one used depending on context?
21:17:34 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
21:17:44 <chiselfuse> so like i `x = foo 5` would use the unary definition and `foo 3 5` would use the binary one?
21:18:16 <chiselfuse> hmm wait. `foo 5` should be partial application
21:21:25 amadaluzia_ joins (~amadaluzi@2a00:23c7:ed8b:6701:e287:4eed:50df:f686)
21:21:25 × amadaluzia quits (~amadaluzi@2a00:23c7:ed8b:6701:a768:391e:7525:9f74) (Ping timeout: 248 seconds)
21:22:04 <geekosaur> unary minus is a parser hack
21:22:13 gorignak joins (~gorignak@user/gorignak)
21:22:21 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 246 seconds)
21:33:21 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
21:33:49 peterbecich joins (~Thunderbi@syn-047-229-123-186.res.spectrum.com)
21:37:01 <EvanR> chiselfuse, we don't have binary functions
21:38:54 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 272 seconds)
21:39:53 <chiselfuse> oh yea it's all lambdas i forgot
21:43:24 <EvanR> > 5-----5
21:43:26 <lambdabot> 5
21:44:33 <mauke> is that a comment?
21:44:38 <yin> yes
21:44:45 <EvanR> lol
21:48:18 × peterbecich quits (~Thunderbi@syn-047-229-123-186.res.spectrum.com) (Ping timeout: 245 seconds)
21:49:08 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
21:49:47 <yin> chiselfuse: there's Prelude.subtract if you want to disambiguate
21:49:52 <yin> :t subtract
21:49:53 <lambdabot> Num a => a -> a -> a
21:50:03 <EvanR> @src subtract
21:50:03 <lambdabot> subtract x y = y - x
21:50:31 <haskellbridge> <Profpatsch> Haskal amirite
21:50:55 <int-e> > (-1+) 4
21:50:56 <lambdabot> 3
21:51:24 <EvanR> wot
21:51:47 <yin> int-e: damn this reminds me of lisp
21:51:55 <geekosaur> heh
21:51:58 <haskellbridge> <Profpatsch> ((-1)+)
21:52:03 <haskellbridge> <Profpatsch> operator sections
21:52:21 <haskellbridge> <Profpatsch> at least not Scala postfix operators
21:52:40 <chiselfuse> yin: so by default (no extensions etc) `-` means either `negate` or `subtract` depending on context?
21:52:56 <chiselfuse> i guess i can do :t negate then
21:53:25 <int-e> the best part about this is that hugs and ghc disagree on which one of (-1+) or (+ -1) is valid.
21:54:30 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 268 seconds)
21:54:44 <chiselfuse> what is (-1+)? is it `+` partially applied on `-1`?
21:55:35 <geekosaur> yes
21:57:35 <EvanR> > 5 - -5
21:57:36 <lambdabot> error:
21:57:36 <lambdabot> Precedence parsing error
21:57:36 <lambdabot> cannot mix ‘-’ [infixl 6] and prefix `-' [infixl 6] in the same infi...
21:57:52 <EvanR> chiselfuse, if it means anything
21:58:00 tuxillo joins (~Thunderbi@131.pool85-57-245.dynamic.orange.es)
21:58:04 <tuxillo> hiyo
21:58:38 <tuxillo> in DragonFly BSD we have a program that reports this? https://termbin.com/ybc7
21:58:48 <tuxillo> how do I debug if it's a ghc problem in this platform?
22:00:48 <mauke> https://gitlab.haskell.org/ghc/ghc/-/issues/21132 ?
22:01:16 <tuxillo> it's x86_64 but let me see if it could be related
22:01:55 <mauke> I mean, it is talking about a 2Gb barrier
22:02:03 <int-e> EvanR: ah hugs disagrees on that one too and allows -1 - -1 (evaluates to 0)
22:02:21 <EvanR> you got hugs
22:02:22 <EvanR> damn
22:02:39 <int-e> it turns out debian still has it
22:02:53 <int-e> I did not have it installed before this discussion :)
22:03:39 <tuxillo> in that link it's talking about adjustorpool which I assume it is enabled for all x86_64 platforms?
22:04:56 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
22:07:29 × inca quits (~inca@pool-96-255-212-224.washdc.fios.verizon.net) (Ping timeout: 260 seconds)
22:07:43 rawles joins (~rawles@user/rawles)
22:09:59 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 244 seconds)
22:14:37 <int-e> EvanR: The Haskell 2010 report explicitly states that a + -b is illegal. In the Haskell 98 report you have to carefully track a grammar that's annotated with precedences to come to the same conclusion. The language about sections is the same; (-1+) is a valid left section because -1+x and (-1)+x parse to the same expression
22:14:45 Sgeo joins (~Sgeo@user/sgeo)
22:15:23 <tuxillo> i'm wondering if i should report this as a bug in haskell or not
22:15:26 <int-e> IOW, hugs got this wrong. But that behavior may predate the Haskell report language :)
22:20:27 <tuxillo> whut?
22:20:42 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
22:21:17 <int-e> tuxillo: that was a different discussion from your adjustor issue
22:21:27 <tuxillo> ah ok
22:22:30 <EvanR> if it's a bug in GHC there are more appropriate places to report it
22:23:25 <int-e> wait what "Could not open /proc/self/maps" is not the same issue as #21132
22:24:20 <int-e> though I guess that's only used for diagnostics?
22:24:21 <tuxillo> no, that's dfly specific and as far as I know it's just that it can't read proc maps which is unrelated to the error itself
22:24:32 <tuxillo> /proc/self/maps is a linux thing iirc
22:24:44 <tuxillo> 799282:4 0 simplex-chat 1744064469.180127 CALL mmap(0x40000000,0x1000,0x3<PROT_READ|PROT_WRITE>,0x1002<MAP_PRIVATE|MAP_ANON>,0xffffffff,0,0)
22:24:44 <tuxillo> 799282:4 0 simplex-chat 1744064469.180130 RET mmap 34440683520/0x804d32000
22:24:48 <int-e> oh
22:24:53 <tuxillo> i can see the mmap returning a valid address
22:25:47 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 244 seconds)
22:25:51 <tuxillo> but it's definitiely not below 2Gb
22:25:59 <int-e> yeah it's way too high for the purpose
22:27:06 inca joins (~inca@pool-96-255-212-224.washdc.fios.verizon.net)
22:29:56 <yin> chiselfuse: yes. it's a shame but that's the way it is. also, -- is a comment
22:31:27 <yin> i *think* LexicalNegation is standard with the latest language versions (?)
22:31:31 <yin> chiselfuse: https://ghc.gitlab.haskell.org/ghc/doc/users_guide/exts/lexical_negation.html
22:32:05 user363627 joins (~user@user/user363627)
22:35:00 <yin> nope, it seems like it's being discussed for GHC2024? i'm not sure, trying to find out these things is always a mess
22:35:20 emmanuelux joins (~emmanuelu@user/emmanuelux)
22:36:14 × weary-traveler quits (~user@user/user363627) (Ping timeout: 260 seconds)
22:36:30 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
22:36:33 <yin> is GHC2024 already defined but GHC2021 still the default?
22:36:39 <geekosaur> it didn't get into GHC2024, which was finalized with ghc 9.12.1
22:36:59 <geekosaur> and yes, GHC2021 is still the default if you use ghc directly
22:37:11 <geekosaur> note that cabal and I think stack still default to Haskell2010
22:37:12 <yin> ty
22:37:21 <yin> wait no way
22:39:08 rawles parts (~rawles@user/rawles) (WeeChat 3.8)
22:41:14 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 252 seconds)
22:42:04 × tromp quits (~textual@2001:1c00:3487:1b00:1419:ab0:498a:2d0c) (Quit: My iMac has gone to sleep. ZZZzzz…)
22:45:56 <yin> bah...
22:45:59 <yin> what a mess
22:46:12 <geekosaur> LexicalNegation didn't get in but PostfixOperators did? also, aren't we well past the deprecation point for StarIsType?
22:46:31 <yin> my thoughts exactly
22:46:37 <yin> i don't like GHC2024 at all
22:47:52 <yin> also what's with defaultSignatures?
22:47:57 × dibblego quits (~dibblego@haskell/developer/dibblego) (Read error: Connection reset by peer)
22:48:16 dibblego joins (~dibblego@116-255-1-119.ip4.superloop.au)
22:48:16 × dibblego quits (~dibblego@116-255-1-119.ip4.superloop.au) (Changing host)
22:48:16 dibblego joins (~dibblego@haskell/developer/dibblego)
22:49:08 × ph88 quits (~ph88@2a02:8109:9e26:c800:7176:23ec:c36b:f7da) (Remote host closed the connection)
22:49:08 × __monty__ quits (~toonn@user/toonn) (Quit: leaving)
22:52:17 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
22:59:04 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 244 seconds)
23:03:00 peterbecich joins (~Thunderbi@syn-047-229-123-186.res.spectrum.com)
23:06:51 × peterbecich quits (~Thunderbi@syn-047-229-123-186.res.spectrum.com) (Client Quit)
23:07:19 peterbecich joins (~Thunderbi@syn-047-229-123-186.res.spectrum.com)
23:10:20 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
23:15:20 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 252 seconds)
23:21:38 × jespada quits (~jespada@r179-25-210-114.dialup.adsl.anteldata.net.uy) (Ping timeout: 245 seconds)
23:25:16 jespada joins (~jespada@r190-133-49-11.dialup.adsl.anteldata.net.uy)
23:26:06 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
23:26:42 × polyphem quits (~rod@pd9fbf91a.dip0.t-ipconnect.de) (Ping timeout: 252 seconds)
23:28:44 szkl joins (uid110435@id-110435.uxbridge.irccloud.com)
23:30:48 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 245 seconds)
23:36:38 × peterbecich quits (~Thunderbi@syn-047-229-123-186.res.spectrum.com) (Ping timeout: 245 seconds)
23:41:54 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
23:43:28 × Tuplanolla quits (~Tuplanoll@91-159-69-59.elisa-laajakaista.fi) (Quit: Leaving.)
23:46:11 × sprotte24 quits (~sprotte24@p200300d16f30f50054794865c50a74ee.dip0.t-ipconnect.de) (Read error: Connection reset by peer)
23:46:29 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 248 seconds)
23:53:07 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
23:57:54 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 260 seconds)

All times are in UTC on 2025-04-07.