Home liberachat/#haskell: Logs Calendar

Logs on 2025-03-28 (liberachat/#haskell)

00:01:32 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 252 seconds)
00:05:23 anselmschueler joins (~quassel@user/schuelermine)
00:05:24 <anselmschueler> Hi
00:05:24 × sprotte24 quits (~sprotte24@p200300d16f0a80004582713a1a0df846.dip0.t-ipconnect.de) (Read error: Connection reset by peer)
00:05:28 <anselmschueler> ’s been a while
00:05:55 xff0x joins (~xff0x@2405:6580:b080:900:879:4ff2:52d5:5929)
00:06:05 geekosaur waves
00:07:51 <anselmschueler> does anyone know when stimes was changed to document that it’ll work with 0 only for some implementors, and that stimesMonoid was added to enforce stimesMonoid 0 = mempty?
00:07:59 <anselmschueler> I seem to remember it wasn’t so some time ago
00:08:19 <anselmschueler> specifically when I wrote this rejected proposal: https://github.com/haskell/core-libraries-committee/issues/72
00:12:23 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
00:12:40 peterbecich joins (~Thunderbi@syn-047-229-123-186.res.spectrum.com)
00:14:56 × tdammers quits (~tdammers@110-136-178-143.ftth.glasoperator.nl) (Ping timeout: 265 seconds)
00:17:25 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 244 seconds)
00:27:51 tdammers joins (~tdammers@110-136-178-143.ftth.glasoperator.nl)
00:28:09 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
00:30:30 × toby-bro quits (~toby-bro@user/toby-bro) (Ping timeout: 276 seconds)
00:32:03 malte joins (~malte@mal.tc)
00:34:41 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 244 seconds)
00:35:21 × st_aldini quits (~Thunderbi@136.48.22.91) (Remote host closed the connection)
00:36:12 × jacopovalanzano quits (~jacopoval@cpc151911-cove17-2-0-cust105.3-1.cable.virginm.net) (Quit: Client closed)
00:39:30 JuanDaugherty joins (~juan@user/JuanDaugherty)
00:41:52 × aetepe quits (~aetepe@188.119.58.34) (Ping timeout: 252 seconds)
00:44:34 × olivial quits (~benjaminl@user/benjaminl) (Ping timeout: 260 seconds)
00:46:13 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
00:51:47 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 268 seconds)
00:54:15 × acidjnk quits (~acidjnk@p200300d6e71c4f64e0b826361c3e438a.dip0.t-ipconnect.de) (Ping timeout: 268 seconds)
00:55:34 × anselmschueler quits (~quassel@user/schuelermine) (Remote host closed the connection)
00:55:57 × Tuplanolla quits (~Tuplanoll@91-159-69-59.elisa-laajakaista.fi) (Quit: Leaving.)
00:58:11 anselmschueler joins (~quassel@user/schuelermine)
00:58:14 <EvanR> :t \n -> (!! n) . iterate
00:58:15 <lambdabot> error:
00:58:15 <lambdabot> • Couldn't match type ‘a -> [a]’ with ‘[c]’
00:58:15 <lambdabot> Expected type: (a -> a) -> [c]
00:58:35 <EvanR> :t \n f -> (!! n) . iterate f
00:58:36 <lambdabot> Int -> (c -> c) -> c -> c
01:01:59 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
01:04:21 <anselmschueler> :h
01:04:24 <anselmschueler> :?
01:04:30 <anselmschueler> hm
01:05:31 <geekosaur> it only supports :t and :k (from ghci) plus "> " to evaluate expressions, otherwise commands start with @
01:05:36 <anselmschueler> oh
01:05:38 <anselmschueler> ok
01:06:25 <geekosaur> (the in-channel help isn't so helpful, you might prefer https://github.com/lambdabot/lambdabot/pull/205/files)
01:06:48 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 252 seconds)
01:08:02 <anselmschueler> @djinn [a] -> (a -> [b]) -> [b]
01:08:02 <lambdabot> Error: Undefined type []
01:09:18 <geekosaur> djinn doesn't understand recursively defined types. there was a bot that did (exference) but it's bitrotted, and even when working it could fail to find solutions
01:09:42 <anselmschueler> geekosaur: the source code is just lost?
01:09:44 <anselmschueler> sad
01:09:50 <anselmschueler> I assume it’s also a hard problem
01:09:54 <anselmschueler> to generate those
01:10:18 <geekosaur> no, it's there, it was broken by compiler changes and I couldn't figure out how to update it when I tried forking it
01:10:23 <geekosaur> ghc internals change a lot
01:10:52 <geekosaur> https://github.com/lspitzner/exference
01:11:02 <anselmschueler> ok
01:11:13 × xff0x quits (~xff0x@2405:6580:b080:900:879:4ff2:52d5:5929) (Ping timeout: 248 seconds)
01:12:16 <anselmschueler> hm @free isn’t working
01:12:19 <anselmschueler> @free fmap
01:12:20 <lambdabot> Extra stuff at end of line in retrieved type "Functor f => (a -> b) -> f a -> f b"
01:12:48 <Leary> @djinn (r -> (a -> r -> r) -> r) -> (a -> (s -> (b -> s -> s) -> s)) -> (t -> (b -> t -> t) -> t)
01:12:48 <lambdabot> f _ _ a _ = a
01:12:51 <geekosaur> @free map
01:12:52 <lambdabot> g . h = k . f => $map g . map h = map k . $map f
01:13:16 <geekosaur> which is actually fmap; this is something of a hack because @free doesn't understand typeclasses
01:13:25 × otto_s quits (~user@p5de2f7cc.dip0.t-ipconnect.de) (Ping timeout: 265 seconds)
01:13:25 <Leary> (i.e. `f _ _ = []`)
01:13:29 <anselmschueler> oh
01:13:52 <anselmschueler> @free fmap @[]
01:13:52 <lambdabot> Extra stuff at end of line
01:14:01 <anselmschueler> :(
01:14:09 <Axman6> you can play with lambdabot in private messages too
01:14:15 <anselmschueler> ok
01:14:19 <Leary> @free fmap :: (a -> b) -> F a -> F b
01:14:19 <lambdabot> g . h = k . f => $map_F g . fmap h = fmap k . $map_F f
01:14:28 <anselmschueler> it’s been too long since I’ve done Haskell
01:14:33 × vanishingideal quits (~vanishing@user/vanishingideal) (Ping timeout: 245 seconds)
01:14:34 <anselmschueler> like proper
01:14:54 otto_s joins (~user@p5de2fe2d.dip0.t-ipconnect.de)
01:14:59 <geekosaur> well, most of these failures are because most of the bot plugins weren't updated
01:15:10 <geekosaur> like, no TypeApplications support
01:15:15 <anselmschueler> yeah
01:16:11 <anselmschueler> two years ago I wrote a small (230 lines) code (still my best Haskell code to date) for directory traversal
01:16:26 <anselmschueler> do you think using existentials for that is overkill?
01:16:40 vanishingideal joins (~vanishing@user/vanishingideal)
01:17:03 <anselmschueler> I had data Landmark = forall t. Landmark { prepare :: FilePath -> IO t, check :: t -> Check }
01:17:09 <anselmschueler> so when the program starts it collects data
01:17:14 × JuanDaugherty quits (~juan@user/JuanDaugherty) (Quit: praxis.meansofproduction.biz (juan@acm.org))
01:17:26 <anselmschueler> and then it starts traversing and each time it checks for each file
01:17:31 <anselmschueler> something
01:17:46 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
01:18:00 <anselmschueler> and existentials seemed like a natural solution
01:18:04 <anselmschueler> but idk if it is anymore
01:19:13 × peterbecich quits (~Thunderbi@syn-047-229-123-186.res.spectrum.com) (Ping timeout: 248 seconds)
01:20:08 <Leary> It's not really any different from `newtype Landmark = Landmark{ prepareAndCheck :: FilePath -> IO Check }`.
01:20:47 olivial joins (~benjaminl@user/benjaminl)
01:22:05 × notdabs quits (~Owner@2600:1700:69cf:9000:9c7c:26a2:e9ed:cf3a) (Read error: Connection reset by peer)
01:22:31 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 244 seconds)
01:33:32 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
01:34:08 <EvanR> there's usually a way to reword your datatype so that existentials, and sometimes higher rank types aren't required
01:34:42 <EvanR> alternatively with higher rank polymorphism, you can make data types not required
01:34:56 <EvanR> whatever is more convenient
01:35:14 ljdarj1 joins (~Thunderbi@user/ljdarj)
01:35:43 × Googulator quits (~Googulato@2a01-036d-0106-01d5-c415-995d-99e3-7810.pool6.digikabel.hu) (Quit: Client closed)
01:36:00 Googulator joins (~Googulato@2a01-036d-0106-01d5-c415-995d-99e3-7810.pool6.digikabel.hu)
01:37:22 × ljdarj quits (~Thunderbi@user/ljdarj) (Ping timeout: 248 seconds)
01:37:22 ljdarj1 is now known as ljdarj
01:38:39 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 268 seconds)
01:41:02 aetepe joins (~aetepe@188.119.58.34)
01:44:12 × anselmschueler quits (~quassel@user/schuelermine) (Ping timeout: 268 seconds)
01:45:59 × aetepe quits (~aetepe@188.119.58.34) (Ping timeout: 260 seconds)
01:49:19 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
01:53:57 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 248 seconds)
01:56:09 weary-traveler joins (~user@user/user363627)
01:59:24 × ljdarj quits (~Thunderbi@user/ljdarj) (Quit: ljdarj)
02:03:48 × gmg quits (~user@user/gehmehgeh) (Remote host closed the connection)
02:03:54 × jmcantrell quits (~weechat@user/jmcantrell) (Quit: WeeChat 4.6.0)
02:04:32 gmg joins (~user@user/gehmehgeh)
02:04:39 jmcantrell joins (~weechat@user/jmcantrell)
02:04:48 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
02:05:20 xff0x joins (~xff0x@fsb6a9491c.tkyc517.ap.nuro.jp)
02:11:38 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 245 seconds)
02:17:39 werneta joins (~werneta@syn-071-083-160-242.res.spectrum.com)
02:22:51 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
02:27:50 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 252 seconds)
02:38:36 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
02:39:54 aetepe joins (~aetepe@188.119.58.34)
02:43:30 ensyde joins (~ensyde@2601:5c6:c200:6dc0::8955)
02:43:38 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 244 seconds)
02:44:44 × aetepe quits (~aetepe@188.119.58.34) (Ping timeout: 260 seconds)
02:51:13 × tomku quits (~tomku@user/tomku) (Ping timeout: 245 seconds)
02:51:24 <haskellbridge> <Bowuigi> EvanR programming with rank N stuff only can be annoying sometimes, specially on a total system
02:51:28 tomku joins (~tomku@user/tomku)
02:52:16 <haskellbridge> <Bowuigi> Mendler-style recursion schemes are fantastic though, if only there was a way to get histomorphisms working on a total setting...
02:54:22 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
02:55:33 aetepe joins (~aetepe@188.119.58.34)
02:59:06 LainExperiments joins (~LainExper@user/LainExperiments)
02:59:22 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 252 seconds)
03:00:02 × aetepe quits (~aetepe@188.119.58.34) (Ping timeout: 248 seconds)
03:02:48 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
03:07:24 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 244 seconds)
03:11:17 aetepe joins (~aetepe@188.119.58.34)
03:12:19 × tromp quits (~textual@2001:1c00:3487:1b00:f8c0:4558:f838:6f52) (Ping timeout: 260 seconds)
03:13:23 × LainExperiments quits (~LainExper@user/LainExperiments) (Quit: Client closed)
03:14:36 emmanuelux_ joins (~emmanuelu@user/emmanuelux)
03:16:05 × emmanuelux quits (~emmanuelu@user/emmanuelux) (Ping timeout: 268 seconds)
03:16:15 × aetepe quits (~aetepe@188.119.58.34) (Ping timeout: 276 seconds)
03:17:35 <haskellbridge> <thirdofmay18081814goya> what exactly is a higher-order effect that algebraic effects can't handle?
03:17:51 <haskellbridge> <thirdofmay18081814goya> is it an effect that takes another effect? something like "Effect a -> Effect b"?
03:18:33 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
03:21:33 LainExperiments joins (~LainExper@user/LainExperiments)
03:23:25 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 244 seconds)
03:34:20 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
03:38:59 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 260 seconds)
03:39:10 <Leary> thirdofmay: `data Catch e m a where Catch :: m a -> (e -> m a) -> Catch e m a`. The effect `runCatchEM :: forall a. Catch E M (M a) -> M a` is a higher order effect because `Catch` needs to know about `M`, and it isn't algebraic because `runCatch c >>= k /= runCatch (c <&> (>>= k))`.
03:40:00 LainExperiments3 joins (LainExperi@user/LainExperiments)
03:41:15 <jackdk> Is LainExperiments serially-numbered?
03:42:06 × LainExperiments quits (~LainExper@user/LainExperiments) (Ping timeout: 240 seconds)
03:45:08 <haskellbridge> <thirdofmay18081814goya> Leary: I see! thanks a lot for the comment!
03:46:52 <EvanR> I had to look at join parts to get that one
03:49:31 <haskellbridge> <Liamzee> are people doing much with civilian linear types these days?
03:49:52 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
03:56:39 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 260 seconds)
03:57:12 <haskellbridge> <Liamzee> i still feel bad about not writing a linearly typed growable vector lib, because it wouldn't have been any good
03:58:15 <jackdk> Axman6 and I have a half-done port of streaming-bytestring to linear types but never finished it
03:58:44 <Axman6> We should finish that
03:59:17 <Axman6> I feel like there wasn't all that much left
03:59:44 <EvanR> https://hackage.haskell.org/package/linear-base-0.4.0/docs/Data-Vector-Mutable-Linear.html
04:03:00 <Axman6> Is there a linear state monad or something that can make passing around linear values a little nicer?
04:06:28 <jackdk> https://hackage.haskell.org/package/linear-base-0.4.0/docs/Control-Functor-Linear.html#g:4 Not the module I would've expected
04:07:56 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
04:09:10 <haskellbridge> <Liamzee> oh, i never realized that linear base had dynamic vectors, only mutable ones
04:10:00 <EvanR> there is also a destination array thing in there
04:10:43 <Leary> thirdofmay: Err, I guess that should have been `data Catch e m a where Catch :: m x -> (Either e x -> a) -> Catch e m a`, which probably clarifies the rest of what I said.
04:12:21 aetepe joins (~aetepe@188.119.58.34)
04:13:01 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 244 seconds)
04:14:05 <haskellbridge> <Liamzee> but no one has built a linearly typed webserver and put it on hackage?
04:16:49 <haskellbridge> <Liamzee> fun recent linear types:
04:16:50 <haskellbridge> <Liamzee> https://hackage.haskell.org/package/text-builder-linear
04:16:54 <haskellbridge> <Liamzee> by bodigrim
04:17:03 × aetepe quits (~aetepe@188.119.58.34) (Ping timeout: 245 seconds)
04:18:36 × LainExperiments3 quits (LainExperi@user/LainExperiments) (Quit: Client closed)
04:19:40 <EvanR> it's not linearly typed but it does do the thing everyone thinks linear types are for http://www.impredicative.com/ur/
04:19:49 <EvanR> Ur/Web
04:23:23 michalz joins (~michalz@185.246.207.205)
04:23:43 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
04:24:38 <haskellbridge> <thirdofmay18081814goya> does anyone know if there's a way to embed a max number of recursive calls in an arbitrary recursive function?
04:24:57 <haskellbridge> <thirdofmay18081814goya> i guess necessarily some method with recursion-schemes right
04:26:19 <haskellbridge> <thirdofmay18081814goya> the idea would be to have a recursive function whose specification is separate from the requirement that it terminates after n calls
04:26:36 <haskellbridge> <thirdofmay18081814goya> so that you can also use it without enforcing the max recursive call
04:27:26 <haskellbridge> <thirdofmay18081814goya> trivially a catamorphism whose algebra returns a pair can do this, any other ideas?
04:28:06 aetepe joins (~aetepe@188.119.58.34)
04:28:21 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 246 seconds)
04:28:46 <EvanR> this isn't doesn't "monkey patch" the way you want, but the partiality monad will let you decide elsewhere how long a recursive algorithm gets to terminate
04:29:04 <Leary> I would write `fixMaxDepth :: Int -> (a -> a) -> Maybe a`.
04:29:24 <Leary> Err, maybe not.
04:29:53 <Leary> `fixMaxDepth :: Int -> (a -> Either a b) -> Maybe b`?
04:29:55 LainExperiments joins (~LainExper@user/LainExperiments)
04:30:10 <EvanR> well, now it's nearly the partiality monad
04:30:48 × aforemny_ quits (~aforemny@2001:9e8:6cdb:6d00:dc2e:87c9:d5a9:a75) (Ping timeout: 245 seconds)
04:31:23 aforemny joins (~aforemny@i577B139C.versanet.de)
04:31:30 <haskellbridge> <thirdofmay18081814goya> i'll check out the partiality monad, thanks!
04:33:14 × aetepe quits (~aetepe@188.119.58.34) (Ping timeout: 260 seconds)
04:34:47 LainExperiments4 joins (~LainExper@user/LainExperiments)
04:36:06 × LainExperiments quits (~LainExper@user/LainExperiments) (Ping timeout: 240 seconds)
04:36:07 bitdex joins (~bitdex@gateway/tor-sasl/bitdex)
04:38:54 peterbecich joins (~Thunderbi@syn-047-229-123-186.res.spectrum.com)
04:39:30 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
04:40:52 Digitteknohippie is now known as Digit
04:44:37 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 248 seconds)
04:51:33 × haskellbridge quits (~hackager@syn-024-093-192-219.res.spectrum.com) (Ping timeout: 252 seconds)
04:53:05 Digitteknohippie joins (~user@user/digit)
04:54:07 × Digit quits (~user@user/digit) (Ping timeout: 252 seconds)
04:54:24 haskellbridge joins (~hackager@syn-024-093-192-219.res.spectrum.com)
04:54:24 ChanServ sets mode +v haskellbridge
04:55:18 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
04:55:23 × xff0x quits (~xff0x@fsb6a9491c.tkyc517.ap.nuro.jp) (Ping timeout: 245 seconds)
04:55:35 <jackdk> thirdofmay18081814goya: Hughes does this for a game tree by generating the infinite tree and then pruning it to N levels, which works because laziness
05:00:02 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 244 seconds)
05:03:49 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
05:06:30 × LainExperiments4 quits (~LainExper@user/LainExperiments) (Ping timeout: 240 seconds)
05:08:08 <haskellbridge> <thirdofmay18081814goya> jackdk: ah very neat, will check this out too, have not considered any notion of laziness so far
05:08:10 <haskellbridge> <thirdofmay18081814goya> thanks!
05:08:49 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 244 seconds)
05:10:44 × peterbecich quits (~Thunderbi@syn-047-229-123-186.res.spectrum.com) (Ping timeout: 265 seconds)
05:10:54 xff0x joins (~xff0x@fsb6a9491c.tkyc517.ap.nuro.jp)
05:12:03 × gmg quits (~user@user/gehmehgeh) (Remote host closed the connection)
05:12:45 gmg joins (~user@user/gehmehgeh)
05:13:33 LainExperiments joins (~LainExper@user/LainExperiments)
05:17:39 Digitteknohippie is now known as Digit
05:19:33 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
05:21:56 <ski> Leary : `Either e x -> a' a la "Exceptional Syntax" ?
05:22:06 <ski> EvanR : Ur has uniqueness ?
05:22:53 <EvanR> does it?
05:23:01 <ski> i dunno
05:23:10 <ski> you said "it does do the thing everyone thinks linear types are for"
05:24:07 <EvanR> memory management, or lack there of
05:24:34 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 248 seconds)
05:27:19 <ski> mhm
05:29:09 aetepe joins (~aetepe@188.119.58.34)
05:32:48 Digitteknohippie joins (~user@user/digit)
05:33:06 <Leary> ski: I'm not familiar with the paper. I pulled that `data Catch` out of my arse, though it may have been inspired by 'A Framework for Higher-Order Effects & Handlers'.
05:33:37 × aetepe quits (~aetepe@188.119.58.34) (Ping timeout: 244 seconds)
05:34:13 × Digit quits (~user@user/digit) (Ping timeout: 268 seconds)
05:35:20 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
05:36:40 Digitteknohippie is now known as Digit
05:41:03 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 252 seconds)
05:44:35 × ChaiTRex quits (~ChaiTRex@user/chaitrex) (Remote host closed the connection)
05:46:08 ChaiTRex joins (~ChaiTRex@user/chaitrex)
05:46:09 takuan joins (~takuan@d8D86B601.access.telenet.be)
05:51:54 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
05:53:14 Square joins (~Square@user/square)
05:57:08 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 265 seconds)
05:57:19 × weary-traveler quits (~user@user/user363627) (Remote host closed the connection)
05:58:01 <ski> Leary : "Exceptional Syntax" by Nick Benton,Andrew Kennedy in 2001 at <https://www.microsoft.com/en-us/research/wp-content/uploads/2016/02/exceptionalsyntax.pdf> (<http://lambda-the-ultimate.org/node/1193)
05:58:19 nvoid joins (~nvoid@2601:140:8700:25fe:5820:136c:b0ce:f5b1)
05:59:07 <ski> basically argues for (in Haskell terms) `catchBind :: Exception e => IO a -> (e -> IO b) -> (a -> IO b) -> IO b' being more appropriate as a primitive, than `catch :: Exception e => IO a -> (e -> IO a) -> IO a'
05:59:40 <ski> one reason being tail calls
06:04:46 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
06:05:47 × nvoid quits (~nvoid@2601:140:8700:25fe:5820:136c:b0ce:f5b1) (Quit: nvoid)
06:09:40 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 252 seconds)
06:10:06 × LainExperiments quits (~LainExper@user/LainExperiments) (Ping timeout: 240 seconds)
06:10:32 <sim590> Consider the following problem: https://projecteuler.net/problem=32. Which I have solved. My algorithm uses some math analysis to determine an upper bound for the search space. Anyway, I use the following function to recognize a pandigital triplet: https://paste.debian.net/1365804/. Using this function, my algorithms gave me the right answer. Then, I decided to rewrite the function a bit to make
06:10:34 <sim590> it simpler. I rewrote it to https://paste.debian.net/1365805/. I don't understand why, but now my whole algorithme doesn't give me the right answer anymore.
06:12:49 <sim590> To me, I thought that the second version made more sense... I'm now doubting if I accidently got the right answer because of a bad upper bound and a bad algorithm... lol
06:16:51 × rvalue quits (~rvalue@user/rvalue) (Read error: Connection reset by peer)
06:17:23 rvalue joins (~rvalue@user/rvalue)
06:19:09 LainExperiments joins (~LainExper@user/LainExperiments)
06:20:34 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
06:20:57 <sim590> The funny thing is with the first function, the algorithm executes in 280 seconds while with the second function, it executes in 420 seconds... (it's by now means optimal, I tried a brute force approach with the help of an upper bound)
06:22:51 × emmanuelux_ quits (~emmanuelu@user/emmanuelux) (Read error: Connection reset by peer)
06:23:49 <sim590> Ah. I get it. The second version doesn't take into account repeating numbers while the Set approach took care of that.
06:24:46 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 244 seconds)
06:24:49 × hattckory quits (~hattckory@bras-base-toroon4524w-grc-30-70-27-118-207.dsl.bell.ca) (Ping timeout: 248 seconds)
06:30:14 aetepe joins (~aetepe@188.119.58.34)
06:30:52 <Leary> thirdofmay: I might be beating a dead horse at this point, but there are some details I kinda bungled due to algebraicity depending on precisely how on operation is expressed (and I prefer to fix these things). `catch :: M a -> (E -> M a) -> M a` naively becomes `catch :: Sig_Catch (M a) -> M a` with `Sig_Catch r = (r, E -> r)` which /isn't/ algebraic, but the last `data Catch` I wrote has a `runCatch` that actually /is/. That's because I cheated and us
06:30:53 <Leary> ed `try` disguised as `catch`: `M a -> M (Either E a)` ~ `M a -> Codensity M (Either E a)` ~ `M a -> (Either E a -> M b) -> M b` ~ `Sig_Try (M b) -> M b` where `Sig_Try r = (M a, Either E a -> r)`.
06:31:40 hattckory joins (~hattckory@70.27.118.207)
06:33:50 <Leary> ski: I see. Those tail calls and algebraicity are probably related.
06:34:57 × aetepe quits (~aetepe@188.119.58.34) (Ping timeout: 248 seconds)
06:35:57 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
06:41:00 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 244 seconds)
06:43:22 × echoreply quits (~echoreply@2001:19f0:9002:1f3b:5400:ff:fe6f:8b8d) (Quit: WeeChat 2.8)
06:43:55 echoreply joins (~echoreply@45.32.163.16)
06:43:59 Digitteknohippie joins (~user@user/digit)
06:45:13 × Digit quits (~user@user/digit) (Ping timeout: 252 seconds)
06:48:50 <haskellbridge> <thirdofmay18081814goya> Leary: am parsing these comments, thanks for the answer!
06:51:45 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
06:56:09 × hattckory quits (~hattckory@70.27.118.207) (Ping timeout: 260 seconds)
06:58:18 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 245 seconds)
07:00:00 × caconym quits (~caconym@user/caconym) (Quit: bye)
07:01:02 caconym joins (~caconym@user/caconym)
07:03:08 Digitteknohippie is now known as Digit
07:05:36 aetepe joins (~aetepe@188.119.58.34)
07:05:46 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
07:10:15 × aetepe quits (~aetepe@188.119.58.34) (Ping timeout: 276 seconds)
07:10:32 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 252 seconds)
07:15:55 × Lord_of_Life quits (~Lord@user/lord-of-life/x-2819915) (Ping timeout: 244 seconds)
07:15:59 × ensyde quits (~ensyde@2601:5c6:c200:6dc0::8955) (Ping timeout: 260 seconds)
07:17:48 ensyde joins (~ensyde@2601:5c6:c200:6dc0::6f7f)
07:18:43 × jmcantrell quits (~weechat@user/jmcantrell) (Ping timeout: 244 seconds)
07:19:11 × ft quits (~ft@p508db463.dip0.t-ipconnect.de) (Quit: leaving)
07:19:25 Lord_of_Life joins (~Lord@user/lord-of-life/x-2819915)
07:21:32 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
07:26:39 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 260 seconds)
07:30:06 × LainExperiments quits (~LainExper@user/LainExperiments) (Quit: Client closed)
07:31:37 ash3en joins (~Thunderbi@ip1f10cbd6.dynamic.kabel-deutschland.de)
07:33:39 wootehfoot joins (~wootehfoo@user/wootehfoot)
07:37:21 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
07:42:14 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 260 seconds)
07:44:16 × connrs quits (~connrs@user/connrs) (Quit: ZNC 1.9.1 - https://znc.in)
07:52:39 × ash3en quits (~Thunderbi@ip1f10cbd6.dynamic.kabel-deutschland.de) (Ping timeout: 265 seconds)
07:53:18 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
07:54:35 × L29Ah quits (~L29Ah@wikipedia/L29Ah) (Read error: Connection timed out)
07:56:56 acidjnk joins (~acidjnk@p200300d6e71c4f71c835c1b6e3010b6c.dip0.t-ipconnect.de)
07:58:11 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 252 seconds)
08:00:15 lortabac joins (~lortabac@2a01:e0a:541:b8f0:55ab:e185:7f81:54a4)
08:00:19 connrs joins (~connrs@user/connrs)
08:02:36 CiaoSen joins (~Jura@2a02:8071:64e1:da0:5a47:caff:fe78:33db)
08:04:51 developer_ joins (~developer@85.50.149.196)
08:06:46 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
08:07:14 vpan joins (~vpan@212.117.1.172)
08:11:39 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 245 seconds)
08:12:06 × Googulator quits (~Googulato@2a01-036d-0106-01d5-c415-995d-99e3-7810.pool6.digikabel.hu) (Ping timeout: 240 seconds)
08:14:37 auri joins (~auri@fsf/member/auri)
08:21:30 __monty__ joins (~toonn@user/toonn)
08:22:34 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
08:29:29 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 260 seconds)
08:33:44 × econo_ quits (uid147250@id-147250.tinside.irccloud.com) (Quit: Connection closed for inactivity)
08:40:37 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
08:43:44 sord937 joins (~sord937@gateway/tor-sasl/sord937)
08:44:54 × sprout quits (~sprout@84-80-106-227.fixed.kpn.net) (Ping timeout: 246 seconds)
08:45:30 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 252 seconds)
08:52:36 × Sgeo quits (~Sgeo@user/sgeo) (Read error: Connection reset by peer)
08:53:26 hattckory joins (~hattckory@bras-base-toroon4524w-grc-30-70-27-118-207.dsl.bell.ca)
08:56:23 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
08:58:09 × hattckory quits (~hattckory@bras-base-toroon4524w-grc-30-70-27-118-207.dsl.bell.ca) (Ping timeout: 276 seconds)
08:58:57 <haskellbridge> <Liamzee> also, Axman6
08:58:58 <haskellbridge> <Liamzee> https://media.discordapp.net/attachments/968989726633779215/1355089415214465144/image.png?ex=67e7a8dc&is=67e6575c&hm=c6a608fb0a4529004be2bd4ee61b350e88d825a2d5cbbfada84b9841929023db&=&format=webp&quality=lossless&width=2548&height=1212
08:59:25 lxsameer joins (~lxsameer@Serene/lxsameer)
09:01:44 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 260 seconds)
09:02:23 ash3en joins (~Thunderbi@185.209.196.192)
09:06:17 sprout joins (~sprout@84-80-106-227.fixed.kpn.net)
09:07:46 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
09:10:15 × sord937 quits (~sord937@gateway/tor-sasl/sord937) (Remote host closed the connection)
09:10:35 sord937 joins (~sord937@gateway/tor-sasl/sord937)
09:11:08 aetepe joins (~aetepe@188.119.58.34)
09:12:33 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 246 seconds)
09:15:20 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
09:17:20 × sord937 quits (~sord937@gateway/tor-sasl/sord937) (Quit: sord937)
09:18:14 Googulator joins (~Googulato@81.183.235.203)
09:18:43 × tzh quits (~tzh@c-76-115-131-146.hsd1.or.comcast.net) (Quit: zzz)
09:19:36 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 252 seconds)
09:25:05 fp joins (~Thunderbi@130.233.70.95)
09:25:16 × Googulator quits (~Googulato@81.183.235.203) (Quit: Client closed)
09:25:29 Googulator joins (~Googulato@81.183.235.203)
09:25:46 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
09:27:00 tromp joins (~textual@2001:1c00:3487:1b00:6095:11f3:6fa5:fb3d)
09:27:01 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Read error: Connection reset by peer)
09:28:34 merijn joins (~merijn@77.242.116.146)
09:28:51 × Square quits (~Square@user/square) (Remote host closed the connection)
09:31:59 sord937 joins (~sord937@gateway/tor-sasl/sord937)
09:38:27 chele joins (~chele@user/chele)
09:43:41 × j1n37 quits (~j1n37@user/j1n37) (Ping timeout: 244 seconds)
09:44:25 j1n37 joins (~j1n37@user/j1n37)
09:44:54 alp joins (~alp@2001:861:8ca0:4940:97d8:ee2c:4105:6ce6)
09:48:20 × sord937 quits (~sord937@gateway/tor-sasl/sord937) (Remote host closed the connection)
09:48:39 sord937 joins (~sord937@gateway/tor-sasl/sord937)
09:53:25 × arahael quits (~arahael@user/arahael) (Ping timeout: 248 seconds)
09:53:28 × sord937 quits (~sord937@gateway/tor-sasl/sord937) (Remote host closed the connection)
09:53:48 sord937 joins (~sord937@gateway/tor-sasl/sord937)
09:54:41 tabaqui joins (~tabaqui@167.71.80.236)
09:55:48 × CiaoSen quits (~Jura@2a02:8071:64e1:da0:5a47:caff:fe78:33db) (Ping timeout: 245 seconds)
09:56:46 × j1n37 quits (~j1n37@user/j1n37) (Read error: Connection reset by peer)
09:56:54 × Googulator quits (~Googulato@81.183.235.203) (Quit: Client closed)
09:57:12 Googulator joins (~Googulato@81.183.235.203)
09:58:17 wildsalander joins (~wildsalan@47.red-80-29-238.dynamicip.rima-tde.net)
09:58:42 × wildsalander quits (~wildsalan@47.red-80-29-238.dynamicip.rima-tde.net) (Client Quit)
09:59:58 j1n37 joins (~j1n37@user/j1n37)
10:01:08 Square joins (~Square@user/square)
10:04:02 × xff0x quits (~xff0x@fsb6a9491c.tkyc517.ap.nuro.jp) (Ping timeout: 248 seconds)
10:06:29 ljdarj joins (~Thunderbi@user/ljdarj)
10:17:15 dhil joins (~dhil@2a0c:b381:52e:3600:cbb4:807:319f:c7af)
10:21:52 CiaoSen joins (~Jura@2a02:8071:64e1:da0:5a47:caff:fe78:33db)
10:25:42 × pavonia quits (~user@user/siracusa) (Quit: Bye!)
10:26:18 × tt12310978324354 quits (~tt1231@2603:6010:8700:4a81:219f:50d3:618a:a6ee) (Quit: The Lounge - https://thelounge.chat)
10:27:20 tt12310978324354 joins (~tt1231@2603:6010:8700:4a81:219f:50d3:618a:a6ee)
10:28:12 <haskellbridge> <Morj> I've been playing around with using texinfo as a target for structured docs of haddock and other tools. Here's the unstyled result: https://morj.men/ron_html/Quick-start.html and the hackage page for comparison: https://hackage.haskell.org/package/ron-hs-0.4.0/docs/Data-Ron.html
10:29:33 <haskellbridge> <Morj> It's fun to see how much importance the creators of texinfo placed on the printed material, compared to now where I want options for easier hierarchy (like a module has classes, classes have functions and implementors, all hyperlinked). This forced me to use '@node' everywhere which inserts a page break
10:31:07 <haskellbridge> <Morj> I also wouldn't call it good for hyperlinked manuals: the dichotomy how there is a node hierarchy, and a chapter-subchapter hierarchy is weird, plus there isn't even an option to make the table of contents automatically
10:31:25 <haskellbridge> <Morj> But this was fun, thanks to someone from here for telling me of this format
10:42:18 × ash3en quits (~Thunderbi@185.209.196.192) (Ping timeout: 265 seconds)
10:49:49 × Square quits (~Square@user/square) (Ping timeout: 244 seconds)
10:53:49 <haskellbridge> <Liamzee> wait, what?
10:53:51 <haskellbridge> <Liamzee> https://hackage.haskell.org/package/linear-base-0.4.0/docs/src/Data.List.Linear.html#take
10:53:55 <haskellbridge> <Liamzee> look at the take function, why is it like this?
10:56:45 ash3en joins (~Thunderbi@185.209.196.192)
11:00:06 L29Ah joins (~L29Ah@wikipedia/L29Ah)
11:15:01 × ensyde quits (~ensyde@2601:5c6:c200:6dc0::6f7f) (Ping timeout: 248 seconds)
11:18:08 × lortabac quits (~lortabac@2a01:e0a:541:b8f0:55ab:e185:7f81:54a4) (Ping timeout: 272 seconds)
11:20:48 × ljdarj quits (~Thunderbi@user/ljdarj) (Ping timeout: 245 seconds)
11:20:50 ubert1 joins (~Thunderbi@2a02:8109:ab8a:5a00:7d86:d0e8:c2d1:2ee3)
11:26:49 × acidjnk quits (~acidjnk@p200300d6e71c4f71c835c1b6e3010b6c.dip0.t-ipconnect.de) (Ping timeout: 252 seconds)
11:27:44 × ash3en quits (~Thunderbi@185.209.196.192) (Ping timeout: 265 seconds)
11:36:37 <haskellbridge> <jv> Liamzee: i remember having it done beautifully on this channel (or maybe #haskell-beginners). should be in the logs from about 6 years ago
11:36:54 <haskellbridge> <jv> or so
11:36:55 <jackdk> Because if you have [a] %1 -> b, then you need to do away with the entire list, not just the prefix that you take
11:37:36 <haskellbridge> <jv> under a different nick though
11:38:07 JuanDaugherty joins (~juan@user/JuanDaugherty)
11:39:18 × Googulator quits (~Googulato@81.183.235.203) (Ping timeout: 240 seconds)
11:57:13 × aetepe quits (~aetepe@188.119.58.34) (Ping timeout: 265 seconds)
11:57:24 lortabac joins (~lortabac@2a01:e0a:541:b8f0:55ab:e185:7f81:54a4)
11:57:35 tremon joins (~tremon@83.80.159.219)
11:58:00 × fp quits (~Thunderbi@130.233.70.95) (Ping timeout: 252 seconds)
11:59:04 aetepe joins (~aetepe@188.119.58.34)
11:59:56 × CiaoSen quits (~Jura@2a02:8071:64e1:da0:5a47:caff:fe78:33db) (Ping timeout: 272 seconds)
12:00:52 <tomsmeding> Liamzee: in other words, that `lseq` is actually doing something, see its definition and the Consumable class
12:03:30 ljdarj joins (~Thunderbi@user/ljdarj)
12:03:51 × merijn quits (~merijn@77.242.116.146) (Ping timeout: 252 seconds)
12:04:31 fp joins (~Thunderbi@130.233.70.95)
12:10:58 × bitdex quits (~bitdex@gateway/tor-sasl/bitdex) (Quit: = "")
12:16:53 acidjnk joins (~acidjnk@p200300d6e71c4f71c835c1b6e3010b6c.dip0.t-ipconnect.de)
12:17:01 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
12:22:53 Googulator joins (~Googulato@81.183.235.203)
12:23:48 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 265 seconds)
12:28:36 <__monty__> I thought `%1 ->` meant at most once, not exactly once?
12:29:23 × tromp quits (~textual@2001:1c00:3487:1b00:6095:11f3:6fa5:fb3d) (Quit: My iMac has gone to sleep. ZZZzzz…)
12:33:59 <yushyin> i think it is exactly once
12:35:18 × Googulator quits (~Googulato@81.183.235.203) (Ping timeout: 240 seconds)
12:35:22 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
12:35:56 ft joins (~ft@p508db463.dip0.t-ipconnect.de)
12:37:58 <tomsmeding> __monty__: it means exactly once. At most once would be an "affine" arrow, not a "linear" one, I think, in the prevailing jargon
12:40:36 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 244 seconds)
12:43:24 × zungi quits (~tory@user/andrewchawk) (Ping timeout: 264 seconds)
12:43:42 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
12:44:27 <__monty__> In what context is it important to consume the argument? Limiting to once is easier to reason about, side-effects are a good reason for example.
12:47:14 Googulator joins (~Googulato@81.183.235.203)
12:48:06 zungi joins (~tory@user/andrewchawk)
12:48:21 <vpan> hi, `foldMapM` from GHC.Utils.Monad seems useful (found it on hoogle), but calling something from the compiler's namespace feels wrong. There must be a reason those functions aren't in base. Is my intuition correct that typical applications (that don't process Haskell code) should stay away from GHC.*?
12:51:03 <__monty__> I think the reason not to use the GHC modules is the size of the package.
12:52:50 × Unicorn_Princess quits (~Unicorn_P@user/Unicorn-Princess/x-3540542) (Remote host closed the connection)
12:54:36 <__monty__> @hoogle foldrM
12:54:37 <lambdabot> Data.Foldable foldrM :: (Foldable t, Monad m) => (a -> b -> m b) -> b -> t a -> m b
12:54:37 <lambdabot> Data.Vector.Fusion.Bundle.Monadic foldrM :: Monad m => (a -> b -> m b) -> b -> Bundle m v a -> m b
12:54:37 <lambdabot> Data.Vector.Fusion.Stream.Monadic foldrM :: Monad m => (a -> b -> m b) -> b -> Stream m a -> m b
12:54:45 <__monty__> That does seem similar.
12:54:54 <Leary> :t (getAp .) . foldMap . (Ap .)
12:54:55 <lambdabot> forall k (t :: * -> *) (f :: k -> *) (a1 :: k) a2. (Foldable t, Monoid (Ap f a1)) => (a2 -> f a1) -> t a2 -> f a1
12:57:30 hattckory joins (~hattckory@bras-base-toroon4524w-grc-30-70-27-118-207.dsl.bell.ca)
12:57:37 weary-traveler joins (~user@user/user363627)
12:58:44 × chele quits (~chele@user/chele) (Remote host closed the connection)
13:01:18 <vpan> thanks for the hints. The trick using `Ap` looks cool. :)
13:03:41 <tomsmeding> __monty__: if you require linearity, you can use linear types as a memory management system. Opened files need to be closed, allocated arrays need to be freed; if you have affine arrows only, you still need a GC to clean them up
13:04:49 × hattckory quits (~hattckory@bras-base-toroon4524w-grc-30-70-27-118-207.dsl.bell.ca) (Ping timeout: 260 seconds)
13:04:52 <tomsmeding> in that sense, linear arrows are "more general": they allow expressing safe APIs for more kinds of resources (i.e. ones that need to be closed/freed/... -- i.e. "consumed" -- at a predictable time)
13:05:30 <__monty__> And `free` is the only possible operation that consumes consumes an array without producing one?
13:05:32 <tomsmeding> I guess with affine arrows you can still opt-in to explicit consumption as the user, but with linear arrows, the API designer can _require_ explicit consumption
13:05:53 <tomsmeding> well, that depends on the API
13:05:57 <tomsmeding> for arrays, kind of?
13:06:16 <tomsmeding> though sometimes it comes in a different guise, like `toList :: Array a -> [a]`
13:06:25 <tomsmeding> er, `toList :: Array a %1-> [a]`, of course
13:06:35 <tomsmeding> (I hate the visuals of that %1-> syntax.)
13:07:04 <__monty__> Yeah, bring back the lollipop.
13:07:20 <tomsmeding> or hell, if you don't want letters in a symbol, do -%> or something
13:08:01 <tomsmeding> originally the syntax allowed multiplicity polymorphism, where you could have `forall p. a %p-> b`, but IIRC ghc doesn't currently implement that or something
13:08:22 <__monty__> How about array indexing? It'd be pretty inconvenient if that had to free the array.
13:08:53 <tomsmeding> oh, apparently ghc does support multiplicity polymorphism
13:09:12 <tomsmeding> __monty__: I suggest you peruse this page :) https://hackage.haskell.org/package/linear-base-0.4.0/docs/Data-Array-Mutable-Linear.html#v:get
13:09:31 <tomsmeding> % :seti -XLinearTypes
13:09:31 <yahb2> <no output>
13:09:39 <tomsmeding> % foo :: forall a b p. (a %p-> b) -> a %p-> b ; foo g x = g x
13:09:39 <yahb2> <no output>
13:09:55 × JuanDaugherty quits (~juan@user/JuanDaugherty) (Quit: praxis.meansofproduction.biz (juan@acm.org))
13:09:56 <__monty__> Is it still all smoke and mirrors or does linear data actually get allocated/freed outside of the GCed memory?
13:09:58 <tomsmeding> % :seti -fprint-explicit-foralls
13:09:58 <yahb2> <no output>
13:10:01 <tomsmeding> % :t foo
13:10:01 <yahb2> foo ; :: forall a b (p :: GHC.Types.Multiplicity). ; (a %p -> b) -> a %p -> b
13:10:54 <tomsmeding> __monty__: I think for this module, it's indeed smoke and mirrors, as you say
13:11:06 <tomsmeding> as in: you do get the advantage that the array can be used outside of IO or ST
13:11:15 <tomsmeding> but indeed the strict linearity is inessential
13:12:41 <Leary> __monty__: GHC doesn't do any magic for you, it gives you the tools to create safe interfaces over your own manually allocated/freed data.
13:12:52 <tomsmeding> ^
13:12:56 × malte quits (~malte@mal.tc) (Ping timeout: 244 seconds)
13:13:53 <tomsmeding> not unlikely that for arrays, allocating the array itself outside of the GC'd heap would be counterproductive, because if it's a boxed array then you'd have to register all the contained pointers as additional GC roots anyway, and it's not boxed then the GC spends only O(1) time on it
13:17:18 jacopovalanzano joins (~jacopoval@cpc151911-cove17-2-0-cust105.3-1.cable.virginm.net)
13:17:21 <jacopovalanzano> o/
13:21:00 × paotsaq quits (~paotsaq@127.209.37.188.rev.vodafone.pt) (Ping timeout: 272 seconds)
13:21:56 malte joins (~malte@mal.tc)
13:26:29 agentultra joins (~user@104-195-156-122.cpe.teksavvy.com)
13:29:12 <agentultra> i'm trying to compile a static executable with `cabal -v build --enable-static --enable-executable-static` but I am finding that theres a build step that fails as cabal seems to be passing `-dynamic` and `-shared` regardless. anyone have links to a guide on how to get cabal to build statically-linked executables?
13:30:40 <tomsmeding> agentultra: https://cs-syd.eu/posts/2024-04-20-static-linking-haskell-nix or https://hasufell.github.io/posts/2024-04-21-static-linking.html perhaps
13:31:11 <agentultra> thanks tomsmeding
13:31:21 <tomsmeding> agentultra: I'm assuming here that you're talking about statically-linking _system_ dependencies, not haskell dependencies
13:31:39 <tomsmeding> haskell dependencies are already linked statically by default, except (essentially) on Arch Linux system GHCs
13:33:17 <tomsmeding> (PSA: if you're on arch linux, as always but especially for you, please use ghcup and not the GHC from the system package manager)
13:34:43 <agentultra> yes. i'm linking in a shared object file that seems to be compiled in a funny way... when i link dynamically, I get a relink error from `sin` from the shared object. it seems to conflict with GHC's dynamically link with libm. I'm trying to statically link to see if that resolves the issue.
13:35:50 hattckory joins (~hattckory@bras-base-toroon4524w-grc-30-70-27-118-207.dsl.bell.ca)
13:36:08 <tomsmeding> agentultra: what exactly is that relink error?
13:36:21 <tomsmeding> compiling haskell programs statically is a bit of a rabbit hole, as you can see from those posts
13:37:06 <agentultra> It's a bit long: /home/jking/Projects/tigerbeetle-hs/dist-newstyle/build/x86_64-linux/ghc-9.6.6/tigerbeetle-hs-0.1.0.0/x/tigerbeetle-hs/build/tigerbeetle-hs/tigerbeetle-hs: Relink `/nix/store/x3v27x8fz9di2nv2j91xgsypvxgy34g9-libtb_client/lib/libtb_client.so' with `/nix/store/h7zcxabfxa7v5xdna45y2hplj31ncf8a-glibc-2.40-36/lib/libm.so.6' for IFUNC symbol `sin'
13:37:13 ash3en joins (~Thunderbi@185.209.196.192)
13:37:43 tomsmeding has never seen that particular error phrasing before
13:37:58 <tomsmeding> if you're using nix already anyway, though, getting a static link _may_ be easy enough
13:38:04 tomsmeding doesn't use nix
13:38:10 ystael joins (~ystael@user/ystael)
13:38:31 <agentultra> i'm learning nix as I go here myself :D
13:38:57 <agentultra> but I'm mostly just using it to create the developer shell and compiling like normal with cabal
13:39:01 <tomsmeding> my first step in debugging this would be to check how that libtb_client.so refers to 'sin', first by running `nm` on it and if necessary perhaps with objdump
13:39:07 <tomsmeding> ah
13:40:18 × developer_ quits (~developer@85.50.149.196) (Ping timeout: 252 seconds)
13:40:21 × robobub quits (uid248673@id-248673.uxbridge.irccloud.com) (Quit: Connection closed for inactivity)
13:40:54 × hattckory quits (~hattckory@bras-base-toroon4524w-grc-30-70-27-118-207.dsl.bell.ca) (Ping timeout: 276 seconds)
13:42:25 <tomsmeding> agentultra: bit of a shot in the dark: what happens if you don't put only `libtb_client` in your extra-libraries, but also `m`?
13:43:32 <tomsmeding> but also output of `ldd /nix/store/x3v27x8fz9di2nv2j91xgsypvxgy34g9-libtb_client/lib/libtb_client.so` might be helpful
13:43:36 random-jellyfish joins (~developer@user/random-jellyfish)
13:44:45 <agentultra> yeah, so the symbol for `sin` from that library is listed as a W,F (Warning/Normal, Function)
13:45:16 <yushyin> agentultra: can't hurt to also ask in #haskell:nixos.org (matrix room) in case you suspect a nix-related issue
13:45:21 <agentultra> and ldd says it's linked with linux-vdso, libpthread, libc.so.6... but not libm
13:45:49 <tomsmeding> agentultra: "W" is weak, not warning
13:45:59 <agentultra> ah right, my b
13:46:14 <tomsmeding> do try also telling ghc to link with libm
13:46:24 <agentultra> a dynamically linked GHC executable does dynamically link with libm
13:46:26 <tomsmeding> (as I suggested a few lines above)
13:46:32 <tomsmeding> oh
13:46:42 <agentultra> ah k, i'll double check that
13:47:15 chele joins (~chele@user/chele)
13:51:02 tromp joins (~textual@2001:1c00:3487:1b00:6095:11f3:6fa5:fb3d)
13:55:38 jespada joins (~jespada@2800:a4:2225:2c00:21b7:d8ab:6242:25ba)
14:01:46 <agentultra> yeah, shot in the dark doesn't change anything... the executable is still dynamically linked with libm.so.6, the libtb_client.so file is not. So the "relink" issue, as I understand it, is because that library's symbol table is looking for the implementation of that function which is conflicting with one already defined globally by the executable?
14:02:25 × malte quits (~malte@mal.tc) (Ping timeout: 248 seconds)
14:02:31 <tomsmeding> I _think_ the error is saying that you need to re-link libtb_client.so with libm.so
14:02:48 <tomsmeding> that it to say, it's not an observation that a re-link is happening, it's an instruction to change libtb_client.so
14:03:18 <tomsmeding> your "it's a bit long" is also funny because in fact the error was really short: _despite_ very long paths, it still fit in a single IRC message
14:03:38 <tomsmeding> which is typical for linker errors, unfortunately: concise to the point of incomprehensibility
14:03:54 <agentultra> true! :D
14:04:23 <tomsmeding> so my feeling (!) is that there is no conflict at all, and that instead, the symbol 'sin' is _missing_ somehow
14:04:29 <tomsmeding> but I don't know enough here
14:05:12 <agentultra> it gives me some ideas though, so thanks for sounding off with me
14:05:34 <tomsmeding> also try linking that libtb_client.so with a simple C file
14:05:39 <tomsmeding> just with plain gcc
14:08:13 × ash3en quits (~Thunderbi@185.209.196.192) (Ping timeout: 244 seconds)
14:08:18 malte joins (~malte@mal.tc)
14:09:24 toby-bro joins (~toby-bro@user/toby-bro)
14:14:35 <hellwolf> what's the alternative to "replicateM constant" where I can pattern matching. Pattern matching the list is not as convenient, as far as I can tell.
14:15:02 <hellwolf> say `replicateN 2 mb >>= \(x1, x2) -> _`
14:17:22 notdabs joins (~Owner@2600:1700:69cf:9000:a99a:9123:20e6:65c6)
14:22:38 <mauke> :t replicateM 2 ?mb >>= \[x1, x2] -> ?result
14:22:38 <lambdabot> (Monad m, ?mb::m a, ?result::m b) => m b
14:27:29 <hellwolf> maybe my skill issue, but I don't like pattermatching these list output when I gave a Int constant as the "size" input.
14:27:42 <hellwolf> what's the idiomatic way of doing it?
14:28:09 <__monty__> Isn't static the default with GHC, I thought Arch's packaging was always so problematic because they want dynamic everything?
14:29:03 Square joins (~Square@user/square)
14:29:10 <agentultra> statically linking the Haskell object files, yes... but we still dynamically link libc, libgmp, etc.
14:29:34 × malte quits (~malte@mal.tc) (Ping timeout: 260 seconds)
14:30:24 × jrm quits (~jrm@user/jrm) (Quit: ciao)
14:30:26 <Leary> hellwolf: `mb >>= \x1 -> mb >>= \x2 -> ...`
14:30:27 <haskellbridge> <Morj> I think the tuple replicate would look something like "replicateN @2 mb >>= \(x1 :/\ x2) -> _"
14:30:35 malte joins (~malte@mal.tc)
14:30:47 <haskellbridge> <Morj> I vaguely remember seing those tuples somewhere, but that might have been purescript
14:31:57 jrm joins (~jrm@user/jrm)
14:33:18 <Leary> You can of course write something like `replicateA :: Applicative f => SNat n -> f a -> f (Vec n a)`, but it's not more idiomatic than the dead-simple approach.
14:34:13 <haskellbridge> <Morj> But can ghc already prove that pattern-matching is exhastive here?
14:34:22 <haskellbridge> <Morj> With Vec runtimeValue I mean
14:34:29 × vpan quits (~vpan@212.117.1.172) (Quit: Leaving.)
14:35:00 <haskellbridge> <Morj> Or, ugh, is it even runtime here, I got confused
14:35:07 <hellwolf> we have lift2M, we just need liftNM
14:35:55 <hellwolf> with "Vec n", we probably can pattern matching, perhaps pattern synonyms would be required.
14:36:16 × alp quits (~alp@2001:861:8ca0:4940:97d8:ee2c:4105:6ce6) (Ping timeout: 268 seconds)
14:36:21 paotsaq joins (~paotsaq@127.209.37.188.rev.vodafone.pt)
14:36:29 <hellwolf> excuse me, from lift2, to liftN, I meant to say.
14:37:11 <hellwolf> but unless it's in the base/core library, it's not idiomatic...
14:37:17 <hellwolf> I know how to write my own, but that's not the point.
14:38:38 <agentultra> hm, it does dynamically link with gcc.
14:39:16 <haskellbridge> <Morj> I sometimes think it would be better if `,` were a right-associative operator instead of built-in construct. This way all (a, b, c) = (a, (b, c)) and we can create our own functions that work with tuples of arbitrary arity
14:39:51 <haskellbridge> <Morj> I think ocaml and sml already do that with `*`?
14:39:56 <agentultra> gcc doesn't explicitly link `libm` though and we don't get a runtime relink error if we try to execute it.
14:42:39 <__monty__> Morj: Are you secretly a LISPer? -_-
14:42:53 <haskellbridge> <Morj> I dream of learning lisp one day!
14:43:04 <hellwolf> use emacs :)
14:43:15 <hellwolf> and have elisp nightmare, instead
14:43:32 <haskellbridge> <Morj> I read a blog of a big janet fan, and for some reason it's very hard for me to understand their quoting and unquoting, even when I have no problems using them in template haskell
14:44:01 <haskellbridge> <Morj> > emacs
14:44:01 <haskellbridge> I've already written 100k lines of vimscript >_<
14:44:30 × Googulator quits (~Googulato@81.183.235.203) (Ping timeout: 240 seconds)
14:45:41 <tomsmeding> agentultra: so it works with gcc? What if you pass -lm to gcc as well?
14:50:17 prasad joins (~Thunderbi@c-73-246-138-70.hsd1.in.comcast.net)
14:59:28 jmcantrell joins (~weechat@user/jmcantrell)
14:59:44 × jespada quits (~jespada@2800:a4:2225:2c00:21b7:d8ab:6242:25ba) (Ping timeout: 260 seconds)
15:03:00 jespada joins (~jespada@2800:a4:231e:8900:903f:fbe:20bf:5608)
15:04:11 × jmcantrell quits (~weechat@user/jmcantrell) (Client Quit)
15:04:27 jmcantrell joins (~weechat@user/jmcantrell)
15:05:44 × malte quits (~malte@mal.tc) (Ping timeout: 252 seconds)
15:08:47 hattckory joins (~hattckory@bras-base-toroon4524w-grc-30-70-27-118-207.dsl.bell.ca)
15:12:12 <agentultra> tomsmeding: oof, it links fine with `-lm` and no runtime relink error :(
15:12:35 <tomsmeding> agentultra: you're saying "runtime" again. Does that "Relink" error occur at _runtime_ of your haskell application?
15:12:56 malte joins (~malte@mal.tc)
15:13:24 <agentultra> yes
15:13:59 <tomsmeding> O.o
15:14:16 <merijn> I mean, depending on your definition of runtime that's logical
15:14:17 <tomsmeding> what does `ldd` say on your compiled haskell application and on that simple C executable?
15:14:42 <merijn> everything be linked statically by default only applies to the Haskell bits
15:14:58 <tomsmeding> merijn: I know what a runtime linker is and roughly what it does, but I was running on the wrong assumption here that it was `ld` that was complaining, not `ld-linux.so`
15:15:22 <merijn> But yeah, pastebin ldd output
15:15:39 <tomsmeding> compile-time linking succeeding and then runtime linking _failing_ sounds like a LD_RUNTIME_PATH mistake somewhere
15:15:45 <tomsmeding> and given that this is nix, it smells a lot like nix issues
15:15:51 <merijn> oh, oof
15:15:54 merijn taps out
15:16:02 <tomsmeding> because of the mention of nix? :p
15:16:06 <merijn> Yes :p
15:16:31 <tomsmeding> *LD_LIBRARY_PATH is what I meant
15:16:51 <agentultra> is there a pastebin for this channel?
15:16:54 × fp quits (~Thunderbi@130.233.70.95) (Ping timeout: 272 seconds)
15:16:58 <tomsmeding> @where paste
15:16:58 <lambdabot> Help us help you: please paste full code, input and/or output at e.g. https://paste.tomsmeding.com
15:17:00 <tomsmeding> (also see topic)
15:19:07 <agentultra> tomsmeding: https://paste.tomsmeding.com/FmcDXN4e
15:19:31 × hattckory quits (~hattckory@bras-base-toroon4524w-grc-30-70-27-118-207.dsl.bell.ca) (Read error: Connection reset by peer)
15:20:39 <tomsmeding> agentultra: and the former gives the Relink error at runtime and the latter doesn't?
15:20:48 <agentultra> tomsmeding: correct
15:20:50 <tomsmeding> Do you actually use functions from libtb_client.so in the C program?
15:21:01 <tomsmeding> perhaps the runtime linker is lazy and only loads it in once it's actually used
15:21:37 <agentultra> no, just linking. I was in the middle of adding a usage, I can get that going and try running it.
15:21:51 <tomsmeding> lazy runtime linking is a thing
15:22:37 <tomsmeding> (if you manually invoke the runtime linker with dlopen(2), it's the RTLD_LAZY flag)
15:22:53 <tomsmeding> er, dlopen(3)
15:24:33 <agentultra> odd that the Haskell executable doesn't call anything from the library either, it just links... wonder if something in the generated FFI bindings invokes something in the library?
15:26:33 <tomsmeding> agentultra: another thing you can try: set LD_DEBUG=files,libs,bindings (or perhaps LD_DEBUG=all) when starting the two executables and check if there is a difference in the resulting outputs
15:26:42 <tomsmeding> *difference between
15:26:54 <tomsmeding> (LD_DEBUG is from ld-linux(8))
15:26:58 × ystael quits (~ystael@user/ystael) (Ping timeout: 244 seconds)
15:27:31 <agentultra> roger, roger
15:29:04 ystael joins (~ystael@user/ystael)
15:32:52 × malte quits (~malte@mal.tc) (Ping timeout: 252 seconds)
15:34:38 <agentultra> So calling the library from C, no run-time relink error.
15:34:52 <agentultra> Checking the differences
15:35:01 <merijn> Is the link invocation for the C code and Haskell the same, though?
15:36:22 tomsmeding . o O ( `cabal build --ghc-options=-v` )
15:36:25 xff0x joins (~xff0x@2405:6580:b080:900:73c3:617e:93dd:971)
15:36:36 <tomsmeding> still doesn't print the ld invocation, though
15:37:10 <tomsmeding> merijn: do you know of a way to make ghc print the actual ld invocation? `bear intercept` doesn't work because ghc passes options through `@` files so the actual flags are not in the cmdline.
15:37:32 <merijn> If you set -v high enough it just prints out everything it does
15:37:42 <merijn> Last I tried anyway
15:37:42 <tomsmeding> (I still have to hack bear at some point to understand this and open those options files)
15:38:57 <tomsmeding> oh wait -v does already show the gcc call, I somehow missed that
15:39:31 <merijn> :)
15:39:45 <tomsmeding> (gcc and ghc look too much alike)
15:41:04 malte joins (~malte@mal.tc)
15:42:05 <agentultra> https://paste.tomsmeding.com/rde825xQ
15:42:44 <tomsmeding> agentultra: you need `--ghc-options=-v`, this makes the cabal build verbose but not what ghc itself does
15:42:59 <agentultra> tomsmeding: ah, sorry will do.
15:43:14 <tomsmeding> we're interested in that "Linking..." line at :589 ;)
15:44:50 <agentultra> tomsmeding: https://paste.tomsmeding.com/9QHmZK9i
15:46:13 × werneta quits (~werneta@syn-071-083-160-242.res.spectrum.com) (Ping timeout: 245 seconds)
15:46:16 <tomsmeding> always nice when ghc links in your library three times
15:46:29 <tomsmeding> agentultra: the line in question is :952 there
15:47:03 <tomsmeding> no less than 5 occurrences of -lm !
15:47:34 <agentultra> oh weird
15:47:40 <tomsmeding> that shouldn't matter though
15:49:08 <tomsmeding> what happens if you compile your C file with `gcc thing.c -o a.out -fuse-ld=gold -Wl,--no-as-needed -lm -no-pie -Wl,--gc-sections -ltb_client`?
15:49:28 <tomsmeding> (an attempt to manually remove all the superfluous stuff from that long command)
15:50:12 <tomsmeding> oh perhaps with `-L/home/jking/Projects/tigerbeetle-hs/lib/x86_64-linux-gnu.2.27`
15:50:39 <tomsmeding> somehow the Relink error should be reproducible without ghc :p
15:51:12 Square2 joins (~Square@user/square)
15:52:01 <agentultra> tomsmeding: `cc test.c -Wall -Iinclude -Llib/x86_64-linux-gnu.2.27 -fuse-ld=gold -Wl,--no-as-needed -lm -no-pie -Wl,--gc-sections -ltb_client`
15:52:08 <agentultra> Creates the relink error when you run it!
15:52:22 <agentultra> and a segfault
15:52:27 <tomsmeding> lol
15:52:27 × tromp quits (~textual@2001:1c00:3487:1b00:6095:11f3:6fa5:fb3d) (Quit: My iMac has gone to sleep. ZZZzzz…)
15:52:29 × jacopovalanzano quits (~jacopoval@cpc151911-cove17-2-0-cust105.3-1.cable.virginm.net) (Quit: Client closed)
15:52:52 <tomsmeding> now reduce it to figure out what the problem is :)
15:52:53 hattckory joins (~hattckory@70.27.118.207)
15:52:59 × malte quits (~malte@mal.tc) (Ping timeout: 260 seconds)
15:53:04 <agentultra> yup, excellent.
15:53:05 <tomsmeding> also, yay progress
15:58:00 <agentultra> yes, thanks a bunch for narrowing that down... I didn't know about the --ghc-options=-v flag
15:58:28 <merijn> agentultra: --ghc-options just pass flags as-is on to ghc :)
16:06:08 <agentultra> tomsmeding: turns out, it's -lm
16:06:34 <tomsmeding> one cannot use libtb_client.so in a program if you also link in libm?
16:06:42 <tomsmeding> that... rather sounds like a problem with tb_client.
16:07:04 <tomsmeding> or at least how it's built
16:07:21 <agentultra> i suspect they statically link libm or include their own implementation
16:07:49 <tomsmeding> if they have their own implementation, then internal references to `sin` in tb_client should just refer to the internal symbol, regardless of how many libm's are around
16:07:50 <agentultra> the ldd output suggests so... is there a way to tell cabal to tell ghc to not link `-lm` when linking this library?
16:08:09 <tomsmeding> how would you then use `sin` from haskell?
16:08:29 <tomsmeding> (I don't think so)
16:09:22 <agentultra> Hm. So creating a static executable wouldn't even work around it?
16:09:41 <merijn> You can just override the linker flags GHC passes
16:10:00 <tomsmeding> merijn: GHC already passes -lm 4 times, are you sure you can make it not pass all 4 of thouse?
16:10:02 <tomsmeding> *those
16:10:10 <merijn> No :p
16:10:18 <merijn> Well yes
16:10:32 <merijn> But the question is "would I be willing to invest that effort?" :p
16:10:41 <tomsmeding> also, I don't think it's a good idea
16:10:55 <tomsmeding> e.g. floor(3) is in libm too
16:11:06 <tomsmeding> so no more floor() for you, I guess, then?
16:11:36 <tomsmeding> (though on a non-ancient CPU, it's probably translated to a CPU instruction)
16:12:04 × hattckory quits (~hattckory@70.27.118.207) (Ping timeout: 260 seconds)
16:13:17 tromp joins (~textual@2001:1c00:3487:1b00:6095:11f3:6fa5:fb3d)
16:13:23 <agentultra> oh weird... it might be the link order
16:13:34 <tomsmeding> link order is significant in general
16:13:54 <merijn> tomsmeding: not in general
16:13:58 <merijn> But on linux, certainly
16:14:04 × weary-traveler quits (~user@user/user363627) (Remote host closed the connection)
16:14:16 <agentultra> `$ cc test.c -Wall -Iinclude -Llib/x86_64-linux-gnu.2.27 -ltb_client -lm` compiles and runs with no error
16:14:19 <tomsmeding> I meant that as in: there are situations where link order is significant, I'm not sure if this is one of those
16:14:41 <tomsmeding> and swapping the -ltb_client and -lm makes it fail?
16:14:42 <agentultra> but if you put `-lm` before `-ltb_client`, you get the relink error.
16:14:48 <tomsmeding> merijn: any ideas?
16:14:58 <merijn> Whisky and crying?
16:15:04 <tomsmeding> that's what I suspected
16:15:16 <merijn> All I know about linking is against my will :p
16:15:41 <merijn> The scary moment you realise that you've become "the person everyone comes to when they hit linker errors" :p
16:15:53 <tomsmeding> heh
16:16:15 <tomsmeding> that happened to me with "linux stuff"
16:16:16 <agentultra> yeah, linkers are pain.
16:16:58 <merijn> And I'm too distracted trying to learn tree-sitter to think about linkers
16:17:08 <tomsmeding> agentultra: any chance you can do, well, precisely what the error is saying -- change the tb_client build process to include -lm when building the shared library?
16:17:08 <agentultra> wonder if this would be ameliorated if ghc had it's own
16:17:44 <agentultra> tomsmeding: i might try that unless there's an easy way to pass the link flags in the desired order to ghc from cabal
16:18:23 <tomsmeding> I strongly suspect ghc just unconditionally adds -lm early on the command line, from looking at the structure of that command line in the log you sent
16:18:49 <tomsmeding> which is overall not a very strange thing to do, tb_client should just declare that it depends on -lm, and it doesn't
16:21:22 × lortabac quits (~lortabac@2a01:e0a:541:b8f0:55ab:e185:7f81:54a4) (Quit: WeeChat 4.5.2)
16:22:14 <EvanR> tomsmeding, I can hit you up for any help with "linux stuff" ? cool
16:22:50 tomsmeding hides
16:23:19 yushyin makes a note
16:23:48 tomsmeding despairs
16:25:18 <agentultra> tomsmeding: agree, I think it's because the link order.. the executable has `sin` first in the elf of the executable and `dlopen` loads this library with it's own `sin` and tries to relink it? So if we change the link order when we call the library it can resolve it's own `sin`.
16:25:34 × jespada quits (~jespada@2800:a4:231e:8900:903f:fbe:20bf:5608) (Quit: My Mac has gone to sleep. ZZZzzz…)
16:26:36 <agentultra> I'm going to see if they'll accept a patch from me to to change their linker options, if that's even possible. The library is actually written in Zig :S
16:27:59 <tomsmeding> agentultra: I think this is what's happening (but take this with a grain of salt): the `sin` symbol is Weak in libtb_client.so (as we saw), which means (man 1 nm) that it's allowed to be undefined at link time. When compiling with -ltb_client -lm, `sin` is first undefined, and then libm provides a definition. When compiling with -lm -tb_client -lm, the first -lm resolves any missing references to
16:28:01 <tomsmeding> `sin`, but then afterwards, tb_client introduces new ones. The second occurrence of -lm (this is where I'm a bit unsure) is ignored because libm was already specified (?)
16:28:20 <tomsmeding> hence in the second case, `sin` remains unresolved, which results in an error at runtime
16:28:34 <tomsmeding> dlopen is not involved here, that is for manually calling into the runtime linker at runtime
16:28:55 <EvanR> it is indeed difficult to resolve one's own sin
16:28:56 <agentultra> gotcha... that seems reasonable
16:29:08 <tomsmeding> it's ld-linux.so, the runtime linker itself, that is relevant here (which is, despite its name, actually an executable)
16:29:28 <tomsmeding> EvanR: it's not at all, just declare that you depend on libm
16:29:40 <EvanR> the good news about libm
16:29:52 <agentultra> well, they'll have a bug report coming soon to get the process started.
16:29:57 <tomsmeding> :)
16:30:14 <agentultra> thanks again for all your help :D
16:30:20 <EvanR> (actually, sin has unlimited radius of convergence so there's that)
16:30:23 <tomsmeding> cheers :)
16:30:37 <tomsmeding> EvanR: floating-point numbers only go so far though
16:30:37 <jle`> that's deep
16:31:19 <EvanR> it's true "correct rounded result" guarantee doesn't cover the entire domain of sin in ieee754
16:31:27 <EvanR> watch yourself
16:31:31 <EvanR> in the far lands
16:34:05 × prasad quits (~Thunderbi@c-73-246-138-70.hsd1.in.comcast.net) (Read error: Connection reset by peer)
16:38:11 malte joins (~malte@mal.tc)
16:41:48 × chele quits (~chele@user/chele) (Remote host closed the connection)
16:44:23 prasad joins (~Thunderbi@c-73-246-138-70.hsd1.in.comcast.net)
16:46:54 <monochrom> "You must not sin." >:)
16:51:17 pyooque joins (~puke@user/puke)
16:51:18 × puke quits (~puke@user/puke) (Killed (erbium.libera.chat (Nickname regained by services)))
16:51:18 pyooque is now known as puke
16:51:19 × nitrix quits (~nitrix@user/meow/nitrix) (Ping timeout: 260 seconds)
16:51:40 <monochrom> But I thought you would want to absolve, not resolve, your sin. >:)
16:55:04 × acidjnk quits (~acidjnk@p200300d6e71c4f71c835c1b6e3010b6c.dip0.t-ipconnect.de) (Ping timeout: 272 seconds)
16:58:09 nitrix joins (~nitrix@user/meow/nitrix)
16:58:20 × L29Ah quits (~L29Ah@wikipedia/L29Ah) (Ping timeout: 265 seconds)
17:06:00 jespada joins (~jespada@2800:a4:231e:8900:903f:fbe:20bf:5608)
17:06:07 <int-e> :t abs
17:06:09 <lambdabot> Num a => a -> a
17:06:17 <int-e> :t abs . sin
17:06:18 <lambdabot> Floating c => c -> c
17:12:53 acidjnk joins (~acidjnk@p200300d6e71c4f71c835c1b6e3010b6c.dip0.t-ipconnect.de)
17:17:35 Sgeo joins (~Sgeo@user/sgeo)
17:22:00 weary-traveler joins (~user@user/user363627)
17:22:39 <EvanR> :t fix . error
17:22:40 <lambdabot> [Char] -> c
17:23:02 <absence> Is there a way to do something like "(\f g h a -> f (g (h a))) <$> f' <*> g' <*> h' <*> a'" without having to manually specify the combining function to the left?
17:23:47 <merijn> I can't tell if that's trying to be idiom brackets or something else
17:23:54 <EvanR> are you sure you don't want to reverse the applicative or something
17:24:14 <merijn> absence: What's it trying to accomplish?
17:24:24 OlzhasYergali joins (~OlzhasYer@188.130.156.6)
17:29:41 L29Ah joins (~L29Ah@wikipedia/L29Ah)
17:29:52 × tromp quits (~textual@2001:1c00:3487:1b00:6095:11f3:6fa5:fb3d) (Quit: My iMac has gone to sleep. ZZZzzz…)
17:30:39 × euphores quits (~SASL_euph@user/euphores) (Quit: Leaving.)
17:30:59 <absence> merijn: f' g' and h' are applicative functors that return some operation (e.g. "pure (+1)"), so I just want to apply them.
17:31:28 <merijn> absence: okay, so how about we simplify this
17:31:38 <merijn> ah, wait
17:31:50 <merijn> absence: Are they all Endo functors?
17:31:56 <merijn> i.e. "a -> a" functions?
17:32:17 <absence> No, otherwise I guess it would be easier...
17:32:44 <merijn> yeah, I was thinking just traverse + some fold
17:35:41 euphores joins (~SASL_euph@user/euphores)
17:38:51 <absence> Hm, I guess it's kind of an applicative version of (.)?
17:39:25 tromp joins (~textual@2001:1c00:3487:1b00:6095:11f3:6fa5:fb3d)
17:39:39 <merijn> absence: I mean, you could just define that? :)
17:39:56 × ubert1 quits (~Thunderbi@2a02:8109:ab8a:5a00:7d86:d0e8:c2d1:2ee3) (Remote host closed the connection)
17:40:03 <haskellbridge> <Bowuigi> Would some fold/traversal with liftA2 work?
17:40:19 <merijn> Bowuigi: No, because that only works for Endo
17:41:02 <merijn> absence: You an just define <.> as custom operator? :)
17:41:24 alp joins (~alp@2001:861:8ca0:4940:10d7:35fd:1caf:385)
17:41:48 <merijn> :t let f <.> g = (.) <$> f <*> g in (<.>)
17:41:49 <lambdabot> Applicative f => f (b -> c) -> f (a -> b) -> f (a -> c)
17:42:13 <merijn> Maybe reverse the arguments depending on how you want it to line up
17:42:27 target_i joins (~target_i@user/target-i/x-6023099)
17:45:01 × OlzhasYergali quits (~OlzhasYer@188.130.156.6) (Quit: Client closed)
17:45:15 <absence> Ugh, "of course" I'm using impredicative types, so that fails in the same way as the regular (.) does, but other than that I guess it would've worked.
17:46:02 <merijn> absence: Can't you fix it with explicit RankN type annotations?
17:48:07 × lxsameer quits (~lxsameer@Serene/lxsameer) (Ping timeout: 265 seconds)
17:50:16 <absence> Is it possible to define a generic (.) that works with RankN, or would it have to be a more specific one for the structures I have?
17:52:08 <monochrom> I think (.) already works with RankN. It is why the lens library has no type error.
17:53:42 <c_wraith> Eh. The lens library uses ALens (or whatever) in a lot of contexts where it'd otherwise need RankN
17:55:16 <monochrom> Does "(\f g h a -> f (g (h a))) <$> f' <*> g' <*> h' <*> a'" simply mean f' <*> (g' <*> (h' <*> a')) ?
17:56:36 × aetepe quits (~aetepe@188.119.58.34) (Ping timeout: 252 seconds)
17:56:48 <monochrom> Come to think of it, I probably once used Applicative laws to prove something related.
18:00:15 × malte quits (~malte@mal.tc) (Remote host closed the connection)
18:02:35 × tromp quits (~textual@2001:1c00:3487:1b00:6095:11f3:6fa5:fb3d) (Quit: My iMac has gone to sleep. ZZZzzz…)
18:05:18 <absence> You may be right, but I run into the same RankN problem: Couldn't match type: forall a. m a -> n a with: b -> c
18:09:35 malte joins (~malte@mal.tc)
18:18:30 tromp joins (~textual@2001:1c00:3487:1b00:6095:11f3:6fa5:fb3d)
18:23:05 aetepe joins (~aetepe@188.119.58.34)
18:23:16 Googulator joins (~Googulato@2a01-036d-0106-01d5-ac5d-24c1-ad5e-7f2b.pool6.digikabel.hu)
18:31:12 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 244 seconds)
18:31:13 × acidjnk quits (~acidjnk@p200300d6e71c4f71c835c1b6e3010b6c.dip0.t-ipconnect.de) (Ping timeout: 245 seconds)
18:39:16 × euphores quits (~SASL_euph@user/euphores) (Remote host closed the connection)
18:40:09 euphores joins (~SASL_euph@user/euphores)
18:44:10 slack1256 joins (~slack1256@2803:c600:5111:9ab8:84f4:ae24:2907:edab)
18:44:48 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
18:57:34 <tomsmeding> absence: what about simply "f' <$> g' <$> h' <$> a'"?
18:57:40 <tomsmeding> % :i <$>
18:57:40 <yahb2> (<$>) :: Functor f => (a -> b) -> f a -> f b ; -- Defined in ‘GHC.Internal.Data.Functor’ ; infixl 4 <$>
19:00:01 × caconym quits (~caconym@user/caconym) (Quit: bye)
19:00:03 <tomsmeding> fun exercise: prove that "(x <$> y) <$> z" and "x <$> (y <$> z)" do exactly the same thin
19:00:05 <tomsmeding> +g
19:00:15 wildsalander joins (~wildsalan@37-33-20-77.bb.dnainternet.fi)
19:00:44 caconym joins (~caconym@user/caconym)
19:00:48 × zungi quits (~tory@user/andrewchawk) (Ping timeout: 264 seconds)
19:00:54 × wildsalander quits (~wildsalan@37-33-20-77.bb.dnainternet.fi) (Client Quit)
19:01:23 acidjnk joins (~acidjnk@p200300d6e71c4f71c835c1b6e3010b6c.dip0.t-ipconnect.de)
19:01:32 <tomsmeding> monochrom: no, (<$>) not (<*>)
19:02:37 <tomsmeding> (hint for my "fun exercise": first infer the types of x, y and z in both cases)
19:03:54 × malte quits (~malte@mal.tc) (Ping timeout: 268 seconds)
19:04:11 malte joins (~malte@mal.tc)
19:04:18 rvalue- joins (~rvalue@user/rvalue)
19:04:33 <haskellbridge> <Liamzee> tomsmeding: no, the problem is that it's keyed so that Prelude.take 3 and Prelude.Linear.take3 do separate things
19:04:45 × rvalue quits (~rvalue@user/rvalue) (Ping timeout: 246 seconds)
19:05:24 <tomsmeding> Liamzee: "keyed"?
19:05:35 <haskellbridge> <Liamzee> namely, Linear.take 3 takes 4 elements of the list
19:05:47 <tomsmeding> _what_
19:06:06 <tomsmeding> surely that's a bug
19:06:28 <haskellbridge> <Liamzee> <0, as opposed to <= 0
19:06:35 <tomsmeding> that makes 0 sense
19:06:48 × sord937 quits (~sord937@gateway/tor-sasl/sord937) (Quit: sord937)
19:08:08 <tomsmeding> Liamzee: any more of such functions?
19:08:24 × malte quits (~malte@mal.tc) (Ping timeout: 244 seconds)
19:09:20 <haskellbridge> <Liamzee> only noticed that one
19:09:23 <haskellbridge> <Liamzee> you want to push the patch?
19:09:27 <tomsmeding> drop also has it
19:09:30 <[exa]> O_o
19:09:38 <haskellbridge> <Liamzee> yeah, i saw
19:09:46 <haskellbridge> <Liamzee> that's a breaking change to API, though
19:09:59 <tomsmeding> that's why it'll just be an issue, not a PR yet
19:10:03 <haskellbridge> <Liamzee> I wonder who's actually using it if drop / take being bugged like this didn't get caught
19:10:08 <tomsmeding> exactly
19:10:17 <tomsmeding> I think Data.List.Linear is not what people are using prelude-linear for
19:10:41 rvalue- is now known as rvalue
19:10:41 <tomsmeding> Data.Array.Mutable.Linear is much more useful
19:12:21 <[exa]> anyway yeah there's a literal off-by-one error here right? https://hackage.haskell.org/package/linear-base-0.4.0/docs/src/Data.List.Linear.html#take
19:12:26 <absence> tomsmeding: That doesn't compile, since f' isn't a function...
19:13:13 <tomsmeding> absence: well, you used it as a function in your original snippet.
19:13:39 <tomsmeding> Liamzee: https://github.com/tweag/linear-base/issues/484
19:14:01 <[exa]> wow, I wanted to check the issue tracker if the bug is there already
19:14:06 <[exa]> 2 issues "opened just now"
19:14:08 <[exa]> good job guys. :D
19:14:24 <tomsmeding> absence: the only difference between the type of what I posted, and the type of what you posted, is that mine has a Functor constraint only
19:14:30 <tomsmeding> oh oops
19:14:52 <tomsmeding> Liamzee: shall I close mine?
19:15:02 <absence> tomsmeding: The type of f' is something like f (a -> b).
19:15:18 <tomsmeding> [exa]: what's cooler is that my issue has a lower number, but it's higher up in the list
19:15:41 <haskellbridge> <Liamzee> closed mine
19:15:44 <tomsmeding> ah I see
19:15:44 <[exa]> yeah I'm just looking at that
19:15:48 × tomku quits (~tomku@user/tomku) (Ping timeout: 252 seconds)
19:16:07 <tomsmeding> absence: _oops_, sorry
19:16:50 × hgolden quits (~hgolden@2603:8000:9d00:3ed1:6ff3:8389:b901:6363) (Remote host closed the connection)
19:17:49 tomku joins (~tomku@user/tomku)
19:20:33 hgolden joins (~hgolden@2603:8000:9d00:3ed1:6ff3:8389:b901:6363)
19:25:45 <[exa]> tomsmeding Liamzee: you guys clicked it literally at the very same second, and although Liamzee has a little tiny bit higher global ID it still sorts by something different (I guess they sort by opening time in seconds (equal) and then probably by title or something)
19:26:40 <tomsmeding> cool
19:27:51 sprotte24 joins (~sprotte24@p200300d16f1244002c79175af1485053.dip0.t-ipconnect.de)
19:28:43 × AlexZenon quits (~alzenon@178.34.150.194) (Ping timeout: 245 seconds)
19:28:59 zungi joins (~tory@user/andrewchawk)
19:29:31 polyphem joins (~rod@p3ee3f49b.dip0.t-ipconnect.de)
19:32:56 pavonia joins (~user@user/siracusa)
19:33:41 × alp quits (~alp@2001:861:8ca0:4940:10d7:35fd:1caf:385) (Ping timeout: 248 seconds)
19:35:54 AlexZenon joins (~alzenon@178.34.150.194)
19:41:09 × remedan quits (~remedan@ip-62-245-108-153.bb.vodafone.cz) (Quit: Bye!)
19:41:39 ash3en joins (~Thunderbi@185.209.196.192)
19:42:10 remedan joins (~remedan@ip-62-245-108-153.bb.vodafone.cz)
19:44:07 <EvanR> 1 second is a very long time in computers
19:44:23 <EvanR> two events within the same 1 second interval might not even be able to see each other xD
19:45:26 Tuplanolla joins (~Tuplanoll@91-159-69-59.elisa-laajakaista.fi)
19:45:30 × AlexZenon quits (~alzenon@178.34.150.194) (Ping timeout: 252 seconds)
19:45:52 × ash3en quits (~Thunderbi@185.209.196.192) (Ping timeout: 252 seconds)
19:48:56 <[exa]> is there any good/recommended way to have a feedable attoparsec parser which can output partial data between the feeds, and has to keep some state information for the whole stream?
19:49:30 <merijn> [exa]: Yes, it's called "attoparsec"?
19:50:34 <merijn> [exa]: It has built in methods for incremental feeding. So you just wrap it in a tuple with some extra state?
19:51:14 <[exa]> merijn: like, I'm doing the lifting manually now (I've got a `parseSomething :: st -> Parser (st, [something])`, feeding it and passing the `st` around manually when one piece finishes
19:52:06 <[exa]> I hoped for something where I could have a `tell`, `put` and `get` and no other thinking to do :D
19:52:24 tomsmeding . o O ( `tell`? )
19:52:29 <merijn> [exa]: I mean, you can just use `StateT` on top of attoparsec?
19:52:56 <merijn> [exa]: If you wanna get fancier than that, you'll have to consider swapping to megaparsec
19:53:00 <[exa]> yes, but then I have to pass the state around that myself anyway
19:53:06 merijn .o O ( is trifecta still a thing? )
19:53:15 AlexZenon joins (~alzenon@178.34.150.194)
19:53:25 <[exa]> tomsmeding: the tell from writer, "we parsed out this information, emit it"
19:53:27 ljdarj1 joins (~Thunderbi@user/ljdarj)
19:53:28 <merijn> [exa]: megaparsec has an embedded state parser
19:53:42 <merijn> s/state parser/state monad
19:53:52 <[exa]> hm let me check
19:54:04 <tomsmeding> [exa]: that sounds not like how parser combinator parsers work :p
19:54:11 <tomsmeding> you return the parsed value, you don't `tell` it
19:54:38 <tomsmeding> wanting to output the parsed values via `tell` sounds like you want a non-Parser that optionally uses Parser inside to parse little chunks
19:55:02 <[exa]> yeah this is for something like RDF turtle, I was thinking about emitting the triples directly without structure.
19:55:20 <[exa]> sounds kinda like I want the actual streamy libraries, right.
19:55:41 <tomsmeding> [exa]: what if the Parser backtracks? Do you keep your writer state? (Flashback to a few days ago)
19:55:54 <merijn> [exa]: You probably want streaming libraries then, yeah
19:56:11 <[exa]> tomsmeding: good point, it should hold until it's clear that it won't backtrack
19:56:21 <merijn> [exa]: conduit works really well with the various parsecs where you just write a parser for one record and emit as you finish them
19:56:27 <[exa]> ok this actually at least proves that my idea with writer is off
19:56:39 <absence> What's the best way to deal with forall mismatches after simplified subsumption? I just made some code compile by writing "fmap (\f x -> f x)", which looks a bit silly, and isn't very intuitive...
19:56:41 × ljdarj quits (~Thunderbi@user/ljdarj) (Ping timeout: 265 seconds)
19:56:41 ljdarj1 is now known as ljdarj
19:56:50 <[exa]> merijn: yeah I think that will be it
19:56:52 × Square2 quits (~Square@user/square) (Ping timeout: 252 seconds)
19:56:52 × Square quits (~Square@user/square) (Ping timeout: 252 seconds)
19:57:01 <tomsmeding> the standard fix for simplified subsumption breaking your code is indeed eta-expansion
19:57:17 <[exa]> ok thanks guys for consultation again! :)
19:57:57 × AlexZenon quits (~alzenon@178.34.150.194) (Ping timeout: 252 seconds)
19:58:10 <absence> tomsmeding: So I've heard, it just feels extra weird when it's inside a functor. But I guess there's no other way?
19:59:21 CiaoSen joins (~Jura@2a02:8071:64e1:da0:5a47:caff:fe78:33db)
20:00:36 AlexZenon joins (~alzenon@178.34.150.194)
20:07:38 × slack1256 quits (~slack1256@2803:c600:5111:9ab8:84f4:ae24:2907:edab) (Remote host closed the connection)
20:08:55 machinedgod joins (~machinedg@d108-173-18-100.abhsia.telus.net)
20:09:29 j1n37- joins (~j1n37@user/j1n37)
20:10:14 × j1n37 quits (~j1n37@user/j1n37) (Ping timeout: 260 seconds)
20:10:48 × aetepe quits (~aetepe@188.119.58.34) (Remote host closed the connection)
20:11:29 × dhil quits (~dhil@2a0c:b381:52e:3600:cbb4:807:319f:c7af) (Ping timeout: 248 seconds)
20:12:48 × zungi quits (~tory@user/andrewchawk) (Ping timeout: 264 seconds)
20:13:18 × CiaoSen quits (~Jura@2a02:8071:64e1:da0:5a47:caff:fe78:33db) (Ping timeout: 272 seconds)
20:18:12 <haskellbridge> <Liamzee> hmmm, that's interesting
20:18:13 <haskellbridge> <Liamzee> Ur isn't a monad?
20:21:16 <EvanR> instance Prelude.Monad Ur where
20:21:26 <EvanR> Ur a >>= f = f a
20:25:55 × polyphem quits (~rod@p3ee3f49b.dip0.t-ipconnect.de) (Ping timeout: 268 seconds)
20:27:30 <haskellbridge> <Liamzee> i'm not sure what the technical term is, i spoke to a friend who did stuff with Linear Haskell
20:27:49 <haskellbridge> <Liamzee> but we talked about the possibility of Linear Haskell simply being a concern for library writers, but you called LH for better memory usage or a disabled GC
20:28:14 <haskellbridge> <Liamzee> having Ur being a monad would be useful for LInear Haskell, so it's interesting to ask why it's not
20:28:24 <haskellbridge> <Liamzee> "Rust as a monadic eDSL" ;)
20:30:34 <EvanR> I'm concerned about your premise that Ur is not a moand
20:30:45 <EvanR> which seems to be plainly false
20:31:16 <EvanR> disabling of the GC when using linear haskell doesn't sound like a thing
20:31:42 <haskellbridge> <Liamzee> https://hackage.haskell.org/package/linear-base-0.1.0/docs/Control-Functor-Linear.html
20:31:51 × weary-traveler quits (~user@user/user363627) (Quit: Konversation terminated!)
20:31:56 <haskellbridge> <Liamzee> oh, i realize the problem now
20:32:04 <haskellbridge> <Liamzee> it's up to 0.4.0, and maybe 0.5.0 :)
20:32:13 weary-traveler joins (~user@user/user363627)
20:32:56 <haskellbridge> <Liamzee> https://hackage.haskell.org/package/linear-base-0.4.0/docs/src/Data.Unrestricted.Linear.Internal.Ur.html#line-75
20:35:58 <haskellbridge> <Liamzee> EvanR: but while doing the computation, you could potentially do free after use, but i'm not sure if the allocator works that way
20:36:31 <EvanR> what do you mean
20:37:30 <EvanR> free what
20:39:21 <haskellbridge> <Liamzee> i mean linear types imply that a value is consumed, meaning that its allocation can be cleared
20:39:53 <haskellbridge> <Liamzee> you might have a GC for the nonlinear haskell wrapping the computation, but the linear computation doesn't need a GC
20:40:27 <EvanR> the meaning of "consumed" doesn't necessarily mean "deleted from existence"
20:40:39 <EvanR> it just means you can't use it again
20:41:02 <haskellbridge> <Liamzee> "not sure if the allocator works that way"
20:41:08 <EvanR> in one example, that space was immediately reused by the operation you just did
20:41:13 <EvanR> freeing it would break things in that case
20:41:29 <EvanR> in another case, the object's ownership transferred elsewhere
20:41:38 <EvanR> in another case, it wasn't a real object the begin with
20:41:59 <EvanR> e.g. it could have been evidence of some sort that's now invalid
20:43:10 <EvanR> linear anything is often much more general in scope
20:43:47 <haskellbridge> <Liamzee> at least in theory, though, it should have better performance due to not needing to do as many allocations
20:43:56 <haskellbridge> <Liamzee> and not needing the GC to be on to cover the data
20:44:09 <EvanR> calling into a memory management system to "free" stuff constantly sounds like overhead of its own
20:44:43 <EvanR> that's why Ur/Web waits until the end of the processing program to discard the entire block of memory
20:45:34 <EvanR> it just sounds like you're conflating "no GC memory management" with linear types
20:49:57 × L29Ah quits (~L29Ah@wikipedia/L29Ah) (Ping timeout: 248 seconds)
20:50:15 <haskellbridge> <Liamzee> Web type?
20:51:42 <haskellbridge> <Liamzee> i'm just being conservative because i was told that there's no automatic mutation implied by linear haskell
20:51:48 <haskellbridge> <Liamzee> which is a feature that some people want
20:55:10 <EvanR> "automatic mutation" ?
20:55:15 <merijn> Liamzee: FYI, GHC's allocator is *stupidly* fast, though
20:55:24 <merijn> EvanR: In place updates when reference count == 1
20:55:32 × jespada quits (~jespada@2800:a4:231e:8900:903f:fbe:20bf:5608) (Quit: My Mac has gone to sleep. ZZZzzz…)
20:56:07 <merijn> Like, I'd be surprised if allocating memory took more than 5 instructions in GHC
20:57:18 <merijn> It's basically "increment a number" and a comparison to check if you exceeded the heap
20:57:29 <merijn> Maybe 1 or 2 instructions for an atomic CAS?
20:57:31 <EvanR> allocation is fast and easy
20:57:45 jespada joins (~jespada@2800:a4:231e:8900:903f:fbe:20bf:5608)
20:57:45 × jespada quits (~jespada@2800:a4:231e:8900:903f:fbe:20bf:5608) (Client Quit)
20:58:42 <merijn> Liamzee: FWIW, I've had Haskell programs with allocation rates of over 4 Gb/s (and this is the average over a duration of 2-3 minutes) that never exceeded more than a few 10s of MB of resident memory
20:59:14 <tomsmeding> one cute trick you can do with LinearTypes that I haven't seen much is `newtype State s a = Staet (s %1-> (Ur a, s))`
20:59:38 <tomsmeding> you get `modify :: (s %1-> s) -> State s a -> State s a`, and it otherwise works essentially exactly like the normal state monad
20:59:42 <haskellbridge> <Liamzee> one cute trick you can do with LinearTypes that I haven't seen much is using LinearTypes ;)
21:00:14 <EvanR> napkin math says that implies you "run out of resident memory" 400 times a second
21:00:15 <tomsmeding> so if you're using a State monad that you would like to do mutable updates with, it's actually very easy to achieve that now
21:01:42 <haskellbridge> <Liamzee> I guess, I'll ask directly, is there something wrong with using LinearTypes as something wrapped over by non-linear Haskell to provide a low-cost performance gain without needing FFI?
21:01:48 <merijn> EvanR: It was a program streaming a few GB worth of data from SQLite via conduit, it actually worked remarkably well in keeping low RES memory for the data size
21:02:01 × kimiamania quits (~65804703@user/kimiamania) (Quit: PegeLinux)
21:02:04 <tomsmeding> Liamzee: https://hackage.haskell.org/package/text-builder-linear for example
21:02:24 kimiamania joins (~65804703@user/kimiamania)
21:02:29 × AlexZenon quits (~alzenon@178.34.150.194) (Ping timeout: 252 seconds)
21:02:53 <haskellbridge> <Liamzee> yeah, i saw, I recently did a purview of the LH ecosystem :)
21:03:28 AlexZenon joins (~alzenon@178.34.150.194)
21:03:34 <haskellbridge> <Liamzee> going full embedded with LH, at this time, is probably not a good idea, but developing wrapped linear Haskell libraries is probably a good transition to build up skills within the community and build up support for the LinearTypes extension
21:04:56 <haskellbridge> <Liamzee> erm, not purview, review
21:06:29 malte joins (~malte@mal.tc)
21:09:20 <EvanR> merijn, tens of megabytes sounds pretty good practically speaking
21:09:44 <EvanR> otoh that would exhaust the first hard drive I had, much less the ram that went with it
21:11:10 <merijn> EvanR: I mean, the raw data was a database of, like, 8 GB and 2 billion rows. That had a bunch of joins blowing up the data queried even more, then doing a full scan of that data. 10s of megabytes was much less than I was prepared to use :p
21:11:35 <merijn> Considering the machine running the code had, like, 192 GB RAM :p
21:15:01 Unicorn_Princess joins (~Unicorn_P@user/Unicorn-Princess/x-3540542)
21:20:27 × malte quits (~malte@mal.tc) (Remote host closed the connection)
21:20:28 × bsima quits (~bsima@143.198.118.179) (Quit: ZNC 1.8.2 - https://znc.in)
21:21:14 bsima joins (~bsima@2604:a880:400:d0::19f1:7001)
21:21:58 × nitrix quits (~nitrix@user/meow/nitrix) (Quit: ZNC 1.9.1 - https://znc.in)
21:23:54 nitrix joins (~nitrix@user/meow/nitrix)
21:23:59 malte joins (~malte@mal.tc)
21:29:59 × wootehfoot quits (~wootehfoo@user/wootehfoot) (Read error: Connection reset by peer)
21:40:39 × malte quits (~malte@mal.tc) (Remote host closed the connection)
21:42:27 L29Ah joins (~L29Ah@wikipedia/L29Ah)
21:46:30 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 252 seconds)
21:47:30 × j1n37- quits (~j1n37@user/j1n37) (Read error: Connection reset by peer)
21:53:01 j1n37 joins (~j1n37@user/j1n37)
21:58:14 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
21:59:52 × chiselfuse quits (~chiselfus@user/chiselfuse) (Remote host closed the connection)
22:00:26 chiselfuse joins (~chiselfus@user/chiselfuse)
22:00:47 malte joins (~malte@mal.tc)
22:05:12 × target_i quits (~target_i@user/target-i/x-6023099) (Quit: leaving)
22:07:27 × malte quits (~malte@mal.tc) (Remote host closed the connection)
22:07:28 × takuan quits (~takuan@d8D86B601.access.telenet.be) (Remote host closed the connection)
22:08:51 × tromp quits (~textual@2001:1c00:3487:1b00:6095:11f3:6fa5:fb3d) (Ping timeout: 246 seconds)
22:12:44 × toby-bro quits (~toby-bro@user/toby-bro) (Ping timeout: 260 seconds)
22:17:45 × michalz quits (~michalz@185.246.207.205) (Remote host closed the connection)
22:44:52 emmanuelux joins (~emmanuelu@user/emmanuelux)
22:50:11 dudek joins (~dudek@2a02:a312:c9df:bf80:6431:ea:b097:7aad)
23:02:46 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 252 seconds)
23:03:50 × __monty__ quits (~toonn@user/toonn) (Quit: leaving)
23:06:49 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
23:11:17 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 248 seconds)
23:22:48 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
23:27:46 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 244 seconds)
23:31:10 × dudek quits (~dudek@2a02:a312:c9df:bf80:6431:ea:b097:7aad) (Quit: Leaving)
23:31:50 malte joins (~malte@mal.tc)
23:34:40 × preflex quits (~preflex@user/mauke/bot/preflex) (Ping timeout: 252 seconds)
23:34:55 sintheta joins (~src@user/src)
23:34:56 preflex joins (~preflex@user/mauke/bot/preflex)
23:35:24 × src quits (~src@user/src) (Ping timeout: 252 seconds)
23:37:14 × tdammers quits (~tdammers@110-136-178-143.ftth.glasoperator.nl) (Ping timeout: 252 seconds)
23:37:37 tdammers joins (~tdammers@110-136-178-143.ftth.glasoperator.nl)
23:38:51 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
23:41:38 × sudden quits (~cat@user/sudden) (Ping timeout: 252 seconds)
23:43:37 sudden joins (~cat@user/sudden)
23:43:43 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 245 seconds)
23:44:08 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
23:51:54 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 252 seconds)
23:57:15 ljdarj1 joins (~Thunderbi@user/ljdarj)

All times are in UTC on 2025-03-28.