Home liberachat/#haskell: Logs Calendar

Logs: liberachat/#haskell

←Prev  Next→ 1,801,408 events total
2025-12-15 19:04:21 × latticepolytope quits (~user@user/isekaijin) (Quit: ERC 5.6.0.30.1 (IRC client for GNU Emacs 30.2))
2025-12-15 19:15:43 Googulator37 joins (~Googulato@2a01-036d-0106-01cb-3c18-a4bd-1bda-7c8b.pool6.digikabel.hu)
2025-12-15 19:16:56 × humasect quits (~humasect@dyn-192-249-132-90.nexicom.net) (Remote host closed the connection)
2025-12-15 19:18:05 milan2 joins (~milan@88.212.61.169)
2025-12-15 19:19:31 × Googulator15 quits (~Googulato@2a01-036d-0106-01cb-3c18-a4bd-1bda-7c8b.pool6.digikabel.hu) (Ping timeout: 272 seconds)
2025-12-15 19:20:29 <milan2> Hello is there something like >>= but for different types? I have "Either" and I want to chain it with "Maybe" so Left goes to Nothing and Right to Just?
2025-12-15 19:23:17 <gentauro> milan2: I don't know about operators, but, Hoogle is your friend ;) `https://hoogle.haskell.org/?hoogle=Either%20a%20b%20-%3E%20Maybe%20a`
2025-12-15 19:24:05 <int-e> :t listToMaybe . rights . pure
2025-12-15 19:24:06 <lambdabot> Either a1 a2 -> Maybe a2
2025-12-15 19:24:29 <int-e> (very intuitive ;-) )
2025-12-15 19:25:23 × califax quits (~califax@user/califx) (Remote host closed the connection)
2025-12-15 19:25:24 target_i joins (~target_i@user/target-i/x-6023099)
2025-12-15 19:25:27 <gentauro> int-e: and you only rely on `base`. That's nice :)
2025-12-15 19:25:44 <gentauro> :t rights
2025-12-15 19:25:45 <lambdabot> [Either a b] -> [b]
2025-12-15 19:26:26 <milan2> gentauro: TY, I didn't know I can search by type signature. Thank you int-e :)
2025-12-15 19:27:00 <int-e> :t \e -> do Right a <- pure e; pure a
2025-12-15 19:27:01 <lambdabot> MonadFail m => Either a b -> m b
2025-12-15 19:27:18 califax joins (~califax@user/califx)
2025-12-15 19:27:18 <gentauro> milan2: This is actually the right signature to search for -> https://hoogle.haskell.org/?hoogle=Either%20a%20b%20-%3E%20Maybe%20b `Either a b -> Maybe b`
2025-12-15 19:28:11 <gentauro> https://hackage-content.haskell.org/package/ghc-9.12.2/docs/src/GHC.Data.Maybe.html#rightToMaybe
2025-12-15 19:28:25 <milan2> Yeah I am looking at that right now :)
2025-12-15 19:29:15 × aku quits (aku@65.108.245.241) (Quit: Lost terminal)
2025-12-15 19:30:33 aku joins (aku@65.108.245.241)
2025-12-15 19:32:15 Lord_of_Life_ joins (~Lord@user/lord-of-life/x-2819915)
2025-12-15 19:33:03 × Lord_of_Life quits (~Lord@user/lord-of-life/x-2819915) (Ping timeout: 256 seconds)
2025-12-15 19:35:09 Lord_of_Life_ is now known as Lord_of_Life
2025-12-15 19:41:23 × ouilemur quits (~jgmerritt@user/ouilemur) (Ping timeout: 250 seconds)
2025-12-15 19:42:34 × Googulator37 quits (~Googulato@2a01-036d-0106-01cb-3c18-a4bd-1bda-7c8b.pool6.digikabel.hu) (Quit: Client closed)
2025-12-15 19:42:54 Googulator37 joins (~Googulato@2a01-036d-0106-01cb-3c18-a4bd-1bda-7c8b.pool6.digikabel.hu)
2025-12-15 19:43:37 ouilemur joins (~jgmerritt@user/ouilemur)
2025-12-15 19:43:44 humasect joins (~humasect@dyn-192-249-132-90.nexicom.net)
2025-12-15 19:53:35 <chromoblob> why not `return`
2025-12-15 19:54:20 <monochrom> We like the name "pure" more. :)
2025-12-15 19:54:43 <int-e> it only took a decade to retrain myself to actually use `pure`.
2025-12-15 19:55:16 <monochrom> I just installed a new device driver in my head. :)
2025-12-15 19:55:37 <int-e> chromoblob: `pure` is shorter and doesn't have the misleading imperative programming connotations that `return` has.
2025-12-15 19:55:49 <monochrom> Yeah I like shorter too. :)
2025-12-15 19:56:27 <int-e> > (do return 1; return 2) :: Maybe Int
2025-12-15 19:56:28 <monochrom> When I teach a language course, my excuse for saying "term" for "expression" is: "term" is shorter. :)
2025-12-15 19:56:28 <lambdabot> Just 2
2025-12-15 19:56:51 <int-e> monochrom: I'm all for short term rewards as well.
2025-12-15 19:57:20 × Googulator37 quits (~Googulato@2a01-036d-0106-01cb-3c18-a4bd-1bda-7c8b.pool6.digikabel.hu) (Quit: Client closed)
2025-12-15 19:57:25 <monochrom> haha
2025-12-15 19:57:40 Googulator37 joins (~Googulato@2a01-036d-0106-01cb-3c18-a4bd-1bda-7c8b.pool6.digikabel.hu)
2025-12-15 20:00:40 × Googulator37 quits (~Googulato@2a01-036d-0106-01cb-3c18-a4bd-1bda-7c8b.pool6.digikabel.hu) (Client Quit)
2025-12-15 20:00:54 Googulator37 joins (~Googulato@2a01-036d-0106-01cb-3c18-a4bd-1bda-7c8b.pool6.digikabel.hu)
2025-12-15 20:03:16 Tuplanolla joins (~Tuplanoll@91-152-225-194.elisa-laajakaista.fi)
2025-12-15 20:03:35 <chromoblob> `return` is historic
2025-12-15 20:04:06 <monochrom> `pure` is modern :)
2025-12-15 20:04:40 <chromoblob> also, `return` signifies that you're using Monad
2025-12-15 20:05:56 <monochrom> IMO unimportant.
2025-12-15 20:08:37 lockna joins (~obr@089144192027.atnat0001.highway.a1.net)
2025-12-15 20:10:11 <monochrom> Eq has (==), Ord is a subclass, and we don't propose to add (===) to Ord to be a synonym of (==) such that when we compare two integers we use (===) to "signify that I'm using Ord".
2025-12-15 20:10:38 <monochrom> If `return` is historic, then it means that it was a historical mistake.
2025-12-15 20:11:23 <monochrom> Or more moderately, s/mistake/oversight/
2025-12-15 20:13:11 <c_wraith> oversight would be accurate, I think. No one had yet realized that Applicative was a useful middle ground.
2025-12-15 20:13:27 <int-e> Or maybe in 1998 Haskell was less concerned with applications.
2025-12-15 20:14:07 <int-e> (remember when it was called "Idiom" for a while... that would've been awful.)
2025-12-15 20:14:43 <monochrom> Monad was called "triple" at the beginning, too. :)
2025-12-15 20:15:24 <Rembane> That's a way less scary word! :D
2025-12-15 20:15:26 <c_wraith> I don't think Applicative was really recognized as useful (in two directions - rich enough to have practical applications, simple enough that it can have useful instances that can't be monads) until the development of applicative parsers
2025-12-15 20:15:38 <int-e> Rembane: but it's way too generic
2025-12-15 20:15:53 pavonia joins (~user@user/siracusa)
2025-12-15 20:15:59 <int-e> Rembane: It's like calling a company Meta because it's about something. ;-)
2025-12-15 20:16:47 <monochrom> Hey wouldn't it be nice! class Tuploid f where pure :: a -> f a; (<*>) :: f a -> f b -> f (a,b); class Tuploid f => Triploid f where (>>=) :: ...
2025-12-15 20:16:52 × gf3 quits (~gf3@user/gf3) (Ping timeout: 246 seconds)
2025-12-15 20:17:04 <Rembane> int-e: Indeed, it doesn't mean anything. :)
2025-12-15 20:17:05 <int-e> (FWIW I call the underlying failed product Facebook 3D out of spite.)
2025-12-15 20:17:42 <monochrom> Alpha and Meta :)
2025-12-15 20:17:54 × humasect quits (~humasect@dyn-192-249-132-90.nexicom.net) (Remote host closed the connection)
2025-12-15 20:18:18 <Rembane> There was something in the regular automata course that was a quintuple of "basically trivial things" I can't remember what though, maybe a turing machine or regular expression or something.
2025-12-15 20:20:58 <int-e> one way to get a quintuple is to have symbols, states, accepting states, rejecting states, transitions
2025-12-15 20:21:11 × lockna quits (~obr@089144192027.atnat0001.highway.a1.net) (Quit: Leaving)
2025-12-15 20:21:27 lockna joins (~obr@089144192027.atnat0001.highway.a1.net)
2025-12-15 20:22:03 <int-e> Which you might do for a Turing machine. Another way is to split transitions into transitions and epsilon-transitions, but not have rejecting states... so a typical NFA.
2025-12-15 20:23:52 <Rembane> Both sound distantly familiar, so at least one of those.
2025-12-15 20:23:54 × lockna quits (~obr@089144192027.atnat0001.highway.a1.net) (Client Quit)
2025-12-15 20:24:08 lockna joins (~obr@089144192027.atnat0001.highway.a1.net)
2025-12-15 20:24:10 l0ckna joins (~obr@089144192027.atnat0001.highway.a1.net)
2025-12-15 20:24:33 × l0ckna quits (~obr@089144192027.atnat0001.highway.a1.net) (Remote host closed the connection)
2025-12-15 20:24:34 × lockna quits (~obr@089144192027.atnat0001.highway.a1.net) (Remote host closed the connection)
2025-12-15 20:24:48 lockna joins (~obr@089144192027.atnat0001.highway.a1.net)
2025-12-15 20:24:50 l0ckna joins (~obr@089144192027.atnat0001.highway.a1.net)
2025-12-15 20:25:05 × lockna quits (~obr@089144192027.atnat0001.highway.a1.net) (Client Quit)
2025-12-15 20:25:05 × l0ckna quits (~obr@089144192027.atnat0001.highway.a1.net) (Remote host closed the connection)
2025-12-15 20:26:39 CiaoSen joins (~Jura@2a02:8071:64e1:da0:5a47:caff:fe78:33db)
2025-12-15 20:31:56 × Googulator37 quits (~Googulato@2a01-036d-0106-01cb-3c18-a4bd-1bda-7c8b.pool6.digikabel.hu) (Quit: Client closed)
2025-12-15 20:32:20 Googulator37 joins (~Googulato@2a01-036d-0106-01cb-3c18-a4bd-1bda-7c8b.pool6.digikabel.hu)
2025-12-15 20:35:16 bggd__ joins (~bgg@2a01:e0a:fd5:f510:6bc5:c845:f799:c476)
2025-12-15 20:35:40 Googulator37 is now known as Googulator
2025-12-15 20:35:43 merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl)
2025-12-15 20:36:41 peterbecich joins (~Thunderbi@71.84.33.135)
2025-12-15 20:38:47 × bggd quits (~bgg@user/bggd) (Read error: Connection reset by peer)
2025-12-15 20:40:31 × merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 240 seconds)
2025-12-15 20:42:14 <c_wraith> woo, I got a practical example of unsafeInterleaveST breaking "pure" code!
2025-12-15 20:42:25 <milan2> Guyz I am thinking about prorotyping web app. Async is a big thing in IO heavy apps. Can I expect that I will be able to create fully async web api from fully async db client, http client and
2025-12-15 20:42:28 <milan2> ?
2025-12-15 20:44:48 <[exa]> milan2: in short yes
2025-12-15 20:45:30 <c_wraith> I decided to go back and rewrite Day 8 of the AoC using ST to make all the updates O(1) instead of just throwing all the indirection into a Map. It turned out slower, and I realized this was due to a loss of laziness from generating a summary of the disjoint set strictly at every iteration even though it was only used once.

All times are in UTC.