Home liberachat/#haskell: Logs Calendar

Logs: liberachat/#haskell

←Prev  Next→ 1,801,407 events total
2025-12-15 20:46:27 <c_wraith> I threw in an unsafeInterleaveST to recover laziness, but I was already using unsafeInterleaveST to run Kruskal's algorithm on demand.
2025-12-15 20:47:03 <c_wraith> Thus I introduced an order dependence in a "pure" expression.
2025-12-15 20:47:13 <c_wraith> The moral of the story: immutability is pretty cool.
2025-12-15 20:48:51 <c_wraith> (It also only sped up to matching performance when I introduced that problem. Not a win!)
2025-12-15 20:49:02 <[exa]> milan2: in longer, make a stupid serial prototype first and then you can switch the backend for whichever concurrent webserver matches your expected workload
2025-12-15 20:50:07 califax_ joins (~califax@user/califx)
2025-12-15 20:50:48 <[exa]> c_wraith: nice way to show that tbh
2025-12-15 20:51:32 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
2025-12-15 20:52:01 <milan2> [exa]: ty
2025-12-15 20:52:51 <c_wraith> I could probably make it a lot faster if I went with an array representation instead of STRef chasing. But I'd still lose on laziness unless I changed a lot of the API.
2025-12-15 20:52:53 eron joins (~eron@187.56.156.228)
2025-12-15 20:53:13 × califax quits (~califax@user/califx) (Ping timeout: 252 seconds)
2025-12-15 20:53:13 califax_ is now known as califax
2025-12-15 20:53:41 <c_wraith> Also, doing it via STRef chasing is *hard*. So many fiddly details. I wanted to practice with them.
2025-12-15 20:56:33 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 260 seconds)
2025-12-15 21:00:37 × peterbecich quits (~Thunderbi@71.84.33.135) (Ping timeout: 264 seconds)
2025-12-15 21:00:44 Googulator21 joins (~Googulato@2a01-036d-0106-01cb-3c18-a4bd-1bda-7c8b.pool6.digikabel.hu)
2025-12-15 21:01:27 × Googulator quits (~Googulato@2a01-036d-0106-01cb-3c18-a4bd-1bda-7c8b.pool6.digikabel.hu) (Quit: Client closed)
2025-12-15 21:05:06 gf32 joins (~gf3@user/gf3)
2025-12-15 21:06:00 × chele quits (~chele@user/chele) (Remote host closed the connection)
2025-12-15 21:06:19 × eron quits (~eron@187.56.156.228) (Quit: Client closed)
2025-12-15 21:07:20 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
2025-12-15 21:12:07 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 240 seconds)
2025-12-15 21:13:58 <gentauro> chromoblob: but int-e is using `do-notation` so it's also `Monadic` right?
2025-12-15 21:14:07 <gentauro> you can see that from the signature
2025-12-15 21:14:23 <c_wraith> > do ()
2025-12-15 21:14:24 <lambdabot> ()
2025-12-15 21:14:25 <gentauro> I recall Marlow expanding `Applicative` to have `do-notation` as well
2025-12-15 21:14:25 humasect joins (~humasect@dyn-192-249-132-90.nexicom.net)
2025-12-15 21:14:28 <c_wraith> () is monadic now
2025-12-15 21:14:37 <gentauro> but, You needed to do a bit more
2025-12-15 21:14:50 humasect_ joins (~humasect@dyn-192-249-132-90.nexicom.net)
2025-12-15 21:14:51 <c_wraith> there is an ApplicativeDo extension
2025-12-15 21:15:19 <c_wraith> It attempts to convert a do block into uses of <*> and <$> with a lot of tupling
2025-12-15 21:15:40 × humasect_ quits (~humasect@dyn-192-249-132-90.nexicom.net) (Remote host closed the connection)
2025-12-15 21:15:58 <gentauro> https://dl.acm.org/doi/10.1145/3341694
2025-12-15 21:16:12 <c_wraith> If it fails to do that conversion, it uses the standard >> and >>= desugaring
2025-12-15 21:16:20 humasect_ joins (~humasect@dyn-192-249-132-90.nexicom.net)
2025-12-15 21:16:48 × humasect_ quits (~humasect@dyn-192-249-132-90.nexicom.net) (Remote host closed the connection)
2025-12-15 21:18:31 × humasect quits (~humasect@dyn-192-249-132-90.nexicom.net) (Ping timeout: 240 seconds)
2025-12-15 21:18:43 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
2025-12-15 21:18:44 <gentauro> I just find the `(\ _ x _ -> x) <$> foo <*> bar <*> baz` more readable than anything else. I rarely use (as in never) monands when I do monadic parsing.
2025-12-15 21:18:53 <gentauro> monadic parsing = parser combinators
2025-12-15 21:19:07 <gentauro> (bad habbits kicking in xD)
2025-12-15 21:20:18 <gentauro> `… <$> … <*> …` combined with `<|>` (Alternate) and you are good to go :)
2025-12-15 21:23:43 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 240 seconds)
2025-12-15 21:31:34 × myme quits (~myme@2a01:799:d5e:5f00:e46f:4150:c7c:78b) (Ping timeout: 260 seconds)
2025-12-15 21:32:41 myme joins (~myme@2a01:799:d5e:5f00:5e12:8326:f92:1a30)
2025-12-15 21:34:04 × takuan quits (~takuan@d8D86B9E9.access.telenet.be) (Remote host closed the connection)
2025-12-15 21:34:43 × target_i quits (~target_i@user/target-i/x-6023099) (Quit: leaving)
2025-12-15 21:34:51 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
2025-12-15 21:38:10 × trickard_ quits (~trickard@cpe-81-98-47-163.wireline.com.au) (Read error: Connection reset by peer)
2025-12-15 21:39:35 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 240 seconds)
2025-12-15 21:39:37 <c_wraith> gentauro: you genually need monadic parsing when the source is context-sensitive. Applicative + Alternative doesn't give you a way to choose parsers based on a value previously parsed.
2025-12-15 21:40:55 trickard_ joins (~trickard@cpe-81-98-47-163.wireline.com.au)
2025-12-15 21:50:38 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
2025-12-15 21:55:15 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 240 seconds)
2025-12-15 22:00:31 × Googulator21 quits (~Googulato@2a01-036d-0106-01cb-3c18-a4bd-1bda-7c8b.pool6.digikabel.hu) (Quit: Client closed)
2025-12-15 22:00:50 Googulator21 joins (~Googulato@2a01-036d-0106-01cb-3c18-a4bd-1bda-7c8b.pool6.digikabel.hu)
2025-12-15 22:03:06 humasect joins (~humasect@dyn-192-249-132-90.nexicom.net)
2025-12-15 22:03:45 × humasect quits (~humasect@dyn-192-249-132-90.nexicom.net) (Remote host closed the connection)
2025-12-15 22:06:08 Googulator21 is now known as Googulator
2025-12-15 22:06:23 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
2025-12-15 22:07:41 humasect joins (~humasect@dyn-192-249-132-90.nexicom.net)
2025-12-15 22:08:16 × humasect quits (~humasect@dyn-192-249-132-90.nexicom.net) (Remote host closed the connection)
2025-12-15 22:15:43 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 240 seconds)
2025-12-15 22:29:02 <chromoblob> c_wraith: how is () a Monad? there is no type parameter in (), and a monad must have a parameter
2025-12-15 22:29:22 <chromoblob> :t ()
2025-12-15 22:29:23 <lambdabot> ()
2025-12-15 22:30:44 Googulator85 joins (~Googulato@2a01-036d-0106-01cb-3c18-a4bd-1bda-7c8b.pool6.digikabel.hu)
2025-12-15 22:30:47 × Googulator quits (~Googulato@2a01-036d-0106-01cb-3c18-a4bd-1bda-7c8b.pool6.digikabel.hu) (Quit: Client closed)
2025-12-15 22:33:21 × milan2 quits (~milan@88.212.61.169) (Quit: WeeChat 4.5.2)
2025-12-15 22:38:48 <davean> chromoblob: that do uses no nonactic things, so it entails no monad class functions
2025-12-15 22:38:55 × ljdarj quits (~Thunderbi@user/ljdarj) (Ping timeout: 240 seconds)
2025-12-15 22:39:15 × euphores quits (~SASL_euph@user/euphores) (Ping timeout: 240 seconds)
2025-12-15 22:39:30 <davean> Thus nothing contradicts it
2025-12-15 22:39:34 <chromoblob> :t return 5 :: ()
2025-12-15 22:39:35 <lambdabot> error: [GHC-83865]
2025-12-15 22:39:35 <lambdabot> • Couldn't match expected type ‘()’ with actual type ‘m0 a0’
2025-12-15 22:39:35 <lambdabot> • In the expression: return 5 :: ()
2025-12-15 22:40:13 <davean> Yes, because that *does* entail Monad because you used return
2025-12-15 22:40:17 <chromoblob> :t do (); ()
2025-12-15 22:40:18 <lambdabot> error: [GHC-83865]
2025-12-15 22:40:18 <lambdabot> • Couldn't match expected type ‘m a0’ with actual type ‘()’
2025-12-15 22:40:18 <lambdabot> • In a stmt of a 'do' block: ()
2025-12-15 22:40:55 <davean> :t do ();
2025-12-15 22:40:55 <lambdabot> ()
2025-12-15 22:40:57 <chromoblob> so, what can i do with this? why make `do` behave so?
2025-12-15 22:41:17 <davean> Its not making it do behave so, its what do is.
2025-12-15 22:41:55 <davean> Do desugars procedurally, via monad functions, or applicitive, none of those are used so the resultant code has no issues
2025-12-15 22:42:03 <davean> do () just becomes ()
2025-12-15 22:42:16 <davean> () is a value and nothing in your do interacts with it
2025-12-15 22:42:20 × michalz quits (~michalz@185.246.207.197) (Remote host closed the connection)
2025-12-15 22:42:26 <tomsmeding> 'do' is syntactic sugar: 'do a; b' ~> 'a >> b'; 'do x <- a; b' ~> 'a >>= \x -> b'; 'do let { x = a }; b' ~> 'let x = a in b'; 'do a' ~> 'a'
2025-12-15 22:42:26 <chromoblob> :t do pure 5
2025-12-15 22:42:27 <lambdabot> (Applicative f, Num a) => f a
2025-12-15 22:42:37 <chromoblob> :t do return 5
2025-12-15 22:42:38 <lambdabot> (Monad m, Num a) => m a
2025-12-15 22:42:46 Googulator85 is now known as Googulator
2025-12-15 22:42:49 <tomsmeding> a trivial 'do' like 'do ()' falls in the final, default case and just desugars to '()'

All times are in UTC.