Logs on 2024-12-19 (liberachat/#haskell)
| 00:02:34 | × | ByronJohnson quits (~bairyn@50.250.232.19) (Ping timeout: 252 seconds) |
| 00:03:07 | × | peterbecich quits (~Thunderbi@syn-047-229-123-186.res.spectrum.com) (Ping timeout: 264 seconds) |
| 00:04:05 | → | ByronJohnson joins (~bairyn@50.250.232.19) |
| 00:08:29 | → | merijn joins (~merijn@128-137-045-062.dynamic.caiway.nl) |
| 00:09:29 | × | notzmv quits (~umar@user/notzmv) (Ping timeout: 265 seconds) |
| 00:10:36 | → | lol_ joins (~lol@2603:3016:1e01:b9c0:e49a:26f1:1256:b271) |
| 00:10:51 | → | dsrt^ joins (~dsrt@c-98-242-74-66.hsd1.ga.comcast.net) |
| 00:12:46 | → | ystael joins (~ystael@user/ystael) |
| 00:13:39 | × | merijn quits (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 276 seconds) |
| 00:14:34 | × | jcarpenter2 quits (~lol@2603:3016:1e01:b9c0:5004:d446:5b51:cb8b) (Ping timeout: 260 seconds) |
| 00:23:51 | → | merijn joins (~merijn@128-137-045-062.dynamic.caiway.nl) |
| 00:30:45 | × | merijn quits (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 265 seconds) |
| 00:34:08 | × | jle` quits (~jle`@syn-023-240-075-236.res.spectrum.com) (Ping timeout: 265 seconds) |
| 00:35:53 | → | jle` joins (~jle`@2603:8001:3b02:84d4::1000) |
| 00:37:03 | × | dsrt^ quits (~dsrt@c-98-242-74-66.hsd1.ga.comcast.net) (Ping timeout: 276 seconds) |
| 00:44:45 | → | dsrt^ joins (~dsrt@c-98-242-74-66.hsd1.ga.comcast.net) |
| 00:45:44 | × | dostoevsky_ quits (~dostoevsk@user/dostoevsky) (Quit: Leaving) |
| 00:46:03 | × | LainExperiments4 quits (~LainExper@user/LainExperiments) (Quit: Client closed) |
| 00:46:38 | → | dostoevsky joins (~dostoevsk@user/dostoevsky) |
| 00:47:38 | → | merijn joins (~merijn@128-137-045-062.dynamic.caiway.nl) |
| 00:50:34 | × | sawilagar quits (~sawilagar@user/sawilagar) (Ping timeout: 265 seconds) |
| 00:52:30 | × | merijn quits (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 265 seconds) |
| 00:54:04 | × | Unicorn_Princess quits (~Unicorn_P@user/Unicorn-Princess/x-3540542) (Remote host closed the connection) |
| 00:54:11 | → | merijn joins (~merijn@128-137-045-062.dynamic.caiway.nl) |
| 00:56:30 | × | sprotte24 quits (~sprotte24@p200300d16f0dce00c42912c31568f36e.dip0.t-ipconnect.de) (Quit: Leaving) |
| 00:58:47 | × | merijn quits (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 265 seconds) |
| 01:00:31 | × | fmira quits (~user@user/fmira) (Remote host closed the connection) |
| 01:01:23 | → | fmira joins (~user@user/fmira) |
| 01:02:10 | × | fmira quits (~user@user/fmira) (Remote host closed the connection) |
| 01:04:49 | × | acidjnk_new quits (~acidjnk@p200300d6e7283f667119c200ba695214.dip0.t-ipconnect.de) (Ping timeout: 248 seconds) |
| 01:09:27 | → | merijn joins (~merijn@128-137-045-062.dynamic.caiway.nl) |
| 01:13:46 | × | merijn quits (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 252 seconds) |
| 01:17:21 | × | xff0x quits (~xff0x@2405:6580:b080:900:c5e5:bb72:26a4:9b68) (Ping timeout: 244 seconds) |
| 01:23:02 | → | LainExperiments joins (~LainExper@user/LainExperiments) |
| 01:24:50 | → | merijn joins (~merijn@128-137-045-062.dynamic.caiway.nl) |
| 01:29:43 | × | merijn quits (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 265 seconds) |
| 01:30:40 | × | ph88 quits (~ph88@2a02:8109:9e26:c800:851e:84df:7cc0:34b6) (Remote host closed the connection) |
| 01:32:49 | × | machinedgod quits (~machinedg@d108-173-18-100.abhsia.telus.net) (Ping timeout: 252 seconds) |
| 01:36:34 | × | alp quits (~alp@2001:861:8ca0:4940:268e:5456:127:feca) (Ping timeout: 272 seconds) |
| 01:39:53 | × | Tuplanolla quits (~Tuplanoll@91-159-69-59.elisa-laajakaista.fi) (Quit: Leaving.) |
| 01:40:14 | → | merijn joins (~merijn@128-137-045-062.dynamic.caiway.nl) |
| 01:40:56 | × | weary-traveler quits (~user@user/user363627) (Remote host closed the connection) |
| 01:44:52 | × | merijn quits (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 252 seconds) |
| 01:53:41 | → | peterbecich joins (~Thunderbi@syn-047-229-123-186.res.spectrum.com) |
| 01:55:37 | → | merijn joins (~merijn@128-137-045-062.dynamic.caiway.nl) |
| 01:59:57 | × | merijn quits (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 252 seconds) |
| 02:02:40 | × | Igloo quits (~ian@81.2.99.210) (Quit: BIAB) |
| 02:09:10 | → | xff0x joins (~xff0x@182.169.73.28) |
| 02:10:59 | → | merijn joins (~merijn@128-137-045-062.dynamic.caiway.nl) |
| 02:13:04 | → | Igloo joins (~ian@81.2.99.210) |
| 02:15:38 | × | merijn quits (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 265 seconds) |
| 02:15:50 | × | mzg quits (mzg@abusers.hu) (Ping timeout: 272 seconds) |
| 02:17:14 | → | notzmv joins (~umar@user/notzmv) |
| 02:18:08 | → | Smiles joins (uid551636@id-551636.lymington.irccloud.com) |
| 02:26:21 | → | merijn joins (~merijn@128-137-045-062.dynamic.caiway.nl) |
| 02:31:27 | × | merijn quits (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 276 seconds) |
| 02:41:15 | × | dsrt^ quits (~dsrt@c-98-242-74-66.hsd1.ga.comcast.net) (Ping timeout: 265 seconds) |
| 02:41:44 | → | merijn joins (~merijn@128-137-045-062.dynamic.caiway.nl) |
| 02:46:31 | × | merijn quits (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 244 seconds) |
| 02:48:19 | → | dsrt^ joins (dsrt@c-98-242-74-66.hsd1.ga.comcast.net) |
| 02:53:20 | × | peterbecich quits (~Thunderbi@syn-047-229-123-186.res.spectrum.com) (Ping timeout: 265 seconds) |
| 02:57:30 | → | merijn joins (~merijn@128-137-045-062.dynamic.caiway.nl) |
| 03:02:10 | × | merijn quits (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 260 seconds) |
| 03:10:39 | lol_ | is now known as jcarpenter2 |
| 03:12:53 | → | merijn joins (~merijn@128-137-045-062.dynamic.caiway.nl) |
| 03:17:31 | × | merijn quits (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 244 seconds) |
| 03:28:16 | → | merijn joins (~merijn@128-137-045-062.dynamic.caiway.nl) |
| 03:32:58 | × | merijn quits (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 265 seconds) |
| 03:43:40 | → | merijn joins (~merijn@128-137-045-062.dynamic.caiway.nl) |
| 03:46:59 | × | td_ quits (~td@i53870921.versanet.de) (Ping timeout: 265 seconds) |
| 03:48:31 | → | td_ joins (~td@i53870932.versanet.de) |
| 03:50:09 | × | merijn quits (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 248 seconds) |
| 04:01:00 | × | ljdarj quits (~Thunderbi@user/ljdarj) (Ping timeout: 265 seconds) |
| 04:01:43 | → | merijn joins (~merijn@128-137-045-062.dynamic.caiway.nl) |
| 04:02:21 | × | LainExperiments quits (~LainExper@user/LainExperiments) (Quit: Client closed) |
| 04:06:43 | × | merijn quits (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 264 seconds) |
| 04:11:43 | → | OftenFaded joins (~OftenFade@user/tisktisk) |
| 04:17:05 | → | merijn joins (~merijn@128-137-045-062.dynamic.caiway.nl) |
| 04:21:57 | × | merijn quits (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 276 seconds) |
| 04:26:55 | × | Smiles quits (uid551636@id-551636.lymington.irccloud.com) (Quit: Connection closed for inactivity) |
| 04:27:39 | → | rekahsoft joins (~rekahsoft@76.69.85.220) |
| 04:31:10 | → | aforemny joins (~aforemny@2001:9e8:6cf7:7000:54e5:6684:9196:e657) |
| 04:31:49 | × | aforemny_ quits (~aforemny@2001:9e8:6cd7:5a00:85fb:8e26:5d91:c068) (Ping timeout: 248 seconds) |
| 04:32:28 | → | merijn joins (~merijn@128-137-045-062.dynamic.caiway.nl) |
| 04:35:38 | × | rekahsoft quits (~rekahsoft@76.69.85.220) (Remote host closed the connection) |
| 04:37:15 | × | merijn quits (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 265 seconds) |
| 04:37:40 | × | Axman6 quits (~Axman6@user/axman6) (Ping timeout: 240 seconds) |
| 04:37:48 | → | rekahsoft joins (~rekahsoft@76.69.85.220) |
| 04:47:51 | → | merijn joins (~merijn@128-137-045-062.dynamic.caiway.nl) |
| 04:51:58 | × | pavonia quits (~user@user/siracusa) (Quit: Bye!) |
| 04:52:18 | × | merijn quits (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 252 seconds) |
| 04:52:22 | → | bitdex joins (~bitdex@gateway/tor-sasl/bitdex) |
| 04:57:18 | → | peterbecich joins (~Thunderbi@syn-047-229-123-186.res.spectrum.com) |
| 04:59:52 | → | lucabtz joins (~lucabtz@user/lucabtz) |
| 05:00:40 | → | tnt1 joins (~Thunderbi@user/tnt1) |
| 05:03:14 | → | merijn joins (~merijn@128-137-045-062.dynamic.caiway.nl) |
| 05:03:48 | × | rekahsoft quits (~rekahsoft@76.69.85.220) (Remote host closed the connection) |
| 05:07:31 | → | rekahsoft joins (~rekahsoft@76.69.85.220) |
| 05:08:11 | × | merijn quits (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 265 seconds) |
| 05:09:58 | × | rekahsoft quits (~rekahsoft@76.69.85.220) (Remote host closed the connection) |
| 05:18:37 | → | merijn joins (~merijn@128-137-045-062.dynamic.caiway.nl) |
| 05:23:20 | × | merijn quits (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 260 seconds) |
| 05:35:15 | × | Square quits (~Square4@user/square) (Ping timeout: 265 seconds) |
| 05:39:51 | → | merijn joins (~merijn@128-137-045-062.dynamic.caiway.nl) |
| 05:49:42 | × | merijn quits (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 276 seconds) |
| 05:54:04 | → | housemate joins (~housemate@246.224.218.139.sta.wbroadband.net.au) |
| 05:55:31 | × | housemate quits (~housemate@246.224.218.139.sta.wbroadband.net.au) (Remote host closed the connection) |
| 05:59:18 | → | gmg joins (~user@user/gehmehgeh) |
| 05:59:53 | → | gorignak joins (~gorignak@user/gorignak) |
| 06:00:27 | → | merijn joins (~merijn@128-137-045-062.dynamic.caiway.nl) |
| 06:04:58 | → | vanishingideal joins (~vanishing@user/vanishingideal) |
| 06:05:13 | × | merijn quits (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 265 seconds) |
| 06:06:33 | → | mari-estel joins (~mari-este@user/mari-estel) |
| 06:07:13 | × | peterbecich quits (~Thunderbi@syn-047-229-123-186.res.spectrum.com) (Ping timeout: 252 seconds) |
| 06:15:49 | → | merijn joins (~merijn@128-137-045-062.dynamic.caiway.nl) |
| 06:17:46 | → | alp joins (~alp@2001:861:8ca0:4940:c0a6:33b6:1011:7f5b) |
| 06:19:36 | → | michalz joins (~michalz@185.246.207.217) |
| 06:20:25 | × | merijn quits (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 252 seconds) |
| 06:21:12 | × | ChaiTRex quits (~ChaiTRex@user/chaitrex) (Ping timeout: 264 seconds) |
| 06:21:40 | → | ChaiTRex joins (~ChaiTRex@user/chaitrex) |
| 06:22:12 | × | ephilalethes quits (~noumenon@202.186.203.84) (Ping timeout: 276 seconds) |
| 06:25:13 | → | mari99981 joins (~mari-este@user/mari-estel) |
| 06:25:13 | × | mari99981 quits (~mari-este@user/mari-estel) (Client Quit) |
| 06:26:56 | → | takuan joins (~takuan@178-116-218-225.access.telenet.be) |
| 06:27:08 | × | mari-estel quits (~mari-este@user/mari-estel) (Ping timeout: 244 seconds) |
| 06:31:10 | → | merijn joins (~merijn@128-137-045-062.dynamic.caiway.nl) |
| 06:37:54 | × | swamp_ quits (~zmt00@user/zmt00) (Read error: Connection reset by peer) |
| 06:38:00 | × | merijn quits (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 260 seconds) |
| 06:38:19 | → | swamp_ joins (~zmt00@user/zmt00) |
| 06:49:12 | → | merijn joins (~merijn@128-137-045-062.dynamic.caiway.nl) |
| 06:53:37 | × | merijn quits (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 248 seconds) |
| 07:00:07 | × | dostoevsky quits (~dostoevsk@user/dostoevsky) (Remote host closed the connection) |
| 07:00:50 | → | dostoevsky joins (~dostoevsk@user/dostoevsky) |
| 07:04:36 | → | merijn joins (~merijn@128-137-045-062.dynamic.caiway.nl) |
| 07:08:59 | × | merijn quits (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 244 seconds) |
| 07:11:16 | × | rvalue quits (~rvalue@user/rvalue) (Ping timeout: 252 seconds) |
| 07:13:10 | → | CiaoSen joins (~Jura@2a05:5800:2d8:3500:ca4b:d6ff:fec1:99da) |
| 07:19:59 | → | merijn joins (~merijn@128-137-045-062.dynamic.caiway.nl) |
| 07:24:37 | × | merijn quits (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 248 seconds) |
| 07:51:45 | <eugenrh> | L29Ah: instead of vim+HLS I plan on using vim+ghci.. I wrote about it here: https://discourse.haskell.org/t/ghci-can-send-data-to-vim-via-terminal-and-vice-versa/9281 |
| 07:52:14 | <eugenrh> | In a few months I think I'll have time to implement/play with that |
| 07:53:34 | <eugenrh> | HLS is a monster.. Last time I've installed it with ghcup, it was 2.9GB large. That's crazy. I don't want to depend on such bloat. |
| 07:56:43 | × | alp quits (~alp@2001:861:8ca0:4940:c0a6:33b6:1011:7f5b) (Ping timeout: 252 seconds) |
| 07:57:05 | <c_wraith> | I've spent too long looking at AoC solutions. I'm having to resist writing stuff like `(,) <*> foo <$> bar' just to avoid a list comprehension |
| 07:57:40 | → | tromp joins (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) |
| 07:58:52 | → | Axman6 joins (~Axman6@user/axman6) |
| 08:00:01 | × | caconym quits (~caconym@user/caconym) (Quit: bye) |
| 08:00:38 | → | caconym joins (~caconym@user/caconym) |
| 08:04:21 | × | michalz quits (~michalz@185.246.207.217) (Ping timeout: 252 seconds) |
| 08:06:46 | → | michalz joins (~michalz@185.246.207.201) |
| 08:07:28 | → | lortabac joins (~lortabac@2a01:e0a:541:b8f0:55ab:e185:7f81:54a4) |
| 08:11:07 | <kqr> | Is there a way to find out if an export from a library is not used in a project? The underlying problem is that I have several definitions in a legacy project that are not used and will not be used, and I'd like to clean them up. My current process is to stumble over a candidate, try deleting it, and if everything still compiles it wasn't used. But I'd love something more systematic! |
| 08:11:41 | → | michalz_ joins (~michalz@185.246.207.221) |
| 08:11:51 | × | michalz quits (~michalz@185.246.207.201) (Ping timeout: 265 seconds) |
| 08:12:20 | × | dsrt^ quits (dsrt@c-98-242-74-66.hsd1.ga.comcast.net) (Ping timeout: 265 seconds) |
| 08:16:40 | → | mzg joins (mzg@abusers.hu) |
| 08:18:23 | → | vpan joins (~vpan@212.117.1.172) |
| 08:19:20 | × | michalz_ quits (~michalz@185.246.207.221) (Quit: ZNC 1.9.0 - https://znc.in) |
| 08:19:50 | → | michalz joins (~michalz@185.246.207.193) |
| 08:23:32 | → | Axma98477 joins (~Axman6@user/axman6) |
| 08:24:27 | <probie> | kqr: In the event you don't find a proper solution, you could probably speed that loop up by exporting nothing at all, and then adding back in only the ones which the compiler says are missing |
| 08:25:41 | × | Axman6 quits (~Axman6@user/axman6) (Ping timeout: 250 seconds) |
| 08:30:08 | → | briandaed joins (~root@user/briandaed) |
| 08:49:07 | → | dsrt^ joins (~dsrt@c-98-242-74-66.hsd1.ga.comcast.net) |
| 08:49:37 | → | lxsameer joins (~lxsameer@Serene/lxsameer) |
| 08:58:07 | → | machinedgod joins (~machinedg@d108-173-18-100.abhsia.telus.net) |
| 08:59:19 | → | acidjnk_new joins (~acidjnk@p200300d6e7283f997119c200ba695214.dip0.t-ipconnect.de) |
| 09:00:16 | × | youthlic quits (~Thunderbi@user/youthlic) (Quit: youthlic) |
| 09:01:52 | × | tzh quits (~tzh@c-76-115-131-146.hsd1.or.comcast.net) (Quit: zzz) |
| 09:02:04 | × | Sgeo quits (~Sgeo@user/sgeo) (Read error: Connection reset by peer) |
| 09:02:09 | → | youthlic joins (~Thunderbi@user/youthlic) |
| 09:04:32 | → | merijn joins (~merijn@77.242.116.146) |
| 09:05:39 | → | mari-estel joins (~mari-este@user/mari-estel) |
| 09:07:31 | <vpan> | hi, I need to run a number of `IO (Maybe a)` actions and it would be nice to return an `Either String a` with message on which stage failed, if any. I saw somewhere in the documentation (can't find the reference right now) that you can just execute a sequence of `IO (Either a b)` actions in a do block and either the last result or the first failure will be returned without the need for nested `case` blocks. |
| 09:07:32 | <vpan> | But I get an error when trying to get the result out of an `Either` using `<-`, see https://paste.tomsmeding.com/8ZZmsTyP . Should I be looking at `ExceptT` or is there a simpler approach? |
| 09:10:29 | <kaol> | maybeToEither doesn't return an IO anything. You need to use a let to define episode, not a bind. |
| 09:13:35 | <vpan> | but then I'm back to checking the case of `Either` "manually" resulting in nested blocks I would like to avoid. `Either` has a `Monad` instance, so bind should be usable, I suppose just not compatible with the current function signature? |
| 09:13:50 | <Leary> | :t runExceptT . traverse ExceptT . zipWith (\i -> fmap (maybe (Left i) Right)) [0..] |
| 09:13:51 | <lambdabot> | (Monad m, Num e, Enum e) => [m (Maybe b)] -> m (Either e [b]) |
| 09:13:58 | <Leary> | Not sure if helpful. |
| 09:14:15 | <kaol> | I think ExceptT is the simpler approach. Make sure the e types in every Either e align and then it's a matter of labeling everything with ExceptT and using runExceptT on the whole. |
| 09:14:38 | <kaol> | If it's some pure IO with no Either, use lift. If it's a different e transform it with withExceptT. |
| 09:16:33 | <kaol> | If you make your functions use ExceptT on their end then you'd save the labeling with ExceptT part from the place where you use them. |
| 09:17:34 | <vpan> | ok, thanks! As a beginner I often find myself missing the obvious simple solutions, so wanted to check if `ExceptT` is not an overkill in this case. :) |
| 09:18:19 | → | mari16773 joins (~mari-este@user/mari-estel) |
| 09:18:19 | <kaol> | I think it's fine. Give it a try, if it fits (and sounds like it would) it's great. |
| 09:19:51 | <kqr> | probie, that is a clever idea! Thanks |
| 09:20:17 | × | mari-estel quits (~mari-este@user/mari-estel) (Ping timeout: 248 seconds) |
| 09:23:56 | <Leary> | vpan: If you're already in `IO`, it's usually better to use `IO`s exception mechanism than to use `Maybe` or `Either` or put `ExceptT` over it. |
| 09:25:58 | → | mari-estel joins (~mari-este@user/mari-estel) |
| 09:28:20 | × | mari16773 quits (~mari-este@user/mari-estel) (Ping timeout: 260 seconds) |
| 09:30:11 | <vpan> | Leary: right, I may be trying too hard to avoid the nasty exceptions. :) Anyway, my intention in this case was simply to flatten the nested `case` blocks checking for `Just`/`Nothing` (which was my first approach) to make it more readable. Not technically necessary, I'm just trying to explore idiomatic and readable ways to do things. |
| 09:31:22 | <kaol> | Some people like to keep their IO code exceptions free. I'd save using them for situations that are, well, exceptional. If it's a section of code where taking the exit rail is an expected outcome I'd prefer the more explicit style of ExceptT. |
| 09:31:58 | <Leary> | kqr: I'll be interested to hear about it if you /do/ find a good solution. A not-so-good one would be to manually merge all the modules into `module Main (main) ...` before rebuilding with `-Wunused-top-binds`. |
| 09:32:52 | → | rvalue joins (~rvalue@user/rvalue) |
| 09:34:01 | × | mari-estel quits (~mari-este@user/mari-estel) (Ping timeout: 252 seconds) |
| 09:34:12 | × | tromp quits (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…) |
| 09:35:11 | → | mari-estel joins (~mari-este@user/mari-estel) |
| 09:43:59 | × | rvalue quits (~rvalue@user/rvalue) (Ping timeout: 244 seconds) |
| 09:45:56 | → | rvalue joins (~rvalue@user/rvalue) |
| 09:47:50 | → | ubert joins (~Thunderbi@2a02:8109:ab8a:5a00:f6f5:1546:1c7e:72ab) |
| 09:48:17 | → | alexherbo2 joins (~alexherbo@2a02-8440-350c-d1b2-f913-af6a-c348-0a7f.rev.sfr.net) |
| 09:50:37 | → | alp joins (~alp@2001:861:8ca0:4940:b388:1d7b:42d:b62) |
| 09:51:24 | × | mari-estel quits (~mari-este@user/mari-estel) (Quit: bluetooth) |
| 09:53:38 | → | mari-estel joins (~mari-este@user/mari-estel) |
| 09:55:03 | → | homo_ joins (~homo@82-128-217-24.bb.dnainternet.fi) |
| 09:55:15 | × | tt12310978324354 quits (~tt1231@2603:6010:8700:4a81:219f:50d3:618a:a6ee) (Quit: Ping timeout (120 seconds)) |
| 09:55:31 | × | homo_ quits (~homo@82-128-217-24.bb.dnainternet.fi) (Changing host) |
| 09:55:31 | → | homo_ joins (~homo@user/homo) |
| 09:55:41 | → | tt12310978324354 joins (~tt1231@2603:6010:8700:4a81:219f:50d3:618a:a6ee) |
| 09:55:55 | × | homo quits (~homo@user/homo) (Quit: Quit) |
| 09:55:56 | homo_ | is now known as homo |
| 09:58:00 | × | ridcully quits (~ridcully@p57b52f42.dip0.t-ipconnect.de) (Ping timeout: 276 seconds) |
| 09:58:10 | × | michalz quits (~michalz@185.246.207.193) (Ping timeout: 272 seconds) |
| 10:01:23 | → | michalz joins (~michalz@185.246.207.221) |
| 10:02:24 | <vpan> | found an article that demonstrates something similar to what I was trying to do - https://mmhaskell.com/blog/2022/3/3/using-either-as-a-monad |
| 10:02:25 | <vpan> | But it does not make sense to me, for example, this piece of code https://paste.tomsmeding.com/bGu9FDh2 : if bind is used for result, it's type should be `User` and yet it is used in a `case`. Not to mention the bind should not work the same way it did not work in my attempt... |
| 10:02:49 | → | ridcully joins (~ridcully@p57b52ec2.dip0.t-ipconnect.de) |
| 10:07:14 | × | michalz quits (~michalz@185.246.207.221) (Ping timeout: 244 seconds) |
| 10:08:12 | <geekosaur> | are you sure you understand it? it looks sensible to me |
| 10:08:26 | <geekosaur> | hm, wait, no |
| 10:08:42 | <geekosaur> | oh, it's in IO. yes, it's valid |
| 10:12:34 | → | housemate joins (~housemate@246.224.218.139.sta.wbroadband.net.au) |
| 10:13:49 | → | tromp joins (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) |
| 10:14:30 | × | homo quits (~homo@user/homo) (Quit: homo) |
| 10:14:45 | → | homo joins (~homo@user/homo) |
| 10:17:13 | × | lortabac quits (~lortabac@2a01:e0a:541:b8f0:55ab:e185:7f81:54a4) (Quit: WeeChat 4.4.2) |
| 10:17:20 | → | michalz joins (~michalz@185.246.207.218) |
| 10:25:52 | × | michalz quits (~michalz@185.246.207.218) (Quit: ZNC 1.9.0 - https://znc.in) |
| 10:26:55 | → | michalz joins (~michalz@185.246.207.217) |
| 10:29:53 | → | Pixi` joins (~Pixi@user/pixi) |
| 10:30:13 | <absence> | If I have a list of values of a sum type, and combine the values element-wise, the result would be a product of combined elements. Similarly, if I wanted to filter such a list of sums, I'd need a product of predicates. There seems to be a relationship/duality between the sum and products, does this have a name I can look up to learn more? |
| 10:31:22 | → | __monty__ joins (~toonn@user/toonn) |
| 10:31:58 | → | Pixi__ joins (~Pixi@user/pixi) |
| 10:32:02 | × | Pixi quits (~Pixi@user/pixi) (Ping timeout: 244 seconds) |
| 10:32:33 | → | Smiles joins (uid551636@id-551636.lymington.irccloud.com) |
| 10:35:24 | × | Pixi` quits (~Pixi@user/pixi) (Ping timeout: 265 seconds) |
| 10:42:40 | → | mreh joins (~matthew@host86-146-25-68.range86-146.btcentralplus.com) |
| 10:43:52 | <mreh> | I'm confused about wether I should be using Managed, ContT or Codensity. |
| 10:44:16 | → | JuanDaugherty joins (~juan@user/JuanDaugherty) |
| 10:44:19 | <mreh> | I think Managed is out because I'd like a transformer |
| 10:44:31 | <opqdonut> | absence: it sounds like your sum type is not really (Either a b) but more like ([a],[b]) |
| 10:44:42 | <opqdonut> | absence: and then you have something like the product of free monoids |
| 10:44:46 | <mreh> | Codensity is Cont but without callCC? |
| 10:44:55 | <mreh> | ContT* |
| 10:45:17 | <opqdonut> | absence: with generators of shapes ([a],[]) and ([],[b]) |
| 10:45:23 | <mari-estel> | huh can this problem be solved without stacks? |
| 10:45:33 | <mari-estel> | %t Managed |
| 10:45:50 | <mari-estel> | %:t Managed |
| 10:46:02 | <mari-estel> | i think i forgot that syntax again... |
| 10:46:13 | <mari-estel> | > :t Managed |
| 10:46:14 | <lambdabot> | <hint>:1:1: error: parse error on input ‘:’ |
| 10:46:22 | <mari-estel> | >:t Managed |
| 10:46:43 | <mari-estel> | whatever |
| 10:46:55 | <mreh> | mari-estel: I'm allocating a bunch of Vulkan, and I could remember to clean up after myself, but where's the fun in that. |
| 10:46:56 | <probie> | :t Managed |
| 10:46:57 | <lambdabot> | error: Data constructor not in scope: Managed |
| 10:47:08 | <mreh> | Vulkan objects |
| 10:47:29 | <mari-estel> | huh vulkan ... what's that again... |
| 10:47:34 | <mari-estel> | @hoogle vulkan |
| 10:47:34 | <lambdabot> | package vulkan |
| 10:47:34 | <lambdabot> | module SDL.Video.Vulkan |
| 10:47:34 | <lambdabot> | package Vulkan |
| 10:47:37 | <mari-estel> | i see |
| 10:47:51 | <probie> | the modern thing that is "better than OpenGL" |
| 10:47:56 | <mreh> | the graphics API |
| 10:48:05 | <mari-estel> | thanks i had already seen |
| 10:48:27 | <mreh> | Vulkan pipelines are "almost entirely immutable" I've been told |
| 10:48:37 | <mreh> | seems like a good fit |
| 10:48:56 | × | rvalue quits (~rvalue@user/rvalue) (Ping timeout: 265 seconds) |
| 10:49:34 | <absence> | opqdonut: No, it's Either a b. If you want to mappend all the as and bs separately, you end up with (a,b), or if you want to filter them separately, you need (a->Bool, b->Bool), right? |
| 10:50:40 | <opqdonut> | absence: Either a b is kind of one way to express the generators of ([a],[b]) |
| 10:51:04 | <opqdonut> | so your basically projecting Either a b -> ([a],[b]) in the natural way, and then doing mappend in ([a],[b]) |
| 10:51:08 | <opqdonut> | *you're |
| 10:51:14 | × | mari-estel quits (~mari-este@user/mari-estel) (Quit: overflow) |
| 10:51:26 | <opqdonut> | or that's at least one perspective on this |
| 10:51:31 | <absence> | Ah, now I see what you mean. |
| 10:52:48 | → | sawilagar joins (~sawilagar@user/sawilagar) |
| 10:53:46 | × | michalz quits (~michalz@185.246.207.217) (Ping timeout: 252 seconds) |
| 10:59:34 | × | CiaoSen quits (~Jura@2a05:5800:2d8:3500:ca4b:d6ff:fec1:99da) (Ping timeout: 265 seconds) |
| 11:01:01 | <absence> | opqdonut: The word generator is used in many different ways, so it's hard to search for. Do you know of a reference? |
| 11:01:20 | <opqdonut> | https://en.wikipedia.org/wiki/Generator_(mathematics) |
| 11:01:44 | <opqdonut> | https://en.wikipedia.org/wiki/Monoid#Generators |
| 11:06:03 | × | dsrt^ quits (~dsrt@c-98-242-74-66.hsd1.ga.comcast.net) (Ping timeout: 246 seconds) |
| 11:06:42 | <opqdonut> | there are a lot of ways in which products and sums are duals, but I can't figure out how that'd apply to this thing |
| 11:08:10 | <absence> | opqdonut: Thanks! At first glance that seems more abstract than what I'm looking for, as I'm more interested in specific relationships like "I have one of several possibilities, but I don't know which, so I must know how to deal with all of them". |
| 11:08:22 | <opqdonut> | oh right: Either a b -> r can be expressed algebraically as r^(a+b) which is the same as r^a*r^b which is (a->r, a->b) in haskell speak |
| 11:09:15 | <jackdk> | opqdonut: I think your final tuple should be `(a->r,b->r)` |
| 11:09:20 | <opqdonut> | yes |
| 11:10:16 | × | housemate quits (~housemate@246.224.218.139.sta.wbroadband.net.au) (Ping timeout: 252 seconds) |
| 11:12:20 | <opqdonut> | there was some work on modelling collections algebraically... IIRC e^a was equivalent to Set a, and we could use this to get the equivalence Set (Either a b) == e^(a+b) == e^a*e^b == (Set a, Set b), which is what absence's original question was about |
| 11:13:12 | <opqdonut> | (it needs to be e^a because the derivative is the type of one-whole contexts, and the type of one-whole contexts of a set is a set, in other words D(e^a) = e^a ...) |
| 11:13:20 | <opqdonut> | (I can't remember the name of the paper though) |
| 11:13:42 | <opqdonut> | *one-hole |
| 11:13:46 | → | dunj3 joins (~dunj3@h1765027.stratoserver.net) |
| 11:15:21 | × | merijn quits (~merijn@77.242.116.146) (Ping timeout: 276 seconds) |
| 11:15:36 | <opqdonut> | here's the famous paper on derivatives of types: http://strictlypositive.org/diff.pdf |
| 11:15:46 | → | rvalue joins (~rvalue@user/rvalue) |
| 11:19:19 | → | LainExperiments joins (~LainExper@user/LainExperiments) |
| 11:23:39 | <hellwolf> | I woke up today, and used yoneda embedding: https://play.haskell.org/saved/n95XGrSf It seems too trivial, on hindsight, since when I made the match function I had not thought of yoneda what so ever. |
| 11:24:32 | <hellwolf> | fixed a typo after reading myself: https://play.haskell.org/saved/TygOIulM |
| 11:25:11 | × | xff0x quits (~xff0x@182.169.73.28) (Ping timeout: 265 seconds) |
| 11:25:15 | <Leary> | absence: Perhaps "coproduct". Sums and products are categorically dual; products in the dual category of C are given by coproducts (sums) in C. |
| 11:30:10 | → | dsrt^ joins (dsrt@c-98-242-74-66.hsd1.ga.comcast.net) |
| 11:35:01 | × | tnt1 quits (~Thunderbi@user/tnt1) (Ping timeout: 252 seconds) |
| 11:35:16 | → | tnt1 joins (~Thunderbi@user/tnt1) |
| 11:39:32 | → | merijn joins (~merijn@77.242.116.146) |
| 11:39:46 | <absence> | Leary: Thanks, I'm aware of that, at least informally. Maybe what I'm missing is "simply" intuition. |
| 11:40:41 | → | mari-estel joins (~mari-este@user/mari-estel) |
| 11:41:21 | × | gvg quits (~dcd@user/gvg) (Ping timeout: 276 seconds) |
| 11:45:56 | → | michalz joins (~michalz@185.246.207.221) |
| 11:49:04 | × | mari-estel quits (~mari-este@user/mari-estel) (Quit: overflow) |
| 11:50:19 | → | mari-estel joins (~mari-este@user/mari-estel) |
| 11:50:51 | <hellwolf> | https://play.haskell.org/saved/QPe3WuiN added another functional dependency and a example application of it in an additional comment. |
| 11:51:37 | × | michalz quits (~michalz@185.246.207.221) (Quit: ZNC 1.9.0 - https://znc.in) |
| 11:52:24 | × | mari-estel quits (~mari-este@user/mari-estel) (Client Quit) |
| 11:53:09 | × | dsrt^ quits (dsrt@c-98-242-74-66.hsd1.ga.comcast.net) (Ping timeout: 244 seconds) |
| 11:54:08 | → | michalz joins (~michalz@185.246.207.197) |
| 11:54:24 | ← | darkling parts (~darkling@2001-ba8-1f1-f0e6-0-0-0-2.autov6rev.bitfolk.space) (Summoning his cosmis powers, and glowing slightly from his toes...) |
| 11:54:33 | → | darkling joins (~darkling@2001-ba8-1f1-f0e6-0-0-0-2.autov6rev.bitfolk.space) |
| 11:56:15 | <vpan> | geekosaur: well, I started by trying the `Maybe` example - I've put the code fragments into a file and tried loading into ghci, see https://paste.tomsmeding.com/1Ls1IoYD . I disabled the email function as I didn't find where to import `member` from. |
| 11:56:17 | <vpan> | The `Either` sample seems to have a similar problem. |
| 11:57:17 | <geekosaur> | shouldn't that be `elem`? (with the backticks, since it's being used infix) |
| 11:58:18 | → | lortabac joins (~lortabac@2a01:e0a:541:b8f0:55ab:e185:7f81:54a4) |
| 11:58:25 | <geekosaur> | yes, you have the usual confusion about IO there |
| 11:58:48 | <geekosaur> | and, well, tcreateUser is in IO, you can't all of a sudden sewitch it into Maybe |
| 11:59:01 | <geekosaur> | use let instead of <- |
| 12:00:04 | × | caconym quits (~caconym@user/caconym) (Quit: bye) |
| 12:00:48 | <vpan> | geekosaur: I understand, but the code is straight from the mmhaskell article and seems to be broken, which I found a little surprising |
| 12:01:23 | → | caconym joins (~caconym@user/caconym) |
| 12:01:28 | × | mud quits (~mud@user/kadoban) (Remote host closed the connection) |
| 12:01:53 | → | mud joins (~mud@user/kadoban) |
| 12:01:56 | <geekosaur> | hm, yes, that does look broken, now that I look again |
| 12:02:13 | <geekosaur> | I think the lesson here is "don't trust random pages on the Internet" |
| 12:04:19 | <vpan> | right, and here I thought if you were trying to teach beginners at least compiling the code would be good practice. :) I had read other mmhaskell articles before and they seemed fine, so was just checking whether it is me missing something or just another case of someone being wrong on the internet. :) |
| 12:05:44 | <geekosaur> | thing is, they're not even using it as a monad, since theyre still doing a case on it |
| 12:05:50 | × | michalz quits (~michalz@185.246.207.197) (Ping timeout: 260 seconds) |
| 12:05:52 | <geekosaur> | the only monad there is IO |
| 12:06:53 | <geekosaur> | the (Either a) monad would "fail" (see Control.Monad.Fail) on a Left, and give you the result on Right |
| 12:21:13 | → | dsrt^ joins (~dsrt@c-98-242-74-66.hsd1.ga.comcast.net) |
| 12:21:15 | → | michalz joins (~michalz@185.246.207.193) |
| 12:24:55 | → | CiaoSen joins (~Jura@2a05:5800:2d8:3500:ca4b:d6ff:fec1:99da) |
| 12:28:54 | × | michalz quits (~michalz@185.246.207.193) (Ping timeout: 272 seconds) |
| 12:34:22 | → | jero98772 joins (~jero98772@2a00:1fa0:4122:828f:7f98:47ba:81b9:d7a4) |
| 12:35:23 | × | tromp quits (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Read error: Connection reset by peer) |
| 12:36:46 | × | jero98772 quits (~jero98772@2a00:1fa0:4122:828f:7f98:47ba:81b9:d7a4) (Client Quit) |
| 12:44:07 | × | dsrt^ quits (~dsrt@c-98-242-74-66.hsd1.ga.comcast.net) (Ping timeout: 272 seconds) |
| 12:44:56 | × | vanishingideal quits (~vanishing@user/vanishingideal) (Quit: leaving) |
| 12:45:25 | → | vanishingideal joins (~vanishing@user/vanishingideal) |
| 12:46:31 | × | ethantwardy quits (user@user/ethantwardy) (Quit: WeeChat 4.4.2) |
| 12:47:12 | ← | lucabtz parts (~lucabtz@user/lucabtz) (Leaving) |
| 12:58:09 | × | lortabac quits (~lortabac@2a01:e0a:541:b8f0:55ab:e185:7f81:54a4) (Quit: WeeChat 4.4.2) |
| 13:01:06 | → | r-sta joins (~r-sta@sgyl-37-b2-v4wan-168528-cust2421.vm6.cable.virginm.net) |
| 13:01:23 | × | gawen quits (~gawen@user/gawen) (Quit: cya) |
| 13:01:37 | × | merijn quits (~merijn@77.242.116.146) (Ping timeout: 248 seconds) |
| 13:02:19 | → | homo_ joins (~homo@82-128-217-24.bb.dnainternet.fi) |
| 13:02:23 | × | homo_ quits (~homo@82-128-217-24.bb.dnainternet.fi) (Changing host) |
| 13:02:23 | → | homo_ joins (~homo@user/homo) |
| 13:02:46 | → | gawen joins (~gawen@user/gawen) |
| 13:02:46 | × | homo quits (~homo@user/homo) (Read error: Connection reset by peer) |
| 13:02:52 | <r-sta> | iv got this weird niggling kind of question to do with i think what people call idiomatic approaches |
| 13:03:05 | <r-sta> | in terms of what consitutes a valid / useful abstraction |
| 13:03:15 | homo_ | is now known as homo |
| 13:03:31 | <r-sta> | i end up having to like jump through hoops i set myself to justify an approach is somehow cannonical or something |
| 13:04:22 | <r-sta> | the more i work with things i would have be "libraries" if i put them on hackage, the more i end up just kind of using them as a style that other things can emulate |
| 13:04:50 | <r-sta> | idk if you could use map as an annalogy, in terms of its recursive implementation, and how other functions might follow similar but slightly different implementations |
| 13:08:17 | → | tnt2 joins (~Thunderbi@user/tnt1) |
| 13:08:39 | → | merijn joins (~merijn@77.242.116.146) |
| 13:09:05 | → | xff0x joins (~xff0x@2405:6580:b080:900:deb8:42d3:dcec:a1de) |
| 13:10:08 | × | tnt1 quits (~Thunderbi@user/tnt1) (Ping timeout: 244 seconds) |
| 13:10:08 | tnt2 | is now known as tnt1 |
| 13:14:50 | <r-sta> | like, how do describe the natural numbers, its a functor? |
| 13:15:11 | <r-sta> | (Num a,Functor f) => f a |
| 13:15:38 | <r-sta> | and then, whatever central "object" like functor or whatever, like, serves as this useful abstraction |
| 13:16:25 | <r-sta> | i was arguing the correct abstraction is actualy a "sheduled" functor |
| 13:16:34 | <r-sta> | but i ended up just modeling this as a sequential store |
| 13:16:48 | <r-sta> | im confused now about the abstraction and how it fits in in terms of librification |
| 13:17:37 | <r-sta> | its like this weird argument like "no, you dont just map them, they appear in order, its not a functor it needs an order its probably traversable or something" |
| 13:18:32 | → | michalz joins (~michalz@185.246.207.215) |
| 13:18:46 | <r-sta> | and then like, well you could have a sheduled functor, but what your actually doing is a sequential operation series of persistent stores, which loosely models the natural numbers, just by virtue of appearing in a sequence, like how you have a counting on the natural numbers which is what you were modelling with the traversable abstraction! |
| 13:19:27 | <r-sta> | ("persistent" because like, 1 stays the same... the "first" ... dog, or whatever...) |
| 13:19:48 | <r-sta> | and then i guess you have a group generator? |
| 13:20:08 | <r-sta> | so this kind of cascading store opperation which populates this "container"... |
| 13:21:32 | <r-sta> | and what i was trying to argue is that when your doing ML, the sequence of improvements on an object, such as a self learning opperator or the target of learning, fits into this sequential morphism setup, so the "abstraction" of the "shedule" which amounts to something almost like an unfold... |
| 13:22:03 | <r-sta> | "the machine is like a bunch of machines of increasing complexity as you train them sequentially" |
| 13:22:06 | <r-sta> | or something |
| 13:22:19 | <r-sta> | is a statement that uses this abstraction to basically define the thing! |
| 13:22:42 | × | merijn quits (~merijn@77.242.116.146) (Ping timeout: 252 seconds) |
| 13:23:29 | <r-sta> | (theres something mad in differential geometry to do with the geometry of the learning process) |
| 13:23:39 | <r-sta> | (its a path...) |
| 13:24:12 | <r-sta> | "automorphic curves in the category of automorphic opperators" or smt |
| 13:24:19 | → | merijn joins (~merijn@77.242.116.146) |
| 13:24:28 | <r-sta> | and you get like "very fast learning paths" |
| 13:24:50 | <r-sta> | like, im sure it makes sense to have the path be the central abstraction... |
| 13:26:41 | <r-sta> | "its the next one" |
| 13:27:37 | × | r-sta quits (~r-sta@sgyl-37-b2-v4wan-168528-cust2421.vm6.cable.virginm.net) (Quit: Client closed) |
| 13:32:51 | → | gvg joins (~dcd@user/gvg) |
| 13:35:51 | × | merijn quits (~merijn@77.242.116.146) (Ping timeout: 246 seconds) |
| 13:37:24 | → | merijn joins (~merijn@77.242.116.146) |
| 13:37:59 | → | ljdarj joins (~Thunderbi@user/ljdarj) |
| 13:42:07 | × | merijn quits (~merijn@77.242.116.146) (Ping timeout: 252 seconds) |
| 13:46:33 | → | SlackCoder joins (~SlackCode@64-94-63-8.ip.weststar.net.ky) |
| 13:49:20 | → | weary-traveler joins (~user@user/user363627) |
| 13:53:38 | → | merijn joins (~merijn@77.242.116.146) |
| 13:53:40 | → | rekahsoft joins (~rekahsoft@76.69.85.220) |
| 13:54:35 | × | malte quits (~malte@mal.tc) (Remote host closed the connection) |
| 13:54:53 | → | malte joins (~malte@mal.tc) |
| 13:56:42 | → | cheater joins (~Username@user/cheater) |
| 13:58:11 | × | merijn quits (~merijn@77.242.116.146) (Ping timeout: 244 seconds) |
| 14:00:13 | → | ubert1 joins (~Thunderbi@2a02:8109:ab8a:5a00:636:48a0:bc95:5cdf) |
| 14:02:02 | × | weary-traveler quits (~user@user/user363627) (Remote host closed the connection) |
| 14:04:05 | × | ubert quits (~Thunderbi@2a02:8109:ab8a:5a00:f6f5:1546:1c7e:72ab) (Ping timeout: 244 seconds) |
| 14:04:05 | ubert1 | is now known as ubert |
| 14:08:09 | → | simplystuart joins (~simplystu@c-75-75-152-164.hsd1.pa.comcast.net) |
| 14:08:26 | → | MAX_DAVIDSON_REA joins (~MAX_DAVID@64.251.61.168) |
| 14:09:13 | × | LainExperiments quits (~LainExper@user/LainExperiments) (Quit: Client closed) |
| 14:09:37 | → | merijn joins (~merijn@77.242.116.146) |
| 14:11:30 | × | SlackCoder quits (~SlackCode@64-94-63-8.ip.weststar.net.ky) (Ping timeout: 276 seconds) |
| 14:14:13 | × | merijn quits (~merijn@77.242.116.146) (Ping timeout: 248 seconds) |
| 14:17:23 | × | MAX_DAVIDSON_REA quits (~MAX_DAVID@64.251.61.168) (Quit: Client closed) |
| 14:18:08 | × | homo quits (~homo@user/homo) (Quit: Quit) |
| 14:18:18 | → | thirteenyearoldb joins (~thirteeny@64.251.61.168) |
| 14:18:23 | → | homo joins (~homo@user/homo) |
| 14:20:07 | × | thirteenyearoldb quits (~thirteeny@64.251.61.168) (Client Quit) |
| 14:21:05 | → | thirteenyearoldb joins (~thirteeny@64.251.61.168) |
| 14:22:49 | → | merijn joins (~merijn@77.242.116.146) |
| 14:31:46 | ← | thirteenyearoldb parts (~thirteeny@64.251.61.168) () |
| 14:32:38 | × | dolio quits (~dolio@130.44.140.168) (Quit: ZNC 1.9.1 - https://znc.in) |
| 14:34:20 | → | ubert1 joins (~Thunderbi@2a02:8109:ab8a:5a00:241b:e6b5:8a3b:fcd8) |
| 14:35:45 | → | pavonia joins (~user@user/siracusa) |
| 14:36:09 | → | dolio joins (~dolio@130.44.140.168) |
| 14:36:48 | × | bitdex quits (~bitdex@gateway/tor-sasl/bitdex) (Ping timeout: 264 seconds) |
| 14:38:19 | × | ubert quits (~Thunderbi@2a02:8109:ab8a:5a00:636:48a0:bc95:5cdf) (Ping timeout: 245 seconds) |
| 14:38:19 | ubert1 | is now known as ubert |
| 14:38:19 | × | dolio quits (~dolio@130.44.140.168) (Client Quit) |
| 14:41:21 | → | dolio joins (~dolio@130.44.140.168) |
| 14:44:30 | → | iamsleepy joins (~weechat@2a01:4f9:3070:feff:54d:81b5:739b:c728) |
| 14:44:46 | → | Sgeo joins (~Sgeo@user/sgeo) |
| 14:52:59 | × | turlando quits (~turlando@user/turlando) (Quit: No Ping reply in 180 seconds.) |
| 14:54:15 | → | turlando joins (~turlando@user/turlando) |
| 14:58:49 | × | dolio quits (~dolio@130.44.140.168) (Ping timeout: 265 seconds) |
| 15:00:05 | × | CiaoSen quits (~Jura@2a05:5800:2d8:3500:ca4b:d6ff:fec1:99da) (Ping timeout: 248 seconds) |
| 15:03:22 | → | dolio joins (~dolio@130.44.140.168) |
| 15:04:00 | × | merijn quits (~merijn@77.242.116.146) (Ping timeout: 252 seconds) |
| 15:05:36 | → | weary-traveler joins (~user@user/user363627) |
| 15:10:26 | → | merijn joins (~merijn@77.242.116.146) |
| 15:11:51 | → | xff0x_ joins (~xff0x@2405:6580:b080:900:47af:5bec:f5b4:7548) |
| 15:14:31 | × | xff0x quits (~xff0x@2405:6580:b080:900:deb8:42d3:dcec:a1de) (Ping timeout: 252 seconds) |
| 15:21:15 | → | lortabac joins (~lortabac@2a01:e0a:541:b8f0:55ab:e185:7f81:54a4) |
| 15:22:03 | → | LainExperiments joins (~LainExper@user/LainExperiments) |
| 15:22:47 | × | LainExperiments quits (~LainExper@user/LainExperiments) (Client Quit) |
| 15:26:38 | × | lortabac quits (~lortabac@2a01:e0a:541:b8f0:55ab:e185:7f81:54a4) (Quit: WeeChat 4.4.2) |
| 15:27:09 | <hellwolf> | I have written a closure function using Data.Set https://play.haskell.org/saved/R6VP6J8M I am sure it is not the most efficient one, and might even be wrong.. anyone has time to have a look and critique? |
| 15:30:02 | × | vpan quits (~vpan@212.117.1.172) (Quit: Leaving.) |
| 15:30:11 | <hellwolf> | And I haven't yet found an interesting example to test, outside of the context of where I cdtually use this. |
| 15:30:54 | <hellwolf> | (I was thinking of a number that generate a list until the Set stops growing, but I don't play with maths enough to come up with such an example on top of my head.) |
| 15:40:18 | × | vanishingideal quits (~vanishing@user/vanishingideal) (Ping timeout: 252 seconds) |
| 15:41:57 | → | vanishingideal joins (~vanishing@user/vanishingideal) |
| 15:46:45 | <Leary> | hellwolf: https://play.haskell.org/saved/EsoKddpA |
| 15:47:30 | <hellwolf> | sorry, it should be (a -> [a]) |
| 15:47:45 | <hellwolf> | I should have written a signature, but I took it out from a where clause |
| 15:47:56 | <Leary> | You can swap `S.map` with `foldMap` then. |
| 15:48:48 | <hellwolf> | closure :: Ord a => (a -> [a]) -> [a] -> Set.Set a -> Set.Set a |
| 15:49:32 | <Leary> | What is the point of the extra list argument? Why not just `Ord a => (a -> Set a) -> Set a -> Set a`? |
| 15:50:45 | × | vanishingideal quits (~vanishing@user/vanishingideal) (Ping timeout: 252 seconds) |
| 15:52:46 | → | vanishingideal joins (~vanishing@user/vanishingideal) |
| 15:54:43 | <hellwolf> | good question, skill issue. |
| 15:55:01 | <hellwolf> | let me do a dropin replacement, and see if everything still works. |
| 15:56:42 | <int-e> | Leary: presumably one of those was an accumulator |
| 15:57:11 | <hellwolf> | Ah, my extra "xs" parameters help not to recaculate more than needed. |
| 15:57:35 | <hellwolf> | but your way seems doing it too. |
| 16:00:14 | <int-e> | Leary: https://paste.tomsmeding.com/PqXVAv3y is something I came up with some years ago |
| 16:01:10 | <int-e> | Leary: so very similar, except that new elements are not just generated based off a single element but also based off inferences made previously |
| 16:01:43 | × | gorignak quits (~gorignak@user/gorignak) (Ping timeout: 272 seconds) |
| 16:02:06 | <int-e> | Leary: I have a corresponding incremental version too (the result list can be consumed lazily): https://paste.tomsmeding.com/6srbBNEH |
| 16:02:46 | <int-e> | hmm |
| 16:03:10 | <int-e> | hellwolf might care more |
| 16:06:37 | <hellwolf> | https://play.haskell.org/saved/tUrCHhqy |
| 16:06:37 | <hellwolf> | int-e I am gonna put your version in a moment |
| 16:06:46 | <int-e> | the underlying mental model was Horn inference... p1,p2,p3 -> q derives q if the single x is one of p1,p2,p3, {p1,p2,p3} is a subset of the known inferences |
| 16:08:04 | <hellwolf> | ah, sorry, I can't understand your version fast enough... I need to leave it there for a while. The latest link of mine has both my naive version and Leary's |
| 16:09:06 | <int-e> | no worries. it's not for efficiency anyway, it's mostly a bit more general |
| 16:09:31 | <int-e> | in a way that I thought might be interesting |
| 16:16:17 | × | ubert quits (~Thunderbi@2a02:8109:ab8a:5a00:241b:e6b5:8a3b:fcd8) (Remote host closed the connection) |
| 16:16:34 | → | ubert joins (~Thunderbi@2a02:8109:ab8a:5a00:fbee:83c2:2fbc:cebb) |
| 16:17:37 | <hellwolf> | https://play.haskell.org/saved/tlycglQO small fixes. |
| 16:18:26 | <hellwolf> | Also, I probably have butchered Leary's version, and replaced a piece of it with "S.fromList (concatMap f new)" |
| 16:18:48 | <hellwolf> | Anyways, not here for the performance, per se... Just sourcing some ideas to learn. |
| 16:19:24 | <int-e> | you can do the same thing with HashSet and it might be faster |
| 16:20:08 | <hellwolf> | Right, actually I don't need the Ord. |
| 16:20:34 | <hellwolf> | but it's not from containers package... I will skip for now. I will optimize it another time. |
| 16:21:41 | <int-e> | the corresponding call for that `saturate` would be `saturate [512] (\x _ > g x)` |
| 16:21:55 | <int-e> | ...grammar borked, oh well |
| 16:22:21 | <int-e> | and I also broke the arrow in (\x _ -> g x) |
| 16:22:34 | <int-e> | @pl \x _ > g x -- const . g I assume |
| 16:22:34 | <lambdabot> | (line 1, column 6): |
| 16:22:34 | <lambdabot> | unexpected ">" |
| 16:22:34 | <lambdabot> | expecting pattern or "->" |
| 16:22:42 | <int-e> | @pl \x _ -> g x |
| 16:22:56 | <lambdabot> | const . g |
| 16:23:24 | × | ubert quits (~Thunderbi@2a02:8109:ab8a:5a00:fbee:83c2:2fbc:cebb) (Ping timeout: 265 seconds) |
| 16:24:26 | <int-e> | (you can easily modify `saturate` to not pass the second argument to `sat1` and then the only remaining difference is passing a set or a list for the seed inferences) |
| 16:24:31 | <hellwolf> | https://play.haskell.org/saved/08Mac53g |
| 16:24:34 | <hellwolf> | wit yours |
| 16:28:33 | → | Square2 joins (~Square@user/square) |
| 16:30:09 | <hellwolf> | and I didn't know that foldl' was not available a few bases ago |
| 16:30:20 | <hellwolf> | *not available from Prelude |
| 16:30:27 | → | agent314 joins (~quassel@104.223.118.58) |
| 16:30:31 | <int-e> | it was always available from Data.List |
| 16:33:36 | × | agent314 quits (~quassel@104.223.118.58) (Client Quit) |
| 16:33:39 | → | ash3en joins (~Thunderbi@2a03:7846:b6eb:101:93ac:a90a:da67:f207) |
| 16:36:23 | × | alexherbo2 quits (~alexherbo@2a02-8440-350c-d1b2-f913-af6a-c348-0a7f.rev.sfr.net) (Remote host closed the connection) |
| 16:36:32 | → | agent314 joins (~quassel@104.223.118.58) |
| 16:36:41 | → | alexherbo2 joins (~alexherbo@2a02-8440-350c-d1b2-f913-af6a-c348-0a7f.rev.sfr.net) |
| 16:37:05 | → | ash3en1 joins (~Thunderbi@146.70.124.222) |
| 16:38:23 | × | ash3en quits (~Thunderbi@2a03:7846:b6eb:101:93ac:a90a:da67:f207) (Ping timeout: 265 seconds) |
| 16:38:23 | ash3en1 | is now known as ash3en |
| 16:40:04 | → | codaraxis joins (~codaraxis@user/codaraxis) |
| 16:40:31 | <ski> | hellwolf : fwiw, what you're computing is (also) called "fixed-point iteration" (in math, logic & computing, generally), and the specific optimization of only reacting to new elements each round ("my extra \"xs\" parameters help not to recaculate more than needed") is called "semi-naïve evaluation" (in the context of deductive databases) |
| 16:45:30 | <ski> | (although, the setting of the latter is a little bit more general, in that there you're generating a set of new elements, not merely from individual already generated elements, but also from subsets of already generated elements. so, if you have `a' *and* `b' generated, that may e.g. allow you to now generate `c'. so `a' might be an old element, and `b' might be newly generated in last round, so you need to |
| 16:45:36 | <ski> | consider subsets where at least one element is new (iow combining new with new&old), for the (semi-naïve) optimization) |
| 16:45:37 | × | machinedgod quits (~machinedg@d108-173-18-100.abhsia.telus.net) (Ping timeout: 248 seconds) |
| 16:46:26 | × | alexherbo2 quits (~alexherbo@2a02-8440-350c-d1b2-f913-af6a-c348-0a7f.rev.sfr.net) (Remote host closed the connection) |
| 16:47:13 | × | pointlessslippe1 quits (~pointless@62.106.85.17) (Quit: ZNC - http://znc.in) |
| 16:47:15 | → | alexherbo2 joins (~alexherbo@2a02-8440-350c-d1b2-4cce-5b9b-3d2d-31a1.rev.sfr.net) |
| 16:50:21 | <hellwolf> | right, I am aware of it's a fixed point. I am not proficient enough to write one for this case :) |
| 16:51:05 | × | alexherbo2 quits (~alexherbo@2a02-8440-350c-d1b2-4cce-5b9b-3d2d-31a1.rev.sfr.net) (Remote host closed the connection) |
| 16:55:52 | <ski> | well, i think int-e's generalization does allow doing this (at the cost of some extra fiddling to e.g. represent the `a,b -> c' case both when `a' is the new element, and when `b' is .. something along the lines is `\x xs -> if x == a && b `S.member` xs || x == b && a `S.member` xs then c : ... else ...') |
| 16:59:14 | → | pointlessslippe1 joins (~pointless@62.106.85.17) |
| 17:00:18 | → | bitdex joins (~bitdex@gateway/tor-sasl/bitdex) |
| 17:00:36 | × | agent314 quits (~quassel@104.223.118.58) (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.) |
| 17:00:52 | × | ft quits (~ft@p508db9c7.dip0.t-ipconnect.de) (Ping timeout: 252 seconds) |
| 17:03:21 | → | comerijn joins (~merijn@77.242.116.146) |
| 17:04:35 | → | segfaultfizzbuzz joins (~segfaultf@23-93-87-166.dedicated.static.sonic.net) |
| 17:05:57 | × | merijn quits (~merijn@77.242.116.146) (Ping timeout: 244 seconds) |
| 17:05:57 | × | hellwolf quits (~user@384c-9f11-ae01-0420-0f00-4d40-07d0-2001.sta.estpak.ee) (Read error: Connection reset by peer) |
| 17:06:12 | → | hellwolf joins (~user@64da-33e4-b3ed-391e-0f00-4d40-07d0-2001.sta.estpak.ee) |
| 17:08:19 | × | comerijn quits (~merijn@77.242.116.146) (Ping timeout: 252 seconds) |
| 17:09:28 | × | weary-traveler quits (~user@user/user363627) (Remote host closed the connection) |
| 17:14:27 | <int-e> | ski: thanks for the "deductive database" keyword |
| 17:18:21 | × | briandaed quits (~root@user/briandaed) (Quit: Lost terminal) |
| 17:20:49 | <int-e> | ski: there's a whole parallel world in SAT solving (unit propagation, and watched literals to speed up scanning the clauses for new candidates) |
| 17:21:49 | <int-e> | (which would lead to very different interface) |
| 17:23:58 | → | ft joins (~ft@p508db9c7.dip0.t-ipconnect.de) |
| 17:26:15 | tomsmeding | is adding the brand-new ghc 9.12.1 to the playground |
| 17:26:24 | tomsmeding | sees that vector doesn't build with that ghc |
| 17:26:36 | tomsmeding | sees the set of compatible packages dwindle before his eyes |
| 17:29:37 | × | ljdarj quits (~Thunderbi@user/ljdarj) (Ping timeout: 265 seconds) |
| 17:31:50 | × | sawilagar quits (~sawilagar@user/sawilagar) (Quit: Leaving) |
| 17:35:43 | <tomsmeding> | well, s/doesn't build/doesn't configure/ |
| 17:36:48 | × | Pixi__ quits (~Pixi@user/pixi) (Quit: Leaving) |
| 17:38:23 | <tomsmeding> | it does? |
| 17:38:36 | → | ash3en1 joins (~Thunderbi@2a03:7846:b6eb:101:93ac:a90a:da67:f207) |
| 17:38:53 | <tomsmeding> | oh I failed reading the cabal configure output |
| 17:39:10 | <tomsmeding> | this is not too bad |
| 17:39:50 | × | ash3en quits (~Thunderbi@146.70.124.222) (Ping timeout: 244 seconds) |
| 17:39:50 | ash3en1 | is now known as ash3en |
| 17:40:01 | <hellwolf> | danke tomsmeding, a orpattern example would be rad |
| 17:42:15 | <tomsmeding> | well the example you can just copy-paste from the docs :) https://downloads.haskell.org/ghc/9.12.1/docs/users_guide/exts/or_patterns.html#extension-OrPatterns |
| 17:42:26 | <tomsmeding> | currently building 127 packages :) |
| 17:47:27 | × | dolio quits (~dolio@130.44.140.168) (Quit: ZNC 1.9.1 - https://znc.in) |
| 17:52:50 | <tomsmeding> | hellwolf: 9.12.1 is up, have a go :) |
| 17:54:42 | <tomsmeding> | I use too many :) |
| 17:54:52 | <homo> | is that... prolog? |
| 17:55:12 | <tomsmeding> | no it's just collapsing multiple patterns that bind no variables into one case |
| 17:55:17 | <tomsmeding> | it's semantically uninteresting |
| 17:56:12 | × | mulk quits (~mulk@pd951419b.dip0.t-ipconnect.de) (Read error: Connection reset by peer) |
| 17:56:15 | <homo> | the joke is that ";" means "or" in prolog |
| 17:56:50 | <tomsmeding> | iirc ';' was chosen mostly because it's already reserved syntax that can never be an operator |
| 17:56:58 | <tomsmeding> | and it meant nothing in that context |
| 17:57:16 | <tomsmeding> | it coinciding with prolog's "or" is just being lucky, I guess |
| 17:57:41 | <tomsmeding> | '|' would be very confusing with guards, even if its technically unambiguous |
| 17:57:49 | <tomsmeding> | *it's |
| 17:59:33 | → | housemate joins (~housemate@149.167.24.31) |
| 18:03:42 | → | tzh joins (~tzh@c-76-115-131-146.hsd1.or.comcast.net) |
| 18:04:42 | × | ash3en quits (~Thunderbi@2a03:7846:b6eb:101:93ac:a90a:da67:f207) (Quit: ash3en) |
| 18:12:18 | <hellwolf> | GREAT! |
| 18:12:21 | <hellwolf> | I hope you like my example: https://play.haskell.org/saved/5lhAatk1 |
| 18:12:55 | × | fun-safe-math quits (~fun-safe-@24.21.106.247) () |
| 18:13:11 | <tomsmeding> | lol |
| 18:14:36 | → | fun-safe-math joins (~fun-safe-@24.21.106.247) |
| 18:14:42 | → | mulk joins (~mulk@pd951419b.dip0.t-ipconnect.de) |
| 18:18:55 | × | Lord_of_Life quits (~Lord@user/lord-of-life/x-2819915) (Ping timeout: 265 seconds) |
| 18:18:56 | → | Lord_of_Life_ joins (~Lord@user/lord-of-life/x-2819915) |
| 18:19:38 | × | fun-safe-math quits (~fun-safe-@24.21.106.247) () |
| 18:20:44 | → | ash3en joins (~Thunderbi@2a03:7846:b6eb:101:93ac:a90a:da67:f207) |
| 18:21:20 | → | fun-safe-math joins (~fun-safe-@24.21.106.247) |
| 18:21:55 | Lord_of_Life_ | is now known as Lord_of_Life |
| 18:23:33 | → | sprotte24 joins (~sprotte24@p200300d16f19ee00b46a5b4fb1cae10a.dip0.t-ipconnect.de) |
| 18:25:39 | × | vanishingideal quits (~vanishing@user/vanishingideal) (Ping timeout: 276 seconds) |
| 18:31:25 | × | Square2 quits (~Square@user/square) (Remote host closed the connection) |
| 18:31:26 | × | OftenFaded quits (~OftenFade@user/tisktisk) (Quit: Client closed) |
| 18:32:31 | → | Square joins (~Square@user/square) |
| 18:33:27 | → | billchenchina joins (~billchenc@2a0d:2580:ff0c:1:4a35:c1dc:b9b7:67d8) |
| 18:33:39 | × | billchenchina quits (~billchenc@2a0d:2580:ff0c:1:4a35:c1dc:b9b7:67d8) (Remote host closed the connection) |
| 18:36:21 | → | wootehfoot joins (~wootehfoo@user/wootehfoot) |
| 18:38:47 | → | peterbecich joins (~Thunderbi@syn-047-229-123-186.res.spectrum.com) |
| 18:44:56 | × | peterbecich quits (~Thunderbi@syn-047-229-123-186.res.spectrum.com) (Ping timeout: 244 seconds) |
| 18:52:31 | × | JuanDaugherty quits (~juan@user/JuanDaugherty) (Quit: JuanDaugherty) |
| 18:54:46 | × | wootehfoot quits (~wootehfoo@user/wootehfoot) (Read error: Connection reset by peer) |
| 18:59:09 | → | Tuplanolla joins (~Tuplanoll@91-159-69-59.elisa-laajakaista.fi) |
| 19:00:09 | → | briandaed joins (~root@user/briandaed) |
| 19:02:12 | → | fmira joins (~user@user/fmira) |
| 19:03:24 | × | fmira quits (~user@user/fmira) (Remote host closed the connection) |
| 19:03:52 | → | fmira joins (~user@user/fmira) |
| 19:04:25 | <__monty__> | I'm looking for kind of the dual to fmap/ap on Maybe, if either argument is Just pick that one. Something like `min <$$> Nothing <**> Just 5 = Just 5`, is that a thing? |
| 19:05:01 | <c_wraith> | what if both are Just? |
| 19:05:59 | <tomsmeding> | > (<|>) <$> [Nothing, Just 2] <*> [Nothing, Just 3] -- __monty__ |
| 19:06:01 | <lambdabot> | [Nothing,Just 3,Just 2,Just 2] |
| 19:07:52 | <__monty__> | If both are Just I want to apply the function, `min` in the example. |
| 19:07:59 | <tomsmeding> | ah |
| 19:08:33 | <tomsmeding> | you can build them from combinators, in generic or less generic ways, but I don't think this particular pattern exists in any of the boot libraries at least |
| 19:08:48 | <__monty__> | I've run into this more then once over the past weeks and it feels like it would be a general math thing. |
| 19:11:11 | <tomsmeding> | the way in which I've seen it before, I think, is in wanting a "safe foldl1" |
| 19:11:53 | <tomsmeding> | i.e. coolSum [1,2,3] = 1 + 2 + 3, and coolSum [1] = 1, but coolSum [] = 0, and in particular coolSum [1] is not 0 + 1 |
| 19:12:20 | <tomsmeding> | or perhaps an "optimised foldl'" |
| 19:14:56 | → | homo_ joins (~homo@82-128-217-24.bb.dnainternet.fi) |
| 19:15:05 | × | homo_ quits (~homo@82-128-217-24.bb.dnainternet.fi) (Changing host) |
| 19:15:05 | → | homo_ joins (~homo@user/homo) |
| 19:16:21 | × | homo quits (~homo@user/homo) (Read error: Connection reset by peer) |
| 19:16:29 | <__monty__> | I suppose `(min <$> mA <*> mB) <|> mA <|> mB` is the closest I'll get. |
| 19:17:05 | <tomsmeding> | if you use this multiple times and it's a relevant pattern in the domain, I'd write a helper function for it that does precisely what you want |
| 19:17:26 | → | machinedgod joins (~machinedg@d108-173-18-100.abhsia.telus.net) |
| 19:17:35 | <tomsmeding> | applyOn2 min mA mA, perhaps |
| 19:17:35 | × | CrunchyFlakes quits (~CrunchyFl@ip1f13e94e.dynamic.kabel-deutschland.de) (Read error: Connection reset by peer) |
| 19:20:12 | → | CrunchyFlakes joins (~CrunchyFl@31.19.233.78) |
| 19:21:47 | homo_ | is now known as homo |
| 19:23:09 | <ski> | int-e : elaborate on "unit propagation" and "watched literals" ? |
| 19:23:38 | <ski> | tomsmeding : ooh, disjunctive patterns :o .. too bad they can't bind variables yet, but still cool to see :) |
| 19:23:59 | tomsmeding | personally feels OrPatterns without binding any variables is only marginally useful |
| 19:24:11 | <ski> | int-e : i'd expect forward-chaining "business rules" systems also to have similar stuff, byw |
| 19:24:12 | <tomsmeding> | but perhaps that's because of the kind of code I'm writing, I don't really have plain enum data types |
| 19:24:17 | <ski> | s/byw/btw/ |
| 19:25:00 | <c_wraith> | It seems like the obvious extension is that they can bind variables as long as every clause binds the same names at the same types. |
| 19:25:18 | <tomsmeding> | and if the list of alternatives is long, then `foo = \case \n A -> True \n B -> True \n ...` is clearer, I think, than foo (A ; B ; ...) = True |
| 19:25:22 | <c_wraith> | Oh, I see. That can interact with type inference, and they didn't want to do that yet. |
| 19:25:24 | <tomsmeding> | c_wraith: yes |
| 19:25:33 | <int-e> | ski: Hmm. Well, you can view each clause a \/ b \/ c of literals in a SAT problem as a bunch of Horn clauses, -a, -b ==> c etc. Unit propagation is basically Horn inference based on these clauses and literals that have been assigned true. (It stops in a "conflict" if for some variable you assign both its positive and its negative literal to be true) |
| 19:25:43 | <tomsmeding> | c_wraith: I get why they didn't want to do it; especially with GADTs it feels very tricky |
| 19:26:58 | <int-e> | ski: watched literals are a bit more technical. Basically with "naive evaluation" you'd have to check a clause whenever one of the literals in it becomes true. "watched literals" singles out 2 literals from each clause and waits for one of them to be true before checking the clause; then it either picks a new literal to watch instead or adds the conclusion as a new inference. |
| 19:27:17 | <ski> | tomsmeding : <https://rosettacode.org/wiki/Pattern_matching#OCaml> is an example i added (translating to OCaml from other examples), years ago, using disjunctive patterns .. this is an example where being able to bind variables helps avoid some annoying code duplication (the branch body. even if you factor it into a function, you'd still need to pass the bound variables as parameters, in each case) |
| 19:28:39 | <tomsmeding> | ski: each of the cases without a right-hand side "fall through" into the next one? |
| 19:28:46 | <ski> | "they can bind variables as long as every clause binds the same names at the same types" -- or binds the intersection, if one'd allow "local guards" (one could even do this with view patterns, already, i think ?) |
| 19:28:47 | <tomsmeding> | (thinking of C switch-case) |
| 19:29:53 | <ski> | > let foo (x,(x ==) -> True) = [x]; foo (x,y) = [x,y] in map foo [(0,0),(1,2)] |
| 19:29:54 | <lambdabot> | [[0],[1,2]] |
| 19:30:01 | <tomsmeding> | that is indeed cute and a non-trivial use-case, thanks for sharing -- but it does require binding names :) |
| 19:30:03 | <int-e> | ski: The reason why people bother with watched literals in this context is that clauses can be very large, having dozens or hundreds of literals. And you have a lot of clauses as well, of course. And SAT solvers spend most of their time doing unit propagation. |
| 19:30:43 | <ski> | int-e : negation is problematic, without stratification, though |
| 19:31:02 | <ski> | (mm, you mentioned conflict) |
| 19:32:05 | <int-e> | ski: Anyway. There's some overlap with the deductive database stuff but I think the above covers the overlap. What SAT solvers do when they encounter a conflict (backtrack, or backjump, and optionally learn a new clause) is specific to SAT solvers. And yeah, it originates in dealing with negation. |
| 19:32:21 | <ski> | tomsmeding : "each of the cases without a right-hand side "fall through" into the next one?" -- no, `B, T (R, T (R,a,x,b), y, c), z, d | B, T (R, a, x, T (R,b,y,c)), z, d | ...' is a single disjunctive patten |
| 19:32:53 | <ski> | (you can nest disjunctive patterns inside other patterns) |
| 19:33:08 | <ski> | also, OCaml tuples do not require outer brackets |
| 19:34:03 | <tomsmeding> | ski: so the first '|' introduces a case, the 2nd, 3rd and 4th '|' are disjunctive separators, and the 5th '|' is again a case? |
| 19:34:13 | <tomsmeding> | sneaky syntax |
| 19:34:15 | <ski> | tomsmeding : iow, there's two different kinds of `|' in that example. (a) ones separating (well, preceding, in my case) the branches; and (b) ones separating the disjuncts/alternatives in a disjunctive pattern |
| 19:34:15 | → | hseg joins (~gesh@46.120.21.36) |
| 19:34:20 | <ski> | yes |
| 19:34:31 | <ski> | giving it the "look" of "fall through" |
| 19:34:36 | <tomsmeding> | well, I think my explanation ends up being equivalent anyway :) |
| 19:34:45 | <ash3en> | is a new but not innovative library worth publishing a paper and if yes, where? |
| 19:34:58 | <hseg> | I forgot to add the sha for an extra-deps in stack, how do I query it from stack? |
| 19:35:02 | <ski> | (btw, i have been thinking, some years ago, of a way to do "fall-through" with pattern-matching `case' ..) |
| 19:35:35 | <int-e> | ski: does "stratification" correspond to treating each positive and negative literal as its own variable? |
| 19:36:11 | <ski> | (imagine `case ... of A x -> f x; B x y -> g x (h x y); C x y z -> g x (i x y z)', but now you want to avoid duplicating the `g x (...)' part of the code) |
| 19:36:25 | <tomsmeding> | ash3en: perhaps not a paper, but you could try for a workshop talk if there's something relevant |
| 19:36:30 | <int-e> | (i.e. one variable for each possible boolean value) |
| 19:36:58 | <ski> | int-e : mm. i see. i think i'd need to look more to understand the why of the watched literals |
| 19:37:53 | <ski> | "ends up being equivalent anyway" -- yes (which was why i formatted it that way, apart from it being the easiest way to handle those rather long individual alternatives in the disjunctive pattern) |
| 19:38:44 | <ski> | int-e : "stratification" refers to not allowing a predicate to "call itself" (directly or indirectly), inside of a negation |
| 19:39:12 | <ski> | (ensuring monotonicity) |
| 19:39:29 | <int-e> | ski: Note that the usual explanation for unit propagation is "find clauses in which all but one literal are false and assign true to the last one" and a conflict is a false clause. |
| 19:40:05 | <int-e> | ski: So viewing that as an instance of Horn inference is artificial. |
| 19:41:07 | <int-e> | But the connection is definitely there :) |
| 19:41:34 | <ski> | hm. wondering whether the conflict would be a bit similar deriving the empty clause, with resolution |
| 19:42:43 | <ski> | hm, the watched literals sounds kinda like indexing |
| 19:42:55 | <ski> | can a clause have multiple watched literals at the same time ? |
| 19:43:24 | × | housemate quits (~housemate@149.167.24.31) (Quit: Nothing to see here. I wasn't there. I take IRC seriously.) |
| 19:43:54 | <ski> | tomsmeding : "but it does require binding names" -- yes. the point was to show an example where "intersection" would be superior to "require all alternatives to bind the same variables" |
| 19:44:06 | <int-e> | ski: It's two. The reason that you need two is that A \/ B encodes both -A -> B and -B -> A. |
| 19:44:37 | <int-e> | ski: so you can't get away with only triggering on one of them |
| 19:44:51 | <int-e> | while with pure Horn clauses you could |
| 19:44:53 | <ski> | (an alternative would be to have an explicit "existential quantification" in patterns, like `forget x in ..x..' *not* binding `x') |
| 19:46:47 | <ski> | "and a conflict is a false clause." -- a clause with all literals refuted ? |
| 19:47:03 | <int-e> | yeah |
| 19:47:20 | <hseg> | nm, just pulled them out of the .lock file |
| 19:47:24 | <ski> | "so you can't get away with only triggering on one of them" -- mhm (still not quite following this) |
| 19:47:32 | <ski> | conflict causes backtrack (or backjump) ? |
| 19:47:33 | <ski> | what is the difference between backtrack and backjump ? |
| 19:48:20 | <int-e> | I don't think I can explain backjump on IRC. It's a refinement of backtracking that generally skips more of the search tree. |
| 19:48:41 | <ski> | mm |
| 19:48:56 | → | housemate joins (~housemate@149.167.24.31) |
| 19:49:07 | × | housemate quits (~housemate@149.167.24.31) (Client Quit) |
| 19:49:09 | <int-e> | And there *is* a search tree; when unit propagation runs out of inferences without a conflict, you pick a variable that doesn't have a value yet, and tentatively pick one. |
| 19:49:09 | <ski> | pruning away branches that are known to only contain failures, or be subsumed by other branches ? |
| 19:50:02 | <ski> | yea. i'd imagine you proceed deterministically, comitting to some order, as much as possible, before resorting to backtracking and choice-points |
| 19:50:03 | <int-e> | yeah, pruning without discarding solutions |
| 19:50:15 | <ski> | (which is what you do in constraint solving) |
| 19:52:03 | <ski> | (also stuff like dividing domains in half, adding choice-points, building a binary tree; rather than enumerating elements one by one, which would build a choice-point tree in the form of a linked list. the former may have more potential for discarding whole subtrees, depending on the problem) |
| 19:52:15 | → | vanishingideal joins (~vanishing@user/vanishingideal) |
| 19:54:44 | × | michalz quits (~michalz@185.246.207.215) (Ping timeout: 264 seconds) |
| 20:00:00 | × | caconym quits (~caconym@user/caconym) (Quit: bye) |
| 20:00:39 | → | caconym joins (~caconym@user/caconym) |
| 20:02:57 | × | lxsameer quits (~lxsameer@Serene/lxsameer) (Ping timeout: 246 seconds) |
| 20:04:33 | × | hseg quits (~gesh@46.120.21.36) (Ping timeout: 248 seconds) |
| 20:08:41 | → | michalz joins (~michalz@185.246.207.221) |
| 20:20:16 | × | krjst quits (~krjst@2604:a880:800:c1::16b:8001) (Ping timeout: 252 seconds) |
| 20:20:41 | × | michalz quits (~michalz@185.246.207.221) (Ping timeout: 252 seconds) |
| 20:21:42 | → | michalz joins (~michalz@185.246.207.197) |
| 20:22:55 | → | krjst joins (~krjst@2604:a880:800:c1::16b:8001) |
| 20:25:26 | → | weary-traveler joins (~user@user/user363627) |
| 20:28:21 | → | prasad joins (~Thunderbi@2601:243:c001:3f07::d5) |
| 20:28:50 | ← | prasad parts (~Thunderbi@2601:243:c001:3f07::d5) () |
| 20:29:44 | → | prasad joins (~Thunderbi@2601:243:c001:3f07::d5) |
| 20:31:53 | × | __monty__ quits (~toonn@user/toonn) (Ping timeout: 244 seconds) |
| 20:32:30 | × | segfaultfizzbuzz quits (~segfaultf@23-93-87-166.dedicated.static.sonic.net) (Remote host closed the connection) |
| 20:33:13 | → | segfaultfizzbuzz joins (~segfaultf@23-93-87-166.dedicated.static.sonic.net) |
| 20:34:51 | → | poopiedookie joins (~poopiedoo@syn-069-206-166-125.res.spectrum.com) |
| 20:38:23 | <prasad> | @type mmap |
| 20:38:24 | <lambdabot> | error: |
| 20:38:24 | <lambdabot> | • Variable not in scope: mmap |
| 20:38:25 | <lambdabot> | • Perhaps you meant one of these: |
| 20:38:42 | → | housemate joins (~housemate@60.231.48.87) |
| 20:38:54 | → | __monty__ joins (~toonn@user/toonn) |
| 20:41:07 | → | housemate_ joins (~housemate@60.231.48.87) |
| 20:41:30 | × | housemate quits (~housemate@60.231.48.87) (Read error: Connection reset by peer) |
| 20:41:35 | <monochrom> | Hot take: Backtrack is just shift within a very recent reset, backjump is just shift within a far away reset. >:) |
| 20:43:09 | <monochrom> | "A long long time ago in a reset far far away... CONT WARS" |
| 20:43:25 | × | housemate_ quits (~housemate@60.231.48.87) (Remote host closed the connection) |
| 20:43:38 | <ski> | choose xs = shift (\c -> concatMap c xs) |
| 20:46:25 | <ski> | (`shift' and `reset' also allows you to convert internal iteration (like in `mapM'), to external iteration (like a stream / iterator / generator)) |
| 20:46:38 | <monochrom> | :) |
| 20:46:54 | <ski> | @hoogle mmap |
| 20:46:55 | <lambdabot> | package mmap |
| 20:46:55 | <lambdabot> | HaskellWorks.Data.ByteString mmap :: FilePath -> IO ByteString |
| 20:46:55 | <lambdabot> | HaskellWorks.Data.Vector.Storable mmap :: Storable a => FilePath -> IO (Vector a) |
| 20:46:59 | <ski> | prasad ^ ? |
| 20:47:03 | <monochrom> | https://www.vex.net/~trebla/haskell/cont.xhtml#inside-out |
| 21:02:30 | → | housemate joins (~housemate@60.231.48.87) |
| 21:17:30 | → | ALpHaBy joins (~ALpHaBy@197.25.200.40) |
| 21:17:51 | <mreh> | does stack still default to Haskell2010? |
| 21:18:25 | <mreh> | or is it an hpack thing? |
| 21:19:04 | <tomsmeding> | mreh: this is dictated by the 'default-language' clause in the .cabal file, so probably hpack |
| 21:19:48 | <mreh> | tomsmeding: yeah |
| 21:20:01 | <mreh> | I say still because GHC has been defaulting to GHC2021 for a while. |
| 21:20:39 | <tomsmeding> | mreh: you can add a default-language field to your package.yaml :) |
| 21:21:49 | <mreh> | it's not me, some upstream package on hackage, somehow the maintainer is using his packages bypassing the default-language in his cabal files |
| 21:22:27 | <mreh> | maybe he's referencing them under `packages:` in his stack.yaml |
| 21:23:26 | <tomsmeding> | someone is uploading packages to hackage that don't compile with the .cabal files they're uploaded with? |
| 21:23:31 | <tomsmeding> | that's... their problem? :p |
| 21:23:50 | <tomsmeding> | then those packages are just broken |
| 21:26:22 | <mreh> | maybe he can execute his code inside his head |
| 21:26:57 | <ALpHaBy> | where can get free shell or znc ? |
| 21:28:13 | <tomsmeding> | at scam companies |
| 21:28:57 | <tomsmeding> | if you want a free irc bouncer, try irccloud.com or thelounge.chat |
| 21:29:21 | <ALpHaBy> | no for web |
| 21:29:32 | <ALpHaBy> | i need one for irc network |
| 21:30:38 | <ALpHaBy> | as like channel #ReQuesT in dalnet network |
| 21:31:02 | <ALpHaBy> | there evryone can get a free znc |
| 21:31:55 | × | housemate quits (~housemate@60.231.48.87) (Remote host closed the connection) |
| 21:32:04 | → | housemate joins (~housemate@60.231.48.87) |
| 21:37:30 | <mauke> | ALpHaBy: what does that have to do with haskell? |
| 21:37:42 | × | housemate quits (~housemate@60.231.48.87) (Ping timeout: 252 seconds) |
| 21:40:05 | × | gmg quits (~user@user/gehmehgeh) (Remote host closed the connection) |
| 21:40:41 | → | gmg joins (~user@user/gehmehgeh) |
| 21:40:41 | × | simplystuart quits (~simplystu@c-75-75-152-164.hsd1.pa.comcast.net) (Remote host closed the connection) |
| 21:42:21 | <ALpHaBy> | mauke i will leave haskell forver becose u are here |
| 21:42:41 | <ski> | ALpHaBy : perhaps something like <https://tildeverse.org/>,<http://sdf.org/>,<https://github.com/dimension-sh/> |
| 21:44:12 | <int-e> | ©1987-2065 -- amazing they solved the Y2K38 problem already |
| 21:45:14 | <int-e> | (from the second link; I feel I might be missing a joke there) |
| 21:45:43 | → | dsrt^ joins (dsrt@c-98-242-74-66.hsd1.ga.comcast.net) |
| 21:47:03 | <tomsmeding> | some copyright law, perhaps? |
| 21:47:20 | tomsmeding | also doesn't get the joke |
| 21:48:29 | ski | . o O ( <https://github.com/cwmccabe/pubnixhist> ) |
| 21:48:57 | ← | ALpHaBy parts (~ALpHaBy@197.25.200.40) () |
| 21:49:11 | → | housemate joins (~housemate@ppp203-122-213-191.static.internode.on.net) |
| 21:49:20 | → | Pixi joins (~Pixi@user/pixi) |
| 21:49:23 | <int-e> | tomsmeding: Okay one part of the joke is that this is a range of about 2^31 seconds. But who uses 1987 based time stamps? Of course it might be a year of birth. |
| 21:49:46 | <int-e> | I can't do math |
| 21:49:53 | <geekosaur> | sadly ncoast.org, where I started my journey, is no more |
| 21:49:56 | <int-e> | that's 78 years, not 68 |
| 21:49:58 | <int-e> | good night |
| 21:51:58 | <tomsmeding> | 2065 - 1987 is 0x92b80f00 seconds |
| 21:52:04 | <tomsmeding> | according to javascript |
| 21:53:12 | <monochrom> | BTW I watched the Y2K movie yesterday haha. |
| 21:53:23 | <tomsmeding> | it's all connected |
| 21:54:27 | × | michalz quits (~michalz@185.246.207.197) (Remote host closed the connection) |
| 21:55:24 | × | takuan quits (~takuan@178-116-218-225.access.telenet.be) (Remote host closed the connection) |
| 21:57:53 | × | fmira quits (~user@user/fmira) (Remote host closed the connection) |
| 21:58:16 | → | fmira joins (~user@user/fmira) |
| 22:00:17 | × | housemate quits (~housemate@ppp203-122-213-191.static.internode.on.net) (Ping timeout: 265 seconds) |
| 22:00:35 | <hellwolf> | hmm, how do you easily pattern matching a String prefix? |
| 22:00:56 | <hellwolf> | 't':'h':'i':'s':"would be painful" |
| 22:02:00 | <monochrom> | I sometimes do that. Other times I use the stripPrefix function. |
| 22:02:52 | → | gorignak joins (~gorignak@user/gorignak) |
| 22:05:14 | <tomsmeding> | hellwolf: if you want to be masochistic: https://play.haskell.org/saved/V66qCMa5 |
| 22:05:31 | <tomsmeding> | mind the AllowAmbiguousTypes, which is a footgun enabler |
| 22:06:01 | <tomsmeding> | perhaps that 'takePrefix' should be called 'stripPrefix' indeed |
| 22:06:05 | <hellwolf> | haha, wow. |
| 22:06:31 | <tomsmeding> | (the only _inputs_ to a pattern synonym are types, hence... this) |
| 22:06:40 | <tomsmeding> | but using ViewPatterns directly you do have inputs |
| 22:07:07 | <tomsmeding> | indeed, you can use that 'takePrefix' directly like: foo (takePrefix "this" -> Just s) = putStrLn $ "this and then: " ++ s |
| 22:07:14 | <tomsmeding> | which is I think what monochrom was getting at |
| 22:07:50 | <hellwolf> | interesting |
| 22:07:53 | <monochrom> | pattern guard but yeah. |
| 22:08:01 | <tomsmeding> | ah |
| 22:08:19 | <hellwolf> | why ViewPatterns is not included in any GHC202 |
| 22:08:22 | <hellwolf> | GHC202x |
| 22:08:37 | <tomsmeding> | perhaps it was considered too esoteric? |
| 22:08:57 | <hellwolf> | perhaps. I barely can write pattern guard properly |
| 22:09:29 | <monochrom> | I like pattern guards more. |
| 22:09:39 | <tomsmeding> | https://github.com/AccelerateHS/accelerate/blob/02da6161ef143a9886c8bce542cd96029c4f527a/src/Data/Array/Accelerate/AST/Idx.hs#L83 |
| 22:10:20 | <c_wraith> | I once did horrible things with stripPrefix and type-level programming |
| 22:11:06 | <hellwolf> | folks, all I want is a scanf |
| 22:11:06 | → | hueso_ joins (~root@user/hueso) |
| 22:11:11 | <hellwolf> | perhaps |
| 22:11:12 | × | hueso quits (~root@user/hueso) (Ping timeout: 276 seconds) |
| 22:11:17 | <tomsmeding> | import Text.Parsec |
| 22:11:34 | <c_wraith> | ugh. use ReadP if you are doing quick and dirty. |
| 22:11:37 | <tomsmeding> | okay perhaps a little overpowered for scanf |
| 22:11:49 | <c_wraith> | parsec-likes are so painful to refactor. |
| 22:12:33 | × | mreh quits (~matthew@host86-146-25-68.range86-146.btcentralplus.com) (Quit: Lost terminal) |
| 22:13:20 | <monochrom> | I hate escape codes, so I agree about ReadP. |
| 22:13:44 | <c_wraith> | ReadP is surprisingly overlooked for something in base |
| 22:14:14 | <Rembane> | Is it Read's competent cousin? |
| 22:14:18 | <monochrom> | I used ReadP when I needed a simple parser for a barebone lambda calculus. :) |
| 22:14:25 | <monochrom> | Yeah! |
| 22:14:42 | <c_wraith> | it's a minimal, but fully-functional parser combinator library for String input |
| 22:15:39 | <Rembane> | Sweet! |
| 22:15:40 | <c_wraith> | It skips things like error reporting tools. I wouldn't use it for things that have to be user-facing. |
| 22:16:03 | <c_wraith> | But when you just want to parse something where it's a flat failure when the input is bad, it's nice. |
| 22:16:07 | <monochrom> | Oh I just use it to write Read instances. :) |
| 22:17:01 | <ski> | @hackage parsek |
| 22:17:02 | <lambdabot> | https://hackage.haskell.org/package/parsek |
| 22:20:47 | <geekosaur> | I don't think I've used scanf since, uh, 1988? |
| 22:21:40 | <hellwolf> | :D |
| 22:22:06 | → | rynite joins (~bwkam@user/rynite) |
| 22:28:25 | × | rynite quits (~bwkam@user/rynite) (Quit: WeeChat 4.4.1) |
| 22:31:34 | → | peterbecich joins (~Thunderbi@syn-047-229-123-186.res.spectrum.com) |
| 22:32:04 | × | Logio quits (em@kapsi.fi) (Ping timeout: 245 seconds) |
| 22:32:23 | → | Logio joins (em@kapsi.fi) |
| 22:39:26 | × | xff0x_ quits (~xff0x@2405:6580:b080:900:47af:5bec:f5b4:7548) (Ping timeout: 265 seconds) |
| 22:40:43 | × | byte quits (~byte@149.28.222.189) (Killed (gold.libera.chat (Nickname regained by services))) |
| 22:53:52 | → | housemate joins (~housemate@ppp203-122-213-191.static.internode.on.net) |
| 22:56:50 | × | peterbecich quits (~Thunderbi@syn-047-229-123-186.res.spectrum.com) (Ping timeout: 265 seconds) |
| 22:58:08 | × | housemate quits (~housemate@ppp203-122-213-191.static.internode.on.net) (Read error: Connection reset by peer) |
| 22:59:19 | → | housemate joins (~housemate@ppp203-122-213-191.static.internode.on.net) |
| 22:59:44 | × | housemate quits (~housemate@ppp203-122-213-191.static.internode.on.net) (Remote host closed the connection) |
| 23:00:45 | → | xff0x joins (~xff0x@2405:6580:b080:900:47af:5bec:f5b4:7548) |
| 23:08:57 | × | dsrt^ quits (dsrt@c-98-242-74-66.hsd1.ga.comcast.net) (Ping timeout: 244 seconds) |
| 23:11:55 | × | Ranhir quits (~Ranhir@157.97.53.139) (Ping timeout: 252 seconds) |
| 23:19:07 | → | ljdarj joins (~Thunderbi@user/ljdarj) |
| 23:20:14 | × | __monty__ quits (~toonn@user/toonn) (Quit: leaving) |
| 23:23:20 | → | housemate joins (~housemate@ppp203-122-213-191.static.internode.on.net) |
| 23:25:14 | → | Ranhir joins (~Ranhir@157.97.53.139) |
| 23:25:24 | × | machinedgod quits (~machinedg@d108-173-18-100.abhsia.telus.net) (Ping timeout: 245 seconds) |
| 23:30:32 | × | housemate quits (~housemate@ppp203-122-213-191.static.internode.on.net) (Remote host closed the connection) |
| 23:33:33 | × | CrunchyFlakes quits (~CrunchyFl@31.19.233.78) (Read error: Connection reset by peer) |
| 23:35:47 | → | CrunchyFlakes joins (~CrunchyFl@31.19.233.78) |
| 23:39:11 | Axma98477 | is now known as Axman6 |
| 23:39:17 | × | haasn quits (sid579015@id-579015.hampstead.irccloud.com) (Quit: Connection closed for inactivity) |
| 23:41:29 | → | merijn joins (~merijn@128-137-045-062.dynamic.caiway.nl) |
| 23:46:09 | × | merijn quits (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 244 seconds) |
| 23:46:09 | × | ystael quits (~ystael@user/ystael) (Read error: Connection reset by peer) |
| 23:47:01 | → | merijn joins (~merijn@128-137-045-062.dynamic.caiway.nl) |
| 23:47:47 | → | ystael joins (~ystael@user/ystael) |
| 23:51:45 | × | merijn quits (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 248 seconds) |
| 23:55:12 | × | prasad quits (~Thunderbi@2601:243:c001:3f07::d5) (Ping timeout: 276 seconds) |
| 23:57:06 | → | Square2 joins (~Square4@user/square) |
All times are in UTC on 2024-12-19.