Logs: liberachat/#haskell
| 2025-11-28 19:24:48 | <EvanR> | :t [id, id, id] |
| 2025-11-28 19:24:49 | <milan> | Could ghc runtime execute print on every function it evaluates? |
| 2025-11-28 19:24:49 | <lambdabot> | [a -> a] |
| 2025-11-28 19:25:09 | <mniip> | yea but if you said `let x = print 3 in [x, x, x]` |
| 2025-11-28 19:25:12 | <mniip> | that would only print once |
| 2025-11-28 19:25:16 | <milan> | Yeah |
| 2025-11-28 19:25:26 | <milan> | Okey I think I can see your point. |
| 2025-11-28 19:25:48 | <EvanR> | you want it to print the function itself? |
| 2025-11-28 19:25:51 | <EvanR> | print id |
| 2025-11-28 19:26:25 | × | notzmv quits (~umar@user/notzmv) (Ping timeout: 264 seconds) |
| 2025-11-28 19:28:55 | × | Lord_of_Life quits (~Lord@user/lord-of-life/x-2819915) (Ping timeout: 240 seconds) |
| 2025-11-28 19:29:15 | → | Lord_of_Life joins (~Lord@user/lord-of-life/x-2819915) |
| 2025-11-28 19:31:09 | <milan> | No I was thining why outputing something to external object is encapsulated in IO. My reasoning was that wheter it chages state of this external object correctly or not can't affect our program (until we do some reading) and so IO here is unnecesary. But as pointed out problem with printing multiple times is one when programming would become very unreliable as sometimes we need to output several |
| 2025-11-28 19:31:11 | <milan> | times. |
| 2025-11-28 19:32:05 | <milan> | Which is possible by chaining multiple print in IO. that guarantees they will be executed multiple times when needed. |
| 2025-11-28 19:35:42 | <EvanR> | let x = putStrLn "HELLO WORLD" >> x in x -- or chaining infinite prints! |
| 2025-11-28 19:35:53 | <EvanR> | you can also factor out the pattern |
| 2025-11-28 19:36:01 | <milan> | Oh cool :) |
| 2025-11-28 19:36:09 | <EvanR> | let loop x = x >> loop x in loop (putStrLn "HELLO WORLD") |
| 2025-11-28 19:36:45 | <EvanR> | separate out the specific things lets you put them back together in other ways |
| 2025-11-28 19:37:20 | <milan> | I really like this language :D |
| 2025-11-28 19:37:36 | <milan> | So sad I am noob :/ |
| 2025-11-28 19:38:34 | <EvanR> | if you call yourself a novice may it sounds better |
| 2025-11-28 19:39:06 | × | humasect quits (~humasect@dyn-192-249-132-90.nexicom.net) (Remote host closed the connection) |
| 2025-11-28 19:45:01 | × | sindu quits (~sindu@2.148.32.207.tmi.telenormobil.no) (Ping timeout: 264 seconds) |
| 2025-11-28 19:51:37 | × | merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 264 seconds) |
| 2025-11-28 19:55:06 | → | tv joins (~tv@user/tv) |
| 2025-11-28 19:55:51 | <milan> | Let's go study a little bit more :).. THank you for answers. |
| 2025-11-28 19:56:41 | → | pavonia joins (~user@user/siracusa) |
| 2025-11-28 20:02:25 | × | ljdarj quits (~Thunderbi@user/ljdarj) (Ping timeout: 264 seconds) |
| 2025-11-28 20:02:55 | → | merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl) |
| 2025-11-28 20:07:43 | × | merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 240 seconds) |
| 2025-11-28 20:11:37 | → | sergheev joins (~sergheev@159.26.108.41) |
| 2025-11-28 20:12:01 | × | sergheev quits (~sergheev@159.26.108.41) (Client Quit) |
| 2025-11-28 20:16:11 | × | myme1 quits (~myme@2a01:799:d5e:5f00:f60f:b1c2:fdec:ad3a) (Ping timeout: 250 seconds) |
| 2025-11-28 20:17:10 | → | myme joins (~myme@2a01:799:d5e:5f00:a10a:6bc:6be7:9209) |
| 2025-11-28 20:23:22 | → | acidjnk joins (~acidjnk@p200300d6e71719110157f51e13fe5b99.dip0.t-ipconnect.de) |
| 2025-11-28 20:25:34 | × | annamalai quits (~annamalai@157.32.117.148) (Ping timeout: 244 seconds) |
| 2025-11-28 20:25:57 | → | CiaoSen joins (~Jura@2a02:8071:64e1:da0:5a47:caff:fe78:33db) |
| 2025-11-28 20:28:56 | → | merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl) |
| 2025-11-28 20:33:35 | × | merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 240 seconds) |
| 2025-11-28 20:44:44 | → | merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl) |
| 2025-11-28 20:46:21 | <gentauro> | Would it make sense that `Bool` had an instance of `Num`? I mean a mapping from `[True, False]` to `[1,0]`? |
| 2025-11-28 20:53:25 | <ncf> | no |
| 2025-11-28 20:54:38 | <geekosaur> | map fronEnum |
| 2025-11-28 21:00:40 | → | target_i joins (~target_i@user/target-i/x-6023099) |
| 2025-11-28 21:01:35 | trickard_ | is now known as trickard |
| 2025-11-28 21:02:29 | <EvanR> | conventionally the + sign in boolean algebra means OR |
| 2025-11-28 21:02:46 | <EvanR> | but if you tried to add 1 and 1 to get 2... and perhaps wrapped back to zero, now it's not that |
| 2025-11-28 21:03:50 | <EvanR> | it's more clear the code does what the person intended if you use numbers as numbers |
| 2025-11-28 21:04:10 | → | jmcantrell joins (~weechat@user/jmcantrell) |
| 2025-11-28 21:04:10 | × | tcard quits (~tcard@2400:4051:5801:7500:cf17:befc:ff82:5303) (Quit: Leaving) |
| 2025-11-28 21:04:38 | → | Googulator joins (~Googulato@2a01-036d-0106-4ad8-d9ec-010d-f188-ffcb.pool6.digikabel.hu) |
| 2025-11-28 21:06:44 | <EvanR> | also the concept of negating a bool usually suggests NOT, but negating 1 and perhaps wrapping back to 1 is not that |
| 2025-11-28 21:07:39 | <EvanR> | and negative zero is just zero |
| 2025-11-28 21:09:12 | <EvanR> | so it's not respecting the booleanness or not respecting the laws of a ring |
| 2025-11-28 21:11:46 | → | tcard joins (~tcard@2400:4051:5801:7500:cf17:befc:ff82:5303) |
| 2025-11-28 21:15:48 | → | Googulator11 joins (~Googulato@2a01-036d-0106-4ad8-d9ec-010d-f188-ffcb.pool6.digikabel.hu) |
| 2025-11-28 21:16:33 | × | Googulator quits (~Googulato@2a01-036d-0106-4ad8-d9ec-010d-f188-ffcb.pool6.digikabel.hu) (Quit: Client closed) |
| 2025-11-28 21:21:02 | → | infinity0 joins (~infinity0@pwned.gg) |
| 2025-11-28 21:22:14 | × | infinity0 quits (~infinity0@pwned.gg) (Client Quit) |
| 2025-11-28 21:22:42 | → | infinity0 joins (~infinity0@pwned.gg) |
| 2025-11-28 21:25:27 | × | infinity0 quits (~infinity0@pwned.gg) (Client Quit) |
| 2025-11-28 21:36:21 | × | merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 250 seconds) |
| 2025-11-28 21:45:54 | × | Googulator11 quits (~Googulato@2a01-036d-0106-4ad8-d9ec-010d-f188-ffcb.pool6.digikabel.hu) (Quit: Client closed) |
| 2025-11-28 21:46:02 | → | Googulator11 joins (~Googulato@84-236-53-137.pool.digikabel.hu) |
| 2025-11-28 21:47:04 | → | merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl) |
| 2025-11-28 21:49:54 | → | infinity0 joins (~infinity0@pwned.gg) |
| 2025-11-28 22:01:05 | × | Googulator11 quits (~Googulato@84-236-53-137.pool.digikabel.hu) (Quit: Client closed) |
| 2025-11-28 22:01:21 | → | Googulator11 joins (~Googulato@84-236-53-137.pool.digikabel.hu) |
| 2025-11-28 22:04:34 | × | target_i quits (~target_i@user/target-i/x-6023099) (Quit: leaving) |
| 2025-11-28 22:05:55 | × | merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 240 seconds) |
| 2025-11-28 22:12:13 | <monochrom> | Yeah "plus" is a very broken analogy for boolean OR. The analogy I use is and=min and or=max. In fact, at that point it is an isomorphism. |
| 2025-11-28 22:12:47 | <monochrom> | You can also get ring-ness with and=times and xor=plus. |
| 2025-11-28 22:12:53 | <Leary> | gentauro: It's another case like `Foldable ((,) a)` where the instance makes perfect sense in principle, but in practice a lot of people will complain that the operations don't do what they expected them to, or that their use of the instance was an accident they wanted GHC to catch. |
| 2025-11-28 22:14:14 | <EvanR> | the more things that "work" the less things the compiler can definitely say are nonsense written by a human |
| 2025-11-28 22:14:53 | <EvanR> | see + operator in javascript |
| 2025-11-28 22:15:38 | → | Googulator95 joins (~Googulato@84-236-53-137.pool.digikabel.hu) |
| 2025-11-28 22:15:45 | × | Googulator11 quits (~Googulato@84-236-53-137.pool.digikabel.hu) (Quit: Client closed) |
| 2025-11-28 22:17:31 | → | merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl) |
| 2025-11-28 22:23:55 | × | merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 240 seconds) |
| 2025-11-28 22:28:57 | <haskellbridge> | <Luca> The xor/and Bool ring is just Z/Z2 |
| 2025-11-28 22:29:54 | <haskellbridge> | <Luca> Z/2Z |
| 2025-11-28 22:30:13 | × | qqe quits (~qqq@185.54.22.255) (Remote host closed the connection) |
| 2025-11-28 22:34:45 | × | divlamir quits (~divlamir@user/divlamir) (Read error: Connection reset by peer) |
| 2025-11-28 22:34:58 | → | divlamir joins (~divlamir@user/divlamir) |
| 2025-11-28 22:35:13 | <monochrom> | :) |
| 2025-11-28 22:35:34 | → | merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl) |
| 2025-11-28 22:39:55 | × | merijn quits (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 240 seconds) |
| 2025-11-28 22:45:38 | <EvanR> | type classes were invented so we could sanely overload specific operators like + for their cultural value |
| 2025-11-28 22:46:03 | <EvanR> | but when + means xor |
| 2025-11-28 22:47:02 | × | milan quits (~milan@88.212.61.169) (Quit: WeeChat 4.5.2) |
| 2025-11-28 22:47:07 | <EvanR> | somebody is going to get pissed off! (in math you'd just non-chalantly use a different operator for this ring, and rely on everyone's mental inference) |
| 2025-11-28 22:48:25 | <EvanR> | how many ways can you implement Monoid for Bool |
| 2025-11-28 22:49:00 | × | tromp quits (~textual@2001:1c00:3487:1b00:9176:7929:ae5a:d4f6) (Quit: My iMac has gone to sleep. ZZZzzz…) |
| 2025-11-28 22:50:24 | → | tromp joins (~textual@2001:1c00:3487:1b00:9176:7929:ae5a:d4f6) |
| 2025-11-28 22:50:56 | → | merijn joins (~merijn@host-vr.cgnat-g.v4.dfn.nl) |
| 2025-11-28 22:52:34 | → | Dhark8 joins (~Shark8@c-174-56-102-109.hsd1.nm.comcast.net) |
| 2025-11-28 22:54:17 | <geekosaur> | (how many ways can you define it for Integer? 😛 ) |
| 2025-11-28 22:54:35 | <tomsmeding> | % check (zero, a00, a01, a10, a11) = let f x y = [a00, a01, a10, a11] !! (2 * fromEnum x + fromEnum y) in and $ [f zero x == x && f x zero == x | x <- [False, True]] ++ [f x (f y z) == f (f x y) z | x <- [False, True], y <- [False, True], z <- [False, True]] |
All times are in UTC.