2023/12/03

2023-12-03 00:01:11 +0100arahael_(~arahael@1.145.97.209)
2023-12-03 00:07:01 +0100acidjnk(~acidjnk@p200300d6e72b9330e8b605edba9a1bca.dip0.t-ipconnect.de) (Ping timeout: 276 seconds)
2023-12-03 00:11:18 +0100eggplantade(~Eggplanta@2600:1700:38c5:d800:f878:9036:c8c3:a993) (Remote host closed the connection)
2023-12-03 00:13:58 +0100arahael__(~arahael@1.145.86.162)
2023-12-03 00:14:01 +0100dhil(~dhil@2001:8e0:2014:3100:b5b8:c8ab:cfa1:c979) (Ping timeout: 256 seconds)
2023-12-03 00:14:43 +0100arahael_(~arahael@1.145.97.209) (Ping timeout: 256 seconds)
2023-12-03 00:15:39 +0100gmg(~user@user/gehmehgeh) (Quit: Leaving)
2023-12-03 00:28:41 +0100eggplantade(~Eggplanta@2600:1700:38c5:d800:f878:9036:c8c3:a993)
2023-12-03 00:32:55 +0100johnw(~johnw@69.62.242.138)
2023-12-03 00:33:28 +0100arahael__(~arahael@1.145.86.162) (Ping timeout: 255 seconds)
2023-12-03 00:43:48 +0100tromp(~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
2023-12-03 00:53:43 +0100jmdaemon(~jmdaemon@user/jmdaemon)
2023-12-03 00:57:08 +0100target_i(~target_i@217.175.14.39) (Quit: leaving)
2023-12-03 00:58:13 +0100tomith(tomith@user/tomith) (Quit: tomith)
2023-12-03 01:20:24 +0100tromp(~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl)
2023-12-03 01:22:09 +0100Eoco(~ian@128.101.131.218) (Quit: WeeChat 4.1.1)
2023-12-03 01:23:01 +0100Eoco(~ian@128.101.131.218)
2023-12-03 01:24:56 +0100Eoco(~ian@128.101.131.218) (Client Quit)
2023-12-03 01:25:16 +0100Eoco(~ian@128.101.131.218)
2023-12-03 01:25:57 +0100Eoco(~ian@128.101.131.218) (Client Quit)
2023-12-03 01:26:25 +0100Eoco(~ian@128.101.131.218)
2023-12-03 01:27:09 +0100mobivme(~mobivme@112.201.111.217)
2023-12-03 01:50:11 +0100mobivme(~mobivme@112.201.111.217) (Ping timeout: 260 seconds)
2023-12-03 01:51:00 +0100tromp(~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
2023-12-03 01:55:12 +0100idgaen(~idgaen@2a01:e0a:498:fd50:fcc6:bb5d:489a:ce8c) (Quit: WeeChat 4.1.1)
2023-12-03 02:03:41 +0100mobivme(~mobivme@112.201.111.217)
2023-12-03 02:07:28 +0100notzmv(~zmv@user/notzmv)
2023-12-03 02:07:43 +0100mobivme(~mobivme@112.201.111.217) (Remote host closed the connection)
2023-12-03 02:09:40 +0100oo_miguel(~Thunderbi@78-11-179-96.static.ip.netia.com.pl) (Ping timeout: 255 seconds)
2023-12-03 02:10:00 +0100mrmr15533(~mrmr@user/mrmr) (Quit: Bye, See ya later!)
2023-12-03 02:10:37 +0100mobivme(~mobivme@112.201.111.217)
2023-12-03 02:19:41 +0100zetef(~quassel@2a02:2f00:5201:4b00:7fc8:6fbe:33d9:ba2a)
2023-12-03 02:21:58 +0100mobivme(~mobivme@112.201.111.217) (Ping timeout: 268 seconds)
2023-12-03 02:24:15 +0100zetef(~quassel@2a02:2f00:5201:4b00:7fc8:6fbe:33d9:ba2a) (Remote host closed the connection)
2023-12-03 02:24:26 +0100mobivme(~mobivme@112.201.111.217)
2023-12-03 02:25:06 +0100Lycurgus(~georg@user/Lycurgus) (Quit: leaving)
2023-12-03 02:25:40 +0100wroathe(~wroathe@207-153-38-140.fttp.usinternet.com)
2023-12-03 02:25:40 +0100wroathe(~wroathe@207-153-38-140.fttp.usinternet.com) (Changing host)
2023-12-03 02:25:40 +0100wroathe(~wroathe@user/wroathe)
2023-12-03 02:27:02 +0100 <wroathe> Hey guys, does withBinaryFile and h{Get/Set}Buf ignore the handles buffering mode? I've got this bit of code here that seems to work, but when I look at the system calls being made with strace it only writes 8192 bytes at a time: https://gist.github.com/JustinChristensen/5e20f9ed6f5e73738be736e4efe5a162
2023-12-03 02:30:51 +0100 <wroathe> h{Get/Put}Buf, I mean
2023-12-03 02:32:21 +0100tremon(~tremon@83.80.159.219) (Quit: getting boxed in)
2023-12-03 02:33:04 +0100mobivme(~mobivme@112.201.111.217) (Ping timeout: 255 seconds)
2023-12-03 02:40:12 +0100remexre(~remexre@user/remexre) (Remote host closed the connection)
2023-12-03 02:44:18 +0100remexre(~remexre@user/remexre)
2023-12-03 02:47:28 +0100benjaminl(~benjaminl@user/benjaminl) (Remote host closed the connection)
2023-12-03 02:47:59 +0100bitdex(~bitdex@gateway/tor-sasl/bitdex) (Remote host closed the connection)
2023-12-03 02:48:27 +0100benjaminl(~benjaminl@user/benjaminl)
2023-12-03 02:48:52 +0100bitdex(~bitdex@gateway/tor-sasl/bitdex)
2023-12-03 02:49:58 +0100evil_(~evil@5.151.177.139)
2023-12-03 02:52:19 +0100 <evil_> Hi, I am trying to do some math operatio on integers and struggling converting between Fraction and Integer. Code for Refrence: https://paste.tomsmeding.com/PC5fbRyj
2023-12-03 02:52:26 +0100 <evil_> mainly getCal function
2023-12-03 02:52:35 +0100remexre(~remexre@user/remexre) (Remote host closed the connection)
2023-12-03 02:52:38 +0100evil_hasevil
2023-12-03 02:52:43 +0100remexre(~remexre@user/remexre)
2023-12-03 02:52:48 +0100mobivme(~mobivme@112.201.111.217)
2023-12-03 02:57:14 +0100mobounce(~mobivme@112.201.111.217)
2023-12-03 02:58:26 +0100mobivme(~mobivme@112.201.111.217) (Ping timeout: 260 seconds)
2023-12-03 03:00:04 +0100sawilagar(~sawilagar@user/sawilagar) (Ping timeout: 255 seconds)
2023-12-03 03:02:46 +0100mobounce(~mobivme@112.201.111.217) (Ping timeout: 255 seconds)
2023-12-03 03:03:41 +0100pretty_dumm_guy(~trottel@2a02:810b:43bf:aba0:436e:e1e6:f8d4:a6aa) (Quit: WeeChat 3.5)
2023-12-03 03:03:44 +0100 <geekosaur> `/` is not defined for Integer. `div` is, or you can use `fromInteger`
2023-12-03 03:04:03 +0100 <geekosaur> the same issue will bite you on line 5
2023-12-03 03:04:28 +0100 <geekosaur> > 5 `div` 2
2023-12-03 03:04:30 +0100 <lambdabot> 2
2023-12-03 03:05:16 +0100 <geekosaur> > 5 / 2 -- "5" here is a `Double`, because numeric literals are in effect wrapped in `fromInteger` or `fromRational`
2023-12-03 03:05:17 +0100 <lambdabot> 2.5
2023-12-03 03:06:42 +0100 <geekosaur> > 5 `divMod` 2
2023-12-03 03:06:43 +0100 <lambdabot> (2,1)
2023-12-03 03:09:46 +0100 <hasevil> geekosaur: k, I still don't get why it wouldn't type cast that
2023-12-03 03:10:09 +0100 <geekosaur> there is no automatic "casting" in Haskell, aside from the special handling of literals
2023-12-03 03:12:41 +0100mobivme(~mobivme@112.201.111.217)
2023-12-03 03:13:17 +0100chomwitt(~chomwitt@2a02:587:7a09:c300:1ac0:4dff:fedb:a3f1) (Ping timeout: 240 seconds)
2023-12-03 03:13:23 +0100 <geekosaur> @quote monochrom fromIntegral
2023-12-03 03:13:23 +0100 <lambdabot> monochrom says: You've got an Int / But you want Double / Who do you call? / "fromIntegral!"
2023-12-03 03:13:56 +0100 <hasevil> wait, isn't it oposite in my case
2023-12-03 03:14:35 +0100 <geekosaur> no, you're doing `x / 10` where `x` is an `Integer` but you need an instance of `Fractional` for `/` to work
2023-12-03 03:14:58 +0100 <hasevil> k, but can I type cast it back to int by dooing `:: Int`
2023-12-03 03:15:00 +0100 <hasevil> ?
2023-12-03 03:15:03 +0100 <geekosaur> no
2023-12-03 03:15:25 +0100 <hasevil> so I have to use fromInteger
2023-12-03 03:15:26 +0100 <geekosaur> use one of `floor` or `ceiling`
2023-12-03 03:15:44 +0100 <wroathe> So I've had a look at Base, and unless I'm misreading it seems that hSetBuffering only works for get/PutChar, and it doesn't actually change the Handle's buffer size at all
2023-12-03 03:15:45 +0100 <geekosaur> `:: Int` says "I know this is an `Int`", not "make this an `Int`:
2023-12-03 03:15:54 +0100 <wroathe> Which... if that's true... just wow
2023-12-03 03:16:01 +0100shapr(~user@2600:1700:c640:3100:bb5e:f749:fac6:1840) (Remote host closed the connection)
2023-12-03 03:16:07 +0100 <geekosaur> the compiler will complain if you say `:: Int` and it's a `Double`
2023-12-03 03:16:15 +0100shapr(~user@2600:1700:c640:3100:6b1f:4416:e400:c56a)
2023-12-03 03:16:57 +0100mobounce(~mobivme@112.201.111.217)
2023-12-03 03:17:27 +0100mobivme(~mobivme@112.201.111.217) (Ping timeout: 252 seconds)
2023-12-03 03:18:51 +0100 <hasevil> geekosaur: ok, got it
2023-12-03 03:19:25 +0100 <hasevil> thx, I misunderstood what `:: Int` does.
2023-12-03 03:22:00 +0100 <geekosaur> you can create new types in Haskell, including new numeric types. How would the compiler know how to extend `::` to include them? Whereas with a conversion function you just write a new one. There are also typeclasses (which is what the `Fractional` thing is about), but there you provide the function in the typeclass instance
2023-12-03 03:22:38 +0100 <geekosaur> don't worry about typeclasses for now, though
2023-12-03 03:22:48 +0100 <hasevil> what it means by `Couldn't match expected type 'Int' with actual type 'a0 -> a0'`
2023-12-03 03:23:05 +0100Unicorn_Princess(~Unicorn_P@user/Unicorn-Princess/x-3540542) (Remote host closed the connection)
2023-12-03 03:23:14 +0100 <hasevil> geekosaur: ok, so :: itself is a predefined function
2023-12-03 03:23:20 +0100 <geekosaur> you're missing a parameter somewhere
2023-12-03 03:23:43 +0100 <geekosaur> it's syntax, not a function. which is why it's not really extendable that way
2023-12-03 03:23:47 +0100 <hasevil> `getCal num = (\x -> (x `mod` 10) * 10 ) + getLastDigit num
2023-12-03 03:23:47 +0100 <hasevil> `
2023-12-03 03:23:51 +0100 <hasevil> I/m dooing this
2023-12-03 03:23:53 +0100 <geekosaur> so we use things that can be extended, like typeclasses
2023-12-03 03:24:21 +0100 <hasevil> k, got it. I think I'm too used to other langage dooing this for me
2023-12-03 03:25:18 +0100 <geekosaur> okay, your problem there is that you have defined an anonymous function and are trying to use it as a number
2023-12-03 03:25:24 +0100mobounce(~mobivme@112.201.111.217) (Remote host closed the connection)
2023-12-03 03:25:36 +0100 <hasevil> my understanding of above lamda is. (x is a Int) mod by 10. which returns an Integal then multipy by 10
2023-12-03 03:25:52 +0100 <geekosaur> right, but you don't apply it to anything
2023-12-03 03:26:06 +0100 <geekosaur> so it's trying to use the lambda itself as a number
2023-12-03 03:26:13 +0100 <hasevil> ? sorry, I'm lost define applying
2023-12-03 03:26:28 +0100 <hasevil> k, so problem is `+`
2023-12-03 03:26:31 +0100 <geekosaur> :t \x -> (x `mod` 10) * 10
2023-12-03 03:26:32 +0100 <lambdabot> Integral a => a -> a
2023-12-03 03:26:42 +0100Tuplanolla(~Tuplanoll@91-159-68-236.elisa-laajakaista.fi) (Quit: Leaving.)
2023-12-03 03:26:46 +0100 <monochrom> How about: Do you intend that line of code to mean?
2023-12-03 03:26:52 +0100 <geekosaur> so now you have to supply a value for x
2023-12-03 03:27:02 +0100 <monochrom> Err, What do you ...
2023-12-03 03:27:13 +0100 <hasevil> monochrom: modx then multiply result with 10
2023-12-03 03:27:27 +0100 <monochrom> And x is defined where?
2023-12-03 03:27:28 +0100 <geekosaur> but what is x supposed to be?
2023-12-03 03:27:32 +0100 <hasevil> num
2023-12-03 03:27:43 +0100 <hasevil> k, i see the prblm
2023-12-03 03:27:47 +0100 <hasevil> i'm dumb
2023-12-03 03:28:05 +0100 <monochrom> OK, why is it not the much lower-tech (num `mod` 10) * 10 + getLastDigit num ?
2023-12-03 03:28:57 +0100 <hasevil> cause I'm trying to understand how lamda functions work
2023-12-03 03:29:28 +0100 <geekosaur> the best place to experiment with lambdas is probably `map`
2023-12-03 03:29:35 +0100 <geekosaur> > map (\
2023-12-03 03:29:36 +0100 <lambdabot> <hint>:1:7: error:
2023-12-03 03:29:36 +0100 <lambdabot> parse error (possibly incorrect indentation or mismatched brackets)
2023-12-03 03:29:56 +0100 <geekosaur> > map (\x -> x + 1) [3,4,5]
2023-12-03 03:29:57 +0100 <lambdabot> [4,5,6]
2023-12-03 03:31:45 +0100 <monochrom> (\x -> (x `mod` 10) * 10 ) num + getLastDigit num
2023-12-03 03:33:59 +0100 <hasevil> monochrom: thx.
2023-12-03 03:35:14 +0100 <geekosaur> that is what I was trying to guide you toward when I asked what you were applying the lambda to
2023-12-03 03:35:37 +0100mobivme(~mobivme@112.201.111.217)
2023-12-03 03:37:47 +0100[_](~itchyjunk@user/itchyjunk/x-7353470)
2023-12-03 03:38:15 +0100 <hasevil> geekosaur: yeah, I figured that
2023-12-03 03:41:50 +0100[itchTheBroken](~itchyjunk@user/itchyjunk/x-7353470) (Ping timeout: 268 seconds)
2023-12-03 03:45:22 +0100nate4(~nate@c-98-45-158-125.hsd1.ca.comcast.net)
2023-12-03 03:46:52 +0100 <hasevil> Int is an Integral?
2023-12-03 03:47:08 +0100 <hasevil> cause fromIntregal works but fromInteger errors out
2023-12-03 03:47:29 +0100 <hasevil> and looking at the defination's that make sense
2023-12-03 03:47:43 +0100 <geekosaur> yes. and Int and Integer are different things (Int is a machine word, Integer is a "bignum")
2023-12-03 03:47:55 +0100 <geekosaur> so fromInteger won't work on an Int
2023-12-03 03:48:10 +0100 <geekosaur> but fromIntegral will, because both Int and Integer have Integral instances
2023-12-03 03:48:27 +0100 <hasevil> geekosaur: k, that's intresting. yeah I got the last part
2023-12-03 03:48:57 +0100 <hasevil> but found it confusing. Reading up on it. Int doesn't have a maxBound right?
2023-12-03 03:49:08 +0100 <geekosaur> > maxBound :: Int
2023-12-03 03:49:10 +0100 <lambdabot> 9223372036854775807
2023-12-03 03:49:19 +0100 <geekosaur> > maxBound :: Integer -- nope
2023-12-03 03:49:20 +0100 <lambdabot> error:
2023-12-03 03:49:20 +0100 <lambdabot> • No instance for (Bounded Integer)
2023-12-03 03:49:20 +0100 <lambdabot> arising from a use of ‘maxBound’
2023-12-03 03:50:28 +0100nate4(~nate@c-98-45-158-125.hsd1.ca.comcast.net) (Ping timeout: 255 seconds)
2023-12-03 03:50:33 +0100 <hasevil> so Integer can extend to infinity and Int is a fraction?
2023-12-03 03:50:33 +0100adanwan(~adanwan@gateway/tor-sasl/adanwan) (Remote host closed the connection)
2023-12-03 03:50:49 +0100 <geekosaur> Integer can be as big as you have memory for
2023-12-03 03:51:26 +0100adanwan(~adanwan@gateway/tor-sasl/adanwan)
2023-12-03 03:51:48 +0100 <hasevil> ok, and to be clear Int and Int8 are differnt things
2023-12-03 03:52:04 +0100 <geekosaur> Int8 is an 8-bit value
2023-12-03 03:52:05 +0100 <hasevil> one is bounded while other is a float
2023-12-03 03:52:17 +0100 <hasevil> *bounded Integer
2023-12-03 03:52:19 +0100 <geekosaur> Int and Int64 are treated distinctly but have the same ranges
2023-12-03 03:52:37 +0100 <geekosaur> > maxBound :: Int8
2023-12-03 03:52:39 +0100 <lambdabot> 127
2023-12-03 03:52:45 +0100 <hasevil> can Int store decimals ".xxx"
2023-12-03 03:52:54 +0100 <geekosaur> no
2023-12-03 03:53:04 +0100 <geekosaur> you need FLoat or Double for that
2023-12-03 03:53:12 +0100 <geekosaur> er, Float
2023-12-03 03:56:47 +0100 <hasevil> so, how Int and Int64 trated differently. https://hackage.haskell.org/package/base-4.19.0.0/docs/Data-Int.html this says it's "fixed-precision" so I thought it's a fraction
2023-12-03 03:57:37 +0100 <geekosaur> fixed precision there means it has 64 bits, no more, no less
2023-12-03 03:57:50 +0100 <geekosaur> (one of which is the sign bit)
2023-12-03 03:58:09 +0100wroathe(~wroathe@user/wroathe) (Quit: leaving)
2023-12-03 03:58:56 +0100 <geekosaur> > (5 :: Int64) + (2 :: Int)
2023-12-03 03:58:56 +0100ph88(~ph88@ip5b40e272.dynamic.kabel-deutschland.de) (Remote host closed the connection)
2023-12-03 03:58:58 +0100 <lambdabot> error:
2023-12-03 03:58:58 +0100 <lambdabot> • Couldn't match expected type ‘Int64’ with actual type ‘Int’
2023-12-03 03:58:58 +0100 <lambdabot> • In the second argument of ‘(+)’, namely ‘(2 :: Int)’
2023-12-03 03:59:11 +0100 <geekosaur> they're the same size but are distinct types
2023-12-03 03:59:29 +0100 <geekosaur> (Because on a 32 bit system Int is equivalent to Int32, not Int64)
2023-12-03 04:00:30 +0100 <geekosaur> if we just aliased Int to whichever size it is on the current machine, code would silently break on machines with a different word size, so if word size matters you should use the explicitly sized type
2023-12-03 04:08:16 +0100Eoco(~ian@128.101.131.218) (Quit: WeeChat 4.1.1)
2023-12-03 04:09:27 +0100Eoco(~ian@128.101.131.218)
2023-12-03 04:09:28 +0100Eoco(~ian@128.101.131.218) (Client Quit)
2023-12-03 04:17:10 +0100 <hasevil> geekosaur: got it. thanks for the help.
2023-12-03 04:18:08 +0100Eoco(~ian@128.101.131.218)
2023-12-03 04:19:10 +0100Eoco(~ian@128.101.131.218) (Client Quit)
2023-12-03 04:19:35 +0100Eoco(~ian@128.101.131.218)
2023-12-03 04:21:43 +0100Eoco(~ian@128.101.131.218) (Client Quit)
2023-12-03 04:22:10 +0100Eoco(~ian@128.101.131.218)
2023-12-03 04:23:58 +0100mobivme(~mobivme@112.201.111.217) (Ping timeout: 256 seconds)
2023-12-03 04:28:46 +0100mobivme(~mobivme@112.201.111.217)
2023-12-03 04:29:38 +0100Xyloes(~wyx@2400:dd01:103a:1012:5923:33ce:7857:fc04)
2023-12-03 04:31:24 +0100 <EvanR> hasevil, the reason fromInteger doesn't work on Int can be explained by its type signature, which is a good way to answer a lot of things in haskell
2023-12-03 04:31:26 +0100 <EvanR> :t fromInteger
2023-12-03 04:31:27 +0100 <lambdabot> Num a => Integer -> a
2023-12-03 04:31:56 +0100 <EvanR> (takes Integer only)
2023-12-03 04:32:22 +0100 <EvanR> which luckily is consistent with the naming of the function
2023-12-03 04:33:47 +0100 <EvanR> (for counterexample of sensible naming, see the Real class... toRational :: Real a => a -> Rational ??
2023-12-03 04:34:53 +0100 <EvanR> I guess pascal was still a thing when the standard classes were named
2023-12-03 04:41:36 +0100 <hasevil> thx EvanR, yeah I saw that. was just curious why Int wasn't in Integral
2023-12-03 04:41:48 +0100 <EvanR> it is
2023-12-03 04:42:10 +0100 <hasevil> yeah,
2023-12-03 04:42:10 +0100 <EvanR> > (10 :: Int) `div` 3
2023-12-03 04:42:11 +0100 <lambdabot> 3
2023-12-03 04:42:21 +0100 <hasevil> geek osaur helped me
2023-12-03 04:42:42 +0100 <hasevil> I was trying
2023-12-03 04:43:03 +0100 <hasevil> > floor ((10 :: Int) / 3))
2023-12-03 04:43:05 +0100 <lambdabot> <hint>:1:24: error: parse error on input ‘)’
2023-12-03 04:43:25 +0100 <hasevil> > floor ((10 :: Int) / 3)
2023-12-03 04:43:27 +0100 <lambdabot> error:
2023-12-03 04:43:27 +0100 <lambdabot> • Could not deduce (RealFrac Int) arising from a use of ‘floor’
2023-12-03 04:43:27 +0100 <lambdabot> from the context: Integral b
2023-12-03 04:43:47 +0100 <EvanR> :t floor
2023-12-03 04:43:48 +0100 <lambdabot> (RealFrac a, Integral b) => a -> b
2023-12-03 04:44:02 +0100 <hasevil> :t (/)
2023-12-03 04:44:03 +0100 <lambdabot> Fractional a => a -> a -> a
2023-12-03 04:44:23 +0100 <EvanR> yeah you can't use / on an Int
2023-12-03 04:44:30 +0100FinnElija(~finn_elij@user/finn-elija/x-0085643) (Killed (NickServ (Forcing logout FinnElija -> finn_elija)))
2023-12-03 04:44:30 +0100finn_elija(~finn_elij@user/finn-elija/x-0085643)
2023-12-03 04:44:30 +0100finn_elijaFinnElija
2023-12-03 04:44:40 +0100 <EvanR> you have to promote it to a Fractional first
2023-12-03 04:44:42 +0100 <hasevil> anyway, new prob, In ghci I can't use tail withouth specifing `Prelude.tail` Is that common
2023-12-03 04:44:57 +0100 <EvanR> if you defined something else called tail yeah
2023-12-03 04:45:00 +0100Sgeo(~Sgeo@user/sgeo) (Read error: Connection reset by peer)
2023-12-03 04:45:01 +0100 <hasevil> EvanR: yeah, did that all sorted now. but took me a minute
2023-12-03 04:45:05 +0100 <hasevil> I'm new to this
2023-12-03 04:45:18 +0100 <hasevil> EvanR: no, just using regular tail
2023-12-03 04:45:22 +0100 <hasevil> it won't let me
2023-12-03 04:45:45 +0100 <EvanR> > tail [1,2,3] -- works for me after starting a new ghci session
2023-12-03 04:45:46 +0100 <lambdabot> [2,3]
2023-12-03 04:46:00 +0100 <hasevil> gives ghci> tail [11, 2, 4]
2023-12-03 04:46:00 +0100 <hasevil> <interactive>:27:1: error: [GHC-87543]
2023-12-03 04:46:00 +0100 <hasevil> Ambiguous occurrence
2023-12-03 04:46:34 +0100 <hasevil> maybe it's because I Imported bunch of things
2023-12-03 04:46:34 +0100nate4(~nate@c-98-45-158-125.hsd1.ca.comcast.net)
2023-12-03 04:47:04 +0100 <EvanR> try :i tail
2023-12-03 04:47:30 +0100 <hasevil> nope, does this on new session too
2023-12-03 04:47:55 +0100 <hasevil> https://paste.tomsmeding.com/PGqNkIiD
2023-12-03 04:48:54 +0100 <hasevil> :i tail
2023-12-03 04:48:54 +0100 <hasevil> tail :: GHC.Stack.Types.HasCallStack => [a] -> [a]
2023-12-03 04:48:54 +0100 <hasevil> -- Defined in
2023-12-03 04:49:04 +0100 <EvanR> ok this isn't ambiguous occurrence anymore at least
2023-12-03 04:49:29 +0100 <EvanR> it's giving (unsolicited?) advice but working?
2023-12-03 04:49:37 +0100 <hasevil> now, it throws a warning
2023-12-03 04:49:50 +0100td_(~td@i5387091D.versanet.de) (Ping timeout: 252 seconds)
2023-12-03 04:49:55 +0100 <hasevil> saying it's a partial function
2023-12-03 04:50:03 +0100 <EvanR> I'm not sure where -Wx-partial is coming frmo
2023-12-03 04:50:09 +0100Sgeo(~Sgeo@user/sgeo)
2023-12-03 04:50:10 +0100 <EvanR> doesn't happen in my environment
2023-12-03 04:50:33 +0100 <EvanR> could be a configuration thing
2023-12-03 04:51:52 +0100td_(~td@83.135.9.0)
2023-12-03 04:57:02 +0100 <hasevil> hmm, I haven't changed anything. whatever ghcup set me up with.
2023-12-03 04:58:12 +0100 <EvanR> I'm using ghci 9.6.3
2023-12-03 04:58:27 +0100 <EvanR> could be a new "feature"
2023-12-03 05:00:46 +0100 <hasevil> yeah, I'm using 9.8.1
2023-12-03 05:02:39 +0100Eoco(~ian@128.101.131.218) (Quit: WeeChat 4.1.1)
2023-12-03 05:02:46 +0100 <hasevil> btw, why I can't pattern match this. https://paste.tomsmeding.com/vgqaCfah
2023-12-03 05:03:15 +0100 <EvanR> > let (x:xs) = "hello" in (x, xs)
2023-12-03 05:03:15 +0100 <hasevil> I know It's not a sting but it's a list should be able to do `x:xs`
2023-12-03 05:03:16 +0100 <lambdabot> ('h',"ello")
2023-12-03 05:03:46 +0100 <EvanR> need parentheses around the pattern
2023-12-03 05:04:24 +0100 <hasevil> nope
2023-12-03 05:04:39 +0100 <hasevil> ern binding: (basePwd : day) = splitFileName pwd
2023-12-03 05:04:39 +0100 <hasevil> In the expression:
2023-12-03 05:04:39 +0100 <hasevil> do pwd <- getCurrentDirectory
2023-12-03 05:04:40 +0100 <hasevil> let (basePwd : day) = splitFileName pwd
2023-12-03 05:04:40 +0100 <hasevil> print (show day)
2023-12-03 05:04:40 +0100 <hasevil> |
2023-12-03 05:04:40 +0100 <hasevil> 9 | let (basePwd:day) = splitFileName pwd
2023-12-03 05:04:55 +0100 <EvanR> splitFilename doesn't seem to return a list
2023-12-03 05:05:08 +0100 <EvanR> so you should get a type error?
2023-12-03 05:05:38 +0100 <hasevil> ../file.hs:9:8: error: [GHC-83865]
2023-12-03 05:07:11 +0100waleee(~waleee@h-176-10-144-38.NA.cust.bahnhof.se) (Ping timeout: 264 seconds)
2023-12-03 05:08:10 +0100 <EvanR> ghci> splitFileName "/home/evan/bin/doom"
2023-12-03 05:08:11 +0100 <EvanR> ("/home/evan/bin/","doom")
2023-12-03 05:09:46 +0100peterbecich(~Thunderbi@047-229-123-186.res.spectrum.com)
2023-12-03 05:09:48 +0100 <EvanR> splitFileName :: FilePath -> (String, String) -- use the types !
2023-12-03 05:14:00 +0100_xor(~xor@72.49.195.41) (Quit: brb/bbiab)
2023-12-03 05:14:07 +0100jle`(~jle`@2603-8001-3b02-84d4-10d7-ccb2-03d8-4763.res6.spectrum.com) (Ping timeout: 260 seconds)
2023-12-03 05:15:06 +0100hasevilfacepalm
2023-12-03 05:15:09 +0100 <hasevil> it's a tupple
2023-12-03 05:24:30 +0100mobivme(~mobivme@112.201.111.217) (Ping timeout: 252 seconds)
2023-12-03 05:26:06 +0100mobivme(~mobivme@112.201.111.217)
2023-12-03 05:36:47 +0100Eoco(~ian@128.101.131.218)
2023-12-03 05:42:00 +0100machinedgod(~machinedg@modemcable243.147-130-66.mc.videotron.ca)
2023-12-03 05:47:13 +0100aforemny(~aforemny@i59F516CC.versanet.de)
2023-12-03 05:47:40 +0100aforemny_(~aforemny@2001:9e8:6cc6:6d00:7f41:9fb0:8b7b:8b35) (Ping timeout: 246 seconds)
2023-12-03 05:49:10 +0100nate4(~nate@c-98-45-158-125.hsd1.ca.comcast.net) (Ping timeout: 268 seconds)
2023-12-03 05:55:35 +0100travgm(~travgm@fsf/member/travgm)
2023-12-03 05:57:34 +0100tromp(~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl)
2023-12-03 05:57:37 +0100johnw(~johnw@69.62.242.138) (Quit: ZNC - http://znc.in)
2023-12-03 05:58:05 +0100tromp(~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Client Quit)
2023-12-03 06:01:22 +0100machinedgod(~machinedg@modemcable243.147-130-66.mc.videotron.ca) (Ping timeout: 260 seconds)
2023-12-03 06:11:21 +0100 <hasevil> hey, so I'm trying to make a shell script in haskell using `runghc` in the shebang. and was wondering if there's a way to either do Network Request or call external shell programs.
2023-12-03 06:11:37 +0100 <hasevil> So like cmd "curl https://http.bin"
2023-12-03 06:12:19 +0100 <hasevil> cause afaik there is no way to import cabal modules into a shell script
2023-12-03 06:13:07 +0100ddellacosta(~ddellacos@ool-44c73d16.dyn.optonline.net) (Ping timeout: 255 seconds)
2023-12-03 06:15:07 +0100ddellacosta(~ddellacos@ool-44c73d16.dyn.optonline.net)
2023-12-03 06:25:58 +0100_xor(~xor@72.49.195.41)
2023-12-03 06:26:18 +0100travgm(~travgm@fsf/member/travgm) (Quit: Textual IRC Client: www.textualapp.com)
2023-12-03 06:31:38 +0100 <glguy> I liked today's problem
2023-12-03 06:32:08 +0100 <EvanR> always need a bad excuse to use comonads!
2023-12-03 06:32:44 +0100 <glguy> I need a pretty good reason to use something that's not in containers or base
2023-12-03 06:33:15 +0100trev(~trev@user/trev)
2023-12-03 06:33:18 +0100 <EvanR> I lost several minutes to building vector and vector-stream...
2023-12-03 06:34:48 +0100 <int-e> but why, you can index into lists just fine at this size
2023-12-03 06:35:01 +0100_xor3(~xor@72.49.195.41)
2023-12-03 06:35:16 +0100 <EvanR> more like why do I not already have a Grid ready to copy and paste
2023-12-03 06:35:26 +0100 <int-e> the code I wrote for part 1 did not prepare me well for part 2 today
2023-12-03 06:35:37 +0100peterbecich(~Thunderbi@047-229-123-186.res.spectrum.com) (Ping timeout: 255 seconds)
2023-12-03 06:36:02 +0100 <glguy> I default to (Map Coord) for these kinds of problems
2023-12-03 06:37:01 +0100_xor(~xor@72.49.195.41) (Ping timeout: 276 seconds)
2023-12-03 06:37:01 +0100_xor3_xor
2023-12-03 06:38:51 +0100 <xerox> liked it as well
2023-12-03 06:42:31 +0100 <glguy> advent of list comprehensions for me
2023-12-03 06:43:03 +0100 <glguy> https://github.com/glguy/advent/blob/main/solutions/src/2023/03.hs
2023-12-03 06:44:36 +0100hays(rootvegeta@fsf/member/hays)
2023-12-03 06:47:23 +0100johnw(~johnw@69.62.242.138)
2023-12-03 06:49:41 +0100rosco(~rosco@175.136.158.171)
2023-12-03 06:52:14 +0100alp_(~alp@2001:861:e3d6:8f80:6297:ed9b:7930:d8f)
2023-12-03 06:52:49 +0100 <EvanR> that's cool totally misread the question xD
2023-12-03 06:55:30 +0100iqubic(~avi@2601:602:9502:c70:cb59:8f8d:7da8:6547) (Ping timeout: 260 seconds)
2023-12-03 06:57:45 +0100 <int-e> glguy: Ah, of course today was the day where they do *not* explore corner cases like two parts sharing the same part number. Or parts on the boundary of the input.
2023-12-03 07:02:09 +0100 <glguy> Well, I was ready for borders but I didn't know what it could mean to have shared part numbers, so I crossed my fingers
2023-12-03 07:03:29 +0100 <int-e> well in schematics this easily happens... stuff like having 3 identical screws...
2023-12-03 07:03:52 +0100 <EvanR> 123 is clearly 3 part numbers next to each other
2023-12-03 07:04:00 +0100 <EvanR> 1, 2, and 3
2023-12-03 07:04:11 +0100 <int-e> It's fine of course, just something that /might/ have saved me time if I hadn't worried about it.
2023-12-03 07:07:07 +0100dikiaap(~dikiaap@user/dikiaap)
2023-12-03 07:09:41 +0100 <EvanR> make sure you account for negative part numbers lol
2023-12-03 07:10:12 +0100 <EvanR> luckily there are no letters so you can't get complex part numbers
2023-12-03 07:10:42 +0100 <int-e> Or go back to the problem, s/gears/bars/g and denote bars by '-'.
2023-12-03 07:16:05 +0100travgm(~travgm@fsf/member/travgm)
2023-12-03 07:34:55 +0100azimut(~azimut@gateway/tor-sasl/azimut) (Ping timeout: 240 seconds)
2023-12-03 07:42:30 +0100hasevil(~evil@5.151.177.139) (Quit: nyaa~)
2023-12-03 07:45:45 +0100nate4(~nate@c-98-45-158-125.hsd1.ca.comcast.net)
2023-12-03 07:46:39 +0100iqubic(~avi@2607:fb91:1515:5d1c:16ae:37fc:2df2:7707)
2023-12-03 07:47:40 +0100 <ski> > let x:xs = "hello" in (x,xs) -- "<EvanR> need parentheses around the pattern" -- nope (not with `case' either)
2023-12-03 07:47:42 +0100 <lambdabot> ('h',"ello")
2023-12-03 07:48:17 +0100 <ski> (something i'm commonly a bit annoyed at, when people insert those)
2023-12-03 07:48:31 +0100 <iqubic> Is it possible to take a [(a,b)] and create an indexed fold where the first of each pair is the index and the second is the value?
2023-12-03 07:48:47 +0100 <int-e> > let ((42)) = 23 in (())
2023-12-03 07:48:48 +0100 <lambdabot> ()
2023-12-03 07:48:55 +0100 <ski> "indexed fold" meaning ?
2023-12-03 07:48:56 +0100 <iqubic> Or is that not possible with the Lens library?
2023-12-03 07:49:50 +0100 <int-e> ski: a fold that also passes the index along with each list element, so similar to tucking "zip [0..]" onto the list before folding
2023-12-03 07:49:54 +0100 <iqubic> indexed fold meaning this, from the Lens Library: https://hackage.haskell.org/package/lens-5.2.3/docs/Control-Lens-Combinators.html#t:IndexedFold
2023-12-03 07:50:15 +0100 <iqubic> I'm trying to do fancy Lens things here.
2023-12-03 07:50:20 +0100 <int-e> unless Lens distorts that beyond recognition
2023-12-03 07:50:25 +0100nate4(~nate@c-98-45-158-125.hsd1.ca.comcast.net) (Ping timeout: 255 seconds)
2023-12-03 07:50:34 +0100 <int-e> as it does, of course.
2023-12-03 07:52:31 +0100 <ski> hm, i guess you could convert to `Map' or so ?
2023-12-03 07:54:06 +0100 <int-e> I see, p a (f a) is, more or less, i -> a -> f a. So you do get an index along with the element.
2023-12-03 07:54:15 +0100 <iqubic> You do.
2023-12-03 07:57:43 +0100 <EvanR> oops
2023-12-03 08:00:36 +0100 <int-e> :t indexed
2023-12-03 08:00:37 +0100 <lambdabot> Indexable i p => p a b -> i -> a -> b
2023-12-03 08:01:00 +0100alp_(~alp@2001:861:e3d6:8f80:6297:ed9b:7930:d8f) (Ping timeout: 256 seconds)
2023-12-03 08:01:32 +0100 <iqubic> I figured it out.
2023-12-03 08:01:33 +0100 <ski> > Data.Map.fromList [(2,"hello"),(1,"world")] ^. ifolded
2023-12-03 08:01:35 +0100 <lambdabot> "worldhello"
2023-12-03 08:01:51 +0100 <iqubic> It's just (folded . ifolded)
2023-12-03 08:02:01 +0100 <iqubic> ski: I figured it out.
2023-12-03 08:02:01 +0100 <iqubic> It's just (folded . ifolded)
2023-12-03 08:02:09 +0100 <ski> which is ?
2023-12-03 08:02:28 +0100 <ski> > [(2,"hello"),(1,"world")] ^. folded . ifolded
2023-12-03 08:02:29 +0100 <lambdabot> "helloworld"
2023-12-03 08:02:30 +0100 <ski> mhm
2023-12-03 08:02:30 +0100 <iqubic> [(2,"hello"),(1,"world")] ^. folded . ifolded
2023-12-03 08:02:41 +0100 <iqubic> That is.
2023-12-03 08:02:43 +0100anderson(~anderson@user/anderson) (Quit: bye)
2023-12-03 08:03:54 +0100poscat(~poscat@user/poscat) (Quit: Bye)
2023-12-03 08:06:01 +0100 <ski> @type folded
2023-12-03 08:06:02 +0100 <lambdabot> (Indexable Int p, Contravariant f1, Foldable f2, Applicative f1) => p a (f1 a) -> f2 a -> f1 (f2 a)
2023-12-03 08:06:08 +0100 <ski> @type ifolded
2023-12-03 08:06:09 +0100 <lambdabot> (FoldableWithIndex i f1, Indexable i p, Contravariant f2, Applicative f2) => p a (f2 a) -> f1 a -> f2 (f1 a)
2023-12-03 08:06:17 +0100anderson(~anderson@user/anderson)
2023-12-03 08:06:20 +0100 <ski> now i'm wondering why the former uses `Int'
2023-12-03 08:07:19 +0100 <ski> > [(2,"hello"),(1 :: Integer,"world")] ^. folded . ifolded
2023-12-03 08:07:20 +0100 <lambdabot> "helloworld"
2023-12-03 08:07:34 +0100machinedgod(~machinedg@modemcable243.147-130-66.mc.videotron.ca)
2023-12-03 08:08:01 +0100 <iqubic> Because folded by default just creates an indexed fold that assigns [0..] to the elements
2023-12-03 08:08:29 +0100 <ski> oh
2023-12-03 08:08:49 +0100 <iqubic> > ["hello","world","example"] ^@.. folded
2023-12-03 08:08:51 +0100 <lambdabot> [(0,"hello"),(1,"world"),(2,"example")]
2023-12-03 08:08:54 +0100 <ski> oh, right .. the ordering differed
2023-12-03 08:09:53 +0100 <ski> (`"worldhello"' with `Map', `"helloworld"' with `folded')
2023-12-03 08:11:02 +0100poscat(~poscat@user/poscat)
2023-12-03 08:11:45 +0100 <ski> > Data.Map.fromList [(2,"hello"),(1,"world")] ^.. ifolded . asIndex
2023-12-03 08:11:46 +0100 <lambdabot> [1,2]
2023-12-03 08:11:48 +0100 <ski> > [(2,"hello"),(1,"world")] ^.. folded . ifolded . asIndex
2023-12-03 08:11:50 +0100 <lambdabot> [2,1]
2023-12-03 08:13:47 +0100machinedgod(~machinedg@modemcable243.147-130-66.mc.videotron.ca) (Ping timeout: 264 seconds)
2023-12-03 08:14:10 +0100Katarushisu18(~Katarushi@cpc147790-finc20-2-0-cust502.4-2.cable.virginm.net)
2023-12-03 08:14:23 +0100cayley54(~cayley5@user/phileasfogg)
2023-12-03 08:14:23 +0100pedant(~who@user/pedant)
2023-12-03 08:15:11 +0100fiddlerwoaroof(~fiddlerwo@user/fiddlerwoaroof) (Ping timeout: 245 seconds)
2023-12-03 08:15:20 +0100hexology(~hexology@user/hexology) (Remote host closed the connection)
2023-12-03 08:15:33 +0100glguy_(g@libera/staff/glguy)
2023-12-03 08:15:39 +0100hexology(~hexology@user/hexology)
2023-12-03 08:15:39 +0100Sciencentistguy9(~sciencent@hacksoc/ordinary-member)
2023-12-03 08:15:43 +0100fiddlerwoaroof(~fiddlerwo@user/fiddlerwoaroof)
2023-12-03 08:15:46 +0100gabriel_sevecek(~gabriel@188-167-229-200.dynamic.chello.sk) (Ping timeout: 245 seconds)
2023-12-03 08:15:46 +0100mmaruseacph2(~mihai@mihai.page) (Ping timeout: 245 seconds)
2023-12-03 08:15:56 +0100travgm(~travgm@fsf/member/travgm) (Quit: travgm)
2023-12-03 08:16:02 +0100mmaruseacph2(~mihai@mihai.page)
2023-12-03 08:16:11 +0100Katarushisu1(~Katarushi@cpc147790-finc20-2-0-cust502.4-2.cable.virginm.net) (Ping timeout: 245 seconds)
2023-12-03 08:16:11 +0100cptaffe(~cptaffe@user/cptaffe) (Ping timeout: 245 seconds)
2023-12-03 08:16:11 +0100lawt(~lawt@2603:c024:c008:d000:5b4f:1ef2:fed2:ef3d) (Ping timeout: 245 seconds)
2023-12-03 08:16:11 +0100cayley5(~cayley5@user/phileasfogg) (Ping timeout: 245 seconds)
2023-12-03 08:16:12 +0100bwe(~bwe@2a01:4f8:1c1c:4878::2) (Ping timeout: 245 seconds)
2023-12-03 08:16:12 +0100cayley54cayley5
2023-12-03 08:16:12 +0100gabriel_sevecek(~gabriel@188-167-229-200.dynamic.chello.sk)
2023-12-03 08:16:12 +0100Katarushisu18Katarushisu1
2023-12-03 08:16:19 +0100bwe(~bwe@2a01:4f8:1c1c:4878::2)
2023-12-03 08:16:22 +0100glguy(g@libera/staff/glguy) (Read error: Connection reset by peer)
2023-12-03 08:16:32 +0100cptaffe(~cptaffe@user/cptaffe)
2023-12-03 08:16:35 +0100lawt(~lawt@2603:c024:c008:d000:5b4f:1ef2:fed2:ef3d)
2023-12-03 08:16:36 +0100bcmiller(~bm3719@66.42.95.185) (Ping timeout: 245 seconds)
2023-12-03 08:16:45 +0100bcmiller_(~bm3719@66.42.95.185)
2023-12-03 08:17:38 +0100Sciencentistguy(~sciencent@hacksoc/ordinary-member) (Ping timeout: 260 seconds)
2023-12-03 08:17:38 +0100Sciencentistguy9Sciencentistguy
2023-12-03 08:19:29 +0100glguy_glguy
2023-12-03 08:21:44 +0100benjaminl(~benjaminl@user/benjaminl) (Remote host closed the connection)
2023-12-03 08:23:04 +0100benjaminl(~benjaminl@user/benjaminl)
2023-12-03 08:27:06 +0100travgm(~travgm@fsf/member/travgm)
2023-12-03 08:29:02 +0100chexum(~quassel@gateway/tor-sasl/chexum) (Remote host closed the connection)
2023-12-03 08:29:18 +0100chexum(~quassel@gateway/tor-sasl/chexum)
2023-12-03 08:32:14 +0100tromp(~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl)
2023-12-03 08:33:25 +0100takuan(~takuan@178-116-218-225.access.telenet.be)
2023-12-03 08:38:31 +0100dikiaap(~dikiaap@user/dikiaap) (Ping timeout: 240 seconds)
2023-12-03 08:40:12 +0100dikiaap(~dikiaap@user/dikiaap)
2023-12-03 08:41:09 +0100tromp(~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
2023-12-03 08:42:04 +0100potato44(uid421314@id-421314.lymington.irccloud.com) (Quit: Connection closed for inactivity)
2023-12-03 08:42:43 +0100ursa-major(~ursa-majo@37.19.210.37)
2023-12-03 08:44:51 +0100peterbecich(~Thunderbi@047-229-123-186.res.spectrum.com)
2023-12-03 08:47:42 +0100potato44(uid421314@id-421314.lymington.irccloud.com)
2023-12-03 08:49:27 +0100rosco(~rosco@175.136.158.171) (Quit: Lost terminal)
2023-12-03 08:55:24 +0100travgm(~travgm@fsf/member/travgm) (Quit: travgm)
2023-12-03 08:56:01 +0100 <EvanR> that took entirely too long!
2023-12-03 08:56:32 +0100tromp(~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl)
2023-12-03 08:59:16 +0100phma(~phma@host-67-44-208-227.hnremote.net) (Read error: Connection reset by peer)
2023-12-03 08:59:40 +0100phma(phma@2001:5b0:210d:4b88:db07:55ae:ef67:3fd5)
2023-12-03 08:59:43 +0100rosco(~rosco@175.136.158.171)
2023-12-03 08:59:59 +0100 <tomsmeding> I want to create a ByteString by poking stuff into memory and then constructing the ByteString without having to copy the whole thing again
2023-12-03 09:00:01 +0100 <tomsmeding> I wrote this: https://paste.tomsmeding.com/yJIviqkA
2023-12-03 09:00:24 +0100 <tomsmeding> how soon will this break
2023-12-03 09:01:54 +0100alp_(~alp@2001:861:e3d6:8f80:b766:b9e9:37ec:cedc)
2023-12-03 09:02:38 +0100acidjnk(~acidjnk@p200300d6e72b93610dd19c2ddb792c3e.dip0.t-ipconnect.de)
2023-12-03 09:02:49 +0100 <int-e> tomsmeding: uhm https://hackage.haskell.org/package/bytestring-0.12.0.2/docs/Data-ByteString-Internal.html#v:create
2023-12-03 09:03:02 +0100 <tomsmeding> lol
2023-12-03 09:03:13 +0100fendor(~fendor@2a02:8388:1605:d100:267b:1353:13d7:4f0c)
2023-12-03 09:03:17 +0100iqubic-(~avi@2601:602:9502:c70:717f:d982:562d:94a3)
2023-12-03 09:03:25 +0100 <tomsmeding> I guess I missed that!
2023-12-03 09:03:52 +0100 <int-e> (there's an `unsafeCreate` too)
2023-12-03 09:03:59 +0100 <tomsmeding> I guess I was trying to look in .Unsafe
2023-12-03 09:04:22 +0100 <tomsmeding> which is 'create' inside unsafeDupablePerformIO
2023-12-03 09:04:23 +0100 <tomsmeding> right
2023-12-03 09:04:34 +0100iqubic(~avi@2607:fb91:1515:5d1c:16ae:37fc:2df2:7707) (Ping timeout: 276 seconds)
2023-12-03 09:04:42 +0100 <tomsmeding> do I now still need all the NOINLINE etc precautions
2023-12-03 09:05:14 +0100 <tomsmeding> the bytestring module even has INLINE, and none of the -fno-full-laziness -fno-cse cargo-culting
2023-12-03 09:06:57 +0100 <int-e> tomsmeding: The IO action is supposed to be pure-in-spirit.
2023-12-03 09:07:16 +0100 <tomsmeding> that's fair
2023-12-03 09:07:29 +0100Square(~Square@user/square)
2023-12-03 09:07:30 +0100 <tomsmeding> I guess that's true!
2023-12-03 09:07:37 +0100 <tomsmeding> yay, one less Unsafe.hs
2023-12-03 09:07:39 +0100 <ski> hm, an `ST' version might be nice
2023-12-03 09:07:49 +0100 <tomsmeding> ByteString no do ST for some reason
2023-12-03 09:07:53 +0100 <ski> createSTByteString :: Int -> (forall s. STPtr s Word8 -> ST s ()) -> ByteString
2023-12-03 09:07:56 +0100 <ski> runSTByteString :: Int -> (forall s. ST s (STByteString s)) -> ByteString
2023-12-03 09:08:11 +0100 <ski> would require `STPtr' / `STByteString', though
2023-12-03 09:08:27 +0100 <int-e> tomsmeding: And, hmm, not take any locks, since a thread of execution can just be garbage collected without a trace if it's duplicating work..
2023-12-03 09:08:53 +0100 <ski> @type Data.Array.ST.runSTUArray
2023-12-03 09:08:54 +0100 <lambdabot> (forall s. ST s (Data.Array.Base.STUArray s i e)) -> Data.Array.Base.UArray i e
2023-12-03 09:09:09 +0100 <tomsmeding> int-e: the joys of unsafe*PerformIO
2023-12-03 09:09:18 +0100 <int-e> there's stToIO, right?
2023-12-03 09:09:27 +0100 <ski> yea
2023-12-03 09:09:28 +0100 <tomsmeding> luckily my poking code is indeed morally pure
2023-12-03 09:09:38 +0100 <ski> (and the other way around)
2023-12-03 09:09:50 +0100 <tomsmeding> (with an 'unsafe' prefix)
2023-12-03 09:09:52 +0100 <int-e> So a .Internals module can be forgiven for not providing an ST version :)
2023-12-03 09:09:56 +0100peterbecich(~Thunderbi@047-229-123-186.res.spectrum.com) (Ping timeout: 245 seconds)
2023-12-03 09:10:14 +0100 <tomsmeding> nothing in 'bytestring' does anything with ST :p
2023-12-03 09:12:40 +0100 <ski> @type Control.Monad.ST.stToIO
2023-12-03 09:12:41 +0100 <lambdabot> ST RealWorld a -> IO a
2023-12-03 09:12:46 +0100 <ski> @type GHC.IO.ioToST
2023-12-03 09:12:47 +0100 <lambdabot> IO a -> ST RealWorld a
2023-12-03 09:12:53 +0100 <ski> @type Control.Monad.ST.Unsafe.unsafeIOToST
2023-12-03 09:12:54 +0100 <lambdabot> IO a -> ST s a
2023-12-03 09:13:23 +0100 <int-e> I was mostly unsure about the CaPiTaLiZaTiOn.
2023-12-03 09:14:02 +0100 <EvanR> unsafeCaseInsensitivePerformIO
2023-12-03 09:14:47 +0100 <int-e> But sTToIO would look *really* ugly, so stToIO was the most likely candidate, plus it looked familiar.
2023-12-03 09:24:01 +0100Simikando(~Simikando@adsl-dyn59.91-127-62.t-com.sk)
2023-12-03 09:26:54 +0100shebpamm(~shebpamm@user/shebpamm) (Quit: leaving)
2023-12-03 09:33:44 +0100 <ski> % newtype STPtr s a = MkSTPtr {unSTPtr :: Ptr a} deriving (Eq,Ord)
2023-12-03 09:33:45 +0100 <yahb2> <no output>
2023-12-03 09:33:55 +0100 <ski> % let pokeElemOffST :: Storable a => STPtr s a -> Int -> a -> ST s (); pokeElemOffST (MkSTPtr p) i a = unsafeIOToST (pokeElemOff p i a)
2023-12-03 09:33:55 +0100 <yahb2> <no output>
2023-12-03 09:34:00 +0100 <ski> % let createSTByteString :: Int -> (forall s. STPtr s Word8 -> ST s ()) -> ByteString; createSTByteString n f = runST (unsafeIOToST (create n (\p -> stToIO (f (MkSTPtr p)))))
2023-12-03 09:34:00 +0100 <yahb2> <no output>
2023-12-03 09:34:08 +0100 <ski> % createSTByteString 4 (\ptr -> forM_ [0 .. 3] (\i -> pokeElemOffST ptr i (fromIntegral (ord 'a' + i))))
2023-12-03 09:34:08 +0100 <yahb2> "abcd"
2023-12-03 09:34:39 +0100 <tomsmeding> cool
2023-12-03 09:37:07 +0100 <ski> (hm, i guess `createByteStringST' might be a better name, since this one doesn't involve `STByteString')
2023-12-03 09:45:05 +0100econo_(uid147250@id-147250.tinside.irccloud.com) (Quit: Connection closed for inactivity)
2023-12-03 09:51:59 +0100tomith(tomith@user/tomith)
2023-12-03 09:54:11 +0100gmg(~user@user/gehmehgeh)
2023-12-03 09:57:11 +0100CiaoSen(~Jura@2a05:5800:284:500:2a3a:4dff:fe84:dbd5)
2023-12-03 09:59:05 +0100 <Square> Anyone happen to know what parser combinator library in Rust world feels most familiar coming from Haskell?
2023-12-03 10:13:16 +0100CiaoSen(~Jura@2a05:5800:284:500:2a3a:4dff:fe84:dbd5) (Ping timeout: 245 seconds)
2023-12-03 10:13:39 +0100 <tomsmeding> can I put Setup.hs flags in a cabal.project.local? (In particular, --show-details=direct for tests)
2023-12-03 10:14:22 +0100CiaoSen(~Jura@2a05:5800:284:500:ca4b:d6ff:fec1:99da)
2023-12-03 10:15:12 +0100 <tomsmeding> oh it seems the answer is "yes, you just write the option name"
2023-12-03 10:22:14 +0100CiaoSen(~Jura@2a05:5800:284:500:ca4b:d6ff:fec1:99da) (Quit: CiaoSen)
2023-12-03 10:30:31 +0100chexum(~quassel@gateway/tor-sasl/chexum) (Remote host closed the connection)
2023-12-03 10:30:43 +0100chexum(~quassel@gateway/tor-sasl/chexum)
2023-12-03 10:37:24 +0100oo_miguel(~Thunderbi@78-11-179-96.static.ip.netia.com.pl)
2023-12-03 10:37:45 +0100[_](~itchyjunk@user/itchyjunk/x-7353470) (Read error: Connection reset by peer)
2023-12-03 10:38:10 +0100Simikando(~Simikando@adsl-dyn59.91-127-62.t-com.sk) (Ping timeout: 276 seconds)
2023-12-03 10:46:00 +0100Simikando(~Simikando@adsl-dyn59.91-127-62.t-com.sk)
2023-12-03 10:51:02 +0100idgaen(~idgaen@2a01:e0a:498:fd50:fcc6:bb5d:489a:ce8c)
2023-12-03 10:51:52 +0100mikess(~sam@user/mikess)
2023-12-03 10:52:29 +0100coot(~coot@89-69-206-216.dynamic.chello.pl)
2023-12-03 10:57:12 +0100alp_(~alp@2001:861:e3d6:8f80:b766:b9e9:37ec:cedc) (Ping timeout: 268 seconds)
2023-12-03 11:06:29 +0100Simikando(~Simikando@adsl-dyn59.91-127-62.t-com.sk) (Ping timeout: 240 seconds)
2023-12-03 11:06:54 +0100tzh(~tzh@c-71-193-181-0.hsd1.or.comcast.net) (Quit: zzz)
2023-12-03 11:07:56 +0100pretty_dumm_guy(trottel@gateway/vpn/protonvpn/prettydummguy/x-88029655)
2023-12-03 11:12:15 +0100Tuplanolla(~Tuplanoll@91-159-68-236.elisa-laajakaista.fi)
2023-12-03 11:14:32 +0100dikiaap(~dikiaap@user/dikiaap) (Leaving)
2023-12-03 11:14:33 +0100Lord_of_Life_(~Lord@user/lord-of-life/x-2819915)
2023-12-03 11:14:59 +0100Lord_of_Life(~Lord@user/lord-of-life/x-2819915) (Ping timeout: 264 seconds)
2023-12-03 11:17:33 +0100Lord_of_Life_Lord_of_Life
2023-12-03 11:22:17 +0100hapisnake777(~hapisnake@2409:408d:710:3c2a::64:20ac)
2023-12-03 11:26:38 +0100 <dminuoso_> Square: nom is pretty nice.
2023-12-03 11:27:34 +0100 <Square> dminuoso_, Ok. That's what I'm using atm, but feel a bit lost at times.
2023-12-03 11:28:34 +0100hapisnake777(~hapisnake@2409:408d:710:3c2a::64:20ac) (Ping timeout: 250 seconds)
2023-12-03 11:30:12 +0100 <dminuoso_> Square: I feel most of the awkardness when working with it, is just Rust things in general.
2023-12-03 11:30:14 +0100califax(~califax@user/califx) (Remote host closed the connection)
2023-12-03 11:30:50 +0100 <Square> dminuoso_, Yeah, you're right about that.
2023-12-03 11:32:21 +0100eggplantade(~Eggplanta@2600:1700:38c5:d800:f878:9036:c8c3:a993) (Remote host closed the connection)
2023-12-03 11:32:56 +0100eggplantade(~Eggplanta@2600:1700:38c5:d800:f878:9036:c8c3:a993)
2023-12-03 11:32:57 +0100califax(~califax@user/califx)
2023-12-03 11:37:01 +0100eggplantade(~Eggplanta@2600:1700:38c5:d800:f878:9036:c8c3:a993) (Ping timeout: 245 seconds)
2023-12-03 11:41:17 +0100simendsjo(~user@84.209.170.3)
2023-12-03 11:41:23 +0100mobivme(~mobivme@112.201.111.217) (Remote host closed the connection)
2023-12-03 11:41:35 +0100sawilagar(~sawilagar@user/sawilagar)
2023-12-03 11:46:58 +0100nate4(~nate@c-98-45-158-125.hsd1.ca.comcast.net)
2023-12-03 11:47:11 +0100misterfish(~misterfis@46.44.172.198)
2023-12-03 11:51:35 +0100nate4(~nate@c-98-45-158-125.hsd1.ca.comcast.net) (Ping timeout: 252 seconds)
2023-12-03 11:53:00 +0100waleee(~waleee@h-176-10-144-38.NA.cust.bahnhof.se)
2023-12-03 11:54:18 +0100mobivme(~mobivme@112.201.111.217)
2023-12-03 12:02:32 +0100mobivme(~mobivme@112.201.111.217) (Remote host closed the connection)
2023-12-03 12:07:14 +0100coot(~coot@89-69-206-216.dynamic.chello.pl) (Quit: coot)
2023-12-03 12:08:00 +0100mc47(~mc47@xmonad/TheMC47)
2023-12-03 12:10:21 +0100mobivme(~mobivme@112.201.111.217)
2023-12-03 12:11:11 +0100eggplantade(~Eggplanta@2600:1700:38c5:d800:f878:9036:c8c3:a993)
2023-12-03 12:12:36 +0100target_i(~target_i@217.175.14.39)
2023-12-03 12:14:54 +0100jespada(~jespada@cpc121308-nmal25-2-0-cust15.19-2.cable.virginm.net) (Quit: Textual IRC Client: www.textualapp.com)
2023-12-03 12:21:11 +0100krei-se(~krei-se@p5085dea2.dip0.t-ipconnect.de) (Quit: ZNC 1.8.2 - https://znc.in)
2023-12-03 12:24:01 +0100krei-se(~krei-se@p5085dea2.dip0.t-ipconnect.de)
2023-12-03 12:24:35 +0100td_(~td@83.135.9.0) (Remote host closed the connection)
2023-12-03 12:26:09 +0100Sgeo(~Sgeo@user/sgeo) (Read error: Connection reset by peer)
2023-12-03 12:29:06 +0100Square(~Square@user/square) (Ping timeout: 245 seconds)
2023-12-03 12:30:21 +0100simendsjo(~user@84.209.170.3) (Ping timeout: 245 seconds)
2023-12-03 12:34:27 +0100td_(~td@83.135.9.0)
2023-12-03 12:48:41 +0100misterfish(~misterfis@46.44.172.198) (Ping timeout: 245 seconds)
2023-12-03 12:51:12 +0100pretty_dumm_guy(trottel@gateway/vpn/protonvpn/prettydummguy/x-88029655) (Quit: WeeChat 3.5)
2023-12-03 12:53:39 +0100califax(~califax@user/califx) (Remote host closed the connection)
2023-12-03 12:53:56 +0100califax(~califax@user/califx)
2023-12-03 12:56:20 +0100Unicorn_Princess(~Unicorn_P@user/Unicorn-Princess/x-3540542)
2023-12-03 12:59:12 +0100raehik(~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net)
2023-12-03 12:59:39 +0100jespada(~jespada@cpc121308-nmal25-2-0-cust15.19-2.cable.virginm.net)
2023-12-03 12:59:51 +0100pretty_dumm_guy(trottel@gateway/vpn/protonvpn/prettydummguy/x-88029655)
2023-12-03 13:07:07 +0100dcoutts(~duncan@cpc69402-oxfd27-2-0-cust903.4-3.cable.virginm.net) (Ping timeout: 255 seconds)
2023-12-03 13:08:54 +0100chomwitt(~chomwitt@2a02:587:7a09:c300:1ac0:4dff:fedb:a3f1)
2023-12-03 13:10:13 +0100tromp(~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
2023-12-03 13:10:52 +0100tromp(~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl)
2023-12-03 13:13:28 +0100misterfish(~misterfis@87.215.131.102)
2023-12-03 13:14:27 +0100raehik(~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net) (Ping timeout: 256 seconds)
2023-12-03 13:31:39 +0100raehik(~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net)
2023-12-03 13:33:38 +0100coot(~coot@89-69-206-216.dynamic.chello.pl)
2023-12-03 13:38:38 +0100szkl(uid110435@id-110435.uxbridge.irccloud.com) (Quit: Connection closed for inactivity)
2023-12-03 13:42:40 +0100chexum(~quassel@gateway/tor-sasl/chexum) (Remote host closed the connection)
2023-12-03 13:42:50 +0100chexum_(~quassel@gateway/tor-sasl/chexum)
2023-12-03 13:46:14 +0100 <exarkun> When I use Megaparsec's getParserState, it always tells me it's at line 1, column 1. Have I misunderstood its purpose?
2023-12-03 13:51:12 +0100lav(~pi@wikipedia/maddy-from-celeste) (Remote host closed the connection)
2023-12-03 13:53:39 +0100 <exarkun> I guess I should use getSourcePos instead
2023-12-03 13:53:57 +0100nate4(~nate@c-98-45-158-125.hsd1.ca.comcast.net)
2023-12-03 13:55:59 +0100tromp(~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
2023-12-03 13:56:36 +0100sawilagar(~sawilagar@user/sawilagar) (Ping timeout: 245 seconds)
2023-12-03 13:58:54 +0100tromp(~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl)
2023-12-03 13:59:08 +0100nate4(~nate@c-98-45-158-125.hsd1.ca.comcast.net) (Ping timeout: 256 seconds)
2023-12-03 13:59:22 +0100 <cheater> hi all
2023-12-03 13:59:47 +0100 <cheater> every package on hackage used to have a thing you could click to see a list of all the defined names in the package, where is it now? i can't find it on here https://hackage.haskell.org/package/servant
2023-12-03 14:00:20 +0100 <cheater> oh "index"
2023-12-03 14:09:33 +0100 <cheater> on the type level, does :> have any specific meaning?
2023-12-03 14:10:53 +0100sawilagar(~sawilagar@user/sawilagar)
2023-12-03 14:14:39 +0100 <cheater> oh, seems like it's from effectful
2023-12-03 14:20:37 +0100coot(~coot@89-69-206-216.dynamic.chello.pl) (Quit: coot)
2023-12-03 14:23:35 +0100mc47(~mc47@xmonad/TheMC47) (Remote host closed the connection)
2023-12-03 14:25:24 +0100mobivme(~mobivme@112.201.111.217) (Read error: Connection reset by peer)
2023-12-03 14:31:55 +0100 <hippoid> is there a function to take a list like [1, 2, 3, 6, 7, 8, 10, 11] and return [[1,2,3], [6,7,8], [10,11]] -- where each element of the new list is the consecutive values from the input list?
2023-12-03 14:31:56 +0100[itchyjunk](~itchyjunk@user/itchyjunk/x-7353470)
2023-12-03 14:33:32 +0100mobivme(~mobivme@112.201.111.217)
2023-12-03 14:33:36 +0100 <xerox> > takeWhile (not . null) . unfoldr (Just . splitAt 3) $ [1,2,3,6,7,8,10,11]
2023-12-03 14:33:38 +0100 <lambdabot> [[1,2,3],[6,7,8],[10,11]]
2023-12-03 14:35:06 +0100 <hippoid> > takeWhile (not . null) . unfoldr (Just . splitAt 3) $ [1,2,3,6,7,8,10,11, 12, 13]
2023-12-03 14:35:07 +0100 <lambdabot> [[1,2,3],[6,7,8],[10,11,12],[13]]
2023-12-03 14:35:22 +0100 <hippoid> i don't want the last 13 in its own element
2023-12-03 14:35:37 +0100 <xerox> what's the complete specification then?
2023-12-03 14:37:11 +0100 <hippoid> values that are consecutive (succ) should be grouped together
2023-12-03 14:37:18 +0100 <hippoid> does that make sense?
2023-12-03 14:40:25 +0100 <hippoid> and the list is guaranteed to be in order
2023-12-03 14:40:45 +0100 <ncf> :t groupBy
2023-12-03 14:40:46 +0100 <lambdabot> (a -> a -> Bool) -> [a] -> [[a]]
2023-12-03 14:41:17 +0100 <[Leary]> Unfortunately it doesn't work for this.
2023-12-03 14:41:18 +0100 <ncf> > groupBy (\a b -> b - a == 1) [1, 2, 3, 6, 7, 8, 10, 11]
2023-12-03 14:41:20 +0100 <lambdabot> [[1,2],[3],[6,7],[8],[10,11]]
2023-12-03 14:41:24 +0100 <ncf> huh
2023-12-03 14:41:44 +0100 <ncf> oh, checked against the first element
2023-12-03 14:41:57 +0100 <ncf> drat
2023-12-03 14:42:58 +0100 <xerox> yeah…
2023-12-03 14:46:38 +0100 <ncf> > map (map snd) . groupBy (\(i,a) (j,b) -> a+j == b+i) . zip [0..] $ [1, 2, 3, 6, 7, 8, 10, 11]
2023-12-03 14:46:39 +0100 <lambdabot> [[1,2,3],[6,7,8],[10,11]]
2023-12-03 14:46:56 +0100 <[Leary]> > (\xs -> fmap snd <$> groupBy ((==) `on` fst) (zip (zipWith subtract [0..] xs) xs)) [1,2,3,6,7,8,10,11]
2023-12-03 14:46:57 +0100 <lambdabot> [[1,2,3],[6,7,8],[10,11]]
2023-12-03 14:47:00 +0100 <[Leary]> Beat me to it.
2023-12-03 14:47:06 +0100 <ncf> haha
2023-12-03 14:47:37 +0100 <ncf> that would be quite clean with groupOn
2023-12-03 14:48:28 +0100 <xerox> > let g _ [] = []; g _ [x] = [[x]]; g c (x:xs) | c x (head y) = (x:y):ys | otherwise = [x]:(y:ys) where (y:ys) = g c xs in g (\a b -> a+1==b) [1,2,3,6,7,8,10,11,12,13]
2023-12-03 14:48:29 +0100raehik(~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net) (Quit: WeeChat 4.1.1)
2023-12-03 14:48:29 +0100 <lambdabot> [[1,2,3],[6,7,8],[10,11,12,13]]
2023-12-03 14:48:42 +0100 <hippoid> whoa, thanks! im digest that over some coffee :>
2023-12-03 14:48:51 +0100 <hippoid> *gonna
2023-12-03 14:51:55 +0100chomwitt(~chomwitt@2a02:587:7a09:c300:1ac0:4dff:fedb:a3f1) (Ping timeout: 256 seconds)
2023-12-03 15:02:23 +0100azimut(~azimut@gateway/tor-sasl/azimut)
2023-12-03 15:16:36 +0100Guest84(~Guest84@92.249.121.42)
2023-12-03 15:19:20 +0100Xyloes(~wyx@2400:dd01:103a:1012:5923:33ce:7857:fc04) (Quit: Konversation terminated!)
2023-12-03 15:20:05 +0100Square(~Square@user/square)
2023-12-03 15:23:54 +0100trev(~trev@user/trev) (Quit: trev)
2023-12-03 15:24:44 +0100trev(~trev@user/trev)
2023-12-03 15:30:38 +0100mechap(~mechap@user/mechap)
2023-12-03 15:37:30 +0100Lycurgus(~georg@user/Lycurgus)
2023-12-03 15:39:20 +0100tromp(~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
2023-12-03 15:40:15 +0100mobivme(~mobivme@112.201.111.217) (Ping timeout: 268 seconds)
2023-12-03 15:43:03 +0100mobivme(~mobivme@112.201.111.217)
2023-12-03 15:48:05 +0100albet70(~xxx@2400:8902::f03c:92ff:fe60:98d8) ()
2023-12-03 15:48:44 +0100Guest84(~Guest84@92.249.121.42) (Quit: Client closed)
2023-12-03 15:55:35 +0100 <cheater> that's convoluted
2023-12-03 15:55:40 +0100 <cheater> just use a fold hippoid
2023-12-03 16:12:01 +0100tromp(~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl)
2023-12-03 16:24:07 +0100 <ski> > let g _ [] = []; g _ [x] = [(x,[])]; g c (x:xs) | c x y = (x,y:ys):yss | otherwise = (x,[]):ys0:yss where ys0@(y,ys):yss = g c xs in map (uncurry (:)) (g (\a b -> a + 1 == b) [1,2,3,6,7,8,10,11])
2023-12-03 16:24:08 +0100 <lambdabot> [[1,2,3],[6,7,8],[10,11]]
2023-12-03 16:24:16 +0100 <ski> > let g _ [] = []; g _ [x] = [(x,[])]; g c (x:xs) | c x y = (x,y:ys):yss | otherwise = (x,[]):ys0:yss where ys0@(y,ys):yss = g c xs in (take 3 . map (uncurry (:)) . g (\a b -> a + 1 == b)) ([1,2,3,6,7,8] ++ [10 ..])
2023-12-03 16:24:23 +0100 <lambdabot> mueval-core: Time limit exceeded
2023-12-03 16:24:25 +0100 <ski> > let g _ [] = []; g _ [x] = [(x,[])]; g c (x:xs) = (x,ys1):yss1 where (ys1,yss1) | c x y = (y:ys,yss0) | otherwise = ([],ys0:yss0); ys0@(y,ys):yss0 = g c xs in map (uncurry (:)) (g (\a b -> a + 1 == b) [1,2,3,6,7,8,10,11])
2023-12-03 16:24:27 +0100 <lambdabot> [[1,2,3],[6,7,8],[10,11]]
2023-12-03 16:24:33 +0100 <ski> > let g _ [] = []; g _ [x] = [(x,[])]; g c (x:xs) = (x,ys1):yss1 where (ys1,yss1) | c x y = (y:ys,yss0) | otherwise = ([],ys0:yss0); ys0@(y,ys):yss0 = g c xs in (take 3 . map (uncurry (:)) . g (\a b -> a + 1 == b)) ([1,2,3,6,7,8] ++ [10 ..])
2023-12-03 16:24:34 +0100 <lambdabot> [[1,2,3],[6,7,8],[10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,2...
2023-12-03 16:33:48 +0100fendor(~fendor@2a02:8388:1605:d100:267b:1353:13d7:4f0c) (Remote host closed the connection)
2023-12-03 16:35:43 +0100azimut(~azimut@gateway/tor-sasl/azimut) (Ping timeout: 240 seconds)
2023-12-03 16:40:35 +0100chomwitt(~chomwitt@2a02:587:7a09:c300:1ac0:4dff:fedb:a3f1)
2023-12-03 16:41:25 +0100wickedjargon(~ff@2607:fea8:5680:3f20::8158)
2023-12-03 16:43:21 +0100 <wickedjargon> hello
2023-12-03 16:45:07 +0100 <wickedjargon> question: this function is meant to apply a list of functions to a list of arguments, however, when I use `show` in the list of functions, I get a `No instance for (Num String)` error, even when `show` is the last function in the list
2023-12-03 16:45:58 +0100 <wickedjargon> https://paste.tomsmeding.com/c2gZfUWb
2023-12-03 16:49:45 +0100Tlsx(~rscastilh@189.61.140.215)
2023-12-03 16:51:16 +0100 <ncf> your function is probably inferred to take a [a -> a], and i don't think you can make it any more general
2023-12-03 16:52:51 +0100 <ncf> instead of lists (free monoids) you probably want some sort of free category construction that lets you build formal chains of morphisms a -> b, b -> c, ...
2023-12-03 16:53:50 +0100 <ski> wickedjargon : use pattern-matching, rather than `null',`head',`tail'
2023-12-03 16:54:20 +0100 <ski> (also you can use `where' instead of `let'-`in')
2023-12-03 16:55:58 +0100 <wickedjargon> ski: okay, trying that now
2023-12-03 16:57:23 +0100 <wickedjargon> ncf: thanks, but I need to learn more before I understand what you wrote
2023-12-03 16:57:55 +0100 <ncf> maybe start by writing down what type you want mapFuncLstToElemLst to have, and see what fails
2023-12-03 17:01:14 +0100 <wickedjargon> ski: using pattern matching and `where` inshead of `let...in` produces te same error
2023-12-03 17:01:20 +0100 <ski> yes
2023-12-03 17:01:30 +0100 <wickedjargon> ncf: okay, let me try that
2023-12-03 17:01:43 +0100 <ski> try changing the list elements to `String's in the example ?
2023-12-03 17:02:20 +0100 <ski> wickedjargon : i made a paste where i did the changes i suggested. i could show it, but perhaps you'd like to try a little more on your own, first ?
2023-12-03 17:04:32 +0100skisuspects that wickedjargon neither knows about free monoids, nor free categories
2023-12-03 17:04:37 +0100 <wickedjargon> ski: I'd prefer to see it
2023-12-03 17:04:46 +0100 <ski> wickedjargon : <https://paste.tomsmeding.com/hFrhacbJ>
2023-12-03 17:05:15 +0100 <ncf> i meant something like this: https://paste.tomsmeding.com/yHvSlSZR
2023-12-03 17:05:28 +0100 <ski> hopefully you'll be able to follow the changes i did
2023-12-03 17:05:58 +0100 <ski> yea, i figured, ncf :)
2023-12-03 17:07:47 +0100skiwould also rename `mapFuncLstToElemLst' to something more wieldy, but figured not to change the naming of top-level / exported definitions, for ease of testing & comparision
2023-12-03 17:08:21 +0100 <ski> (oh, and one of the base cases is redundant .. can you figure out which ?)
2023-12-03 17:09:12 +0100idgaen(~idgaen@2a01:e0a:498:fd50:fcc6:bb5d:489a:ce8c) (Quit: WeeChat 4.1.1)
2023-12-03 17:10:42 +0100 <ski> (well .. i guess the behaviour would differ with an infinite or partial list of functions, in that case. but i'm not sure it'd be worth it for that, and for the small efficiency gain for a relatively rare occurance)
2023-12-03 17:11:46 +0100 <wickedjargon> something unexpected came up, I'm going to return to this problem this evening. thanks so much.
2023-12-03 17:12:53 +0100Festive_Derg(A_D@libera/staff/dragon) (Quit: ZNC - https://znc.in)
2023-12-03 17:14:35 +0100A_Dragon(A_D@libera/staff/dragon)
2023-12-03 17:15:42 +0100notzmv(~zmv@user/notzmv) (Ping timeout: 260 seconds)
2023-12-03 17:17:41 +0100rosco(~rosco@175.136.158.171) (Quit: Lost terminal)
2023-12-03 17:18:15 +0100dhil(~dhil@2001:8e0:2014:3100:e2a4:ca79:e8ee:d85f)
2023-12-03 17:21:50 +0100 <ski> wickedjargon : no problem
2023-12-03 17:25:21 +0100waleee(~waleee@h-176-10-144-38.NA.cust.bahnhof.se) (Ping timeout: 256 seconds)
2023-12-03 17:25:22 +0100euleritian(~euleritia@77.22.252.56) (Read error: Connection reset by peer)
2023-12-03 17:26:06 +0100euleritian(~euleritia@ip4d16fc38.dynamic.kabel-deutschland.de)
2023-12-03 17:30:01 +0100jmdaemon(~jmdaemon@user/jmdaemon) (Ping timeout: 255 seconds)
2023-12-03 17:30:50 +0100helge_(~textual@h-158-174-186-9.NA.cust.bahnhof.se)
2023-12-03 17:30:52 +0100azimut(~azimut@gateway/tor-sasl/azimut)
2023-12-03 17:31:44 +0100 <helge_> Is it preferable to use ghcup to install HLS, or to let VS Code do it?
2023-12-03 17:32:55 +0100 <helge_> I have two project folders, both created with "stack new". One today, one about one month ago. For the new project folder, VS Code claims that I need HLS 2.5.0.0. The old one doesn't. ghcup says that I have HLS 2.4.0.0.
2023-12-03 17:32:56 +0100califax(~califax@user/califx) (Remote host closed the connection)
2023-12-03 17:34:05 +0100 <helge_> I don't understand what is so different between my two project folders, that VS Code (and an extension in it) cares about.
2023-12-03 17:35:46 +0100mobivme(~mobivme@112.201.111.217) (Ping timeout: 245 seconds)
2023-12-03 17:44:44 +0100alexherbo2(~alexherbo@2a02-8440-3141-ad43-9872-e573-fc8f-0e1e.rev.sfr.net)
2023-12-03 17:46:35 +0100mobivme(~mobivme@112.201.111.217)
2023-12-03 17:47:47 +0100euleritian(~euleritia@ip4d16fc38.dynamic.kabel-deutschland.de) (Read error: Connection reset by peer)
2023-12-03 17:48:27 +0100califax(~califax@user/califx)
2023-12-03 17:48:40 +0100califax(~califax@user/califx) (Remote host closed the connection)
2023-12-03 17:49:07 +0100euleritian(~euleritia@ip4d16fc38.dynamic.kabel-deutschland.de)
2023-12-03 17:50:33 +0100alexherbo2(~alexherbo@2a02-8440-3141-ad43-9872-e573-fc8f-0e1e.rev.sfr.net) (Remote host closed the connection)
2023-12-03 17:51:45 +0100alexherbo2(~alexherbo@134.151.22.93.rev.sfr.net)
2023-12-03 17:56:07 +0100nate4(~nate@c-98-45-158-125.hsd1.ca.comcast.net)
2023-12-03 17:57:01 +0100Hobbyboy(Hobbyboy@hobbyboy.co.uk) (Quit: The BNC has broken!)
2023-12-03 17:57:02 +0100euleritian(~euleritia@ip4d16fc38.dynamic.kabel-deutschland.de) (Read error: Connection reset by peer)
2023-12-03 17:57:11 +0100euleritian(~euleritia@dynamic-002-247-250-109.2.247.pool.telefonica.de)
2023-12-03 17:57:23 +0100ddellacosta(~ddellacos@ool-44c73d16.dyn.optonline.net) (Quit: WeeChat 4.1.1)
2023-12-03 17:57:28 +0100euleritian(~euleritia@dynamic-002-247-250-109.2.247.pool.telefonica.de) (Read error: Connection reset by peer)
2023-12-03 17:57:47 +0100euleritian(~euleritia@ip4d16fc38.dynamic.kabel-deutschland.de)
2023-12-03 18:00:45 +0100nate4(~nate@c-98-45-158-125.hsd1.ca.comcast.net) (Ping timeout: 252 seconds)
2023-12-03 18:03:27 +0100dcoutts(~duncan@cpc69402-oxfd27-2-0-cust903.4-3.cable.virginm.net)
2023-12-03 18:03:53 +0100califax(~califax@user/califx)
2023-12-03 18:09:06 +0100euleritian(~euleritia@ip4d16fc38.dynamic.kabel-deutschland.de) (Read error: Connection reset by peer)
2023-12-03 18:09:23 +0100 <haskellbridge> 14<m​aerwald> Different ghc version
2023-12-03 18:09:36 +0100 <haskellbridge> 14<m​aerwald> GHC 9.4.8 needs HLS 2.5.0.0
2023-12-03 18:10:04 +0100euleritian(~euleritia@ip4d16fc38.dynamic.kabel-deutschland.de)
2023-12-03 18:12:04 +0100billb(~billb@cpe-66-8-173-22.hawaii.res.rr.com)
2023-12-03 18:13:15 +0100 <xerox> ski: appreciate it
2023-12-03 18:14:39 +0100 <ski> xerox : i was thinking about `foldr'ing it, but got stuck a bit on making sure it was still incremental (i.e. could handle infinite lists), and then got distracted
2023-12-03 18:14:49 +0100 <xerox> :))
2023-12-03 18:15:28 +0100alexherbo2(~alexherbo@134.151.22.93.rev.sfr.net) (Ping timeout: 250 seconds)
2023-12-03 18:15:32 +0100billb(~billb@cpe-66-8-173-22.hawaii.res.rr.com) (Client Quit)
2023-12-03 18:17:15 +0100dcoutts(~duncan@cpc69402-oxfd27-2-0-cust903.4-3.cable.virginm.net) (Ping timeout: 252 seconds)
2023-12-03 18:17:35 +0100 <ski> (also, the `head' and the repeated taking apart `y:ys' and reforming `(c:y):ys' was bothering me, which was why i used pairs there, instead)
2023-12-03 18:17:53 +0100 <xerox> (yeah me too but didn't have the time to do better at that point)
2023-12-03 18:19:55 +0100califax(~califax@user/califx) (Remote host closed the connection)
2023-12-03 18:21:51 +0100 <helge_> haskellbridge : You are right, I have different ghci versions in my two folders. What could be the reason? The only relevant difference that I have found is in stack.yaml, where I have slightly different values for resolver. lts/21/20.yaml vs lts/21/22.yaml.
2023-12-03 18:27:21 +0100econo_(uid147250@id-147250.tinside.irccloud.com)
2023-12-03 18:30:26 +0100 <ski> helge_ : s/haskellbridge/maerwald/
2023-12-03 18:30:31 +0100 <helge_> In my two folders, "ghc --version" both responds with 9.4.7, but in the newer folder, "stack ghci" starts version 9.4.8.
2023-12-03 18:30:51 +0100califax(~califax@user/califx)
2023-12-03 18:30:52 +0100 <geekosaur> the resolver specifies the ghc version
2023-12-03 18:31:45 +0100 <geekosaur> https://www.stackage.org/ shows the resolvers and their ghc versions, you will note that 21.22 indeed upgraded ghc to 9.4.8
2023-12-03 18:34:45 +0100eggplantade(~Eggplanta@2600:1700:38c5:d800:f878:9036:c8c3:a993) (Remote host closed the connection)
2023-12-03 18:35:06 +0100eggplantade(~Eggplanta@2600:1700:38c5:d800:d9f3:ec2f:a760:e0fe)
2023-12-03 18:36:24 +0100 <helge_> I used ghcup tui to add HLS version 2.5.0.0, and it seems to solve the problem. Thanks a lot for the help!
2023-12-03 18:39:56 +0100Feuermagier(~Feuermagi@user/feuermagier)
2023-12-03 18:41:08 +0100dcoutts(~duncan@cpc69402-oxfd27-2-0-cust903.4-3.cable.virginm.net)
2023-12-03 18:47:16 +0100helge_(~textual@h-158-174-186-9.NA.cust.bahnhof.se) (Quit: Textual IRC Client: www.textualapp.com)
2023-12-03 18:48:27 +0100dcoutts(~duncan@cpc69402-oxfd27-2-0-cust903.4-3.cable.virginm.net) (Ping timeout: 260 seconds)
2023-12-03 18:48:59 +0100tzh(~tzh@c-71-193-181-0.hsd1.or.comcast.net)
2023-12-03 18:49:41 +0100 <shapr> @quote
2023-12-03 18:49:41 +0100 <lambdabot> mdedetrich says: safety might not be a concern
2023-12-03 18:50:52 +0100ursa-major(~ursa-majo@37.19.210.37) (Ping timeout: 276 seconds)
2023-12-03 18:55:38 +0100idgaen(~idgaen@2a01:e0a:498:fd50:fcc6:bb5d:489a:ce8c)
2023-12-03 18:57:45 +0100pavonia(~user@user/siracusa) (Quit: Bye!)
2023-12-03 18:58:14 +0100todi(~todi@pd9571327.dip0.t-ipconnect.de) (Remote host closed the connection)
2023-12-03 19:00:31 +0100wootehfoot(~wootehfoo@user/wootehfoot)
2023-12-03 19:04:53 +0100A_DragonFestive_Derg
2023-12-03 19:16:31 +0100waleee(~waleee@h-176-10-144-38.NA.cust.bahnhof.se)
2023-12-03 19:16:36 +0100iqubic-(~avi@2601:602:9502:c70:717f:d982:562d:94a3) (Ping timeout: 245 seconds)
2023-12-03 19:21:18 +0100todi(~todi@pd9571327.dip0.t-ipconnect.de)
2023-12-03 19:21:24 +0100todi(~todi@pd9571327.dip0.t-ipconnect.de) (Remote host closed the connection)
2023-12-03 19:22:06 +0100todi(~todi@pd9571327.dip0.t-ipconnect.de)
2023-12-03 19:22:06 +0100tromp(~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
2023-12-03 19:29:06 +0100__monty__(~toonn@user/toonn)
2023-12-03 19:30:09 +0100wootehfoot(~wootehfoo@user/wootehfoot) (Quit: Leaving)
2023-12-03 19:35:40 +0100euleritian(~euleritia@ip4d16fc38.dynamic.kabel-deutschland.de) (Read error: Connection reset by peer)
2023-12-03 19:36:22 +0100euleritian(~euleritia@ip4d16fc38.dynamic.kabel-deutschland.de)
2023-12-03 19:38:12 +0100plates(~plates@cbd100.neoplus.adsl.tpnet.pl)
2023-12-03 19:38:55 +0100tromp(~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl)
2023-12-03 19:42:44 +0100todi(~todi@pd9571327.dip0.t-ipconnect.de) (Remote host closed the connection)
2023-12-03 19:43:37 +0100todi(~todi@pd9571327.dip0.t-ipconnect.de)
2023-12-03 19:46:11 +0100trev(~trev@user/trev) (Quit: trev)
2023-12-03 19:47:25 +0100dcoutts(~duncan@cpc69402-oxfd27-2-0-cust903.4-3.cable.virginm.net)
2023-12-03 19:55:09 +0100dcoutts(~duncan@cpc69402-oxfd27-2-0-cust903.4-3.cable.virginm.net) (Ping timeout: 252 seconds)
2023-12-03 20:03:49 +0100euleritian(~euleritia@ip4d16fc38.dynamic.kabel-deutschland.de) (Ping timeout: 255 seconds)
2023-12-03 20:04:13 +0100euleritian(~euleritia@ip4d16fc38.dynamic.kabel-deutschland.de)
2023-12-03 20:16:53 +0100malte(~malte@mal.tc) (Ping timeout: 240 seconds)
2023-12-03 20:20:22 +0100peterbecich(~Thunderbi@047-229-123-186.res.spectrum.com)
2023-12-03 20:23:10 +0100mobivme(~mobivme@112.201.111.217) (Read error: Connection reset by peer)
2023-12-03 20:27:14 +0100mobivme(~mobivme@112.201.111.217)
2023-12-03 20:35:10 +0100plates(~plates@cbd100.neoplus.adsl.tpnet.pl) (Quit: Client closed)
2023-12-03 20:43:41 +0100Tlsx(~rscastilh@189.61.140.215) (Read error: Connection reset by peer)
2023-12-03 20:47:22 +0100Tlsx(~rscastilh@189.61.140.215)
2023-12-03 21:04:20 +0100Hobbyboy(Hobbyboy@hobbyboy.co.uk)
2023-12-03 21:14:35 +0100zmt01(~zmt00@user/zmt00)
2023-12-03 21:15:00 +0100tromp(~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
2023-12-03 21:18:22 +0100zmt00(~zmt00@user/zmt00) (Ping timeout: 260 seconds)
2023-12-03 21:19:11 +0100drdo(~drdo@bl14-14-49.dsl.telepac.pt) (Ping timeout: 260 seconds)
2023-12-03 21:21:56 +0100JeremyB99(~JeremyB99@2600:1702:21b0:a500:b427:1e7a:fffe:f069) (Read error: Connection reset by peer)
2023-12-03 21:24:06 +0100JeremyB99(~JeremyB99@2600:1702:21b0:a500:b427:1e7a:fffe:f069)
2023-12-03 21:24:14 +0100drdo(~drdo@bl14-14-49.dsl.telepac.pt)
2023-12-03 21:25:04 +0100iqubic(~avi@2601:602:9502:c70:717f:d982:562d:94a3)
2023-12-03 21:25:11 +0100JeremyB99(~JeremyB99@2600:1702:21b0:a500:b427:1e7a:fffe:f069) (Read error: Connection reset by peer)
2023-12-03 21:27:40 +0100Sgeo(~Sgeo@user/sgeo)
2023-12-03 21:30:20 +0100califax(~califax@user/califx) (Remote host closed the connection)
2023-12-03 21:30:20 +0100gmg(~user@user/gehmehgeh) (Remote host closed the connection)
2023-12-03 21:30:42 +0100califax(~califax@user/califx)
2023-12-03 21:31:05 +0100gmg(~user@user/gehmehgeh)
2023-12-03 21:34:19 +0100JeremyB99(~JeremyB99@2600:1702:21b0:a500:b427:1e7a:fffe:f069)
2023-12-03 21:35:15 +0100fendor(~fendor@2a02:8388:1605:d100:267b:1353:13d7:4f0c)
2023-12-03 21:35:52 +0100JeremyB99(~JeremyB99@2600:1702:21b0:a500:b427:1e7a:fffe:f069) (Read error: Connection reset by peer)
2023-12-03 21:43:04 +0100coot(~coot@89-69-206-216.dynamic.chello.pl)
2023-12-03 21:44:27 +0100Tlsx(~rscastilh@189.61.140.215) ()
2023-12-03 21:50:14 +0100alexherbo2(~alexherbo@153.13.23.93.rev.sfr.net)
2023-12-03 21:53:55 +0100mikess(~sam@user/mikess) (Quit: leaving)
2023-12-03 21:54:09 +0100tromp(~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl)
2023-12-03 21:55:21 +0100travgm(~travgm@fsf/member/travgm)
2023-12-03 21:57:35 +0100nate4(~nate@c-98-45-158-125.hsd1.ca.comcast.net)
2023-12-03 21:58:11 +0100JeremyB99(~JeremyB99@2600:1702:21b0:a500:b427:1e7a:fffe:f069)
2023-12-03 22:01:43 +0100koz(~koz@121.99.240.58) (Ping timeout: 255 seconds)
2023-12-03 22:02:37 +0100nate4(~nate@c-98-45-158-125.hsd1.ca.comcast.net) (Ping timeout: 276 seconds)
2023-12-03 22:02:58 +0100koz(~koz@121.99.240.58)
2023-12-03 22:03:41 +0100JeremyB99(~JeremyB99@2600:1702:21b0:a500:b427:1e7a:fffe:f069) (Read error: Connection reset by peer)
2023-12-03 22:03:43 +0100takuan(~takuan@178-116-218-225.access.telenet.be) (Remote host closed the connection)
2023-12-03 22:05:29 +0100foul_owl(~kerry@157.97.134.167) (Ping timeout: 252 seconds)
2023-12-03 22:09:54 +0100pavonia(~user@user/siracusa)
2023-12-03 22:19:31 +0100iqubic(~avi@2601:602:9502:c70:717f:d982:562d:94a3) (Ping timeout: 245 seconds)
2023-12-03 22:20:00 +0100foul_owl(~kerry@157.97.134.165)
2023-12-03 22:22:08 +0100gmg(~user@user/gehmehgeh) (Remote host closed the connection)
2023-12-03 22:22:51 +0100gmg(~user@user/gehmehgeh)
2023-12-03 22:23:26 +0100JeremyB99(~JeremyB99@2600:1702:21b0:a500:b427:1e7a:fffe:f069)
2023-12-03 22:24:03 +0100travgm(~travgm@fsf/member/travgm) (Quit: Adios)
2023-12-03 22:24:24 +0100JeremyB99(~JeremyB99@2600:1702:21b0:a500:b427:1e7a:fffe:f069) (Read error: Connection reset by peer)
2023-12-03 22:26:23 +0100 <glguy> How do I disable ghc 9.8's new warning for partial functions?
2023-12-03 22:26:56 +0100 <glguy> Oh, it was -Wno-x-partial
2023-12-03 22:27:25 +0100ddellacosta(~ddellacos@ool-44c73d16.dyn.optonline.net)
2023-12-03 22:29:39 +0100travgm(~travgm@fsf/member/travgm)
2023-12-03 22:31:14 +0100eggplantade(~Eggplanta@2600:1700:38c5:d800:d9f3:ec2f:a760:e0fe) (Remote host closed the connection)
2023-12-03 22:31:49 +0100eggplantade(~Eggplanta@2600:1700:38c5:d800:d9f3:ec2f:a760:e0fe)
2023-12-03 22:32:47 +0100target_i(~target_i@217.175.14.39) (Quit: leaving)
2023-12-03 22:35:28 +0100son0p(~ff@181.136.122.143) (Quit: Bye)
2023-12-03 22:36:11 +0100eggplantade(~Eggplanta@2600:1700:38c5:d800:d9f3:ec2f:a760:e0fe) (Ping timeout: 245 seconds)
2023-12-03 22:37:27 +0100wickedjargon(~ff@2607:fea8:5680:3f20::8158) (Remote host closed the connection)
2023-12-03 22:41:18 +0100 <EvanR> it warns for all uses of partial functions? or just the usual suspects like tail
2023-12-03 22:42:39 +0100 <EvanR> which has a reasonable non-partial alternative
2023-12-03 22:44:47 +0100JeremyB99(~JeremyB99@2600:1702:21b0:a500:b427:1e7a:fffe:f069)
2023-12-03 22:45:43 +0100JeremyB99(~JeremyB99@2600:1702:21b0:a500:b427:1e7a:fffe:f069) (Read error: Connection reset by peer)
2023-12-03 22:48:02 +0100 <geekosaur> only functions in base which have a WARNING pragma, apparently
2023-12-03 22:48:55 +0100 <geekosaur> (which means it doesn't show up in `ghc --show-options`)
2023-12-03 22:54:40 +0100fendor(~fendor@2a02:8388:1605:d100:267b:1353:13d7:4f0c) (Remote host closed the connection)
2023-12-03 22:56:11 +0100eggplantade(~Eggplanta@2600:1700:38c5:d800:d9f3:ec2f:a760:e0fe)
2023-12-03 22:57:12 +0100 <glguy> I had forgotten the - after no
2023-12-03 22:58:16 +0100glguyfinds a chance to get TransformListComp back into his solution repo :) - lost my previous one in a refactor
2023-12-03 22:59:46 +0100ec_(~ec@gateway/tor-sasl/ec)
2023-12-03 22:59:57 +0100ec_ec
2023-12-03 23:00:05 +0100iqubic(~avi@2601:602:9502:c70:717f:d982:562d:94a3)
2023-12-03 23:00:07 +0100 <Rembane> That sounds spicy! :)
2023-12-03 23:06:19 +0100travgm(~travgm@fsf/member/travgm) (Ping timeout: 276 seconds)
2023-12-03 23:06:24 +0100waleee(~waleee@h-176-10-144-38.NA.cust.bahnhof.se) (Ping timeout: 268 seconds)
2023-12-03 23:08:12 +0100coot(~coot@89-69-206-216.dynamic.chello.pl) (Quit: coot)
2023-12-03 23:08:56 +0100ec(~ec@gateway/tor-sasl/ec) (Remote host closed the connection)
2023-12-03 23:12:26 +0100dcoutts(~duncan@cpc69402-oxfd27-2-0-cust903.4-3.cable.virginm.net)
2023-12-03 23:12:32 +0100wroathe(~wroathe@50.205.197.50)
2023-12-03 23:12:32 +0100wroathe(~wroathe@50.205.197.50) (Changing host)
2023-12-03 23:12:32 +0100wroathe(~wroathe@user/wroathe)
2023-12-03 23:14:59 +0100son0p(~ff@181.136.122.143)
2023-12-03 23:15:31 +0100 <wroathe> Hey guys, I've got this program I've been working on in a much better spot thanks to the advice in here, but I see lots of allocations and GCs going on in the inner loop, even though the total heap usage of the program is much much better. I have some theories as to why this would be, but my question for you guys is how you go about analyzing a program to determine where allocations are being made and
2023-12-03 23:15:37 +0100 <wroathe> where to apply strictness annotations or how to specify unboxed values
2023-12-03 23:16:13 +0100 <wroathe> https://gist.github.com/JustinChristensen/2111f13e812112b5ac973e292606d17f here's the latest
2023-12-03 23:17:07 +0100 <wroathe> The "hot" area for allocations according to the ticky-ticky profiling option is lines 78-84
2023-12-03 23:17:13 +0100 <wroathe> Which makes sense
2023-12-03 23:17:59 +0100 <wroathe> What I'm trying to determine is if I can rewrite 65-84 in a way that avoids allocations and GCs, but beyond having someone give me the answer I'm more interesting in "learning how to fish" here
2023-12-03 23:18:09 +0100 <wroathe> So how would you go about analyzing this program to determine where the allocations are being made?
2023-12-03 23:18:24 +0100dhil(~dhil@2001:8e0:2014:3100:e2a4:ca79:e8ee:d85f) (Ping timeout: 256 seconds)
2023-12-03 23:19:48 +0100 <wroathe> My current working theory is that it allocates a "FixState" value for every character in the input stream, and I'm hoping to 1. Prove this, 2. Figure out if there's an optimization option or a way to write this code to avoid that
2023-12-03 23:22:07 +0100 <[Leary]> wroathe: I'm not experienced in this area, but I gather if you dump and examine the generated STG you'll be able to see all the allocations (as lets).
2023-12-03 23:22:49 +0100 <wroathe> Ah, that was one of my points of confusion with dumping the STG. So you're saying a "let" always means a heap allocation?
2023-12-03 23:22:52 +0100 <wroathe> I'll give that a shot
2023-12-03 23:23:41 +0100tromp(~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Read error: Connection reset by peer)
2023-12-03 23:26:11 +0100peterbecich(~Thunderbi@047-229-123-186.res.spectrum.com) (Ping timeout: 245 seconds)
2023-12-03 23:33:57 +0100gmg(~user@user/gehmehgeh) (Quit: Leaving)
2023-12-03 23:34:44 +0100 <wroathe> I don't really know what I'm looking at, but I do see my data constructors for that enumerated value referenced quite a bit
2023-12-03 23:37:18 +0100__monty__(~toonn@user/toonn) (Quit: leaving)
2023-12-03 23:37:45 +0100 <wroathe> Oh, I wonder if this is what I'm looking for: https://gitlab.haskell.org/ghc/ghc/-/wikis/unpacked-sum-types
2023-12-03 23:40:18 +0100 <[Leary]> wroathe: I'm not sure if this will actually help, but one thing I'd try is rewriting `loop` as `doTheThing input output buf = fix \loop !state -> ... loop nextState`. Another thing could be church encoding FixState.
2023-12-03 23:41:26 +0100 <wroathe> TODO: learn what church encoding is
2023-12-03 23:41:29 +0100 <wroathe> Thanks for the tip
2023-12-03 23:43:56 +0100 <[Leary]> Here it would be `newtype FixState = FixState{ branch :: forall a. a -> a -> a }; start = FixState \s _ -> s; backslash = FixState \_ b -> b`. Then instead of `case state of ...` you do `match state ...`.
2023-12-03 23:44:25 +0100 <[Leary]> Err, `branch state ...`.
2023-12-03 23:47:08 +0100alexherbo2(~alexherbo@153.13.23.93.rev.sfr.net) (Remote host closed the connection)
2023-12-03 23:49:31 +0100JeremyB99(~JeremyB99@2600:1702:21b0:a500:b427:1e7a:fffe:f069)
2023-12-03 23:49:54 +0100ski. o O ( "Multi-return function call" by Olin Shivers,David Fisher in 2004-09,2006-0[79] at <https://www.khoury.northeastern.edu/home/shivers/citations.html#mrlc> )
2023-12-03 23:50:19 +0100JeremyB99(~JeremyB99@2600:1702:21b0:a500:b427:1e7a:fffe:f069) (Read error: Connection reset by peer)
2023-12-03 23:50:46 +0100wroathe(~wroathe@user/wroathe) (Ping timeout: 245 seconds)
2023-12-03 23:59:19 +0100peterbecich(~Thunderbi@047-229-123-186.res.spectrum.com)