Logs on 2026-02-24 (liberachat/#haskell)
| 00:05:57 | × | bryanv quits (~quassel@2603:c028:4503:7500:45b7:933:ab17:bc10) (Server closed connection) |
| 00:06:10 | → | bryanv joins (~quassel@2603:c028:4503:7500:45b7:933:ab17:bc10) |
| 00:06:51 | × | humasect quits (~humasect@dyn-192-249-132-90.nexicom.net) (Quit: Leaving...) |
| 00:08:31 | → | merijn joins (~merijn@host-cl.cgnat-g.v4.dfn.nl) |
| 00:13:36 | × | merijn quits (~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 268 seconds) |
| 00:19:37 | × | ChaiTRex quits (~ChaiTRex@user/chaitrex) (Remote host closed the connection) |
| 00:19:57 | → | ChaiTRex joins (~ChaiTRex@user/chaitrex) |
| 00:23:53 | → | merijn joins (~merijn@host-cl.cgnat-g.v4.dfn.nl) |
| 00:28:21 | × | merijn quits (~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 255 seconds) |
| 00:31:17 | × | Raito_Bezarius quits (~Raito@libera/contributor/wireguard.tunneler.raito-bezarius) (Server closed connection) |
| 00:31:59 | → | Raito_Bezarius joins (~Raito@libera/contributor/wireguard.tunneler.raito-bezarius) |
| 00:33:17 | × | fgaz quits (1ff9197ed6@2a03:6000:1812:100::11ea) (Server closed connection) |
| 00:33:24 | → | fgaz joins (1ff9197ed6@2a03:6000:1812:100::11ea) |
| 00:38:27 | → | merijn joins (~merijn@host-cl.cgnat-g.v4.dfn.nl) |
| 00:41:14 | × | ljdarj quits (~Thunderbi@user/ljdarj) (Ping timeout: 252 seconds) |
| 00:43:12 | × | merijn quits (~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 255 seconds) |
| 00:48:08 | → | Square3 joins (~Square@user/square) |
| 00:48:57 | → | arandombit joins (~arandombi@user/arandombit) |
| 00:51:17 | × | orcus quits (~orcus@user/brprice) (Server closed connection) |
| 00:51:26 | → | jtnuttall joins (~jeremy@user/jeremyn) |
| 00:51:36 | → | orcus joins (~orcus@user/brprice) |
| 00:53:49 | → | merijn joins (~merijn@host-cl.cgnat-g.v4.dfn.nl) |
| 00:53:57 | × | haasn quits (sid579015@id-579015.hampstead.irccloud.com) (Server closed connection) |
| 00:54:21 | → | haasn joins (sid579015@id-579015.hampstead.irccloud.com) |
| 00:55:17 | × | edm quits (sid147314@id-147314.hampstead.irccloud.com) (Server closed connection) |
| 00:55:40 | → | edm joins (sid147314@id-147314.hampstead.irccloud.com) |
| 00:56:09 | × | xff0x quits (~xff0x@2405:6580:b080:900:c463:24ea:8f04:8fed) (Ping timeout: 248 seconds) |
| 00:58:23 | × | merijn quits (~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 268 seconds) |
| 01:09:12 | → | merijn joins (~merijn@host-cl.cgnat-g.v4.dfn.nl) |
| 01:13:39 | × | merijn quits (~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 245 seconds) |
| 01:16:37 | × | Tuplanolla quits (~Tuplanoll@88-114-89-88.elisa-laajakaista.fi) (Quit: Leaving.) |
| 01:17:11 | × | Googulator quits (~Googulato@2a01-036d-0106-499d-1c5a-0e4b-5795-d7e3.pool6.digikabel.hu) (Quit: Client closed) |
| 01:17:18 | → | Googulator51 joins (~Googulato@2a01-036d-0106-499d-1c5a-0e4b-5795-d7e3.pool6.digikabel.hu) |
| 01:18:10 | × | emmanuelux quits (~em@user/emmanuelux) (Read error: Connection reset by peer) |
| 01:20:27 | → | Googulator17 joins (~Googulato@2a01-036d-0106-499d-1c5a-0e4b-5795-d7e3.pool6.digikabel.hu) |
| 01:20:27 | × | Googulator51 quits (~Googulato@2a01-036d-0106-499d-1c5a-0e4b-5795-d7e3.pool6.digikabel.hu) (Client Quit) |
| 01:24:35 | → | merijn joins (~merijn@host-cl.cgnat-g.v4.dfn.nl) |
| 01:28:10 | × | Googulator17 quits (~Googulato@2a01-036d-0106-499d-1c5a-0e4b-5795-d7e3.pool6.digikabel.hu) (Quit: Client closed) |
| 01:28:18 | → | Googulator17 joins (~Googulato@2a01-036d-0106-499d-1c5a-0e4b-5795-d7e3.pool6.digikabel.hu) |
| 01:31:21 | × | merijn quits (~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 255 seconds) |
| 01:32:20 | × | califax quits (~califax@user/califx) (Remote host closed the connection) |
| 01:36:34 | → | califax joins (~califax@user/califx) |
| 01:42:37 | → | merijn joins (~merijn@host-cl.cgnat-g.v4.dfn.nl) |
| 01:44:06 | × | nonzen quits (~nonzen@user/nonzen) (Server closed connection) |
| 01:44:22 | → | nonzen joins (~nonzen@user/nonzen) |
| 01:47:07 | × | merijn quits (~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 264 seconds) |
| 01:49:33 | → | xff0x joins (~xff0x@fsb6a9491c.tkyc517.ap.nuro.jp) |
| 01:51:25 | × | paddymahoney quits (~paddymaho@pool-99-250-10-137.cpe.net.cable.rogers.com) (Ping timeout: 268 seconds) |
| 01:52:03 | × | jtnuttall quits (~jeremy@user/jeremyn) (Ping timeout: 255 seconds) |
| 01:55:17 | → | paddymahoney joins (~paddymaho@pool-99-250-10-137.cpe.net.cable.rogers.com) |
| 01:57:59 | → | merijn joins (~merijn@host-cl.cgnat-g.v4.dfn.nl) |
| 01:59:37 | → | peterbecich joins (~Thunderbi@71.84.33.135) |
| 02:01:54 | × | arandombit quits (~arandombi@user/arandombit) (Ping timeout: 268 seconds) |
| 02:02:24 | × | merijn quits (~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 256 seconds) |
| 02:08:06 | × | JSharp quits (sid4580@user/JSharp) (Server closed connection) |
| 02:08:25 | → | JSharp joins (sid4580@user/JSharp) |
| 02:10:06 | × | unlucy quits (sid572875@user/unlucy) (Server closed connection) |
| 02:10:35 | → | unlucy joins (sid572875@user/unlucy) |
| 02:13:22 | → | merijn joins (~merijn@host-cl.cgnat-g.v4.dfn.nl) |
| 02:17:56 | × | merijn quits (~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 268 seconds) |
| 02:21:54 | → | weary-traveler joins (~user@user/user363627) |
| 02:28:45 | → | merijn joins (~merijn@host-cl.cgnat-g.v4.dfn.nl) |
| 02:31:07 | × | stef204 quits (~stef204@user/stef204) (Quit: WeeChat 4.2.1) |
| 02:33:13 | × | merijn quits (~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 248 seconds) |
| 02:33:43 | → | jtnuttall joins (~jeremy@user/jeremyn) |
| 02:34:06 | × | piele quits (~piele@eiseth.creativeserver.net) (Server closed connection) |
| 02:34:18 | → | piele joins (~piele@eiseth.creativeserver.net) |
| 02:36:00 | → | bjorkintosh joins (~bjork@user/bjorkintosh) |
| 02:36:01 | ← | bjorkintosh parts (~bjork@user/bjorkintosh) (Leaving) |
| 02:44:06 | → | merijn joins (~merijn@host-cl.cgnat-g.v4.dfn.nl) |
| 02:46:37 | × | hook54321 quits (sid149355@user/hook54321) (Server closed connection) |
| 02:47:53 | → | hook54321 joins (sid149355@user/hook54321) |
| 02:48:46 | × | merijn quits (~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 268 seconds) |
| 02:48:53 | × | Googulator17 quits (~Googulato@2a01-036d-0106-499d-1c5a-0e4b-5795-d7e3.pool6.digikabel.hu) (Quit: Client closed) |
| 02:49:08 | → | Googulator17 joins (~Googulato@2a01-036d-0106-499d-1c5a-0e4b-5795-d7e3.pool6.digikabel.hu) |
| 02:51:53 | → | merijn joins (~merijn@host-cl.cgnat-g.v4.dfn.nl) |
| 02:55:40 | × | peterbecich quits (~Thunderbi@71.84.33.135) (Ping timeout: 256 seconds) |
| 02:56:43 | × | merijn quits (~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 264 seconds) |
| 03:07:10 | → | merijn joins (~merijn@host-cl.cgnat-g.v4.dfn.nl) |
| 03:14:03 | × | merijn quits (~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 268 seconds) |
| 03:16:31 | × | Googulator17 quits (~Googulato@2a01-036d-0106-499d-1c5a-0e4b-5795-d7e3.pool6.digikabel.hu) (Quit: Client closed) |
| 03:16:46 | → | Googulator17 joins (~Googulato@2a01-036d-0106-499d-1c5a-0e4b-5795-d7e3.pool6.digikabel.hu) |
| 03:21:26 | × | Logio quits (em@kapsi.fi) (Server closed connection) |
| 03:21:36 | → | Logio joins (em@kapsi.fi) |
| 03:21:46 | → | arandombit joins (~arandombi@user/arandombit) |
| 03:25:06 | <Leary> | Upper bounds aside, `cabal check` doesn't seem to care about lower bounds. Does that mean I can give up on the archaeology necessary to find them? |
| 03:25:12 | → | merijn joins (~merijn@host-cl.cgnat-g.v4.dfn.nl) |
| 03:27:37 | × | Lord_of_Life quits (~Lord@user/lord-of-life/x-2819915) (Quit: Laa shay'a waqi'un moutlaq bale kouloun moumkine) |
| 03:27:49 | → | humasect joins (~humasect@dyn-192-249-132-90.nexicom.net) |
| 03:28:08 | × | haskell-noob quits (~haskell-n@50.35.80.129) (Quit: Client closed) |
| 03:28:36 | → | Lord_of_Life joins (~Lord@user/lord-of-life/x-2819915) |
| 03:29:40 | × | merijn quits (~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 256 seconds) |
| 03:34:26 | <monochrom> | I usually do. I set my lower bounds to be what I happen to have when I start the project. Then I don't change them until someone wants it changed. |
| 03:39:28 | <Leary> | Well, in that case you're setting them conservatively. I was more wondering about the opposite strategy of omitting them entirely. |
| 03:40:33 | → | werneta joins (~werneta@71.83.160.242) |
| 03:40:34 | → | merijn joins (~merijn@host-cl.cgnat-g.v4.dfn.nl) |
| 03:40:40 | → | xff0x_ joins (~xff0x@fsb6a9491c.tkyc517.ap.nuro.jp) |
| 03:41:00 | × | arandombit quits (~arandombi@user/arandombit) (Ping timeout: 256 seconds) |
| 03:41:24 | × | machinedgod quits (~machinedg@d172-219-48-230.abhsia.telus.net) (Ping timeout: 255 seconds) |
| 03:42:45 | × | xff0x quits (~xff0x@fsb6a9491c.tkyc517.ap.nuro.jp) (Ping timeout: 255 seconds) |
| 03:44:13 | → | peterbecich joins (~Thunderbi@71.84.33.135) |
| 03:44:59 | xff0x_ | is now known as xff0x |
| 03:45:00 | × | merijn quits (~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 255 seconds) |
| 03:45:11 | <monochrom> | Then one day you will run into something like this recent example: https://discourse.haskell.org/t/breaking-changes-in-time-1-15-ghc-9-14/13711 |
| 03:45:53 | <monochrom> | (time-1.15 adds new pattern synonyms that name-clashes with someone's existing code that assumes <=1.14) |
| 03:47:26 | × | APic quits (apic@apic.name) (Server closed connection) |
| 03:47:26 | <monochrom> | So if you set a lower bound like <=1.14 or 1.13, the worst that can happen is cabal downloads and builds an appropriate version of time. If you don't set a lower bound, now you have to set a lower bound. |
| 03:47:38 | → | APic joins (apic@apic.name) |
| 03:55:56 | → | merijn joins (~merijn@host-cl.cgnat-g.v4.dfn.nl) |
| 03:59:57 | × | yahb2 quits (~yahb2@user/tomsmeding/bot/yahb2) (Server closed connection) |
| 04:00:19 | → | yahb2 joins (~yahb2@user/tomsmeding/bot/yahb2) |
| 04:00:19 | ChanServ | sets mode +v yahb2 |
| 04:00:20 | × | merijn quits (~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 252 seconds) |
| 04:08:53 | <Leary> | In that particular case, I think the actual issue is importing without concern for namespace pollution. Also, that's an upper bound? |
| 04:09:15 | <Leary> | Reflecting things a bit, your point seems to be that an older version of a dependency (than is implicitly assumed) may be used to build the package, causing it to fail. |
| 04:09:40 | <Leary> | But the alternative of refusing to build what would have succeeded doesn't really seem better; either way the bound is wrong and you're relying on intrepid explorers to eventually correct it. |
| 04:09:55 | × | arahael quits (~wetfoot@user/arahael) (Ping timeout: 265 seconds) |
| 04:11:17 | → | merijn joins (~merijn@host-cl.cgnat-g.v4.dfn.nl) |
| 04:16:03 | × | merijn quits (~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 255 seconds) |
| 04:17:42 | × | ec quits (~ec@gateway/tor-sasl/ec) (Remote host closed the connection) |
| 04:18:07 | → | ec joins (~ec@gateway/tor-sasl/ec) |
| 04:18:18 | <monochrom> | Oh oops yeah that's an upper bound. |
| 04:20:06 | × | eL_Bart0- quits (eL_Bart02@dietunichtguten.org) (Server closed connection) |
| 04:20:19 | → | eL_Bart0 joins (eL_Bart02@dietunichtguten.org) |
| 04:20:33 | × | lbseale quits (~quassel@user/ep1ctetus) (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.) |
| 04:21:17 | → | lbseale joins (~quassel@user/ep1ctetus) |
| 04:23:56 | → | lisbeths joins (uid135845@id-135845.lymington.irccloud.com) |
| 04:26:39 | → | merijn joins (~merijn@host-cl.cgnat-g.v4.dfn.nl) |
| 04:31:21 | × | merijn quits (~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 255 seconds) |
| 04:32:27 | <geekosaur> | ithis is a long-running argument, and there are no real solutions because you can't reliably infer upper or lower bounds; you or someone else must experiment or actively test |
| 04:32:46 | × | eso quits (a0662dfd5e@2a03:6000:1812:100::1266) (Server closed connection) |
| 04:32:49 | <geekosaur> | and leaving either off forces others to do it for you by their tripping over it |
| 04:32:54 | → | eso joins (a0662dfd5e@2a03:6000:1812:100::1266) |
| 04:42:01 | → | merijn joins (~merijn@host-cl.cgnat-g.v4.dfn.nl) |
| 04:42:51 | × | Athas quits (athas@2a01:7c8:aaac:1cf:acb7:4f2b:6164:21c9) (Quit: ZNC 1.9.1 - https://znc.in) |
| 04:43:03 | → | Athas joins (athas@2a01:7c8:aaac:1cf:10a0:cce8:21cf:53aa) |
| 04:43:37 | → | michalz joins (~michalz@185.246.207.221) |
| 04:46:46 | × | doyougnu quits (~doyougnu@38.175.72.111) (Server closed connection) |
| 04:47:32 | → | doyougnu joins (~doyougnu@38.175.72.111) |
| 04:49:04 | × | merijn quits (~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 265 seconds) |
| 04:52:48 | → | merijn joins (~merijn@host-cl.cgnat-g.v4.dfn.nl) |
| 04:57:27 | × | merijn quits (~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 255 seconds) |
| 04:58:16 | × | ChaiTRex quits (~ChaiTRex@user/chaitrex) (Ping timeout: 252 seconds) |
| 04:58:48 | → | ChaiTRex joins (~ChaiTRex@user/chaitrex) |
| 05:07:42 | × | defragger quits (~random@i5C742DFE.versanet.de) (Ping timeout: 256 seconds) |
| 05:08:11 | → | merijn joins (~merijn@host-cl.cgnat-g.v4.dfn.nl) |
| 05:13:04 | × | merijn quits (~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 268 seconds) |
| 05:19:12 | × | Googulator17 quits (~Googulato@2a01-036d-0106-499d-1c5a-0e4b-5795-d7e3.pool6.digikabel.hu) (Quit: Client closed) |
| 05:19:28 | → | Googulator17 joins (~Googulato@2a01-036d-0106-499d-1c5a-0e4b-5795-d7e3.pool6.digikabel.hu) |
| 05:23:33 | → | merijn joins (~merijn@host-cl.cgnat-g.v4.dfn.nl) |
| 05:28:27 | × | merijn quits (~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 272 seconds) |
| 05:28:57 | × | jtnuttall quits (~jeremy@user/jeremyn) (Ping timeout: 255 seconds) |
| 05:29:34 | → | lol__ joins (~lol@2603:3016:1e01:b940:4d29:e35:f98e:367a) |
| 05:34:00 | × | lol_ quits (~lol@2603:3016:1e01:b940:9441:c46b:69b3:7076) (Ping timeout: 264 seconds) |
| 05:38:55 | → | merijn joins (~merijn@host-cl.cgnat-g.v4.dfn.nl) |
| 05:40:31 | × | emaczen quits (~user@user/emaczen) (Ping timeout: 264 seconds) |
| 05:43:31 | × | merijn quits (~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 264 seconds) |
| 05:50:57 | → | Square2 joins (~Square4@user/square) |
| 05:53:45 | × | Square3 quits (~Square@user/square) (Ping timeout: 248 seconds) |
| 05:53:48 | → | merijn joins (~merijn@host-cl.cgnat-g.v4.dfn.nl) |
| 05:58:31 | × | merijn quits (~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 264 seconds) |
| 06:03:04 | × | p3n_ quits (~p3n@217.198.124.246) (Quit: ZNC 1.10.1 - https://znc.in) |
| 06:03:34 | → | p3n joins (~p3n@2a00:19a0:3:7c:0:d9c6:7cf6:1) |
| 06:05:55 | × | peterbecich quits (~Thunderbi@71.84.33.135) (Ping timeout: 265 seconds) |
| 06:09:11 | → | merijn joins (~merijn@host-cl.cgnat-g.v4.dfn.nl) |
| 06:13:39 | × | merijn quits (~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 245 seconds) |
| 06:17:29 | → | takuan joins (~takuan@d8D86B9E9.access.telenet.be) |
| 06:24:33 | → | merijn joins (~merijn@host-cl.cgnat-g.v4.dfn.nl) |
| 06:26:09 | × | Googulator17 quits (~Googulato@2a01-036d-0106-499d-1c5a-0e4b-5795-d7e3.pool6.digikabel.hu) (Quit: Client closed) |
| 06:26:15 | → | Googulator33 joins (~Googulato@2a01-036d-0106-499d-1c5a-0e4b-5795-d7e3.pool6.digikabel.hu) |
| 06:29:56 | × | merijn quits (~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 252 seconds) |
| 06:38:10 | × | haritz quits (~hrtz@user/haritz) (Quit: ZNC 1.8.2+deb3.1+deb12u1 - https://znc.in) |
| 06:40:35 | → | merijn joins (~merijn@host-cl.cgnat-g.v4.dfn.nl) |
| 06:44:34 | × | Googulator33 quits (~Googulato@2a01-036d-0106-499d-1c5a-0e4b-5795-d7e3.pool6.digikabel.hu) (Quit: Client closed) |
| 06:44:35 | → | Googulator78 joins (~Googulato@2a01-036d-0106-499d-1c5a-0e4b-5795-d7e3.pool6.digikabel.hu) |
| 06:45:19 | × | merijn quits (~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 264 seconds) |
| 06:51:41 | × | marinelli quits (~weechat@gateway/tor-sasl/marinelli) (Quit: marinelli) |
| 06:54:48 | → | merijn joins (~merijn@host-cl.cgnat-g.v4.dfn.nl) |
| 06:59:21 | × | jmcantrell quits (~weechat@user/jmcantrell) (Ping timeout: 248 seconds) |
| 06:59:24 | × | merijn quits (~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 255 seconds) |
| 07:00:47 | → | peterbecich joins (~Thunderbi@71.84.33.135) |
| 07:08:15 | <gentauro> | adding this to a file works -> `{-# OPTIONS_GHC -Wall -Werror -fpackage-trust #-}`. However, this does not: `{-# OPTIONS_GHC -Wall -Werror -fpackage-trust -trust=base #-}`. |
| 07:08:39 | gentauro | error msg: "Unknown flag in {-# OPTIONS_GHC #-} pragma: -trust=base". |
| 07:09:08 | <gentauro> | anybody know how to pass trusted packages in the `OPTIONS_GHC` pragma? |
| 07:10:10 | → | merijn joins (~merijn@host-cl.cgnat-g.v4.dfn.nl) |
| 07:11:36 | <gentauro> | there seem to be `GHC` cli flags for that -> https://ghc.gitlab.haskell.org/ghc/doc/users_guide/exts/safe_haskell.html#package-trust |
| 07:11:51 | × | Sgeo quits (~Sgeo@user/sgeo) (Read error: Connection reset by peer) |
| 07:11:53 | <gentauro> | however, they don't work with `runghc` :-\ |
| 07:15:10 | × | merijn quits (~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 268 seconds) |
| 07:20:09 | <gentauro> | Is there built-in logic in Haskell such as in F# `Enum.GetValues(typeof<tags>)` where you can get a sequence of the values for an (enum) datatype? For example for `data FooBarEnum = Foo | Bar deriving (Eq, Show)`. |
| 07:20:29 | gentauro | which would result in [ Foo, Bar ] |
| 07:21:44 | <Leary> | @let data FooBarEnum = Foo | Bar deriving (Eq, Show, Enum) |
| 07:21:46 | <lambdabot> | Defined. |
| 07:21:56 | <Leary> | > [minBound .. maxBound] :: [FooBarEnum] |
| 07:21:57 | <lambdabot> | No instance for ‘Bounded FooBarEnum’ |
| 07:21:57 | <lambdabot> | arising from a use of ‘minBound’ |
| 07:21:58 | <lambdabot> | In the expression: minBound |
| 07:22:24 | <Leary> | Ah, Forgot to derive `Bounded`. Well, you get the idea. |
| 07:23:04 | <Leary> | > [minBound .. maxBound] :: [FooBarEnum] |
| 07:23:05 | <lambdabot> | [Foo,Bar] |
| 07:24:47 | → | marinelli joins (~weechat@gateway/tor-sasl/marinelli) |
| 07:25:32 | → | merijn joins (~merijn@host-cl.cgnat-g.v4.dfn.nl) |
| 07:27:01 | <gentauro> | Leary: now that was nifty <3 |
| 07:27:32 | <gentauro> | many thx |
| 07:29:04 | × | img quits (~img@user/img) (Quit: ZNC 1.10.1 - https://znc.in) |
| 07:29:48 | → | wickedjargon joins (~user@2605:8d80:5430:dc79:6396:7e42:d4e3:36f9) |
| 07:30:20 | → | img joins (~img@user/img) |
| 07:30:52 | × | merijn quits (~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 276 seconds) |
| 07:36:31 | → | Enrico63 joins (~Enrico63@host-79-19-156-232.retail.telecomitalia.it) |
| 07:37:13 | × | tzh quits (~tzh@c-76-115-131-146.hsd1.or.comcast.net) (Quit: zzz) |
| 07:40:54 | → | merijn joins (~merijn@host-cl.cgnat-g.v4.dfn.nl) |
| 07:44:04 | × | Enrico63 quits (~Enrico63@host-79-19-156-232.retail.telecomitalia.it) (Quit: Client closed) |
| 07:47:54 | × | merijn quits (~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 265 seconds) |
| 07:52:41 | × | jj quits (~apropos@node-1w7jr9pqogh9vahu1mvneock5.ipv6.telus.net) (Ping timeout: 248 seconds) |
| 07:55:47 | → | merijn joins (~merijn@host-cl.cgnat-g.v4.dfn.nl) |
| 07:56:33 | → | jj joins (~apropos@node-1w7jr9pqogh9vahu1mvneock5.ipv6.telus.net) |
| 08:00:09 | × | merijn quits (~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 248 seconds) |
| 08:02:09 | → | chele joins (~chele@user/chele) |
| 08:06:23 | × | wickedjargon quits (~user@2605:8d80:5430:dc79:6396:7e42:d4e3:36f9) (Read error: Connection reset by peer) |
| 08:11:10 | → | merijn joins (~merijn@host-cl.cgnat-g.v4.dfn.nl) |
| 08:11:18 | × | lbseale quits (~quassel@user/ep1ctetus) (Ping timeout: 256 seconds) |
| 08:15:00 | × | peterbecich quits (~Thunderbi@71.84.33.135) (Ping timeout: 255 seconds) |
| 08:15:32 | × | merijn quits (~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 252 seconds) |
| 08:18:04 | × | Pozyomka quits (~pyon@user/pyon) (Ping timeout: 268 seconds) |
| 08:27:27 | → | tromp joins (~textual@2001:1c00:3487:1b00:7955:9591:6018:7ef9) |
| 08:28:15 | → | AlexNoo joins (~AlexNoo@178.34.163.162) |
| 08:28:59 | → | AlexNoo_ joins (~AlexNoo@178.34.163.162) |
| 08:29:43 | → | AlexNoo__ joins (~AlexNoo@178.34.163.162) |
| 08:33:06 | × | AlexNoo quits (~AlexNoo@178.34.163.162) (Ping timeout: 268 seconds) |
| 08:33:41 | → | AlexNoo joins (~AlexNoo@178.34.163.162) |
| 08:33:43 | × | AlexNoo_ quits (~AlexNoo@178.34.163.162) (Ping timeout: 268 seconds) |
| 08:34:20 | × | AlexNoo__ quits (~AlexNoo@178.34.163.162) (Ping timeout: 268 seconds) |
| 08:37:54 | → | __monty__ joins (~toonn@user/toonn) |
| 08:50:43 | × | srk quits (~sorki@user/srk) (Ping timeout: 264 seconds) |
| 08:51:37 | → | emmanuelux joins (~em@user/emmanuelux) |
| 08:52:16 | → | srk joins (~sorki@user/srk) |
| 08:52:36 | → | merijn joins (~merijn@77.242.116.146) |
| 09:06:08 | → | lxsameer joins (~lxsameer@Serene/lxsameer) |
| 09:07:46 | × | emmanuelux quits (~em@user/emmanuelux) (Quit: bye) |
| 09:13:07 | → | Alex_delenda_est joins (~al_test@178.34.163.162) |
| 09:14:02 | → | AlexZenon joins (~alzenon@178.34.163.162) |
| 09:15:47 | → | Alex_test_ joins (~al_test@178.34.163.162) |
| 09:15:54 | × | jreicher quits (~joelr@user/jreicher) (Quit: brb) |
| 09:17:33 | × | Alex_delenda_est quits (~al_test@178.34.163.162) (Ping timeout: 255 seconds) |
| 09:18:24 | → | jreicher joins (~joelr@user/jreicher) |
| 09:20:15 | × | Alex_test_ quits (~al_test@178.34.163.162) (Ping timeout: 255 seconds) |
| 09:25:44 | → | Alex_delenda_est joins (~al_test@178.34.163.162) |
| 09:27:08 | × | sp1ff quits (~user@2601:1c2:4701:7850::8cd) (Ping timeout: 268 seconds) |
| 09:31:27 | <dminuoso> | % :t minBound |
| 09:31:27 | <yahb2> | minBound :: Bounded a => a |
| 09:31:58 | <dminuoso> | Curious, why is Ord not a superclass of Bounded? |
| 09:32:19 | <dminuoso> | What does `minimum/maximum` even mean in the absence of an ordering? |
| 09:32:50 | → | Enrico63 joins (~Enrico63@host-79-19-156-232.retail.telecomitalia.it) |
| 09:33:40 | <tomsmeding> | perhaps it makes sense that an Enum has a first and a last value for enumeration, but while it has an ordering compatible with that Enum instance, that ordering makes no semantical sense and is hence not defined? |
| 09:33:53 | <tomsmeding> | but then you could argue that you should give that Ord instance anyway |
| 09:34:47 | <humasect> | it says right in the first sentence https://hackage-content.haskell.org/package/base-4.22.0.0/docs/Data-Bounded.html |
| 09:35:05 | <tomsmeding> | lol, dminuoso ^ |
| 09:35:24 | tomsmeding | should have thought of that |
| 09:35:32 | <dminuoso> | humasect: Yes, and its not much of an explanation. |
| 09:35:43 | <dminuoso> | It reads nonsensical to me. |
| 09:35:48 | <humasect> | perhaps look into its meaning, disassemble it to understanding |
| 09:35:50 | <tomsmeding> | dminuoso: not every ordering is total |
| 09:35:54 | <dminuoso> | Oh. |
| 09:35:54 | <tomsmeding> | partial orders are a thing |
| 09:35:55 | <humasect> | how to learn ? |
| 09:36:09 | → | sp1ff joins (~user@c-24-20-218-28.hsd1.wa.comcast.net) |
| 09:36:22 | <dminuoso> | tomsmeding: Is there a notion of `minimum` in a partially ordered set, then? |
| 09:36:30 | <dminuoso> | Im not even sure what that would mean. |
| 09:36:32 | <__monty__> | tomsmeding: But Bounded doesn't deal with just any partial order. |
| 09:36:43 | <tomsmeding> | dminuoso: yes, a lower bound :) https://en.wikipedia.org/wiki/Lattice_(order) |
| 09:36:44 | <__monty__> | It's restricted to partial orders that have a single lower and upper bound. |
| 09:37:15 | <tomsmeding> | sure, but even those need not have a total ordering |
| 09:37:27 | <tomsmeding> | perhaps "lower bound" is not the technically correct term here |
| 09:37:38 | <tomsmeding> | (but then, it's probably "minimum", which would not have helped dminuoso) |
| 09:38:17 | <tomsmeding> | dminuoso: all subset of a given set S are partially ordered by inclusion, and they have a unique minimum ({}) and maximum (S), but they are not totally ordered |
| 09:38:47 | <dminuoso> | tomsmeding: Okay so what you're saying is that Bounded is just synonmous for Lattice? |
| 09:38:55 | <tomsmeding> | perhaps? |
| 09:39:16 | <tomsmeding> | well, a bounded lattice |
| 09:39:46 | <dminuoso> | tomsmeding: Aren't all lattices bounded by their suprema? |
| 09:40:04 | <dminuoso> | Ohh wait. |
| 09:40:06 | <dminuoso> | I see. |
| 09:40:07 | <tomsmeding> | according to the wikipedia definition that I'm currently reading, a plain "lattice" requires joins and meets of _two_ elements |
| 09:40:10 | <tomsmeding> | and thus finite sets |
| 09:40:27 | <tomsmeding> | a _complete lattice_ additionally requires suprema and infima of larger sets |
| 09:40:38 | <tomsmeding> | thus all complete lattices are bounded, but not all bounded lattices are complete? Perhaps? |
| 09:40:55 | dminuoso | wonders why lattices are called lattices |
| 09:41:19 | <tomsmeding> | because of this picture I always assumed https://commons.wikimedia.org/wiki/File:Pow3nonlattice.svg |
| 09:41:39 | <jreicher> | dminuoso: hasse diagrams |
| 09:41:51 | × | xff0x quits (~xff0x@fsb6a9491c.tkyc517.ap.nuro.jp) (Ping timeout: 255 seconds) |
| 09:42:06 | <jreicher> | https://en.wikipedia.org/wiki/Hasse_diagram |
| 09:42:21 | <tomsmeding> | which that picture is an example of |
| 09:42:40 | <Leary> | It's a bounded partial order with minimal and maximal elements---that doesn't imply unique suprema or infima. |
| 09:42:51 | × | Enrico63 quits (~Enrico63@host-79-19-156-232.retail.telecomitalia.it) (Quit: Client closed) |
| 09:43:09 | <tomsmeding> | fair! Even pairs need not have unique joins or meets |
| 09:43:48 | <dminuoso> | Leary: Are you saying that Bounded does not have uniqueness requirements? |
| 09:44:16 | <tomsmeding> | dminuoso: even if there is a maximal element of the entire set, that does not necessarily mean there is a _unique_ smallest upper bound of any subset of the set |
| 09:44:31 | <__monty__> | dminuoso: I think they're talking about lattices. |
| 09:44:33 | <tomsmeding> | "lattice" implies that such upper bounds (and lower bounds) are unique |
| 09:44:57 | <tomsmeding> | so Bounded is not a "bounded lattice", it's a "partial order with minimal and maximal elements" |
| 09:45:07 | <tomsmeding> | which... we knew 10 minutes ago already |
| 09:45:08 | <dminuoso> | tomsmeding: Trying to understand what "maximal element of the entire set" would mean, if it was not a unique smallest supremum of any subset of the set. |
| 09:45:20 | <tomsmeding> | welcome to math where there are unintuitive counterexamples |
| 09:45:27 | <dminuoso> | Oh hold on. |
| 09:45:35 | <dminuoso> | The favourite person in a group could work I suppose. |
| 09:46:10 | <jreicher> | tomsmeding: clopen is my favourite |
| 09:46:44 | <dminuoso> | Hold on what I just said makes no sense. |
| 09:46:52 | <jreicher> | dminuoso: are you wondering what the difference between lattice and having max and min is? |
| 09:47:06 | <dminuoso> | The uniqueness is not of any subset, but a *pair* of elements. |
| 09:47:11 | <jreicher> | Yes |
| 09:47:18 | <jreicher> | (But I'm still not sure what the initial question was) |
| 09:47:24 | <tomsmeding> | (which are, in particular, subsets) |
| 09:47:29 | <tomsmeding> | jreicher: I think yes |
| 09:47:46 | <tomsmeding> | do you have an example of a bounded partial order that is not a lattice? |
| 09:47:51 | → | fp joins (~Thunderbi@wireless-86-50-141-0.open.aalto.fi) |
| 09:47:53 | <tomsmeding> | (I don't) |
| 09:48:02 | <Leary> | dminuoso: Maximal means nothing else is bigger than it, though perhaps the /greatest/ element is a better notion for a bound, in which case its bigger than everything. |
| 09:48:22 | <int-e> | I'm confused; Bounded just defined two points called minBound and maxBound? So it would work for partial orders too (and thus, lattices) |
| 09:48:44 | <tomsmeding> | int-e: the original original question was why Bounded does not have Ord as a superclass, which had answer "partial orders are a thing" |
| 09:48:45 | <Leary> | tomsmeding: You can just contrive a small finite partial order on paper. |
| 09:48:58 | <Leary> | It's not hard to make a counterexample. |
| 09:49:03 | <int-e> | tomsmeding: Ah. I see, lack of context strikes again. |
| 09:49:08 | <tomsmeding> | int-e: then we thought "but is Bounded then a bounded lattice?", to which the answer is no, as no unique joins/meets are required |
| 09:49:16 | <tomsmeding> | now we want an example of that :p |
| 09:49:54 | <jreicher> | tomsmeding: by "bounded" do we just mean the entire set (rather than any pair) as an infimum and supremum? |
| 09:49:59 | <tomsmeding> | yes |
| 09:50:02 | <tomsmeding> | or at least, I do |
| 09:50:11 | <__monty__> | dminuoso: If you're looking for any example of it whatsoever I think the one tomsmeding mentioned is the easiest. Take any set with more than one element and all subsets of that set, the partial order relation is subset-of, the minBound would be the empty set, the maxBound the set you started with, some pairs of subsets won't satisfy the subset-of relation in either order. So this can implement Bounded |
| 09:50:17 | <__monty__> | but not Ord. |
| 09:50:30 | <jreicher> | Then just "duplicate" a meet or join. It will no longer be a lattice. |
| 09:50:48 | <tomsmeding> | __monty__: yes, we figured that out, but we're already at the next question: that thing is clearly a lattice, but we want a not-lattice that is nevertheless a bounded partial order |
| 09:51:04 | <int-e> | Is it okay if it's? 0 < 1,2 < 3,4 < 5 has minimal and maximal elements but 3,4 have no infimum and 1,2 have no supremum |
| 09:51:29 | <tomsmeding> | but there's no unique maximum |
| 09:51:30 | <__monty__> | tomsmeding: The conversation has moved on but I'm not sure it's not leaving dminuoso behind ; ) |
| 09:51:42 | <tomsmeding> | ah :p |
| 09:51:43 | <int-e> | tomsmeding: 5 is the unique maximal element here |
| 09:51:47 | <Leary> | tomsmeding: https://gist.github.com/LSLeary/c52be6739f5815d13a6774d46dcbde75 |
| 09:51:53 | <tomsmeding> | int-e: no, because 2 !< 5 |
| 09:52:00 | <int-e> | tomsmeding: it's transitive |
| 09:52:07 | <tomsmeding> | oh notation |
| 09:52:14 | <tomsmeding> | yes |
| 09:52:27 | <tomsmeding> | yes perfect |
| 09:52:36 | <jreicher> | I think int-e and I are thinking the same. 0 is one end and 5 is the other. The join of 1 and 2 is not unique |
| 09:52:37 | tomsmeding | closes the image editor |
| 09:52:41 | <int-e> | tomsmeding: sorry, I'm trying to cast a Hesse diagram in ASCII here |
| 09:52:51 | <int-e> | the translation is a bit lossy ;) |
| 09:52:55 | <jreicher> | int-e: have I understood you correctly? |
| 09:53:18 | <tomsmeding> | Leary: that notation in your gist is a bit ambiguous, what do the /\ on line 4 mean :p |
| 09:53:19 | <int-e> | Hasse diagram, meh. |
| 09:54:13 | <dminuoso> | Leary: Did you mean it like https://paste.tomsmeding.com/ayvscggm ? |
| 09:54:34 | <__monty__> | I'm also interested in kind of the reverse question, are there structures that can implement Ord but not Bounded? Something like a cyclical ordering? I suppose only if we put the "laws" of the class aside. |
| 09:54:43 | <dminuoso> | Or well, maybe without that x even |
| 09:54:51 | <merijn> | __monty__: Clearly we need a PartialOrd superclass of Ord that implement "a -> a -> Maybe Ordering" |
| 09:54:53 | <dminuoso> | Not sure if it makes it less or more ambiguous |
| 09:54:55 | <tomsmeding> | dminuoso: the x must be a crossing of lines without a node, yes |
| 09:55:11 | <tomsmeding> | __monty__: Integer? |
| 09:56:14 | <jreicher> | __monty__: if the order is transitive and antisymmetric it can't be cyclical |
| 09:56:24 | <Leary> | tomsmeding: Cross connections. Bit hard in slapdash asci. I revised it with an X if that's clearer. |
| 09:56:52 | <tomsmeding> | yes, which is also what dminuoso made of it |
| 09:57:21 | <__monty__> | tomsmeding: Oh, obviously, darn, less interesting than I thought. |
| 09:59:28 | <int-e> | tomsmeding: here is what it looks like properly: https://int-e.eu/~bf3/tmp/hapo.png |
| 10:01:03 | <__monty__> | TIL, min and max can return a value that is distinct from their arguments, as long as it is == to one of their arguments. |
| 10:01:25 | <__monty__> | I assume that's for some sort of canonicalization? |
| 10:01:58 | <tomsmeding> | int-e: yes |
| 10:02:13 | <Leary> | __monty__: `==` values aren't supposed to be distinguishable in the first place. |
| 10:02:35 | tomsmeding | has a meeting -> afk |
| 10:08:00 | → | xdminsy joins (~xdminsy@112.10.231.192) |
| 10:08:16 | <__monty__> | Leary: But things like Arg exist and they exist because they are useful, I assume. |
| 10:08:35 | → | morj joins (~morj@user/morj) |
| 10:11:25 | <Leary> | It's occasionally pragmatic to break the law, yes. `Arg` actually wouldn't be useful if people always remembered to write `fooBy` instead of just `foo :: Ord a => ...`. |
| 10:11:52 | <Leary> | At least, not useful enough to justify its existence. |
| 10:13:02 | → | petrichor joins (~jez@user/petrichor) |
| 10:13:29 | × | xdminsy quits (~xdminsy@112.10.231.192) (Quit: Konversation terminated!) |
| 10:16:01 | → | morj_away joins (~morj@user/morj) |
| 10:16:37 | × | morj quits (~morj@user/morj) (Ping timeout: 272 seconds) |
| 10:17:10 | <int-e> | `fooBy` is awful when you have data structures with invariants (consider an implementation of containers that implements Data.Map using Data.Set with `Arg k v` elements) |
| 10:18:20 | <int-e> | (So it's not just programmer laziness.) |
| 10:20:38 | × | morj_away quits (~morj@user/morj) (Client Quit) |
| 10:20:56 | int-e | ponders extending this argument to saying that type classes are useles; people could just pass around the right operations explicitly. :-P |
| 10:21:57 | <Leary> | Even in such a case, `Arg` should be handrolled in the guts of containers, not exposed from base. |
| 10:23:43 | <Leary> | Re the extended argument, it's really about typeclasses with laws being used to implement operations that /don't require/ those laws and are useful in their absence; the typeclass method merely being a default choice. |
| 10:26:50 | × | divlamir quits (~divlamir@user/divlamir) (Read error: Connection reset by peer) |
| 10:27:05 | → | divlamir joins (~divlamir@user/divlamir) |
| 10:29:22 | × | ec quits (~ec@gateway/tor-sasl/ec) (Ping timeout: 252 seconds) |
| 10:31:16 | × | hsw quits (~hsw@106.104.102.45) (Remote host closed the connection) |
| 10:31:37 | → | ec joins (~ec@gateway/tor-sasl/ec) |
| 10:32:21 | → | hsw joins (~hsw@106.104.102.45) |
| 10:49:08 | → | mange joins (~mange@user/mange) |
| 10:53:35 | → | Enrico63 joins (~Enrico63@host-79-19-156-232.retail.telecomitalia.it) |
| 10:57:55 | × | humasect quits (~humasect@dyn-192-249-132-90.nexicom.net) (Quit: Leaving...) |
| 10:59:31 | × | infinity0 quits (~infinity0@pwned.gg) (Ping timeout: 276 seconds) |
| 11:07:22 | × | lxsameer quits (~lxsameer@Serene/lxsameer) (Quit: WeeChat 4.8.1) |
| 11:10:10 | × | tromp quits (~textual@2001:1c00:3487:1b00:7955:9591:6018:7ef9) (Quit: My iMac has gone to sleep. ZZZzzz…) |
| 11:12:42 | → | Frostillicus joins (~Frostilli@pool-71-174-119-69.bstnma.fios.verizon.net) |
| 11:14:03 | × | fp quits (~Thunderbi@wireless-86-50-141-0.open.aalto.fi) (Ping timeout: 268 seconds) |
| 11:14:06 | → | xdminsy joins (~xdminsy@112.10.231.192) |
| 11:16:47 | × | xdminsy quits (~xdminsy@112.10.231.192) (Client Quit) |
| 11:17:08 | → | xdminsy joins (~xdminsy@112.10.231.192) |
| 11:17:21 | × | xdminsy quits (~xdminsy@112.10.231.192) (Client Quit) |
| 11:17:43 | × | Frostillicus quits (~Frostilli@pool-71-174-119-69.bstnma.fios.verizon.net) (Ping timeout: 264 seconds) |
| 11:17:52 | → | xdminsy joins (~xdminsy@112.10.231.192) |
| 11:19:33 | → | infinity0 joins (~infinity0@pwned.gg) |
| 11:19:40 | × | terrorjack quits (~terrorjac@2a01:4f8:271:2d98::2) (Quit: The Lounge - https://thelounge.chat) |
| 11:26:37 | → | wickedjargon joins (~user@2605:8d80:5430:ec04:8f71:3db2:1c1a:13ef) |
| 11:34:05 | → | fp joins (~Thunderbi@130.233.70.214) |
| 11:36:53 | × | wickedjargon quits (~user@2605:8d80:5430:ec04:8f71:3db2:1c1a:13ef) (Remote host closed the connection) |
| 11:38:45 | → | wickedjargon joins (~user@2605:8d80:5430:ec04:8f71:3db2:1c1a:13ef) |
| 11:40:22 | → | Pozyomka joins (~pyon@user/pyon) |
| 11:47:32 | × | xdminsy quits (~xdminsy@112.10.231.192) (Quit: Konversation terminated!) |
| 11:52:54 | → | humasect joins (~humasect@dyn-192-249-132-90.nexicom.net) |
| 11:54:53 | <gentauro> | tomsmeding: have you road the functional pearl from Alejandro Russo on how to use `lattices` to secure apps? |
| 11:54:58 | <gentauro> | it's a pretty good one !!! |
| 11:55:50 | gentauro | I actually live coded an implementation for a Spanish audience (HackMadrid / HaskellMAD). Nobody understood anything xD |
| 11:58:10 | gentauro | for Spanish speaking peeps -> https://www.youtube.com/watch?v=iU5dfVRREUo&t=7806s (02:10:06 - 03:11:59) |
| 12:02:13 | gentauro | merijn and tomsmeding perhaps that talk will provide "some" endorsment for Hackage? xD |
| 12:08:01 | → | smalltalkman joins (uid545680@id-545680.hampstead.irccloud.com) |
| 12:08:35 | × | mange quits (~mange@user/mange) (Quit: Zzz...) |
| 12:08:53 | → | CiaoSen joins (~Jura@2a02:8071:64e1:da0:5a47:caff:fe78:33db) |
| 12:21:19 | × | Enrico63 quits (~Enrico63@host-79-19-156-232.retail.telecomitalia.it) (Quit: Client closed) |
| 12:30:32 | → | haritz joins (~hrtz@2a01:4b00:bc2e:7000:d5af:a266:ca31:5ef8) |
| 12:30:32 | × | haritz quits (~hrtz@2a01:4b00:bc2e:7000:d5af:a266:ca31:5ef8) (Changing host) |
| 12:30:32 | → | haritz joins (~hrtz@user/haritz) |
| 12:45:05 | → | SlackCoder joins (~SlackCode@64-94-63-8.ip.weststar.net.ky) |
| 12:45:58 | → | Taneb joins (~username@host-87-11-133-28.retail.telecomitalia.it) |
| 12:46:25 | × | SlackCoder quits (~SlackCode@64-94-63-8.ip.weststar.net.ky) (Client Quit) |
| 12:49:08 | × | humasect quits (~humasect@dyn-192-249-132-90.nexicom.net) (Quit: Leaving...) |
| 12:56:10 | × | wickedjargon quits (~user@2605:8d80:5430:ec04:8f71:3db2:1c1a:13ef) (Remote host closed the connection) |
| 12:58:45 | × | AlexNoo quits (~AlexNoo@178.34.163.162) (Quit: Leaving) |
| 12:59:15 | × | Alex_delenda_est quits (~al_test@178.34.163.162) (Quit: ;-) |
| 12:59:40 | × | AlexZenon quits (~alzenon@178.34.163.162) (Quit: ;-) |
| 13:06:31 | → | qqq joins (~qqq@185.54.22.240) |
| 13:17:39 | → | Frostillicus joins (~Frostilli@pool-71-174-119-69.bstnma.fios.verizon.net) |
| 13:20:39 | → | AlexNoo joins (~AlexNoo@178.34.163.162) |
| 13:21:53 | × | fp quits (~Thunderbi@130.233.70.214) (Ping timeout: 265 seconds) |
| 13:22:27 | → | AlexZenon joins (~alzenon@178.34.163.162) |
| 13:22:44 | → | xff0x joins (~xff0x@ai083101.d.east.v6connect.net) |
| 13:26:51 | × | AlexZenon quits (~alzenon@178.34.163.162) (Ping timeout: 255 seconds) |
| 13:26:58 | → | ljdarj joins (~Thunderbi@user/ljdarj) |
| 13:31:28 | → | AlexZenon joins (~alzenon@178.34.163.162) |
| 13:34:37 | → | Alex_test_ joins (~al_test@178.34.163.162) |
| 13:38:06 | × | AlexZenon quits (~alzenon@178.34.163.162) (Ping timeout: 255 seconds) |
| 13:38:33 | → | fp joins (~Thunderbi@130.233.70.214) |
| 13:41:18 | Alex_test_ | is now known as Alex_delenda_est |
| 13:43:32 | → | AlexZenon joins (~alzenon@178.34.163.162) |
| 13:43:53 | → | lbseale joins (~quassel@user/ep1ctetus) |
| 13:44:24 | → | troydm joins (~troydm@user/troydm) |
| 13:44:54 | → | chenjf joins (~chenjf@68.64.178.54) |
| 13:50:20 | × | lbseale quits (~quassel@user/ep1ctetus) (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.) |
| 13:51:04 | → | lbseale joins (~quassel@user/ep1ctetus) |
| 13:56:00 | → | machinedgod joins (~machinedg@d172-219-48-230.abhsia.telus.net) |
| 14:01:45 | → | castan joins (~castan@2a02:2f0f:8210:d800:f4b5:9670:6ef1:55e) |
| 14:02:13 | × | castan quits (~castan@2a02:2f0f:8210:d800:f4b5:9670:6ef1:55e) (Client Quit) |
| 14:04:58 | <tomsmeding> | gentauro: I'm pretty sure I have not read that pearl |
| 14:05:34 | Googulator78 | is now known as Googulator |
| 14:07:32 | → | philopsos1 joins (~caecilius@user/philopsos) |
| 14:20:00 | × | philopsos1 quits (~caecilius@user/philopsos) (Read error: error:0A000139:SSL routines::record layer failure) |
| 14:26:15 | × | chenjf quits (~chenjf@68.64.178.54) (Ping timeout: 255 seconds) |
| 14:29:37 | × | califax quits (~califax@user/califx) (Remote host closed the connection) |
| 14:29:53 | → | califax joins (~califax@user/califx) |
| 14:33:06 | × | Frostillicus quits (~Frostilli@pool-71-174-119-69.bstnma.fios.verizon.net) (Quit: Frostillicus) |
| 14:35:13 | → | philopsos1 joins (~caecilius@user/philopsos) |
| 14:40:43 | → | comerijn joins (~merijn@77.242.116.146) |
| 14:43:21 | × | merijn quits (~merijn@77.242.116.146) (Ping timeout: 255 seconds) |
| 14:46:03 | × | philopsos1 quits (~caecilius@user/philopsos) (Ping timeout: 255 seconds) |
| 14:49:56 | → | misterfish joins (~misterfis@84.53.85.146) |
| 14:52:25 | → | tromp joins (~textual@2001:1c00:3487:1b00:7955:9591:6018:7ef9) |
| 14:59:10 | × | CiaoSen quits (~Jura@2a02:8071:64e1:da0:5a47:caff:fe78:33db) (Quit: CiaoSen) |
| 15:02:08 | → | rekahsoft joins (~rekahsoft@bras-base-orllon1103w-grc-20-76-67-111-168.dsl.bell.ca) |
| 15:03:53 | → | GdeVolpiano joins (~GdeVolpia@user/GdeVolpiano) |
| 15:04:33 | × | GdeVolpi1 quits (~GdeVolpia@user/GdeVolpiano) (Read error: Connection reset by peer) |
| 15:06:38 | × | Taneb quits (~username@host-87-11-133-28.retail.telecomitalia.it) (Remote host closed the connection) |
| 15:15:17 | → | chenjf joins (~chenjf@68.64.178.54) |
| 15:16:04 | → | jtnuttall joins (~jeremy@user/jeremyn) |
| 15:17:08 | <gentauro> | tomsmeding: let me see if I can find it (Chalmers moved their stuff when they made the new website) |
| 15:18:18 | <gentauro> | tomsmeding: there you go -> https://www.cse.chalmers.se/~russo/publications_files/pearl-russo.pdf |
| 15:20:35 | × | rainbyte quits (~rainbyte@186.22.19.214) (Remote host closed the connection) |
| 15:20:38 | <tomsmeding> | thanks, will have a look :) |
| 15:20:47 | → | rainbyte joins (~rainbyte@186.22.19.214) |
| 15:22:05 | <gentauro> | tomsmeding: there is also the ICFP 2015 Vancouver: https://www.youtube.com/watch?v=K6Uf61U0fvo (but it's recorded with a toaster …) :-\ |
| 15:22:42 | gentauro | less than 19 min, if you ears can handle the toaster A/V |
| 15:24:14 | × | fp quits (~Thunderbi@130.233.70.214) (Ping timeout: 256 seconds) |
| 15:30:50 | × | tromp quits (~textual@2001:1c00:3487:1b00:7955:9591:6018:7ef9) (Quit: My iMac has gone to sleep. ZZZzzz…) |
| 15:31:30 | × | comerijn quits (~merijn@77.242.116.146) (Ping timeout: 255 seconds) |
| 15:33:06 | → | merijn joins (~merijn@77.242.116.146) |
| 15:40:03 | × | merijn quits (~merijn@77.242.116.146) (Ping timeout: 255 seconds) |
| 15:40:17 | → | emaczen joins (~user@user/emaczen) |
| 15:44:41 | → | merijn joins (~merijn@77.242.116.146) |
| 15:46:48 | × | chenjf quits (~chenjf@68.64.178.54) (Ping timeout: 255 seconds) |
| 15:52:51 | → | CiaoSen joins (~Jura@2a02:8071:64e1:da0:5a47:caff:fe78:33db) |
| 15:52:55 | × | traxex quits (traxex@user/traxex) (Ping timeout: 272 seconds) |
| 15:54:40 | × | CiaoSen quits (~Jura@2a02:8071:64e1:da0:5a47:caff:fe78:33db) (Client Quit) |
| 15:54:52 | → | CiaoSen joins (~Jura@2a02:8071:64e1:da0:5a47:caff:fe78:33db) |
| 15:54:53 | × | CiaoSen quits (~Jura@2a02:8071:64e1:da0:5a47:caff:fe78:33db) (Client Quit) |
| 16:07:00 | × | _d0t quits (~{-d0t-}@user/-d0t-/x-7915216) (Ping timeout: 264 seconds) |
| 16:10:49 | → | califax_ joins (~califax@user/califx) |
| 16:10:54 | × | califax quits (~califax@user/califx) (Quit: ZNC 1.10.1 - https://znc.in) |
| 16:11:17 | × | Square2 quits (~Square4@user/square) (Ping timeout: 268 seconds) |
| 16:12:07 | califax_ | is now known as califax |
| 16:13:14 | × | pavonia quits (~user@user/siracusa) (Quit: Bye!) |
| 16:16:56 | × | paddymahoney quits (~paddymaho@pool-99-250-10-137.cpe.net.cable.rogers.com) (Ping timeout: 256 seconds) |
| 16:19:16 | × | misterfish quits (~misterfis@84.53.85.146) (Ping timeout: 265 seconds) |
| 16:22:18 | → | _d0t joins (~{-d0t-}@user/-d0t-/x-7915216) |
| 16:34:16 | × | petrichor quits (~jez@user/petrichor) (Quit: ZNC 1.10.1 - https://znc.in) |
| 16:37:54 | → | philopsos1 joins (~caecilius@user/philopsos) |
| 16:40:48 | × | jtnuttall quits (~jeremy@user/jeremyn) (Ping timeout: 255 seconds) |
| 16:42:57 | → | jmcantrell_ joins (~weechat@user/jmcantrell) |
| 16:45:06 | jmcantrell_ | is now known as jmcantrell |
| 16:48:19 | × | Googulator quits (~Googulato@2a01-036d-0106-499d-1c5a-0e4b-5795-d7e3.pool6.digikabel.hu) (Quit: Client closed) |
| 16:48:33 | → | Googulator joins (~Googulato@2a01-036d-0106-499d-1c5a-0e4b-5795-d7e3.pool6.digikabel.hu) |
| 16:52:59 | × | lisbeths quits (uid135845@id-135845.lymington.irccloud.com) (Quit: Connection closed for inactivity) |
| 16:54:20 | → | tromp joins (~textual@2001:1c00:3487:1b00:7955:9591:6018:7ef9) |
| 17:00:55 | → | Milan_Vanca joins (~milan@user/Milan-Vanca:32634) |
| 17:00:59 | × | lbseale quits (~quassel@user/ep1ctetus) (Quit: No Ping reply in 180 seconds.) |
| 17:02:14 | → | lbseale joins (~quassel@user/ep1ctetus) |
| 17:04:12 | <Milan_Vanca> | Hello guyz.. Stupid quesiton incoming! We can nicely nest "case of" fn a b c = case a of.. case b of... Lovely but sadly I can't pattern match and need guards. Which I don't know how to nest. I don't want to duplicate e1 && e2 && e3 when only e4 changes. |
| 17:05:29 | → | lxsameer joins (~lxsameer@Serene/lxsameer) |
| 17:09:39 | <ncf> | guards don't do anything that let and case can't |
| 17:10:10 | <ncf> | if you really want a RHS equivalent of guards there is MultiWayIf https://ghc.gitlab.haskell.org/ghc/doc/users_guide/exts/multiway_if.html |
| 17:18:56 | <Milan_Vanca> | So is there other way how to rewrite this more nicely? https://paste.tomsmeding.com/NokCDmVI |
| 17:20:48 | <Milan_Vanca> | Imagine I want to have another otherwise with under counter path. |
| 17:20:50 | → | petrichor joins (~jez@user/petrichor) |
| 17:21:07 | <Milan_Vanca> | I probably need whole new function for it |
| 17:23:45 | × | bggd_ quits (~bgg@2a01:e0a:fd5:f510:ad7c:fa54:e40d:9544) (Remote host closed the connection) |
| 17:24:54 | × | merijn quits (~merijn@77.242.116.146) (Ping timeout: 255 seconds) |
| 17:25:36 | → | euphores joins (~SASL_euph@user/euphores) |
| 17:26:42 | → | cipherrot joins (~jez@user/petrichor) |
| 17:27:24 | × | petrichor quits (~jez@user/petrichor) (Ping timeout: 245 seconds) |
| 17:32:27 | <Milan_Vanca> | I think I can do this https://paste.tomsmeding.com/FfemQcpX but this case of is ugly? |
| 17:32:45 | × | Pozyomka quits (~pyon@user/pyon) (Quit: brb) |
| 17:33:10 | → | Pozyomka joins (~pyon@user/pyon) |
| 17:34:55 | × | weary-traveler quits (~user@user/user363627) (Remote host closed the connection) |
| 17:35:44 | × | ljdarj quits (~Thunderbi@user/ljdarj) (Ping timeout: 245 seconds) |
| 17:36:14 | <ncf> | i don't see a reason not to use an if statement there |
| 17:36:23 | <ncf> | well, an if expression |
| 17:37:29 | <Milan_Vanca> | What about now? https://paste.tomsmeding.com/ptnApMeq |
| 17:38:28 | <Milan_Vanca> | Like I can do it with if but it does not look like nicer solution. |
| 17:39:13 | <Milan_Vanca> | If I had only 2 then I would use an if expression which is perfect solution for that case |
| 17:40:27 | <ncf> | i mean that's fine, if you have a lot of those you might want to define a list or a map like [(methodGet, counterGet), (methodPut, counterPut), ...] and then do a lookup into that |
| 17:42:16 | <Milan_Vanca> | Hmm map with lookup sounds interesting too. |
| 17:45:34 | → | wickedjargon joins (~user@2605:8d80:5431:6cb2:b646:a30f:510c:87ce) |
| 17:48:57 | → | wickedja` joins (~user@2605:8d80:5431:6cb2:b646:a30f:510c:87ce) |
| 17:51:47 | × | wickedjargon quits (~user@2605:8d80:5431:6cb2:b646:a30f:510c:87ce) (Remote host closed the connection) |
| 17:51:54 | × | wickedja` quits (~user@2605:8d80:5431:6cb2:b646:a30f:510c:87ce) (Remote host closed the connection) |
| 17:52:37 | → | wickedjargon joins (~user@2605:8d80:5431:6cb2:b646:a30f:510c:87ce) |
| 17:52:51 | × | tromp quits (~textual@2001:1c00:3487:1b00:7955:9591:6018:7ef9) (Quit: My iMac has gone to sleep. ZZZzzz…) |
| 17:56:01 | → | tromp joins (~textual@2001:1c00:3487:1b00:7955:9591:6018:7ef9) |
| 17:56:45 | × | cipherrot quits (~jez@user/petrichor) (Quit: ZNC 1.10.1 - https://znc.in) |
| 17:58:21 | → | petrichor joins (~jez@user/petrichor) |
| 18:04:02 | × | philopsos1 quits (~caecilius@user/philopsos) (Ping timeout: 256 seconds) |
| 18:05:29 | → | lisbeths joins (uid135845@id-135845.lymington.irccloud.com) |
| 18:08:45 | <haskellbridge> | <loonycyborg> Milan_Vanca: not sure if it applies to your situation but you can do deep nesting in the pattern too, so if you just want to look deeper in a nested structure you can fold nested "case" into a single case. |
| 18:11:34 | × | glguy quits (glguy@libera/staff/glguy) (*.net *.split) |
| 18:11:39 | → | glguy joins (glguy@libera/staff/glguy) |
| 18:13:03 | → | traxex joins (traxex@user/traxex) |
| 18:15:19 | × | rainbyte quits (~rainbyte@186.22.19.214) (Remote host closed the connection) |
| 18:15:23 | <Milan_Vanca> | loonycyborg: Do you mean something like (v1, (Just v2), _) ? |
| 18:15:28 | → | rainbyte_ joins (~rainbyte@186.22.19.214) |
| 18:15:45 | <haskellbridge> | <loonycyborg> yep |
| 18:18:04 | <Milan_Vanca> | Yeah :) This is nice.. and If I wanted to modify v2 I could use lenses for that. Is that correct? |
| 18:18:41 | <EvanR> | that is one way |
| 18:20:46 | <EvanR> | you can also write an update function f g (v1, Just x, v3) = (v1, Just (g x), v3) |
| 18:21:39 | <Milan_Vanca> | Little more verbose but one does not need another lib. |
| 18:21:40 | <EvanR> | for a one off case, this takes a lot less support |
| 18:26:32 | × | GdeVolpiano quits (~GdeVolpia@user/GdeVolpiano) (Quit: WeeChat 4.7.2) |
| 18:26:52 | → | GdeVolpiano joins (~GdeVolpia@user/GdeVolpiano) |
| 18:32:35 | → | tremon joins (~tremon@83.80.159.219) |
| 18:32:59 | × | T_S_____ quits (sid501726@id-501726.uxbridge.irccloud.com) (Server closed connection) |
| 18:33:08 | → | T_S_____ joins (sid501726@id-501726.uxbridge.irccloud.com) |
| 18:39:09 | → | paddymahoney joins (~paddymaho@pool-99-250-10-137.cpe.net.cable.rogers.com) |
| 18:41:50 | → | humasect joins (~humasect@dyn-192-249-132-90.nexicom.net) |
| 18:46:15 | → | tzh joins (~tzh@c-76-115-131-146.hsd1.or.comcast.net) |
| 18:48:09 | × | paddymahoney quits (~paddymaho@pool-99-250-10-137.cpe.net.cable.rogers.com) (Ping timeout: 248 seconds) |
| 18:48:45 | → | merijn joins (~merijn@host-cl.cgnat-g.v4.dfn.nl) |
| 18:50:42 | × | euphores quits (~SASL_euph@user/euphores) (Quit: Leaving.) |
| 18:52:12 | → | morj_away joins (~morj@user/morj) |
| 18:52:59 | × | exarkun quits (~exarkun@user/exarkun) (Server closed connection) |
| 18:53:24 | → | target_i joins (~target_i@user/target-i/x-6023099) |
| 18:54:20 | → | exarkun joins (~exarkun@user/exarkun) |
| 18:55:48 | × | merijn quits (~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 255 seconds) |
| 18:58:03 | × | target_i quits (~target_i@user/target-i/x-6023099) (Ping timeout: 255 seconds) |
| 18:58:44 | → | target_i joins (~target_i@user/target-i/x-6023099) |
| 19:02:45 | → | Sgeo joins (~Sgeo@user/sgeo) |
| 19:03:45 | → | paddymahoney joins (~paddymaho@pool-99-250-10-137.cpe.net.cable.rogers.com) |
| 19:04:44 | → | euphores joins (~SASL_euph@user/euphores) |
| 19:06:48 | → | merijn joins (~merijn@host-cl.cgnat-g.v4.dfn.nl) |
| 19:08:14 | × | wickedjargon quits (~user@2605:8d80:5431:6cb2:b646:a30f:510c:87ce) (Ping timeout: 245 seconds) |
| 19:11:44 | × | merijn quits (~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 268 seconds) |
| 19:15:39 | × | aristid quits (sid1599@id-1599.uxbridge.irccloud.com) (Server closed connection) |
| 19:15:47 | → | aristid joins (sid1599@id-1599.uxbridge.irccloud.com) |
| 19:17:24 | × | paddymahoney quits (~paddymaho@pool-99-250-10-137.cpe.net.cable.rogers.com) (Ping timeout: 255 seconds) |
| 19:18:59 | × | disconnect3d quits (~disconnec@user/disconnect3d) (Server closed connection) |
| 19:21:55 | → | merijn joins (~merijn@host-cl.cgnat-g.v4.dfn.nl) |
| 19:25:49 | → | arandombit joins (~arandombi@2a02:2455:8656:7100:eca0:756e:c98c:4e3f) |
| 19:25:49 | × | arandombit quits (~arandombi@2a02:2455:8656:7100:eca0:756e:c98c:4e3f) (Changing host) |
| 19:25:49 | → | arandombit joins (~arandombi@user/arandombit) |
| 19:25:56 | → | wickedjargon joins (~user@2605:8d80:5431:6cb2:b646:a30f:510c:87ce) |
| 19:26:48 | × | merijn quits (~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 265 seconds) |
| 19:29:08 | → | disconnect3d joins (~disconnec@user/disconnect3d) |
| 19:34:28 | → | paddymahoney joins (~paddymaho@pool-99-250-10-137.cpe.net.cable.rogers.com) |
| 19:35:51 | × | paddymahoney quits (~paddymaho@pool-99-250-10-137.cpe.net.cable.rogers.com) (Remote host closed the connection) |
| 19:36:58 | × | humasect quits (~humasect@dyn-192-249-132-90.nexicom.net) (Quit: Leaving...) |
| 19:37:17 | → | merijn joins (~merijn@host-cl.cgnat-g.v4.dfn.nl) |
| 19:39:21 | → | Psychotic1 joins (~Psychotic@2600:1007:b0a8:2a87:b8ca:d0cd:23e3:1e08) |
| 19:41:42 | × | merijn quits (~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 255 seconds) |
| 19:43:11 | × | machinedgod quits (~machinedg@d172-219-48-230.abhsia.telus.net) (Ping timeout: 268 seconds) |
| 19:47:10 | × | Lord_of_Life quits (~Lord@user/lord-of-life/x-2819915) (Ping timeout: 256 seconds) |
| 19:49:50 | → | Lord_of_Life joins (~Lord@user/lord-of-life/x-2819915) |
| 19:52:40 | → | merijn joins (~merijn@host-cl.cgnat-g.v4.dfn.nl) |
| 19:52:48 | → | paddymahoney joins (~paddymaho@pool-99-250-10-137.cpe.net.cable.rogers.com) |
| 19:54:19 | × | andjjj23 quits (~irc@107.170.228.47) (Server closed connection) |
| 19:54:37 | → | andjjj23 joins (~irc@107.170.228.47) |
| 19:57:22 | × | merijn quits (~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 268 seconds) |
| 19:59:54 | × | arandombit quits (~arandombi@user/arandombit) (Ping timeout: 245 seconds) |
| 20:07:40 | × | petrichor quits (~jez@user/petrichor) (Quit: ZNC 1.10.1 - https://znc.in) |
| 20:08:03 | → | merijn joins (~merijn@host-cl.cgnat-g.v4.dfn.nl) |
| 20:12:24 | × | merijn quits (~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 245 seconds) |
| 20:13:25 | → | humasect joins (~humasect@dyn-192-249-132-90.nexicom.net) |
| 20:14:33 | → | arandombit joins (~arandombi@2a02:2455:8656:7100:eca0:756e:c98c:4e3f) |
| 20:14:33 | × | arandombit quits (~arandombi@2a02:2455:8656:7100:eca0:756e:c98c:4e3f) (Changing host) |
| 20:14:33 | → | arandombit joins (~arandombi@user/arandombit) |
| 20:16:29 | → | ljdarj joins (~Thunderbi@user/ljdarj) |
| 20:18:49 | × | Psychotic1 quits (~Psychotic@2600:1007:b0a8:2a87:b8ca:d0cd:23e3:1e08) (Ping timeout: 248 seconds) |
| 20:18:56 | × | nonzen quits (~nonzen@user/nonzen) (Quit: Gone) |
| 20:19:01 | × | sajith quits (~sajith@user/sajith) (Quit: Gone) |
| 20:19:06 | → | nonzen_ joins (~nonzen@user/nonzen) |
| 20:19:40 | → | sajith joins (~sajith@user/sajith) |
| 20:20:26 | × | gmg quits (~user@user/gehmehgeh) (Ping timeout: 252 seconds) |
| 20:20:28 | × | dtman34 quits (~dtman34@c-73-242-68-179.hsd1.mn.comcast.net) (Ping timeout: 276 seconds) |
| 20:21:39 | × | eugenrh quits (~eugenrh@user/eugenrh) (Server closed connection) |
| 20:21:57 | → | eugenrh joins (~eugenrh@user/eugenrh) |
| 20:22:25 | × | wickedjargon quits (~user@2605:8d80:5431:6cb2:b646:a30f:510c:87ce) (Ping timeout: 276 seconds) |
| 20:22:39 | → | gmg joins (~user@user/gehmehgeh) |
| 20:23:26 | → | merijn joins (~merijn@host-cl.cgnat-g.v4.dfn.nl) |
| 20:30:09 | × | chele quits (~chele@user/chele) (Remote host closed the connection) |
| 20:30:17 | × | merijn quits (~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 268 seconds) |
| 20:32:19 | × | xacktm quits (xacktm@user/xacktm) (Server closed connection) |
| 20:32:29 | → | dtman34 joins (~dtman34@2601:447:d183:2302:b0c5:8965:1c3f:d560) |
| 20:32:32 | × | michalz quits (~michalz@185.246.207.221) (Remote host closed the connection) |
| 20:32:34 | → | xacktm joins (bnc4free@user/xacktm) |
| 20:34:06 | × | lisbeths quits (uid135845@id-135845.lymington.irccloud.com) (Quit: Connection closed for inactivity) |
| 20:41:28 | → | merijn joins (~merijn@host-cl.cgnat-g.v4.dfn.nl) |
| 20:46:06 | × | merijn quits (~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 256 seconds) |
| 20:47:05 | × | op_4 quits (~tslil@user/op-4/x-9116473) (Ping timeout: 264 seconds) |
| 20:47:05 | × | srk quits (~sorki@user/srk) (Ping timeout: 248 seconds) |
| 20:47:18 | → | srk- joins (~sorki@user/srk) |
| 20:49:54 | → | prdak joins (~Thunderbi@user/prdak) |
| 20:49:59 | srk- | is now known as srk |
| 20:50:00 | → | op_4 joins (~tslil@user/op-4/x-9116473) |
| 20:55:33 | → | petrichor joins (~jez@user/petrichor) |
| 20:56:50 | → | merijn joins (~merijn@host-cl.cgnat-g.v4.dfn.nl) |
| 21:01:21 | × | merijn quits (~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 255 seconds) |
| 21:04:04 | × | ljdarj quits (~Thunderbi@user/ljdarj) (Ping timeout: 245 seconds) |
| 21:04:18 | <lantti> | is there a faster way to print a list of Int, separated by spaces, than "putStrLn (unwords $ map show ints)"? |
| 21:05:14 | <Rembane> | lantti: Faster as in time from first character to last character? |
| 21:05:27 | <Rembane> | ...minimizing that time that is |
| 21:05:31 | <lantti> | yes |
| 21:06:06 | <Rembane> | Converting it to a chunked bytestring could be faster, but I haven't compared. |
| 21:06:34 | → | aka_dude joins (~aka_dude@192.71.166.120) |
| 21:06:39 | <lantti> | I'm doing an algorithms course where I have to choice to do it in C, Rust or Haskell and I chose Haskell, but in my current task just printing the result takes me to the limit on acceptable time use |
| 21:06:49 | <newmind> | depending on the length of ints, maybe with a builder, but i doubt for any reasonable length outputs there is that much difference to be had here |
| 21:07:33 | × | aka_dude quits (~aka_dude@192.71.166.120) (Client Quit) |
| 21:07:38 | <dolio> | You could try `mapM_` with something. But I'd be surprised if it were a lot faster. |
| 21:07:44 | <newmind> | so, since haskell is a lazy language... how are you calculating ints? |
| 21:07:45 | <lantti> | although on a positive note, I did pass already. I'm just trying to improve my result from barely passing to something better |
| 21:07:54 | <Rembane> | lantti: How many ints do you print? |
| 21:08:08 | <lantti> | 10^6 |
| 21:08:20 | <mauke> | :t shows |
| 21:08:22 | <lambdabot> | Show a => a -> ShowS |
| 21:08:52 | <EvanR> | :t mapM_ print |
| 21:08:53 | <lambdabot> | (Foldable t, Show a) => t a -> IO () |
| 21:08:59 | <mauke> | that's not space separated |
| 21:09:18 | <dolio> | Yeah, you need the space analogue of print. |
| 21:09:28 | <tomsmeding> | lantti: are you allowed to use dependencies, like 'text' or 'bytestring'? |
| 21:09:59 | <dolio> | Is there a show-to-text/bytestring that doesn't run through show? |
| 21:10:17 | <dolio> | Other than the one I stopped maintaining like 10 years ago? |
| 21:10:48 | <tomsmeding> | well, for a start I'd be curious how `T.putStrLn (T.intercalate " " (map T.show ints))` performs, despite still using Prelude.show |
| 21:11:00 | <mauke> | :t let f [] = "\n"; f (x : xs) = shows x (' ' : f xs) in f |
| 21:11:03 | <lambdabot> | Show a => [a] -> [Char] |
| 21:11:13 | <tomsmeding> | dolio: https://hackage-content.haskell.org/package/text-2.1.4/docs/Data-Text-Lazy-Builder-Int.html ? |
| 21:11:34 | <dolio> | Oh, nice. |
| 21:11:48 | <mauke> | > let f [] = "\n"; f (x : xs) = shows x (' ' : f xs) in f [1,2,3] |
| 21:11:49 | <lambdabot> | "1 2 3 \n" |
| 21:11:51 | <dolio> | Also, is printing actually the bottleneck? |
| 21:12:13 | → | merijn joins (~merijn@host-cl.cgnat-g.v4.dfn.nl) |
| 21:12:24 | <tomsmeding> | right, possibly laziness makes it look like it is, even if it actually isn't |
| 21:12:36 | <EvanR> | isn't builder in appropriate here since we already have a lazy list of the things to print, in order |
| 21:12:45 | <EvanR> | just print them in order |
| 21:12:51 | <tomsmeding> | well, putStrLn takes an MVar on stdout |
| 21:13:04 | <tomsmeding> | taking an MVar for outputting like 5 bytes may not be optimal |
| 21:13:16 | <EvanR> | facepalm |
| 21:13:29 | <tomsmeding> | writing everything in a big buffer and then sending that buffer into stdout may be quite a bit faster |
| 21:13:41 | <EvanR> | this sounds so backwards |
| 21:13:58 | <EvanR> | kind of like buffering your own buffer before it gets to the OS buffers, which are then buffered |
| 21:14:09 | <lantti> | I'm currently trying to figure out how the profiling works, so I can get a better idea of the bottlenecks |
| 21:14:20 | <tomsmeding> | EvanR: output is already buffered, the actual write(2) call in the kernel is only called when stdout is flushed, which, if you don't write newlines, happens only every 4096 bytes or so |
| 21:14:47 | <dolio> | It's already effectively building a 'buffer' as a lazy list of characters. Builder is just generally a better one. |
| 21:15:08 | <tomsmeding> | EvanR: also, a Text Builder produces a _lazy_ text, so that doesn't actually create a whole separate buffering step |
| 21:15:33 | <dolio> | I think you can directly put a builder, too. |
| 21:15:35 | <EvanR> | a lazy text itself is already a lazy list |
| 21:15:35 | <tomsmeding> | or, well, it does, but then it (kind of) synchronises with the one in the RTS so they kinda merge |
| 21:15:46 | <EvanR> | then a builder to make a straight lazy list is not helping |
| 21:16:31 | <tomsmeding> | dolio: doesn't seem like you can, but toLazyText should be fine |
| 21:16:39 | × | merijn quits (~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 255 seconds) |
| 21:16:49 | <EvanR> | builder is often recommended in case people are trying to form a big sequence from pieces other than just tacking onto the end |
| 21:16:54 | <dolio> | Oh. I guess it's just bytestring builders. |
| 21:17:10 | <tomsmeding> | EvanR: which i why I recommended `T.intercalate` first |
| 21:17:20 | <tomsmeding> | but that doesn't have the nice Int serialiser |
| 21:17:41 | <newmind> | lantti: what's the actual time you're getting? just to see how reasonable it is |
| 21:18:02 | → | aka_dude joins (~aka_dude@2a03:f80:30:f490::1) |
| 21:18:19 | × | morj_away quits (~morj@user/morj) (Quit: Konversation terminated!) |
| 21:19:01 | × | aka_dude quits (~aka_dude@2a03:f80:30:f490::1) (Remote host closed the connection) |
| 21:19:21 | <tomsmeding> | further tip: benchmark your code but setting `ints = replicate 100000 123456789` or something, just to double-check it's actually the printing that's slow, not the computation preceding it |
| 21:20:01 | <newmind> | that was my second suggestion, replacing ints with [1..100000] or something |
| 21:20:32 | <EvanR> | .oO( replace the printing with just evaluating the ints in sequence ) |
| 21:20:42 | <tomsmeding> | that's the dual version :p |
| 21:23:22 | <mauke> | :t mapM_ evaluate |
| 21:23:24 | <lambdabot> | Foldable t => t b -> IO () |
| 21:24:47 | <EvanR> | hopefully evaluate doesn't first take an MVar before evaluating xD |
| 21:25:04 | <EvanR> | requiring us to do artifically additional buffering wtf |
| 21:25:35 | <lantti> | I can't figure out the profiling under stack right now, but unix time command for the 10000000 Ints case gives 0.8s |
| 21:25:39 | × | cbarrett quits (sid192934@id-192934.helmsley.irccloud.com) (Server closed connection) |
| 21:25:51 | → | cbarrett joins (sid192934@id-192934.helmsley.irccloud.com) |
| 21:25:54 | <EvanR> | 10^7 ints |
| 21:26:07 | <lantti> | oops, 1000000 |
| 21:26:32 | <EvanR> | are they particularly uniform ints or like up to 3 digits or |
| 21:27:17 | <lantti> | the whole task is that one: https://cses.fi/alon/task/1092/ |
| 21:27:55 | <lantti> | so basically two runs of consecutive ints with one exception |
| 21:28:09 | <lantti> | in each run |
| 21:29:33 | <EvanR> | ok it doesn't seem to be trying to print out literally 10^6 ints but the program is more complex than that |
| 21:30:17 | → | merijn joins (~merijn@host-cl.cgnat-g.v4.dfn.nl) |
| 21:30:24 | <haskellbridge> | <ijouw> Is there a good way to define a more general Ord class that avoids troubles with functions using Ordered argumens like nubOn? |
| 21:31:02 | <EvanR> | :t nubOn |
| 21:31:20 | <EvanR> | @botsnack |
| 21:31:31 | <lambdabot> | :) |
| 21:31:32 | <lambdabot> | error: [GHC-88464] Variable not in scope: nubOn |
| 21:31:52 | → | aka_dude joins (~aka_dude@192.71.166.120) |
| 21:32:26 | <haskellbridge> | <ijouw> i meant this: nubOrdOn :: Ord b => (a -> b) -> [a] -> [a] |
| 21:32:29 | × | jreicher quits (~joelr@user/jreicher) (Ping timeout: 252 seconds) |
| 21:32:40 | <EvanR> | what is the trouble? |
| 21:32:41 | <haskellbridge> | <ijouw> Filters duplicates by sorting |
| 21:32:50 | <lantti> | It does need to print out 10^6 ints in the case n = 10^6. But thanks for the tips, i'll try some out and see if that makes a difference. |
| 21:33:09 | → | jreicher joins (~joelr@user/jreicher) |
| 21:33:46 | <EvanR> | yeah but it has to print a lot more than that in that case, so someone trying to replicate your running time is going to undershoot by a lot |
| 21:34:07 | <tomsmeding> | EvanR: yes, "YES" and 2 more ints |
| 21:34:07 | <haskellbridge> | <ijouw> It obviously does not work on MyOrd a => [a], and specifying MyOrd a, Ord a => [a] makes MyOrd seem pointless |
| 21:34:21 | <EvanR> | oh it's only 2 lines |
| 21:34:25 | <EvanR> | not N |
| 21:34:57 | <EvanR> | MyOrd ? |
| 21:35:02 | × | merijn quits (~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 268 seconds) |
| 21:35:11 | <EvanR> | you want it to work on a variable class? |
| 21:35:41 | <EvanR> | if you're trying to define an alternate Ord instance, that's what newtypes are for, then you use Ord |
| 21:36:26 | <haskellbridge> | <ijouw> I want to use type families to allow the return type to be wrapped for DSL stuff |
| 21:36:58 | <tomsmeding> | it kind of sounds like you'll need to be a bit more specific here |
| 21:37:42 | <EvanR> | maybe you need ways to lift library functions like nubOrdOn into your DSL |
| 21:43:02 | → | Arsen joins (16abab341f@gentoo/developer/managarm.dev.Arsen) |
| 21:45:40 | → | merijn joins (~merijn@host-cl.cgnat-g.v4.dfn.nl) |
| 21:45:47 | <haskellbridge> | <ijouw> I want this https://hackage-content.haskell.org/package/Boolean-0.2.4/docs/Data-Boolean.html#t:OrdB and then define a function nubOrd' :: (OrdB a, BooleanOf a ~ Bool) => [a] -> [a] ; (maybe i should just not reimplement everything...) |
| 21:46:06 | <monochrom> | I am unconvinced that (putStrLn . unwords . map show) is too slow. It's only 0.05 seconds on my laptop if you redirect to a file (which is the right thing to do if you're simulating an online autotester; if you let it go to a terminal, then the bottleneck is the terminal) |
| 21:47:07 | <newmind> | .o( but it does say a lot about haskell as a language/ecosystem that we're discussing it ) |
| 21:47:33 | <EvanR> | it? |
| 21:47:58 | <newmind> | why something as simple as "print out this list of numbers" might be slow |
| 21:48:16 | <monochrom> | No, it says a lot about people having double standards. |
| 21:48:19 | → | Guest81 joins (~Guest81@52.144.37.132) |
| 21:48:20 | <EvanR> | people mistake what's slow all the time, that's a haskell thing |
| 21:49:28 | <EvanR> | this problem that separates a million integers into two sets that adds up to the same thing |
| 21:49:28 | <newmind> | ywah, but with lazy eval, monads that need to be resolved... it's less straightforward than it would be in C.. which is perfectly fine, just... weird |
| 21:49:38 | <EvanR> | printing it out doesn't sound like the crunchy part |
| 21:50:10 | <mauke> | printing is slow in C, too |
| 21:50:15 | <monochrom> | After compiling with -O, the IO monad doesn't exist in the machine code. |
| 21:50:21 | × | merijn quits (~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 265 seconds) |
| 21:50:28 | <EvanR> | i was going to say C is the one where you are sometimes trying to deduce how slow printing is |
| 21:50:29 | <tomsmeding> | (that's a claim) |
| 21:50:36 | <tomsmeding> | maybe in this tight loop that's true |
| 21:50:44 | <mauke> | back when I did SPOJ, I got significant time improvements by bypassing stdio |
| 21:50:48 | <lantti> | I suspected the printing because I realized there is an analytic solution to the actual problem and generating the lists is just some math operations and [1..xyz] |
| 21:51:08 | <lantti> | I'm in the process of re-evaluating that assumption :) |
| 21:51:20 | <Guest81> | I am reading "learn you a Haskell ..." and I am using interactive on the haskell.org homepage. But when I input a simple equality such as "a = [1,2,3]" is get a parse error. What am I doing wrong? |
| 21:51:40 | <Rembane> | Guest81: Try a let a = [1,2,3] |
| 21:51:55 | <tomsmeding> | that "Try it!" prompt on haskell.org is not a proper haskell interpreter |
| 21:52:02 | <EvanR> | a = [1,2,3] ought to work in ghci and at top level? |
| 21:52:08 | <tomsmeding> | it doesn't there |
| 21:52:20 | <Guest81> | no go: let a = [1,2,3] |
| 21:52:21 | <Guest81> | <no location info>: not an expression: ‘let a = [1,2,3]’ |
| 21:52:32 | <EvanR> | "interesting" |
| 21:52:47 | <monochrom> | "a = [1,2,3]" works for me. |
| 21:53:06 | <tomsmeding> | there's https://play.haskell.org if you want to upgrade to writing a full program (which doesn't have to be complicated!); otherwise, either install ghci, or there may be some other online repl |
| 21:53:12 | <monochrom> | "let a = [1,2,3]" also works for me. |
| 21:53:23 | <tomsmeding> | monochrom: we're talking about the "Try it!" thing on haskell.org, which is stupid and broken |
| 21:53:35 | <monochrom> | Oh that. Sorry! |
| 21:53:51 | <monochrom> | "let a = [1,2,3] in length a" |
| 21:54:07 | <tomsmeding> | ah yes, that does work Guest81 ^ |
| 21:54:18 | <monochrom> | But play.haskell.org is better. |
| 21:54:19 | × | astra quits (sid289983@user/amish) (Server closed connection) |
| 21:54:20 | <tomsmeding> | apparently it accepts only full expressions |
| 21:54:31 | <tomsmeding> | play.haskell.org is not a repl, though :) |
| 21:54:32 | × | prdak quits (~Thunderbi@user/prdak) (Ping timeout: 268 seconds) |
| 21:54:33 | → | astra joins (sid289983@id-289983.hampstead.irccloud.com) |
| 21:54:51 | × | ChaiTRex quits (~ChaiTRex@user/chaitrex) (Remote host closed the connection) |
| 21:55:00 | <monochrom> | Who writes 1000 lines of code on a REPL anyway? Be realistic. |
| 21:55:02 | <geekosaur> | probably just hint |
| 21:55:10 | <Guest81> | OK so basically "Try it!" is not a true interpreter. |
| 21:55:12 | → | ChaiTRex joins (~ChaiTRex@user/chaitrex) |
| 21:55:35 | <tomsmeding> | it is an interpreter, but not ghci |
| 21:55:46 | <mauke> | a = [1,2,3] is not an expression |
| 21:55:48 | <tomsmeding> | ghci does quite a bit more than just an interpreter for basic expressions, and "learn you a haskell" assumes ghci |
| 21:56:55 | <Guest81> | So i need ghci. Thanks all. |
| 21:57:07 | <tomsmeding> | that's probably easiest, yes (use ghcup) |
| 21:57:44 | <EvanR> | repl is overrated, you want to load a file anyway. Then reload |
| 21:58:31 | × | ChaiTRex quits (~ChaiTRex@user/chaitrex) (Client Quit) |
| 21:59:39 | → | philderbeast joins (~philderbe@57-134-39-54.resi.cgocable.ca) |
| 21:59:44 | ← | Guest81 parts (~Guest81@52.144.37.132) () |
| 22:00:27 | → | ChaiTRex joins (~ChaiTRex@user/chaitrex) |
| 22:01:02 | → | merijn joins (~merijn@host-cl.cgnat-g.v4.dfn.nl) |
| 22:01:40 | × | Milan_Vanca quits (~milan@user/Milan-Vanca:32634) (Quit: WeeChat 4.7.2) |
| 22:02:15 | × | humasect quits (~humasect@dyn-192-249-132-90.nexicom.net) (Quit: Leaving...) |
| 22:03:14 | × | philderbeast quits (~philderbe@57-134-39-54.resi.cgocable.ca) (Client Quit) |
| 22:03:59 | <haskellbridge> | <ijouw> Isn't the two sets algorithm discussed above easy to compute? The question is whether the sum [1..n] is even (solvable in constant time) (or am I missing something?). Printing could indeed be slowest part. |
| 22:04:21 | × | takuan quits (~takuan@d8D86B9E9.access.telenet.be) (Ping timeout: 255 seconds) |
| 22:04:25 | <tomsmeding> | ijouw: do you have a proof that if sum [1..n] is even, there is such a splitting? |
| 22:04:32 | → | peterbecich joins (~Thunderbi@71.84.33.135) |
| 22:04:35 | × | target_i quits (~target_i@user/target-i/x-6023099) (Quit: leaving) |
| 22:04:44 | <tomsmeding> | (there is, but figuring out what the splitting is, requires a little trick) |
| 22:04:47 | <haskellbridge> | <ijouw> Working on it |
| 22:08:07 | × | merijn quits (~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 264 seconds) |
| 22:10:01 | → | abiss27 joins (~abiss27@user/abiss) |
| 22:11:53 | × | petrichor quits (~jez@user/petrichor) (Ping timeout: 248 seconds) |
| 22:12:45 | <mauke> | ah, I see it |
| 22:13:01 | <mauke> | 1 + 2 = 3 |
| 22:15:12 | <mauke> | nvm, I'm blind |
| 22:17:05 | <mauke> | hah, no. I was wrong about being wrong. I just did it backwards :-) |
| 22:17:36 | <newmind> | mauke: did you get nerdsniped there? |
| 22:17:39 | × | gmc quits (sid58314@id-58314.ilkley.irccloud.com) (Server closed connection) |
| 22:17:50 | → | gmc joins (sid58314@id-58314.ilkley.irccloud.com) |
| 22:19:06 | → | merijn joins (~merijn@host-cl.cgnat-g.v4.dfn.nl) |
| 22:19:31 | → | petrichor joins (~jez@user/petrichor) |
| 22:19:53 | × | tremon quits (~tremon@83.80.159.219) (Quit: getting boxed in) |
| 22:21:16 | <tomsmeding> | lantti: I'm not sure what you did, but it can probably be done more efficiently; this is haskell with `putStrLn . unwords . map show` https://tomsmeding.com/ss/get/tomsmeding/RnFf4z |
| 22:23:02 | <tomsmeding> | (I figured out a way to compute what numbers to print in constant time; then I just have to print all those numbers) |
| 22:23:28 | <tomsmeding> | it's a fun problem :) |
| 22:24:08 | × | merijn quits (~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 268 seconds) |
| 22:24:58 | <tomsmeding> | and I'm not sure where even that 0.30s comes from; it takes less than 1ms on that input on my machine |
| 22:25:35 | × | peterbecich quits (~Thunderbi@71.84.33.135) (Ping timeout: 245 seconds) |
| 22:25:48 | <geekosaur> | `sum [1..n]` isn't there a number theory approach for that? |
| 22:26:22 | <haskellbridge> | <ijouw> yes, it is (n*(n+1))/2 |
| 22:26:41 | <tomsmeding> | it seems printing is actually rather slow on that judge server! On roughly 260000 I take 0.08s, on roughly 653000 I take 0.21s, and on 1000000 I take 0.30s |
| 22:27:25 | <tomsmeding> | and I can assure you that I am actually doing work that should take <10us plus `putStrLn . unwords . map show` on a lazy list of Int |
| 22:28:21 | <tomsmeding> | (I'm not sure if it's responsible to post my solution publically for people to scrutinise) |
| 22:28:43 | → | terrorjack joins (~terrorjac@2a01:4f8:271:2d98::2) |
| 22:29:56 | <lantti> | tomsmeding: I already passed so you won't boost my grade with it |
| 22:30:21 | <lantti> | of course I don't know if any other students are reading this |
| 22:31:07 | <tomsmeding> | lantti: do you determine what numbers to print in constant time? |
| 22:31:19 | <tomsmeding> | or is there a little loop or something involved |
| 22:31:32 | <lantti> | yes, but I still generate a list of them. eliminating that list now... |
| 22:31:33 | <tomsmeding> | (and how do your judge times compare to mine?) |
| 22:31:42 | → | prdak joins (~Thunderbi@user/prdak) |
| 22:31:48 | <lantti> | yes, to the constant time |
| 22:31:55 | <tomsmeding> | interesting |
| 22:32:41 | × | arandombit quits (~arandombi@user/arandombit) (Ping timeout: 248 seconds) |
| 22:32:50 | <lantti> | I also use a delete on one of the lists to remove that one int that needs to move to the other set |
| 22:33:12 | <lantti> | all that can still go away if i make a loop instead of a list |
| 22:33:30 | <lantti> | but that might work against me as well, lets see |
| 22:33:39 | × | kawzeg quits (kawzeg@2a01:4f9:c013:cfbf::1) (Server closed connection) |
| 22:33:57 | → | kawzeg joins (kawzeg@2a01:4f9:c013:cfbf::1) |
| 22:34:27 | → | arahael joins (~wetfoot@user/arahael) |
| 22:34:59 | → | machinedgod joins (~machinedg@d172-219-48-230.abhsia.telus.net) |
| 22:36:19 | × | prdak quits (~Thunderbi@user/prdak) (Ping timeout: 264 seconds) |
| 22:36:26 | → | pavonia joins (~user@user/siracusa) |
| 22:36:59 | <tomsmeding> | turns out my lists weren't actually lazy when printed -- I was materialising them with 'length'. If I don't do that, my worst-case time on the judge server goes from 0.30s to 0.21s |
| 22:38:13 | × | tromp quits (~textual@2001:1c00:3487:1b00:7955:9591:6018:7ef9) (Quit: My iMac has gone to sleep. ZZZzzz…) |
| 22:38:37 | <tomsmeding> | (that server is really slow...) |
| 22:39:15 | <mauke> | you guys are using lists? |
| 22:39:30 | <tomsmeding> | I am using lists only to pass to `putStrLn . unwords . map show` |
| 22:40:31 | <newmind> | tomsmeding: without printing and just evaluating its fast on the server too? |
| 22:42:19 | <tomsmeding> | then the server would mark my answer wrong and (presumably? didn't try) not proceed to the larger test cases |
| 22:42:41 | <mauke> | it should run all of them |
| 22:44:39 | → | merijn joins (~merijn@host-cl.cgnat-g.v4.dfn.nl) |
| 22:45:57 | <tomsmeding> | ok if I replace the `putStrLn . unwords . map show` with `mapM_ evaluate` then maximum runtime goes from 0.21s to 0.02s |
| 22:46:14 | <lantti> | ah, ok, I got it to 0.21s too by eliminating two calls to length and one to delete |
| 22:46:41 | × | __monty__ quits (~toonn@user/toonn) (Quit: leaving) |
| 22:46:49 | <lantti> | ah, so there it is :) |
| 22:47:01 | <tomsmeding> | and if I do `evaluate . length . unwords . map show` instead, I get 0.16s |
| 22:47:21 | <tomsmeding> | so that's 0.02s for the computation, 0.14s for the serialisation, and 0.05s for the printing |
| 22:47:36 | <tomsmeding> | this is all <0.001s on my machine lol |
| 22:48:52 | <haskellbridge> | <ijouw> I now have a formal proof by induction with step 4 |
| 22:48:57 | × | merijn quits (~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 246 seconds) |
| 22:49:17 | <tomsmeding> | that sounds like mauke's solution (exchanged ideas in private chat) |
| 22:49:28 | <tomsmeding> | mine is overengineered, I used a sqrt |
| 22:50:41 | <mauke> | my solution doesn't use lists :-) |
| 22:50:42 | <haskellbridge> | <ijouw> I am debating whether i want to put it in an automatic solver |
| 22:51:52 | <tomsmeding> | mauke: I tool the liberty to submit your solution to the judge; it takes 0.59s |
| 22:52:11 | <tomsmeding> | stdout handling is slow, told you |
| 22:52:26 | <tomsmeding> | *took |
| 22:53:22 | <mauke> | spoilers: https://cses.fi/paste/7167882c695ce46ff9ce6b/ |
| 22:54:57 | <tomsmeding> | overengineered spoilers: https://cses.fi/paste/b23bf94c9440505af9ce60/ (if we're sharing anyway...) |
| 22:56:05 | <haskellbridge> | <ijouw> There is div from Integral, no need for double cast for /2 |
| 22:56:18 | <tomsmeding> | yes, because there's also sqrt |
| 22:57:40 | <tomsmeding> | *yes I do because |
| 23:00:02 | → | merijn joins (~merijn@host-cl.cgnat-g.v4.dfn.nl) |
| 23:04:20 | × | merijn quits (~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 245 seconds) |
| 23:07:49 | <lantti> | mine was https://privatebin.net/?97447d6805a0ea49#CfnZntNYLfYtSvpCod6DSKRYS8xDhzqycvhjmKNhppjv |
| 23:07:59 | <haskellbridge> | <ijouw> My solution fails locally at readLn? I am confused. |
| 23:10:11 | → | emmanuelux joins (~em@user/emmanuelux) |
| 23:10:36 | <haskellbridge> | <ijouw> I was using a library which wraps reads with Maybe and forgot to adjust the type... |
| 23:10:50 | <haskellbridge> | <ijouw> When removing it so i can submit with fewer deps |
| 23:15:24 | → | merijn joins (~merijn@host-cl.cgnat-g.v4.dfn.nl) |
| 23:19:15 | <mauke> | lantti: I suggest changing "otherwise" to "print" for even more confusion |
| 23:19:45 | × | merijn quits (~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 246 seconds) |
| 23:20:59 | × | snek quits (sid280155@id-280155.lymington.irccloud.com) (Server closed connection) |
| 23:21:11 | → | snek joins (sid280155@id-280155.lymington.irccloud.com) |
| 23:21:44 | <lantti> | mauke: is it not meant to be used like that? is it only for gurads then? |
| 23:22:21 | <lantti> | guards, even |
| 23:23:39 | × | saolsen quits (sid26430@id-26430.lymington.irccloud.com) (Server closed connection) |
| 23:23:50 | → | saolsen joins (sid26430@id-26430.lymington.irccloud.com) |
| 23:25:00 | <lantti> | but looking at my code now I do admit that there are some decisions that only make sense if you consider that they were the smallest change to the previous version, like the decision to include the lengths of the sets in the same list as the sets themselves |
| 23:25:38 | <lantti> | (the previous version used length on the generated lists) |
| 23:26:53 | <lantti> | (and the term "step squad" comes from the BBC childrens series called Numberblocks) |
| 23:29:25 | <lantti> | (which I can recommend to anyone with children in the 1-3 primary school or earlier) |
| 23:30:47 | → | merijn joins (~merijn@host-cl.cgnat-g.v4.dfn.nl) |
| 23:32:16 | <lantti> | should I use _ -> as the catch all case then? I'm not working with haskell all that much as one may notice |
| 23:33:05 | → | Comstar joins (~Comstar@user/Comstar) |
| 23:33:39 | × | acidsys quits (~crameleon@openSUSE/member/crameleon) (Server closed connection) |
| 23:33:54 | → | acidsys joins (~crameleon@openSUSE/member/crameleon) |
| 23:34:09 | × | emmanuelux quits (~em@user/emmanuelux) (Quit: bye) |
| 23:35:05 | × | merijn quits (~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 248 seconds) |
| 23:36:05 | <int-e> | mauke: Yeah that looks like the best solution. Kind of sad; the simple greedy algorithm for the knapsack problem would work here. |
| 23:36:15 | → | emmanuelux joins (~em@user/emmanuelux) |
| 23:37:02 | <int-e> | (but then you'd have to accumulate a full result before printing anything) |
| 23:38:57 | → | chenjf joins (~chenjf@68.64.178.54) |
| 23:39:39 | × | tamer quits (~tamer@user/tamer) (Server closed connection) |
| 23:40:00 | → | tamer joins (~tamer@5.2.74.82) |
| 23:40:59 | × | bjs quits (sid190364@user/bjs) (Server closed connection) |
| 23:41:15 | → | bjs joins (sid190364@user/bjs) |
| 23:44:58 | <Comstar> | I can't think of a way to implement breadth-first searches (for the sake of discussion assume for a binary tree) that doesn't use a `Control.Monad.State` implementation |
| 23:45:29 | <Comstar> | do y'all know of a more pure approach? I guess I could do like, some folding magic |
| 23:45:49 | <Comstar> | I feel like I could probably find some neat code examples searching around github &al |
| 23:46:11 | → | merijn joins (~merijn@host-cl.cgnat-g.v4.dfn.nl) |
| 23:46:25 | × | chenjf quits (~chenjf@68.64.178.54) (Quit: WeeChat 4.8.1) |
| 23:47:13 | <int-e> | Comstar: If you have a state S and function branch :: S -> [S] then the list monad's bind (aka concatMap) can produce the next level of a tree from the previous one. (This gets a bit awkward if you also want to record history, but you can make that part of S) |
| 23:47:36 | <Comstar> | yeah that makes sense |
| 23:47:54 | <int-e> | "history" being the path through the underlying tree |
| 23:48:15 | <Leary> | Comstar: There was a haskell challenge for this a while back. This was my solution: https://gist.github.com/LSLeary/5083d1dfe403d1562e7778713d97b22a |
| 23:49:31 | <int-e> | Leary: that task is related but abuses Foldable on an infinite tree that you already have as a value. |
| 23:50:18 | <int-e> | (and it's an abuse because that Semigroup instance isn't lawful) |
| 23:50:40 | <Comstar> | Leary, oh wow line 25 in `Search.hs` is really interesting, I didn't know you could do `\case` like that, does that trick have a name? |
| 23:50:51 | <Comstar> | oh it's prob the LambdaCase language extension |
| 23:50:56 | <int-e> | it is |
| 23:50:56 | <Leary> | int-e: Do we not have a (foldable) binary tree to search? And yes, I agree, but specialising the code to a binary tree means we can kill the evil. |
| 23:50:57 | <Comstar> | that'll be fun to explore |
| 23:51:32 | <int-e> | Leary: I don't know whether we have one. My main point was that it's abuse. |
| 23:51:56 | × | earthy quits (~arthurvl@2a02-a469-f5e2-1-83d2-ca43-57a2-dc81.fixed6.kpn.net) (Ping timeout: 268 seconds) |
| 23:53:06 | × | merijn quits (~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 256 seconds) |
| 23:53:16 | → | peterbecich joins (~Thunderbi@71.84.33.135) |
| 23:53:22 | <lantti> | mauke: oh, now i see. so the "otherwise" only worked because any identifier would have worked there |
| 23:53:41 | <int-e> | I've implemented quite a few breadth first searches in Haskell and I've never materialized the tree; only levels (usually as lists because it's convenient, or as sets because I expected a significant number of transpositions.) |
All times are in UTC on 2026-02-24.