Logs on 2022-07-17 (liberachat/#haskell)
| 00:00:19 | → | bitdex joins (~bitdex@gateway/tor-sasl/bitdex) |
| 00:01:44 | × | califax quits (~califax@user/califx) (Remote host closed the connection) |
| 00:05:11 | → | califax joins (~califax@user/califx) |
| 00:06:15 | <SrPx> | just a little nice thing I did today: https://twitter.com/VictorTaelin/status/1548458824821944322 |
| 00:06:23 | <SrPx> | Debug.Trace with λ-inspecting capabilities |
| 00:06:53 | <qrpnxz> | lovely! |
| 00:09:51 | → | eggplantade joins (~Eggplanta@2600:1700:bef1:5e10:5546:a014:fe40:2124) |
| 00:10:50 | × | Lumia quits (~Lumia@c-24-34-172-110.hsd1.ma.comcast.net) (Ping timeout: 240 seconds) |
| 00:14:59 | × | dsrt^ quits (~dsrt@c-73-207-207-252.hsd1.ga.comcast.net) (Remote host closed the connection) |
| 00:16:30 | × | vglfr quits (~vglfr@88.155.51.199) (Ping timeout: 240 seconds) |
| 00:16:58 | × | matthewmosior quits (~matthewmo@173.170.253.91) (Ping timeout: 244 seconds) |
| 00:17:14 | → | tabemann joins (~tabemann@2600:380:a15c:4a49:de17:348c:4193:88a8) |
| 00:17:33 | → | Lumia joins (~Lumia@c-24-34-172-110.hsd1.ma.comcast.net) |
| 00:22:38 | × | merijn quits (~merijn@c-001-001-023.client.esciencecenter.eduvpn.nl) (Ping timeout: 244 seconds) |
| 00:31:20 | → | wbntdodt^ joins (~wbntdodt@c-73-207-207-252.hsd1.ga.comcast.net) |
| 00:34:15 | × | nate4 quits (~nate@98.45.169.16) (Ping timeout: 276 seconds) |
| 00:38:31 | → | matthewmosior joins (~matthewmo@173.170.253.91) |
| 00:55:21 | → | yauhsien joins (~yauhsien@61-231-46-226.dynamic-ip.hinet.net) |
| 00:58:49 | × | Lumia quits (~Lumia@c-24-34-172-110.hsd1.ma.comcast.net) (Ping timeout: 244 seconds) |
| 00:59:30 | × | yauhsien quits (~yauhsien@61-231-46-226.dynamic-ip.hinet.net) (Ping timeout: 240 seconds) |
| 01:06:42 | → | Lumia joins (~Lumia@c-24-34-172-110.hsd1.ma.comcast.net) |
| 01:07:24 | → | tabemann_ joins (~tabemann@h96-61-110-237.mtjltn.dedicated.static.tds.net) |
| 01:10:10 | × | gurkenglas quits (~gurkengla@dslb-002-203-144-112.002.203.pools.vodafone-ip.de) (Ping timeout: 240 seconds) |
| 01:10:19 | → | jmorris joins (uid537181@id-537181.uxbridge.irccloud.com) |
| 01:10:31 | × | tabemann quits (~tabemann@2600:380:a15c:4a49:de17:348c:4193:88a8) (Killed (NickServ (GHOST command used by tabemann_!~tabemann@h96-61-110-237.mtjltn.dedicated.static.tds.net))) |
| 01:10:57 | tabemann_ | is now known as tabemann |
| 01:10:58 | × | califax quits (~califax@user/califx) (Remote host closed the connection) |
| 01:11:04 | → | califax_ joins (~califax@user/califx) |
| 01:11:57 | × | tabemann quits (~tabemann@h96-61-110-237.mtjltn.dedicated.static.tds.net) (Client Quit) |
| 01:12:18 | califax_ | is now known as califax |
| 01:14:38 | → | yuv4199 joins (~yuv4199@user/yuv4199) |
| 01:15:11 | × | Lumia quits (~Lumia@c-24-34-172-110.hsd1.ma.comcast.net) (Quit: ,-) |
| 01:15:49 | × | byorgey quits (~byorgey@155.138.238.211) (Quit: Lost terminal) |
| 01:15:50 | → | nate4 joins (~nate@98.45.169.16) |
| 01:16:54 | × | waleee quits (~waleee@2001:9b0:213:7200:cc36:a556:b1e8:b340) (Ping timeout: 244 seconds) |
| 01:17:57 | → | Lumia joins (~Lumia@c-24-34-172-110.hsd1.ma.comcast.net) |
| 01:23:50 | × | nate4 quits (~nate@98.45.169.16) (Ping timeout: 240 seconds) |
| 01:30:04 | × | FinnElija quits (~finn_elij@user/finn-elija/x-0085643) (Ping timeout: 268 seconds) |
| 01:31:50 | → | FinnElija joins (~finn_elij@user/finn-elija/x-0085643) |
| 01:34:11 | × | econo quits (uid147250@user/econo) (Quit: Connection closed for inactivity) |
| 01:39:50 | × | benin0 quits (~benin@183.82.24.82) (Ping timeout: 240 seconds) |
| 01:42:47 | × | matthewmosior quits (~matthewmo@173.170.253.91) (Ping timeout: 255 seconds) |
| 01:48:15 | ← | jakalx parts (~jakalx@base.jakalx.net) () |
| 01:52:45 | → | nate4 joins (~nate@98.45.169.16) |
| 01:56:47 | → | lainon joins (~lainon@2600:1700:1bb0:1c10:4df5:d7cd:2eb0:d172) |
| 01:57:10 | × | nate4 quits (~nate@98.45.169.16) (Ping timeout: 240 seconds) |
| 02:00:02 | × | califax quits (~califax@user/califx) (Remote host closed the connection) |
| 02:00:29 | × | Lumia quits (~Lumia@c-24-34-172-110.hsd1.ma.comcast.net) (Quit: ,-) |
| 02:00:55 | → | califax joins (~califax@user/califx) |
| 02:01:51 | × | mon_aaraj quits (~MonAaraj@user/mon-aaraj/x-4416475) (Ping timeout: 244 seconds) |
| 02:02:30 | × | mvk quits (~mvk@2607:fea8:5ce3:8500::909a) (Ping timeout: 240 seconds) |
| 02:03:41 | × | FinnElija quits (~finn_elij@user/finn-elija/x-0085643) (Remote host closed the connection) |
| 02:04:07 | → | mon_aaraj joins (~MonAaraj@user/mon-aaraj/x-4416475) |
| 02:04:38 | × | gdown quits (~gavin@h69-11-149-231.kndrid.broadband.dynamic.tds.net) (Remote host closed the connection) |
| 02:06:00 | × | pretty_dumm_guy quits (trottel@gateway/vpn/protonvpn/prettydummguy/x-88029655) (Quit: WeeChat 3.5) |
| 02:09:46 | → | FinnElija joins (~finn_elij@user/finn-elija/x-0085643) |
| 02:10:32 | → | matthewmosior joins (~matthewmo@173.170.253.91) |
| 02:10:51 | × | perrierjouet quits (~perrier-j@modemcable012.251-130-66.mc.videotron.ca) (Quit: WeeChat 3.5) |
| 02:12:40 | × | lainon quits (~lainon@2600:1700:1bb0:1c10:4df5:d7cd:2eb0:d172) (Quit: Textual IRC Client: www.textualapp.com) |
| 02:16:31 | → | jakalx joins (~jakalx@base.jakalx.net) |
| 02:17:04 | → | merijn joins (~merijn@c-001-001-023.client.esciencecenter.eduvpn.nl) |
| 02:28:02 | × | ChaiTRex quits (~ChaiTRex@user/chaitrex) (Ping timeout: 268 seconds) |
| 02:29:08 | → | ChaiTRex joins (~ChaiTRex@user/chaitrex) |
| 02:31:10 | → | mvk joins (~mvk@2607:fea8:5ce3:8500::909a) |
| 02:33:18 | → | yauhsien joins (~yauhsien@61-231-46-226.dynamic-ip.hinet.net) |
| 02:40:25 | × | yauhsien quits (~yauhsien@61-231-46-226.dynamic-ip.hinet.net) (Ping timeout: 272 seconds) |
| 02:40:43 | → | finn_elija joins (~finn_elij@user/finn-elija/x-0085643) |
| 02:40:43 | × | FinnElija quits (~finn_elij@user/finn-elija/x-0085643) (Killed (NickServ (Forcing logout FinnElija -> finn_elija))) |
| 02:40:43 | finn_elija | is now known as FinnElija |
| 02:46:10 | × | merijn quits (~merijn@c-001-001-023.client.esciencecenter.eduvpn.nl) (Ping timeout: 240 seconds) |
| 02:47:19 | × | causal quits (~user@50.35.83.177) (Quit: WeeChat 3.5) |
| 02:48:55 | × | [itchyjunk] quits (~itchyjunk@user/itchyjunk/x-7353470) (Read error: Connection reset by peer) |
| 02:57:20 | × | TonyStone quits (~TonyStone@2603-7080-8607-c36a-c542-8032-a2eb-86d5.res6.spectrum.com) (Quit: Leaving) |
| 02:58:30 | × | td_ quits (~td@94.134.91.147) (Ping timeout: 240 seconds) |
| 03:00:30 | → | td_ joins (~td@94.134.91.33) |
| 03:02:35 | × | mud quits (~mud@user/kadoban) (Ping timeout: 272 seconds) |
| 03:12:55 | → | merijn joins (~merijn@c-001-001-023.client.esciencecenter.eduvpn.nl) |
| 03:14:56 | → | nate4 joins (~nate@98.45.169.16) |
| 03:15:56 | × | zebrag quits (~chris@user/zebrag) (Quit: Konversation terminated!) |
| 03:17:25 | → | nasosev joins (~nasosev@193-116-244-197.tpgi.com.au) |
| 03:17:34 | → | econo joins (uid147250@user/econo) |
| 03:17:38 | × | merijn quits (~merijn@c-001-001-023.client.esciencecenter.eduvpn.nl) (Ping timeout: 240 seconds) |
| 03:19:30 | × | nate4 quits (~nate@98.45.169.16) (Ping timeout: 240 seconds) |
| 03:20:53 | × | matthewmosior quits (~matthewmo@173.170.253.91) (Ping timeout: 244 seconds) |
| 03:25:05 | → | byorgey joins (~byorgey@155.138.238.211) |
| 03:25:30 | × | mvk quits (~mvk@2607:fea8:5ce3:8500::909a) (Ping timeout: 240 seconds) |
| 03:26:30 | × | marquis_andras quits (~marquis_a@202-161-119-113.tpgi.com.au) (Ping timeout: 264 seconds) |
| 03:28:11 | → | matthewmosior joins (~matthewmo@173.170.253.91) |
| 03:33:07 | → | marquis_andras joins (~marquis_a@202-161-119-113.tpgi.com.au) |
| 03:33:25 | → | mud joins (~mud@user/kadoban) |
| 03:33:42 | × | jao quits (~jao@cpc103048-sgyl39-2-0-cust502.18-2.cable.virginm.net) (Ping timeout: 264 seconds) |
| 03:45:37 | → | Infinite joins (~Infinite@2405:201:6014:10d3:ad94:e94c:999a:8ee4) |
| 03:48:26 | → | benin0 joins (~benin@183.82.24.82) |
| 04:15:03 | → | merijn joins (~merijn@c-001-001-023.client.esciencecenter.eduvpn.nl) |
| 04:23:49 | → | nate4 joins (~nate@98.45.169.16) |
| 04:24:59 | → | segfaultfizzbuzz joins (~segfaultf@157-131-253-58.fiber.dynamic.sonic.net) |
| 04:25:10 | → | jmdaemon joins (~jmdaemon@user/jmdaemon) |
| 04:27:39 | → | gdown joins (~gavin@h69-11-149-231.kndrid.broadband.dynamic.tds.net) |
| 04:28:35 | × | nate4 quits (~nate@98.45.169.16) (Ping timeout: 244 seconds) |
| 04:35:56 | × | qhong quits (~qhong@DN200ouo5.stanford.edu) (Read error: Connection reset by peer) |
| 04:36:05 | → | qhong joins (~qhong@rescomp-21-400677.stanford.edu) |
| 04:37:39 | × | qhong quits (~qhong@rescomp-21-400677.stanford.edu) (Read error: Connection reset by peer) |
| 04:37:49 | → | qhong joins (~qhong@rescomp-21-400677.stanford.edu) |
| 04:45:06 | × | segfaultfizzbuzz quits (~segfaultf@157-131-253-58.fiber.dynamic.sonic.net) (Ping timeout: 244 seconds) |
| 04:47:43 | × | merijn quits (~merijn@c-001-001-023.client.esciencecenter.eduvpn.nl) (Ping timeout: 272 seconds) |
| 05:03:33 | × | machinedgod quits (~machinedg@d172-219-86-154.abhsia.telus.net) (Ping timeout: 272 seconds) |
| 05:04:51 | → | perrierjouet joins (~perrier-j@modemcable012.251-130-66.mc.videotron.ca) |
| 05:05:53 | × | nasosev quits (~nasosev@193-116-244-197.tpgi.com.au) (Remote host closed the connection) |
| 05:06:41 | → | [Leary] joins (~Leary]@122-58-224-198-vdsl.sparkbb.co.nz) |
| 05:06:51 | → | nasosev joins (~nasosev@193-116-244-197.tpgi.com.au) |
| 05:11:47 | × | nasosev quits (~nasosev@193-116-244-197.tpgi.com.au) (Ping timeout: 272 seconds) |
| 05:12:57 | × | dextaa quits (~DV@user/dextaa) (Read error: Connection reset by peer) |
| 05:14:06 | → | christiansen joins (~christian@83-95-137-75-dynamic.dk.customer.tdc.net) |
| 05:14:58 | → | dextaa joins (~DV@user/dextaa) |
| 05:21:42 | × | Infinite quits (~Infinite@2405:201:6014:10d3:ad94:e94c:999a:8ee4) (Quit: Client closed) |
| 05:22:33 | × | azimut quits (~azimut@gateway/tor-sasl/azimut) (Ping timeout: 268 seconds) |
| 05:24:42 | → | nasosev joins (~nasosev@193-116-244-197.tpgi.com.au) |
| 05:25:13 | × | nasosev quits (~nasosev@193-116-244-197.tpgi.com.au) (Remote host closed the connection) |
| 05:25:25 | → | nasosev joins (~nasosev@193-116-244-197.tpgi.com.au) |
| 05:29:15 | → | codaraxis__ joins (~codaraxis@user/codaraxis) |
| 05:30:28 | → | yauhsien joins (~yauhsien@61-231-46-226.dynamic-ip.hinet.net) |
| 05:33:10 | × | codaraxis___ quits (~codaraxis@user/codaraxis) (Ping timeout: 244 seconds) |
| 05:36:23 | × | matthewmosior quits (~matthewmo@173.170.253.91) (Ping timeout: 244 seconds) |
| 05:38:10 | × | yauhsien quits (~yauhsien@61-231-46-226.dynamic-ip.hinet.net) (Ping timeout: 240 seconds) |
| 05:44:14 | → | merijn joins (~merijn@c-001-001-023.client.esciencecenter.eduvpn.nl) |
| 05:44:52 | → | Infinite joins (~Infinite@2405:201:6014:10d3:4f78:d3da:1ccc:ed35) |
| 05:44:58 | × | winny quits (~weechat@user/winny) (Remote host closed the connection) |
| 05:45:59 | → | winny joins (~weechat@user/winny) |
| 05:58:30 | × | pgass quits (~pg@190.247.245.154) (Ping timeout: 240 seconds) |
| 05:58:56 | → | kk joins (uid561904@id-561904.hampstead.irccloud.com) |
| 06:00:05 | → | redmp joins (~redmp@mobile-166-170-39-12.mycingular.net) |
| 06:00:05 | × | Vajb quits (~Vajb@n1zigc3rgo9mpde2w-1.v6.elisa-mobile.fi) (Read error: Connection reset by peer) |
| 06:00:22 | → | kenran joins (~kenran@200116b82bf92200fbcfdaca0ff5dcd6.dip.versatel-1u1.de) |
| 06:00:52 | → | Vajb joins (~Vajb@hag-jnsbng11-58c3ad-40.dhcp.inet.fi) |
| 06:01:42 | → | zxx7529 joins (~Thunderbi@user/zxx7529) |
| 06:02:09 | × | kenran quits (~kenran@200116b82bf92200fbcfdaca0ff5dcd6.dip.versatel-1u1.de) (Client Quit) |
| 06:02:22 | × | kmein quits (~weechat@user/kmein) (Quit: ciao kakao) |
| 06:02:23 | → | gleostocha joins (~runic@c-73-15-32-211.hsd1.ca.comcast.net) |
| 06:02:54 | → | kmein joins (~weechat@user/kmein) |
| 06:06:43 | → | matthewmosior joins (~matthewmo@173.170.253.91) |
| 06:07:30 | × | gdown quits (~gavin@h69-11-149-231.kndrid.broadband.dynamic.tds.net) (Remote host closed the connection) |
| 06:09:58 | × | zxx7529 quits (~Thunderbi@user/zxx7529) (Remote host closed the connection) |
| 06:10:10 | → | zxx7529 joins (~Thunderbi@user/zxx7529) |
| 06:11:28 | × | zxx7529 quits (~Thunderbi@user/zxx7529) (Remote host closed the connection) |
| 06:11:40 | → | zxx7529 joins (~Thunderbi@user/zxx7529) |
| 06:11:58 | → | nate4 joins (~nate@98.45.169.16) |
| 06:17:01 | × | nate4 quits (~nate@98.45.169.16) (Ping timeout: 272 seconds) |
| 06:18:29 | × | zxx7529 quits (~Thunderbi@user/zxx7529) (Remote host closed the connection) |
| 06:18:30 | × | merijn quits (~merijn@c-001-001-023.client.esciencecenter.eduvpn.nl) (Ping timeout: 240 seconds) |
| 06:18:42 | → | zxx7529 joins (~Thunderbi@user/zxx7529) |
| 06:23:22 | × | Infinite quits (~Infinite@2405:201:6014:10d3:4f78:d3da:1ccc:ed35) (Ping timeout: 252 seconds) |
| 06:24:42 | <nasosev> | any obvious reason why `cabal repl` does not have tab completion for imported modules ? |
| 06:28:49 | × | zxx7529 quits (~Thunderbi@user/zxx7529) (Remote host closed the connection) |
| 06:29:02 | → | zxx7529 joins (~Thunderbi@user/zxx7529) |
| 06:32:50 | × | nasosev quits (~nasosev@193-116-244-197.tpgi.com.au) (Remote host closed the connection) |
| 06:34:45 | × | stefan-_ quits (~cri@42dots.de) (Ping timeout: 272 seconds) |
| 06:36:12 | → | nasosev joins (~nasosev@193-116-244-197.tpgi.com.au) |
| 06:38:31 | → | stefan-_ joins (~cri@42dots.de) |
| 06:38:37 | → | timothy93 joins (~timothy@202-142-132-25.ca8e84.mel.static.aussiebb.net) |
| 06:40:31 | → | acidjnk joins (~acidjnk@p200300d6e705864588abf31f379d9ca5.dip0.t-ipconnect.de) |
| 06:42:10 | <timothy93> | Hi, can someone help me with something? I've made a stream but interleaving them isn't being lazy: https://paste.tomsmeding.com/9HPAOIJN, `Cons a _ = interleaveStreams (streamRepeat 2) undefined` works, but trying to access a gives me the Prelude.undefined exception. |
| 06:45:09 | × | zxx7529 quits (~Thunderbi@user/zxx7529) (Remote host closed the connection) |
| 06:45:10 | → | takuan joins (~takuan@178-116-218-225.access.telenet.be) |
| 06:45:22 | → | zxx7529 joins (~Thunderbi@user/zxx7529) |
| 06:46:18 | × | winny quits (~weechat@user/winny) (Remote host closed the connection) |
| 06:46:18 | × | califax quits (~califax@user/califx) (Read error: Connection reset by peer) |
| 06:52:59 | × | zxx7529 quits (~Thunderbi@user/zxx7529) (Remote host closed the connection) |
| 06:53:12 | → | zxx7529 joins (~Thunderbi@user/zxx7529) |
| 06:56:59 | × | noteness quits (~noteness@user/noteness) (Remote host closed the connection) |
| 06:59:50 | × | elkcl quits (~elkcl@broadband-37-110-156-162.ip.moscow.rt.ru) (Ping timeout: 240 seconds) |
| 07:10:08 | <c_wraith> | timothy93: you're matching the heads of each stream at the same time. That's stricter than necessary - you could delay matching the head of the second argument until producing the first element. |
| 07:10:15 | <tomsmeding> | nasosev: tab completion for what exactly? Should work in my experience |
| 07:11:47 | <timothy93> | c_wraith: thanks, this works: `interleaveStreams (Cons a s) t = Cons a (interleaveStreams t s)` |
| 07:12:07 | <c_wraith> | that's the usual implementation of that function, yes |
| 07:13:30 | → | califax joins (~califax@user/califx) |
| 07:13:35 | → | noteness joins (~noteness@user/noteness) |
| 07:13:35 | → | winny joins (~weechat@user/winny) |
| 07:14:04 | <nasosev> | tomsmeding: for exaple, I have a module named MyModule and a function that s listed in 'exposed-modules' under 'library' in my cabal file. In the repl, typing 'M' then tab, it is not listed |
| 07:14:34 | <tomsmeding> | Oh completion for _module names_ |
| 07:14:35 | <nasosev> | although other stuff from base appears |
| 07:14:45 | → | merijn joins (~merijn@c-001-001-023.client.esciencecenter.eduvpn.nl) |
| 07:15:37 | <tomsmeding> | Oh ffs my termux cabal doesn't do repl |
| 07:15:56 | <[exa]> | nasosev: just checking -- if you type the rest of the module name and binding manually, the name exists, right? |
| 07:16:04 | <nasosev> | [exa]: yes |
| 07:16:25 | <[exa]> | what ghc version is that? (I'd say it's more of a ghci problem than cabal problem) |
| 07:16:49 | <nasosev> | 9.2.2 |
| 07:18:48 | <nasosev> | it works correctly with `stack ghci` and ghc 9.0.2 |
| 07:19:16 | <nasosev> | (i'm in the process of migrating my project to cabal with 9.2.2) |
| 07:19:49 | <[exa]> | it works here for me with 9.0.2 and cabal |
| 07:19:57 | <[exa]> | let's blame 9.2.2? :] |
| 07:20:05 | <tomsmeding> | nasosev: works for me on ghc 8.10.7, completion gives module names in current project in `cabal repl` |
| 07:20:17 | × | matthewmosior quits (~matthewmo@173.170.253.91) (Ping timeout: 255 seconds) |
| 07:20:19 | <[exa]> | (technically, stack vs cabal choice shouldn't have much influence on the autocompletion) |
| 07:21:57 | <[exa]> | lemme try with 9.2.x |
| 07:22:07 | <nasosev> | i see.not sure I can easily test 9.0.2 cause i just refactored my project to use OverloadedRecordDot |
| 07:22:10 | <nasosev> | ok |
| 07:22:50 | × | mon_aaraj quits (~MonAaraj@user/mon-aaraj/x-4416475) (Ping timeout: 240 seconds) |
| 07:24:24 | × | nasosev quits (~nasosev@193-116-244-197.tpgi.com.au) (Remote host closed the connection) |
| 07:25:02 | → | mon_aaraj joins (~MonAaraj@user/mon-aaraj/x-4416475) |
| 07:25:03 | → | nasosev joins (~nasosev@193-116-244-197.tpgi.com.au) |
| 07:25:40 | <nasosev> | it could also be a problem with my .cabal config ? |
| 07:26:07 | <[exa]> | anything specific that you changed? |
| 07:26:38 | × | acidjnk quits (~acidjnk@p200300d6e705864588abf31f379d9ca5.dip0.t-ipconnect.de) (Ping timeout: 255 seconds) |
| 07:27:11 | <nasosev> | i started a new cabal project with `cabal init`, and i added all the internal modules to library -> exposed modules since they were not there |
| 07:27:20 | <[exa]> | that should be okay |
| 07:27:37 | <nasosev> | I noticed the stack project has a module called 'Paths_projectName', i guess it was generated by stack? is that related |
| 07:28:07 | <nasosev> | did you test it with 9.2.x btw? i got disconected for a minute when my computer fell asleep |
| 07:28:09 | <[exa]> | okay I have 9.2.3 here and MyModule.mything tabs correctly |
| 07:28:22 | <tomsmeding> | It can be generated for any project, stack chooses to do it always, is not related |
| 07:29:07 | → | vglfr joins (~vglfr@88.155.1.22) |
| 07:29:16 | <nasosev> | hmmm... related question, do you know how to get qualified names imported automatically in the repl? i've tried to put 'import My.Module qualified as Module' in my .ghci but it did not work |
| 07:30:18 | <nasosev> | trying to make my repl experience more comfortable... atm i copy and paste a long list of qualified imports from a text file everytime i spin it up |
| 07:30:46 | <phma> | nanosev: I created a stack project called random-ladder, and I get a message "Warning: Multiple files use the same module name: Paths_random_ladder found at the following paths" |
| 07:31:10 | <tomsmeding> | nasosev: why did that not work? Does it work when you write `import qualified My.Module as Module`? |
| 07:31:30 | <phma> | nasosev: any idea what this Paths_ thing is for, or where it is? |
| 07:32:18 | <nasosev> | phma: no idea |
| 07:32:50 | × | redmp quits (~redmp@mobile-166-170-39-12.mycingular.net) (Ping timeout: 240 seconds) |
| 07:33:03 | <tomsmeding> | phma: find .stack-work -name 'Paths_*.hs' |
| 07:33:20 | <tomsmeding> | It's a generated file that contains some metadata about the project |
| 07:33:42 | <nasosev> | tomsmeding: yes when i write the exact same line in the repl it works, but if it's in the .ghci it doesn't |
| 07:33:56 | <tomsmeding> | O.o |
| 07:35:08 | <tomsmeding> | Works for me on 8.10.7, `import qualified Prelude as P` as the only thing in ~/.ghci gives me P.head etc |
| 07:35:34 | <tomsmeding> | Oh wait, cabal repl is bound to interfere |
| 07:35:52 | <nasosev> | my .ghci also has some other stuff in it: https://pastebin.com/raw/cY0SjmDc |
| 07:36:03 | <[exa]> | yeah if I do the import MyModule in 9.2.3 ghci, I get a warning that MyModule doesn't exist (yet) |
| 07:36:12 | <[exa]> | s/warning/error/ |
| 07:36:32 | <tomsmeding> | Oh no that just works |
| 07:37:09 | → | matthewmosior joins (~matthewmo@173.170.253.91) |
| 07:37:16 | <nasosev> | without the other stuff still doesn't work |
| 07:37:35 | <tomsmeding> | Yeah importing modules from the current project in .ghci while using cabal repl runs into the issue that [exa] gave |
| 07:37:51 | <tomsmeding> | The modules are only brought in scope in ghci after .ghci runs |
| 07:38:16 | <tomsmeding> | But you should see a warning/error about that |
| 07:38:27 | <nasosev> | oh yeah, i do get that error too, didn't notice it before |
| 07:38:41 | <[exa]> | nasosev: technically, I usually have a toy module that has all the imports right, and I :load it (which is not a big deal, can be done as :l X if you name the module short :] ) |
| 07:38:44 | <nasosev> | i tried loading the module in my repl with :m + .. and it also did not work |
| 07:38:47 | <phma> | Should stack.yaml.lock be committed to git or ignored? |
| 07:39:34 | <tomsmeding> | phma: https://docs.haskellstack.org/en/stable/lock_files/#lock-files |
| 07:39:37 | <nasosev> | [exa]: actually I tried that, I have a module that imports all the other modules of my project qualified, but it doesn't work |
| 07:40:16 | <nasosev> | e.g. I have a module MyLib, and in it i have a line `import qualified My.Module` |
| 07:40:36 | <[exa]> | nasosev: alternatively you can make your own "correct" load using `:def`, which should work in .ghci |
| 07:40:57 | <nasosev> | sorry -- 'import qualified My.Module as Module' . Then in ghci, If do ":l MyLib", `Module` is not in scope |
| 07:41:06 | <[exa]> | nasosev: https://downloads.haskell.org/ghc/latest/docs/html/users_guide/ghci.html#ghci-cmd-:def |
| 07:41:18 | × | matthewmosior quits (~matthewmo@173.170.253.91) (Ping timeout: 244 seconds) |
| 07:41:36 | <tomsmeding> | :def myload \_ -> return "import qualified My.Module as Module\nimport qualified Prelude as P" |
| 07:41:50 | <[exa]> | I'd go for someting like :def L = return "import MyModule\n ..." yeah tomsmeding was faster. |
| 07:42:16 | → | chomwitt joins (~chomwitt@2a02:587:dc00:5a00:442d:46e5:a654:241a) |
| 07:42:33 | <nasosev> | hm, so if i have 50 modules i want to import I have to list them all after `return "...` |
| 07:42:55 | <[exa]> | you always work with 50 modules? |
| 07:43:08 | <tomsmeding> | This is defining a ghci macro, kinda hacky, so yes |
| 07:43:29 | <[exa]> | like technically the macro can perfectly read the module list from a file :D |
| 07:43:42 | <tomsmeding> | :p it's just haskell |
| 07:44:03 | <tomsmeding> | :def myload \_ -> readFile "imports.txt" |
| 07:44:22 | <nasosev> | yeah i want everything available in the repl with the qualified names |
| 07:44:32 | <nasosev> | tomsmeding: ok that is cool i'll try it |
| 07:44:46 | <nasosev> | i guess i'm trying to workaround this limitation https://stackoverflow.com/questions/4385195/re-export-qualified |
| 07:45:16 | <tomsmeding> | :def source readFile |
| 07:45:56 | × | xff0x quits (~xff0x@2405:6580:b080:900:df60:d63b:15e3:9245) (Ping timeout: 244 seconds) |
| 07:49:10 | × | merijn quits (~merijn@c-001-001-023.client.esciencecenter.eduvpn.nl) (Ping timeout: 240 seconds) |
| 07:49:15 | <nasosev> | Ok, I get errors "could not load module.... memember of hidden package [myproject]..perhaps you need to add it to build-depends" |
| 07:49:45 | <nasosev> | i tried doing that but got other errors.. i guess the project cannot depend on itself ? :) |
| 07:50:07 | × | wootehfoot quits (~wootehfoo@user/wootehfoot) (Ping timeout: 272 seconds) |
| 07:50:55 | × | noteness quits (~noteness@user/noteness) (Remote host closed the connection) |
| 07:51:17 | → | noteness joins (~noteness@user/noteness) |
| 07:53:33 | × | bitdex quits (~bitdex@gateway/tor-sasl/bitdex) (Remote host closed the connection) |
| 07:54:35 | <tomsmeding> | nasosev: a project depending on itself is a contradiction |
| 07:54:45 | <tomsmeding> | You mean a different component in thr same cabal file? |
| 07:54:57 | <tomsmeding> | Cabal repl can only load one component at a time into the repl |
| 07:55:09 | <tomsmeding> | Hm, though importing should work |
| 07:55:22 | → | bitdex joins (~bitdex@gateway/tor-sasl/bitdex) |
| 07:55:27 | <nasosev> | i mean, when i did what you suggested, when the repl boots up it complains that hte modules in my imports.txt are member of the hidden package [myprojectname] |
| 07:56:11 | <tomsmeding> | nasosev: my suggestion was putting that :def in .ghci, and then manually running :myload after ghci has come up and your project has been loaded |
| 07:56:31 | <nasosev> | oh, my bad, i put :myload in the .ghci file |
| 07:56:38 | <tomsmeding> | Calling :myload in .ghci is useless because then you could've just listed the imports there anyway -- which is the same as before :p |
| 07:57:08 | <tomsmeding> | The point is that _first_ .ghci is loaded, _then_ the project is brought into scope, _then_ the interactive shell is started |
| 07:57:09 | <nasosev> | tomsmeding: ok that works great! sorry i was stupid |
| 07:57:20 | × | noteness quits (~noteness@user/noteness) (Ping timeout: 268 seconds) |
| 07:57:50 | × | zxx7529 quits (~Thunderbi@user/zxx7529) (Ping timeout: 240 seconds) |
| 07:58:30 | <nasosev> | and even better -- somehow this fixed the autocomplete issue as well! after I do :myload, all the qualified names are available in autocomplete |
| 07:58:44 | → | xff0x joins (~xff0x@2405:6580:b080:900:1300:28ff:6b85:b3ee) |
| 07:58:49 | <nasosev> | thank u everyone |
| 07:58:50 | × | vglfr quits (~vglfr@88.155.1.22) (Ping timeout: 240 seconds) |
| 07:59:24 | <tomsmeding> | Ah, so they weren't even imported in the first place :) |
| 07:59:25 | <tomsmeding> | Nice |
| 07:59:56 | <tomsmeding> | Glad that it works :) |
| 08:00:05 | <nasosev> | :) |
| 08:00:25 | <tomsmeding> | I just checked -- ghci has a command line flag to ad hoc load another .ghci file into the repl, but that also gets loaded before cabal loads in the modules |
| 08:00:29 | <tomsmeding> | So doesn't help here |
| 08:00:56 | × | califax quits (~califax@user/califx) (Remote host closed the connection) |
| 08:00:56 | × | adanwan quits (~adanwan@gateway/tor-sasl/adanwan) (Remote host closed the connection) |
| 08:01:16 | → | califax joins (~califax@user/califx) |
| 08:01:29 | → | adanwan joins (~adanwan@gateway/tor-sasl/adanwan) |
| 08:04:07 | × | winny quits (~weechat@user/winny) (Remote host closed the connection) |
| 08:04:34 | → | winny joins (~weechat@user/winny) |
| 08:07:08 | × | eggplantade quits (~Eggplanta@2600:1700:bef1:5e10:5546:a014:fe40:2124) (Remote host closed the connection) |
| 08:09:21 | → | _ht joins (~quassel@231-169-21-31.ftth.glasoperator.nl) |
| 08:10:32 | → | wootehfoot joins (~wootehfoo@user/wootehfoot) |
| 08:11:48 | → | matthewmosior joins (~matthewmo@173.170.253.91) |
| 08:15:24 | × | jmdaemon quits (~jmdaemon@user/jmdaemon) (Ping timeout: 244 seconds) |
| 08:16:02 | × | matthewmosior quits (~matthewmo@173.170.253.91) (Ping timeout: 244 seconds) |
| 08:17:10 | × | myme1 quits (~myme@2a01:799:d5a:cd00:ae2e:877c:9fc6:a159) (Ping timeout: 272 seconds) |
| 08:17:50 | → | myme1 joins (~myme@2a01:799:d5a:cd00:bd43:77d0:4f58:e98) |
| 08:20:18 | → | Tuplanolla joins (~Tuplanoll@91-159-69-97.elisa-laajakaista.fi) |
| 08:21:01 | <nasosev> | another question about defining stuff in .ghci: I want my pretty-simple printer to use the compact option by default. currently i have pretty-simple loaded with this .ghci file: https://pastebin.com/raw/cY0SjmDc |
| 08:22:13 | <nasosev> | the compact mode is activated by calling "pPrintStringOpt CheckColorTty defaultOutputOptionsDarkBg {outputOptionsCompact = True}", but when i put that in .ghci and load the repl, it does not work and prints a message: "Some flags have not been recognized: CheckColorTty, defaultOutputOptionsDarkBg, {outputOptionsCompact, =, True}" |
| 08:22:20 | × | timothy93 quits (~timothy@202-142-132-25.ca8e84.mel.static.aussiebb.net) (Quit: Client closed) |
| 08:22:46 | <nasosev> | with the definition in the .ghci .... :def! pretty \ _ -> pure ":set -interactive-print Text.Pretty.Simple.pPrintStringOpt CheckColorTty defaultOutputOptionsDarkBg {outputOptionsCompact = True}" |
| 08:23:03 | <tomsmeding> | I think -interactive-print just wants a single identifier |
| 08:24:49 | <nasosev> | i had tried defining "printCompact = :def! pretty \ _ -> pure ":set -interactive-print Text.Pretty.Simple.pPrintStringOpt CheckColorTty defaultOutputOptionsDarkBg {outputOptionsCompact = True}" in my project before, but now i understand why that won't work since .ghci loads before project |
| 08:24:53 | <tomsmeding> | Yeah, user guide confirms that |
| 08:25:15 | <nasosev> | typo: printCompact = Text.Pretty.Simple.pPrintStringOpt CheckColorTty defaultOutputOptionsDarkBg {outputOptionsCompact = True} |
| 08:25:48 | → | fr33domlover joins (~fr33@bzq-79-178-75-11.red.bezeqint.net) |
| 08:25:51 | × | fr33domlover quits (~fr33@bzq-79-178-75-11.red.bezeqint.net) (Client Quit) |
| 08:26:21 | <tomsmeding> | Write your own package that exports precisely the function you want, install it, and load it in .ghci just like you load pretty-simple? :') |
| 08:26:26 | <tomsmeding> | This is not very ergonomic |
| 08:26:48 | → | fr33domlover joins (~fr33@bzq-79-178-75-11.red.bezeqint.net) |
| 08:27:40 | <tomsmeding> | Ghci is basically a surprisingly effective collection of hacks |
| 08:28:11 | <tomsmeding> | Perhaps that doesn't do justice to those working on ghci, sorry |
| 08:28:17 | × | Vajb quits (~Vajb@hag-jnsbng11-58c3ad-40.dhcp.inet.fi) (Read error: Connection reset by peer) |
| 08:28:34 | <tomsmeding> | But a bunch of things certainly look like they could be more elegant in design (backwards-incompatibly) |
| 08:28:42 | → | noteness joins (~noteness@user/noteness) |
| 08:28:58 | → | Vajb joins (~Vajb@n1zigc3rgo9mpde2w-1.v6.elisa-mobile.fi) |
| 08:31:27 | <nasosev> | hmm, ok! |
| 08:41:06 | <nasosev> | i tried this, but does not work: |
| 08:41:11 | <nasosev> | :m + Text.Pretty.Simple |
| 08:41:11 | <nasosev> | :def printCompact \ _ -> pure "printCompact = Text.Pretty.Simple.pPrintStringOpt CheckColorTty defaultOutputOptionsDarkBg {outputOptionsCompact = True}" |
| 08:41:11 | <nasosev> | :printCompact |
| 08:41:13 | <nasosev> | :def! pretty \ _ -> pure ":set -interactive-print printCompact" |
| 08:44:49 | × | hyiltiz quits (~quassel@31.220.5.250) (Quit: hyiltiz) |
| 08:45:19 | → | merijn joins (~merijn@c-001-001-023.client.esciencecenter.eduvpn.nl) |
| 08:45:24 | → | matthewmosior joins (~matthewmo@173.170.253.91) |
| 08:45:51 | → | nate4 joins (~nate@98.45.169.16) |
| 08:50:30 | × | nate4 quits (~nate@98.45.169.16) (Ping timeout: 240 seconds) |
| 08:53:57 | → | hyiltiz joins (~quassel@31.220.5.250) |
| 08:55:48 | <tomsmeding> | Are you putting this in .ghci? |
| 08:56:17 | <tomsmeding> | nasosev: local definitions in ghci, like your printCompact is, get lost on a :reload |
| 08:56:41 | <tomsmeding> | Hence the suggestion of putting it in a package :p |
| 08:56:50 | <tomsmeding> | % a = 42 |
| 08:56:50 | <yahb2> | <no output> |
| 08:56:52 | <tomsmeding> | % a |
| 08:56:53 | <yahb2> | 42 |
| 08:56:56 | <tomsmeding> | % :r |
| 08:56:56 | <yahb2> | Ok, one module loaded. |
| 08:56:58 | <tomsmeding> | % a |
| 08:56:58 | <yahb2> | <interactive>:166:1: error: Variable not in scope: a |
| 08:58:15 | <nasosev> | ohhh i see, damn. so ideally the maintainer of pretty-simple should make the compact option a single identifier |
| 08:59:27 | <nasosev> | putting it in a packag edoesn't seem like a good long term option, as i would have to keep it up to date manually? |
| 08:59:54 | <tomsmeding> | Yes to both, though there's not much to be kept up to date :D |
| 09:00:17 | <tomsmeding> | Unless pretty-simple updates and you want functionality from the new version |
| 09:00:47 | <tomsmeding> | Hm, not shre what happens if the local project uses a newer version of pretty-simple than the suggested ad hoc library does... |
| 09:00:51 | <tomsmeding> | *sure |
| 09:03:30 | × | tzh quits (~tzh@c-24-21-73-154.hsd1.or.comcast.net) (Quit: zzz) |
| 09:03:55 | → | gmg joins (~user@user/gehmehgeh) |
| 09:04:57 | → | acidjnk joins (~acidjnk@p200300d6e705864588abf31f379d9ca5.dip0.t-ipconnect.de) |
| 09:07:00 | × | wootehfoot quits (~wootehfoo@user/wootehfoot) (Ping timeout: 268 seconds) |
| 09:07:31 | → | eggplantade joins (~Eggplanta@2600:1700:bef1:5e10:5546:a014:fe40:2124) |
| 09:09:53 | → | wootehfoot joins (~wootehfoo@user/wootehfoot) |
| 09:10:51 | × | wbntdodt^ quits (~wbntdodt@c-73-207-207-252.hsd1.ga.comcast.net) (Remote host closed the connection) |
| 09:12:16 | × | eggplantade quits (~Eggplanta@2600:1700:bef1:5e10:5546:a014:fe40:2124) (Ping timeout: 272 seconds) |
| 09:13:31 | × | gmg quits (~user@user/gehmehgeh) (Remote host closed the connection) |
| 09:14:13 | → | gmg joins (~user@user/gehmehgeh) |
| 09:16:02 | × | nasosev quits (~nasosev@193-116-244-197.tpgi.com.au) (Remote host closed the connection) |
| 09:16:29 | → | gurkenglas joins (~gurkengla@dslb-002-203-144-112.002.203.pools.vodafone-ip.de) |
| 09:16:35 | → | nasosev joins (~nasosev@193-116-244-197.tpgi.com.au) |
| 09:17:59 | → | coot joins (~coot@213.134.190.95) |
| 09:19:30 | × | merijn quits (~merijn@c-001-001-023.client.esciencecenter.eduvpn.nl) (Ping timeout: 240 seconds) |
| 09:19:40 | → | alternateved joins (~user@staticline-31-183-144-54.toya.net.pl) |
| 09:20:19 | → | cfricke joins (~cfricke@user/cfricke) |
| 09:20:34 | × | chomwitt quits (~chomwitt@2a02:587:dc00:5a00:442d:46e5:a654:241a) (Ping timeout: 268 seconds) |
| 09:24:27 | → | epolanski joins (uid312403@id-312403.helmsley.irccloud.com) |
| 09:25:07 | × | cfricke quits (~cfricke@user/cfricke) (Ping timeout: 272 seconds) |
| 09:27:54 | × | nasosev quits (~nasosev@193-116-244-197.tpgi.com.au) (Ping timeout: 276 seconds) |
| 09:30:00 | → | nasosev joins (~nasosev@193-116-244-197.tpgi.com.au) |
| 09:30:36 | × | dextaa quits (~DV@user/dextaa) (Read error: Connection reset by peer) |
| 09:32:19 | → | dextaa joins (~DV@user/dextaa) |
| 09:33:58 | → | mmhat joins (~mmh@p200300f1c70559c1ee086bfffe095315.dip0.t-ipconnect.de) |
| 09:36:38 | × | Sgeo quits (~Sgeo@user/sgeo) (Read error: Connection reset by peer) |
| 09:38:51 | <nasosev> | tomsmeding: actually, a nice solution for me is to just put it at the top of my imports.txt file :) |
| 09:39:16 | <tomsmeding> | 👍 |
| 09:40:58 | × | gmg quits (~user@user/gehmehgeh) (Remote host closed the connection) |
| 09:41:03 | × | fr33domlover quits (~fr33@bzq-79-178-75-11.red.bezeqint.net) (Quit: fr33domlover) |
| 09:41:41 | → | gmg joins (~user@user/gehmehgeh) |
| 09:43:38 | <[exa]> | (lovely how autoexec.bat eventually crawls to every platform!) |
| 09:46:45 | <turlando> | I have this function that evolves by recurring with updated values. It has a lot of "state" values. I managed to remove one of the arguments by abstracting it in a state monad. I'd love to abstract in the same way other params as well. Do I need to use StateT in order to avoid nesting of state monads? What's the cleanest/easiest way to do it? |
| 09:47:16 | × | econo quits (uid147250@user/econo) (Quit: Connection closed for inactivity) |
| 09:47:58 | × | wootehfoot quits (~wootehfoo@user/wootehfoot) (Ping timeout: 240 seconds) |
| 09:48:35 | → | zxx7529 joins (~Thunderbi@user/zxx7529) |
| 09:49:56 | × | matthewmosior quits (~matthewmo@173.170.253.91) (Ping timeout: 244 seconds) |
| 09:51:39 | <[exa]> | turlando: better have 1 state monad that holds a type with several fields |
| 09:52:12 | → | wootehfoot joins (~wootehfoo@user/wootehfoot) |
| 09:52:18 | <[exa]> | like, `data MyState = { this :: Int, that :: String }` and then use `State MyState a` as the monad |
| 09:53:40 | × | nasosev quits (~nasosev@193-116-244-197.tpgi.com.au) (Remote host closed the connection) |
| 09:54:10 | × | mon_aaraj quits (~MonAaraj@user/mon-aaraj/x-4416475) (Ping timeout: 240 seconds) |
| 09:54:22 | → | nasosev joins (~nasosev@193-116-244-197.tpgi.com.au) |
| 09:54:32 | <[exa]> | there are nice utility functions that make this quite bearable. You will like `gets` which can be used as `i <- gets this` or `str <- gets that` with the above data |
| 09:54:54 | <turlando> | [exa]: Kinda wanted to avoid that since the fields are quite different: one is a monotonic counter, that I use by binding a «next :: State Int a» function, another is an instance of RandomGen, another is a kind of priority queue. I'd love to keep operations on them separated, not sure if that's a good idea though |
| 09:54:55 | <[exa]> | then there's partial structure updates, `modify $ \s -> s{this=123}` |
| 09:55:10 | × | nasosev quits (~nasosev@193-116-244-197.tpgi.com.au) (Remote host closed the connection) |
| 09:55:22 | → | nasosev joins (~nasosev@193-116-244-197.tpgi.com.au) |
| 09:56:40 | <[exa]> | turlando: technically you won't gain much by separating them physically. But maybe you might want to make a few utility functions that access this for you |
| 09:56:57 | <[exa]> | like, `nextRandom :: State MyState Int` and so |
| 09:58:16 | <[exa]> | this hides the field accesses from the "user" code, and if you later decide to migrate to some other kind of monad (e.g. RWST), you just change the utility functions layer and the rest of the code stays same |
| 09:58:43 | <turlando> | I see, and this way I guess I can keep the "local" utilities I need that operate on the specific state, say the counter, (so I can test and use them individually) and wrap them in the "global" state/record, right? |
| 09:59:39 | <[exa]> | yes. Also, if you need to explicitly make sure your user code can't "break" the monad, just wrap this type in a newtype and write the Functor/Applicative/Monad instances for it (should be trivial) |
| 09:59:58 | <[exa]> | as in `newtype MyMonad a = MyMonad (State MyState a)` |
| 10:00:01 | <turlando> | That's a great tip, thanks |
| 10:00:02 | <[exa]> | (roughly) |
| 10:00:19 | <[exa]> | finally, there's lenses that play veeeeeery well with State |
| 10:00:33 | → | merijn joins (~merijn@c-001-001-023.client.esciencecenter.eduvpn.nl) |
| 10:00:56 | <turlando> | I kinda wanted to stay away from lenses right now, both for mental complexity and for compile time explosion due templatehaskell |
| 10:01:25 | → | mon_aaraj joins (~MonAaraj@user/mon-aaraj/x-4416475) |
| 10:01:40 | × | acidjnk quits (~acidjnk@p200300d6e705864588abf31f379d9ca5.dip0.t-ipconnect.de) (Ping timeout: 272 seconds) |
| 10:02:06 | <[exa]> | it's not that bad with compiletimes tbh, and you don't really need TH, writing lenses manually is easy. In any case you can get roughly this: https://hackage.haskell.org/package/lens-5.1.1/docs/Control-Lens-Operators.html#v:.-61- |
| 10:02:53 | → | matthewmosior joins (~matthewmo@173.170.253.91) |
| 10:03:17 | <[exa]> | anyway, if I guess your usecase right, the wrap+utils approach is probably the best one here |
| 10:03:59 | <turlando> | Thanks for linking that page, I will keep in mind for the future, but right now I don't think that importing lens and all that jazz is justified for what I have to do |
| 10:04:14 | <[exa]> | :] |
| 10:05:08 | <[exa]> | `zoom` is IMO the coolest tool there, e.g. `zoom both` from the example here: https://hackage.haskell.org/package/lens-5.1.1/docs/Control-Lens-Combinators.html#v:zoom |
| 10:08:08 | → | acidjnk joins (~acidjnk@p200300d6e705864588abf31f379d9ca5.dip0.t-ipconnect.de) |
| 10:08:12 | × | mon_aaraj quits (~MonAaraj@user/mon-aaraj/x-4416475) (Ping timeout: 276 seconds) |
| 10:09:11 | × | Player-205[m] quits (~sashaserp@2001:470:69fc:105::2:30b8) (Quit: issued !quit command) |
| 10:09:42 | × | winny quits (~weechat@user/winny) (Remote host closed the connection) |
| 10:09:49 | → | mon_aaraj joins (~MonAaraj@user/mon-aaraj/x-4416475) |
| 10:10:18 | → | winny joins (~weechat@user/winny) |
| 10:13:25 | × | coot quits (~coot@213.134.190.95) (Quit: coot) |
| 10:14:16 | ← | jakalx parts (~jakalx@base.jakalx.net) (Error from remote client) |
| 10:14:40 | × | dextaa quits (~DV@user/dextaa) (Read error: Connection reset by peer) |
| 10:15:50 | × | christiansen quits (~christian@83-95-137-75-dynamic.dk.customer.tdc.net) (Ping timeout: 240 seconds) |
| 10:16:55 | → | dextaa joins (~DV@user/dextaa) |
| 10:18:53 | × | mon_aaraj quits (~MonAaraj@user/mon-aaraj/x-4416475) (Ping timeout: 244 seconds) |
| 10:19:48 | × | OscarZ quits (~oscarz@188.126.80.50) (Quit: Leaving) |
| 10:21:10 | → | mon_aaraj joins (~MonAaraj@user/mon-aaraj/x-4416475) |
| 10:21:29 | → | jakalx joins (~jakalx@base.jakalx.net) |
| 10:28:20 | × | mmhat quits (~mmh@p200300f1c70559c1ee086bfffe095315.dip0.t-ipconnect.de) (Quit: WeeChat 3.6) |
| 10:43:44 | × | mon_aaraj quits (~MonAaraj@user/mon-aaraj/x-4416475) (Ping timeout: 255 seconds) |
| 10:45:35 | → | mon_aaraj joins (~MonAaraj@user/mon-aaraj/x-4416475) |
| 10:50:37 | × | acidjnk quits (~acidjnk@p200300d6e705864588abf31f379d9ca5.dip0.t-ipconnect.de) (Ping timeout: 272 seconds) |
| 10:51:52 | → | chomwitt joins (~chomwitt@2a02:587:dc00:5a00:64ed:563e:8ed6:402) |
| 10:52:00 | → | MajorBiscuit joins (~MajorBisc@2a02-a461-129d-1-6d4c-38a4-18b7-4b48.fixed6.kpn.net) |
| 10:56:08 | × | Cale quits (~cale@cpef48e38ee8583-cm30b7d4b3fc20.cpe.net.cable.rogers.com) (Remote host closed the connection) |
| 10:57:18 | × | chomwitt quits (~chomwitt@2a02:587:dc00:5a00:64ed:563e:8ed6:402) (Ping timeout: 240 seconds) |
| 11:02:08 | × | matthewmosior quits (~matthewmo@173.170.253.91) (Ping timeout: 255 seconds) |
| 11:03:38 | × | dextaa quits (~DV@user/dextaa) (Read error: Connection reset by peer) |
| 11:05:48 | → | dextaa joins (~DV@user/dextaa) |
| 11:07:43 | × | mon_aaraj quits (~MonAaraj@user/mon-aaraj/x-4416475) (Ping timeout: 272 seconds) |
| 11:09:04 | → | mon_aaraj joins (~MonAaraj@user/mon-aaraj/x-4416475) |
| 11:09:28 | → | eggplantade joins (~Eggplanta@2600:1700:bef1:5e10:5546:a014:fe40:2124) |
| 11:09:43 | × | zxx7529 quits (~Thunderbi@user/zxx7529) (Ping timeout: 268 seconds) |
| 11:10:02 | → | justsomeguy joins (~justsomeg@user/justsomeguy) |
| 11:10:39 | × | nasosev quits (~nasosev@193-116-244-197.tpgi.com.au) () |
| 11:10:59 | → | [itchyjunk] joins (~itchyjunk@user/itchyjunk/x-7353470) |
| 11:13:25 | → | elkcl joins (~elkcl@broadband-37-110-156-162.ip.moscow.rt.ru) |
| 11:13:30 | × | mon_aaraj quits (~MonAaraj@user/mon-aaraj/x-4416475) (Ping timeout: 240 seconds) |
| 11:14:03 | × | eggplantade quits (~Eggplanta@2600:1700:bef1:5e10:5546:a014:fe40:2124) (Ping timeout: 272 seconds) |
| 11:15:02 | → | nate4 joins (~nate@98.45.169.16) |
| 11:15:20 | <yuv4199> | Hello! I am new to Dhall, coming from Haskell and really like it for writing configurations. Now, there are `dhall` bindings for Haskell and I was wondering if it is possible to pack an existential type and use it in Haskell. Basically, I would like to have some type class `class Fooable a where foo :: a -> Text` and a type `data Foo = forall a. |
| 11:15:21 | <yuv4199> | Fooable a => Foo a` then I would like to configure values from Dhall: writing `{foo = Natural/show}` in Dhall and read that into a `Foo` from Haskell with `Dhall.input` |
| 11:15:24 | → | mon_aaraj joins (~MonAaraj@user/mon-aaraj/x-4416475) |
| 11:15:43 | → | wbntdodt^ joins (~wbntdodt@c-73-207-207-252.hsd1.ga.comcast.net) |
| 11:16:06 | <yuv4199> | I already asked in #dhall but didn't get an answer and the only thing I could find was this article (https://bkase.dev/posts/data-abstraction-dhall) but I don't think it helps.. |
| 11:20:12 | × | nate4 quits (~nate@98.45.169.16) (Ping timeout: 268 seconds) |
| 11:20:25 | → | frost joins (~frost@user/frost) |
| 11:20:31 | → | matthewmosior joins (~matthewmo@173.170.253.91) |
| 11:22:30 | × | mon_aaraj quits (~MonAaraj@user/mon-aaraj/x-4416475) (Ping timeout: 240 seconds) |
| 11:23:55 | <[exa]> | yuv4199: this looks as very easily impossible. Where precisely you want to pack the existential? Define the existential in Dhall and have Haskell interpret the definitions from the Dhall language? |
| 11:24:33 | × | justsomeguy quits (~justsomeg@user/justsomeguy) (Quit: WeeChat 3.5) |
| 11:24:44 | → | mon_aaraj joins (~MonAaraj@user/mon-aaraj/x-4416475) |
| 11:27:27 | → | chomwitt joins (~chomwitt@2a02:587:dc00:5a00:5e21:fc87:3c21:5fd2) |
| 11:28:39 | <yin> | can something like Typeable or Generics be considered "metaprogramming" in haskell? |
| 11:30:16 | <[exa]> | yuv4199: I'd say it's reflection, which people could categorize in metaprogramming |
| 11:30:26 | <[exa]> | yin: ^ mishighlight, sorry |
| 11:31:03 | × | noteness quits (~noteness@user/noteness) (Remote host closed the connection) |
| 11:31:37 | × | chexum quits (~quassel@gateway/tor-sasl/chexum) (Remote host closed the connection) |
| 11:31:57 | → | noteness joins (~noteness@user/noteness) |
| 11:31:59 | <[exa]> | technically, metaprogramming is "manipulating source by a custom program before running the result" which is what Typeable and Generics dodges using a pretty nice abstraction |
| 11:33:10 | → | chexum joins (~quassel@gateway/tor-sasl/chexum) |
| 11:33:38 | <[exa]> | the current implementation gives a very rich description of your datatypes to your program to play with them, but unless you throw it to TemplateHaskell, you do not really manipulate and create the source code by your program |
| 11:33:59 | <yuv4199> | exa: yeah, the idea would be to unpack and interpret within Haskell. I wouldn't mind using TH or write some Generics instances. |
| 11:34:08 | <yin> | yeah usually it's moving computations from runtime to compile time but all this happening at the type level, and types being otherwise erased before runtime |
| 11:34:26 | <yin> | it feels loke it's the other way around |
| 11:34:51 | <[exa]> | yin: do you have some tiny usecase or something, just to materialize the idea? |
| 11:35:18 | <yin> | not at all. just a random thought |
| 11:36:35 | <[exa]> | ah okay. well, my 50 cent: 1] you can certainly translate whatever Dhall to Haskell code and generate programs from that using TemplateHaskell but I wouldn't say it's going to give you a very transparent system in the end |
| 11:37:56 | <[exa]> | 2] unless you need the result to be magically fast (i.e., benefit from ghc optimizations or something), I'd just suggest trying to reuse the dhall evaluation functions to make a smal interpreter in Haskell and use it instead of the existentials |
| 11:38:35 | × | mon_aaraj quits (~MonAaraj@user/mon-aaraj/x-4416475) (Ping timeout: 260 seconds) |
| 11:39:30 | × | arahael quits (~arahael@121-44-2-189.tpgi.com.au) (Ping timeout: 240 seconds) |
| 11:39:45 | <[exa]> | like, your "Foo" above is basically "a packed program that generates Text". You can almost equivalently have "A source of a program that generates Text". |
| 11:40:20 | → | zxx7529 joins (~Thunderbi@user/zxx7529) |
| 11:40:34 | → | mon_aaraj joins (~MonAaraj@user/mon-aaraj/x-4416475) |
| 11:44:36 | × | zxx7529 quits (~Thunderbi@user/zxx7529) (Remote host closed the connection) |
| 11:44:37 | <yuv4199> | In my usecase it would stay a function though, what I really would want to pass to Haskell is two functions `A -> T` and `U -> A` |
| 11:44:37 | <yuv4199> | for fix `T` and `U`. I guess I could leave those as is, read with TH and pack them but it wouldn't be transparent like you said. Initially I wanted to pass something like `{handlers : List Foo, ...}` |
| 11:44:50 | → | zxx7529 joins (~Thunderbi@user/zxx7529) |
| 11:44:53 | × | adanwan quits (~adanwan@gateway/tor-sasl/adanwan) (Ping timeout: 268 seconds) |
| 11:45:00 | <[exa]> | oh whoops looks like I confused the answer from yin with your answer, sorry :D |
| 11:45:22 | → | adanwan joins (~adanwan@gateway/tor-sasl/adanwan) |
| 11:46:25 | <[exa]> | y[tab] didn't really help. |
| 11:47:05 | <[exa]> | yuv4199: so you'd code the 2 functions in Dhall, and have the Haskell program work with them somehow, right? |
| 11:48:25 | <yuv4199> | Exactly, yeah |
| 11:48:27 | <[exa]> | yin: with Generics it's like exposing enough information about the types that ghc can compile the code that works over the generic information to something that looks like you'd write it manually or produce it with TemplateHaskell. But without metaprogramming and TemplateHaskell. |
| 11:51:19 | <[exa]> | yuv4199: you might hit a bit of a conceptual wall there, Dhall is supposed to produce the "json-like structure", which doesn't really describe functions well. You might need to use the Dhall library code in a slightly nonstandard way to get the functions out nicely |
| 11:52:06 | <[exa]> | (possible reduction to a more tangible problem: how do you put a dhall function into json?) |
| 11:53:52 | <yuv4199> | Ah, wait. If that is not possible then I can forget it - yeah. I am quite new to Dhall, so I was not aware of that limitation. I assumed that'd work since I can write records containing functions (though I did not yet try to use them from within Haskell) |
| 11:54:03 | → | arahael joins (~arahael@14-200-134-141.tpgi.com.au) |
| 11:55:08 | <[exa]> | yeah if you want the "standard behavior dhall", you certainly should think how to encode the information into json. :] |
| 11:56:56 | <yuv4199> | Oh, okay but it works. I just tested this: `f <- input auto "./f.dhall`; print @Text (f (101 :: Natural))` with `f.dhall` containing `Natural/show`, so we can pass functions from Dhall to Haskell and evaluate them there |
| 11:57:04 | <yuv4199> | So that shouldn't be a limitation. |
| 12:00:08 | <[exa]> | oh good so it's got its own nice transparent interpreter |
| 12:01:00 | <[exa]> | lovely https://hackage.haskell.org/package/dhall-1.41.1/docs/Dhall-Marshal-Decode.html#g:8 |
| 12:04:17 | × | MajorBiscuit quits (~MajorBisc@2a02-a461-129d-1-6d4c-38a4-18b7-4b48.fixed6.kpn.net) (Ping timeout: 244 seconds) |
| 12:06:00 | → | mrmr joins (~mrmr@user/mrmr) |
| 12:16:20 | × | FinnElija quits (~finn_elij@user/finn-elija/x-0085643) (Ping timeout: 268 seconds) |
| 12:18:09 | → | FinnElija joins (~finn_elij@user/finn-elija/x-0085643) |
| 12:20:33 | × | mon_aaraj quits (~MonAaraj@user/mon-aaraj/x-4416475) (Ping timeout: 272 seconds) |
| 12:21:59 | → | mon_aaraj joins (~MonAaraj@user/mon-aaraj/x-4416475) |
| 12:24:56 | × | matthewmosior quits (~matthewmo@173.170.253.91) (Ping timeout: 244 seconds) |
| 12:25:53 | × | chomwitt quits (~chomwitt@2a02:587:dc00:5a00:5e21:fc87:3c21:5fd2) (Ping timeout: 255 seconds) |
| 12:33:55 | → | bitmapper joins (uid464869@id-464869.lymington.irccloud.com) |
| 12:38:37 | × | zxx7529 quits (~Thunderbi@user/zxx7529) (Remote host closed the connection) |
| 12:38:51 | → | zxx7529 joins (~Thunderbi@user/zxx7529) |
| 12:40:47 | × | zxx7529 quits (~Thunderbi@user/zxx7529) (Remote host closed the connection) |
| 12:41:00 | → | zxx7529 joins (~Thunderbi@user/zxx7529) |
| 12:42:16 | → | nasosev joins (~nasosev@193-116-244-197.tpgi.com.au) |
| 12:43:02 | × | GoldsteinQ quits (~goldstein@goldstein.rs) (Ping timeout: 244 seconds) |
| 12:50:48 | × | zxx7529 quits (~Thunderbi@user/zxx7529) (Remote host closed the connection) |
| 12:51:01 | → | zxx7529 joins (~Thunderbi@user/zxx7529) |
| 12:53:02 | × | nasosev quits (~nasosev@193-116-244-197.tpgi.com.au) (Remote host closed the connection) |
| 12:53:35 | → | nasosev joins (~nasosev@193-116-244-197.tpgi.com.au) |
| 12:54:35 | → | matthewmosior joins (~matthewmo@173.170.253.91) |
| 12:55:08 | × | img quits (~img@user/img) (Quit: ZNC 1.8.2 - https://znc.in) |
| 12:56:27 | × | iteratee quits (~kyle@162.218.222.107) (Read error: Connection reset by peer) |
| 12:56:28 | × | mon_aaraj quits (~MonAaraj@user/mon-aaraj/x-4416475) (Ping timeout: 272 seconds) |
| 12:58:05 | → | img joins (~img@user/img) |
| 12:58:19 | → | mon_aaraj joins (~MonAaraj@user/mon-aaraj/x-4416475) |
| 12:59:01 | → | iteratee joins (~kyle@162.218.222.107) |
| 12:59:29 | × | nasosev quits (~nasosev@193-116-244-197.tpgi.com.au) (Ping timeout: 268 seconds) |
| 13:04:26 | × | adanwan quits (~adanwan@gateway/tor-sasl/adanwan) (Ping timeout: 268 seconds) |
| 13:04:38 | → | adanwan_ joins (~adanwan@gateway/tor-sasl/adanwan) |
| 13:05:09 | → | nasosev joins (~nasosev@193-116-244-197.tpgi.com.au) |
| 13:05:22 | × | nasosev quits (~nasosev@193-116-244-197.tpgi.com.au) (Client Quit) |
| 13:06:57 | × | mon_aaraj quits (~MonAaraj@user/mon-aaraj/x-4416475) (Ping timeout: 276 seconds) |
| 13:08:04 | × | img quits (~img@user/img) (Quit: ZNC 1.8.2 - https://znc.in) |
| 13:08:47 | → | mon_aaraj joins (~MonAaraj@user/mon-aaraj/x-4416475) |
| 13:10:59 | → | img joins (~img@user/img) |
| 13:11:11 | → | eggplantade joins (~Eggplanta@2600:1700:bef1:5e10:5546:a014:fe40:2124) |
| 13:11:39 | → | christiansen joins (~christian@83-95-137-75-dynamic.dk.customer.tdc.net) |
| 13:13:07 | → | pretty_dumm_guy joins (trottel@gateway/vpn/protonvpn/prettydummguy/x-88029655) |
| 13:15:35 | × | eggplantade quits (~Eggplanta@2600:1700:bef1:5e10:5546:a014:fe40:2124) (Ping timeout: 244 seconds) |
| 13:16:24 | → | jao joins (~jao@cpc103048-sgyl39-2-0-cust502.18-2.cable.virginm.net) |
| 13:26:16 | → | jargon joins (~jargon@184.101.188.251) |
| 13:32:08 | × | zxx7529 quits (~Thunderbi@user/zxx7529) (Remote host closed the connection) |
| 13:32:22 | → | zxx7529 joins (~Thunderbi@user/zxx7529) |
| 13:33:59 | × | zxx7529 quits (~Thunderbi@user/zxx7529) (Remote host closed the connection) |
| 13:34:10 | → | zxx7529 joins (~Thunderbi@user/zxx7529) |
| 13:35:09 | × | adanwan_ quits (~adanwan@gateway/tor-sasl/adanwan) (Remote host closed the connection) |
| 13:36:08 | × | zxx7529 quits (~Thunderbi@user/zxx7529) (Remote host closed the connection) |
| 13:37:35 | → | adanwan joins (~adanwan@gateway/tor-sasl/adanwan) |
| 13:38:17 | → | zxx7529 joins (~Thunderbi@user/zxx7529) |
| 13:38:20 | × | FinnElija quits (~finn_elij@user/finn-elija/x-0085643) (Remote host closed the connection) |
| 13:39:08 | → | FinnElija joins (~finn_elij@user/finn-elija/x-0085643) |
| 13:39:25 | → | chomwitt joins (~chomwitt@2a02:587:dc00:5a00:c8e4:ebdd:c459:66df) |
| 13:51:34 | × | jargon quits (~jargon@184.101.188.251) (Remote host closed the connection) |
| 13:55:58 | × | mon_aaraj quits (~MonAaraj@user/mon-aaraj/x-4416475) (Ping timeout: 240 seconds) |
| 13:57:56 | → | pgass joins (~pg@190.247.245.154) |
| 13:58:13 | → | mon_aaraj joins (~MonAaraj@user/mon-aaraj/x-4416475) |
| 13:58:35 | × | matthewmosior quits (~matthewmo@173.170.253.91) (Ping timeout: 244 seconds) |
| 14:03:05 | × | zxx7529 quits (~Thunderbi@user/zxx7529) (Remote host closed the connection) |
| 14:03:15 | <[itchyjunk]> | I am having issue understanding this problem statement. https://bpa.st/QDLQ |
| 14:03:19 | → | zxx7529 joins (~Thunderbi@user/zxx7529) |
| 14:03:38 | <[itchyjunk]> | so this list can contain ints or strings. i am to identify ints, sum them up and return? |
| 14:03:52 | <[itchyjunk]> | "as if all were numbers" |
| 14:04:03 | <[itchyjunk]> | i don't get that part |
| 14:04:39 | <tomsmeding> | [itchyjunk]: underspecified |
| 14:04:48 | <tomsmeding> | But sounds like [Either String Int] -> Int |
| 14:05:01 | <tomsmeding> | Or perhaps Num a => [Either String a] -> a |
| 14:05:12 | <tomsmeding> | Which might actually be more appropriate |
| 14:05:13 | <[itchyjunk]> | yes they give one line of code to start with which says : |
| 14:05:14 | <[itchyjunk]> | sumMix :: [Either String Int] -> Int |
| 14:05:17 | <tomsmeding> | Ah |
| 14:05:32 | <tomsmeding> | sum . map (either read id) |
| 14:06:01 | <[itchyjunk]> | oh google is telling me Either is like the `Maybe` thingy, right? |
| 14:06:03 | <geekosaur> | that sums them all, sounds like they want just the Ints? |
| 14:06:10 | <[itchyjunk]> | So i have left a or right a |
| 14:06:20 | <[itchyjunk]> | oh, is it just ints? hmm |
| 14:06:25 | <geekosaur> | filter out the Rights and sum them |
| 14:06:53 | <[itchyjunk]> | It's Rights just because of the ordering that says Either String Int? |
| 14:07:05 | <geekosaur> | mm, I guess that raises the question of what "filter out" means 🙂 |
| 14:07:06 | <[itchyjunk]> | If it was Either Int String, i would be lefts, correct? |
| 14:07:12 | <geekosaur> | yes |
| 14:07:16 | <[itchyjunk]> | that it does :x |
| 14:07:35 | <geekosaur> | but if it saus "identify ints, sum them up" then you want whichever side has the Ints |
| 14:08:05 | <tomsmeding> | geekosaur: nothing so well-defined https://bpa.st/QDLQ |
| 14:08:06 | <[itchyjunk]> | so from some list, i can extract each element (x:xs). now if Right x then i want to sum this but if it's Left x i want to ignore it |
| 14:08:25 | <[itchyjunk]> | "return the sum of the array values as if all were numbers." |
| 14:08:32 | <[itchyjunk]> | why does it say "as if all were numbers"? |
| 14:08:44 | <geekosaur> | because I went by your description, which was wrong |
| 14:09:00 | <geekosaur> | tomsmeding had it right, you need to convert the Strings to numbers |
| 14:09:08 | <geekosaur> | not just ignore them |
| 14:09:22 | <[itchyjunk]> | hmmmmm |
| 14:09:24 | <geekosaur> | (which assumes the Strings contain String representations of numbers, but) |
| 14:09:58 | <[itchyjunk]> | i'll think about this a bit more i guess |
| 14:11:01 | <geekosaur> | tomsmeding already gave you the answer (which was probably a bad idea) |
| 14:11:17 | <tomsmeding> | (maybe, sorry) |
| 14:12:16 | × | zxx7529 quits (~Thunderbi@user/zxx7529) (Remote host closed the connection) |
| 14:14:21 | <geekosaur> | anyway the key here is you want something that does one thing if it's a Left and something else if it's a Right. you should have been shown something that fits that description already |
| 14:14:27 | → | ulvarref` joins (~user@188.124.56.153) |
| 14:14:52 | → | nate4 joins (~nate@98.45.169.16) |
| 14:15:38 | × | frost quits (~frost@user/frost) (Ping timeout: 252 seconds) |
| 14:16:05 | × | ulvarrefr quits (~user@185.24.53.152) (Ping timeout: 260 seconds) |
| 14:20:10 | × | nate4 quits (~nate@98.45.169.16) (Ping timeout: 260 seconds) |
| 14:24:38 | × | mon_aaraj quits (~MonAaraj@user/mon-aaraj/x-4416475) (Ping timeout: 240 seconds) |
| 14:26:01 | → | mimmy joins (~mimmy@38.126.149.170) |
| 14:26:58 | → | mon_aaraj joins (~MonAaraj@user/mon-aaraj/x-4416475) |
| 14:27:36 | → | matthewmosior joins (~matthewmo@173.170.253.91) |
| 14:33:06 | → | n0den1te joins (~n0den1te@182.77.107.91) |
| 14:35:16 | × | n0den1te quits (~n0den1te@182.77.107.91) (Quit: leaving) |
| 14:37:05 | → | Haskelytic joins (~Haskelyti@118.179.211.17) |
| 14:39:17 | × | wbntdodt^ quits (~wbntdodt@c-73-207-207-252.hsd1.ga.comcast.net) (Ping timeout: 244 seconds) |
| 14:48:04 | → | brence joins (~brence@2a01:4b00:895f:3d00:ccf8:b008:7015:50b0) |
| 14:49:10 | <brence> | can we have a Num instance for primitive types (Int# etc.)? |
| 14:49:27 | <geekosaur> | not currently |
| 14:49:34 | <geekosaur> | there's been some discussion about it |
| 14:49:44 | <tomsmeding> | :k Num |
| 14:49:45 | <lambdabot> | * -> Constraint |
| 14:49:53 | <tomsmeding> | :k Int# |
| 14:49:55 | <lambdabot> | error: |
| 14:49:55 | <lambdabot> | Not in scope: type constructor or class ‘Int#’ |
| 14:49:55 | <lambdabot> | Perhaps you meant one of these: |
| 14:50:21 | <merijn> | brence: Unboxed types have a different kind than boxed types |
| 14:50:43 | <merijn> | Which, as tomsmeding attempted to show, doesn't match the kind signature of the Num class |
| 14:50:46 | <geekosaur> | iirc there are more fundamental issues than that |
| 14:50:56 | <tomsmeding> | % :k Int# |
| 14:50:56 | <yahb2> | Int# :: TYPE 'IntRep |
| 14:51:00 | <brence> | Ah, I see thanks |
| 14:51:18 | <tomsmeding> | % :k Int |
| 14:51:18 | <yahb2> | Int :: * |
| 14:51:21 | <merijn> | geekosaur: Like? |
| 14:51:37 | <brence> | geekosaur: the discussions were about making Num levity polymorphic? |
| 14:51:50 | × | euandreh quits (~euandreh@189.6.33.250) (Ping timeout: 240 seconds) |
| 14:52:00 | <merijn> | brence: That would make the class look horrifically complex for beginners, though |
| 14:52:13 | <brence> | yeah, I agree |
| 14:52:38 | <geekosaur> | it should in theory be possible to rephrase Num such that be levity polymorphic, but it would introduce other issues. I'm looking for the discussion |
| 14:54:46 | <brence> | Does GHC -O2 replace Int with Int# and (+) with (+#) when it's an obvious optimization? |
| 14:54:54 | <tomsmeding> | https://play-haskell.tomsmeding.com/play/paste/FJsVvd8M/1 |
| 14:55:08 | <merijn> | brence: The strictness analyzer tries to do that where possible, yes |
| 14:55:16 | <geekosaur> | brence, if it can determine strictness, yes |
| 14:55:16 | <tomsmeding> | brence: also look up the worker-wrapper optimisation |
| 14:55:58 | <merijn> | brence: In fact, this is why the pedantic distinction between "Haskell is non-strict" (i.e. *not* lazy!) and "Haskell is lazy" matters |
| 14:56:43 | <tomsmeding> | (And `UNum LiftedRep Int` also results in a valid instance in that paste) |
| 14:57:09 | <merijn> | brence: If Haskell was defined as lazy, making code strict like that would violate the semantics. By specifying "non-strict" (i.e. "it should work, if it works when the code is lazy") means that GHC is allowed to make code strict IFF it knows for sure making it strict does not break anything |
| 14:57:15 | <tomsmeding> | merijn: "haskell is at least as defined as lazy evaluation"? |
| 14:57:39 | <tomsmeding> | What you said :p |
| 14:59:40 | × | dextaa quits (~DV@user/dextaa) (Read error: Connection reset by peer) |
| 14:59:43 | <geekosaur> | brence, someone asked the same thing you did (making Num levity polymorphic) |
| 14:59:59 | <geekosaur> | I think it was in #ghc, but I started out by checking the mailing lists |
| 15:01:52 | → | dextaa joins (~DV@user/dextaa) |
| 15:02:14 | <tomsmeding> | Didn't edwardk also do stuff with unlifted types in type classes |
| 15:02:30 | <merijn> | Probably |
| 15:02:42 | × | dextaa quits (~DV@user/dextaa) (Read error: Connection reset by peer) |
| 15:02:50 | <merijn> | Isn't the answer to "didn't edwardk also do X?" always "probably"? :p |
| 15:03:11 | <geekosaur> | "No variable may have a levity-polymorphic type." |
| 15:03:22 | <geekosaur> | (tyvars, iirc) |
| 15:03:41 | <geekosaur> | so as yet you can't really use levity polymorphism in a lot of places |
| 15:04:41 | <geekosaur> | I think this includes classes with instances of different levities |
| 15:04:59 | → | dextaa joins (~DV@user/dextaa) |
| 15:05:12 | <geekosaur> | so maybe you can't have levity polymorphic Num after all |
| 15:06:18 | <brence> | geekosaur: isn't that what tomsmeding did in the paste? |
| 15:06:24 | <tomsmeding> | geekosaur: edited version of the paste above: https://play-haskell.tomsmeding.com/play/paste/Es18J95w/1 |
| 15:06:31 | <geekosaur> | (the strictness analyzer runs after typechecking, so it's allowed to switch levity) |
| 15:07:19 | × | dextaa quits (~DV@user/dextaa) (Read error: Connection reset by peer) |
| 15:07:20 | <geekosaur> | huh |
| 15:07:31 | <tomsmeding> | 8.6.5 even allows it :p |
| 15:07:50 | <geekosaur> | I may well lbe misunderstanding the discussion I found, I am far from expert on this |
| 15:07:54 | <tomsmeding> | To be honest I had no clue and just typed what seemed to make sense to me |
| 15:08:21 | <geekosaur> | maybe it's undeclared lecity polymorphism or something |
| 15:09:16 | <tomsmeding> | The obvious simplification `class UNum (a :: k) where add :: a -> a -> a` is rejected, in any case, but that makes sense because random kinds might not have inhabitable types |
| 15:09:35 | → | dextaa joins (~DV@user/dextaa) |
| 15:10:06 | × | jmorris quits (uid537181@id-537181.uxbridge.irccloud.com) (Quit: Connection closed for inactivity) |
| 15:11:18 | <brence> | geekosaur: I think the quote means you can't make a single variable levity polymorphic but this doesn't mean a function can't be levity polymorphic in its arguments? |
| 15:12:00 | <tomsmeding> | Ah, so where geekosaur assumed "tyvars", "variable" actually referred to value variables? |
| 15:12:04 | <geekosaur> | functions have always permitted levity polymorphic parameters |
| 15:12:05 | <tomsmeding> | That sounds likely |
| 15:12:11 | <geekosaur> | results used to have to be kind * |
| 15:12:17 | <tomsmeding> | `add` is always lifted because of the -> |
| 15:12:21 | <geekosaur> | but that has changed over time |
| 15:12:36 | → | raehik joins (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net) |
| 15:13:54 | <tomsmeding> | Hm `x :: UNum r t => t ; x = undefined` compiles fine |
| 15:14:43 | <geekosaur> | :k (->) |
| 15:14:44 | <lambdabot> | * -> * -> * |
| 15:16:26 | <tomsmeding> | % :set -fprint-explicit-runtime-reps |
| 15:16:26 | <yahb2> | <no output> |
| 15:16:27 | <geekosaur> | https://downloads.haskell.org/ghc/9.2.1/docs/html/users_guide/exts/levity_polymorphism.html#no-levity-polymorphic-variables-or-arguments |
| 15:16:32 | <tomsmeding> | % :k (->) |
| 15:16:32 | <yahb2> | (->) :: TYPE q -> TYPE r -> * |
| 15:16:35 | × | ridcully quits (~ridcully@pd951f3bf.dip0.t-ipconnect.de) (Remote host closed the connection) |
| 15:16:46 | → | ridcully joins (~ridcully@pd951f3bf.dip0.t-ipconnect.de) |
| 15:17:11 | <geekosaur> | back in the day that used to print something ridiculous with ? and ?? or something like that. would have to restore logs from my old desktop to se |
| 15:17:13 | <geekosaur> | e |
| 15:18:20 | → | nate4 joins (~nate@98.45.169.16) |
| 15:18:38 | <tomsmeding> | % -set -fprint-explicit-foralls -fprint-explicit-kinds |
| 15:18:39 | <yahb2> | <interactive>:186:2: error: ; • Variable not in scope: set ; • Perhaps you meant ‘seq’ (imported from Prelude) ; ; <interactive>:186:7: error: ; • Variable not in scope: fprint ; •... |
| 15:18:50 | <tomsmeding> | % :set -fprint-explicit-foralls -fprint-explicit-kinds |
| 15:18:50 | <yahb2> | <no output> |
| 15:19:03 | <tomsmeding> | % :k (->) |
| 15:19:04 | <yahb2> | (->) :: forall {q :: RuntimeRep} {r :: RuntimeRep}. ; TYPE q -> TYPE r -> * |
| 15:19:40 | <tomsmeding> | geekosaur: yeah that quote in the user guide I think refers to valur variables |
| 15:19:40 | × | mimmy quits (~mimmy@38.126.149.170) (Ping timeout: 260 seconds) |
| 15:19:58 | → | machinedgod joins (~machinedg@d172-219-86-154.abhsia.telus.net) |
| 15:20:03 | <tomsmeding> | Interesting then that my paste is accepted |
| 15:21:07 | × | christiansen quits (~christian@83-95-137-75-dynamic.dk.customer.tdc.net) (Ping timeout: 244 seconds) |
| 15:21:20 | → | GoldsteinQ joins (~goldstein@goldstein.rs) |
| 15:22:35 | × | pavonia quits (~user@user/siracusa) (Quit: Bye!) |
| 15:24:23 | → | kazaf joins (~kazaf@94.180.63.53) |
| 15:29:12 | <albet70> | how I can construct a value has StreamingBody? https://hackage.haskell.org/package/wai-3.0.2.3/docs/Network-Wai.html#t:StreamingBody |
| 15:29:54 | <edwardk> | tomsmeding: https://github.com/ekmett/unboxed |
| 15:29:57 | <albet70> | I don't know how to use this stream function from https://hackage.haskell.org/package/scotty-0.10.1/docs/Web-Scotty-Trans.html#v:stream |
| 15:30:14 | <albet70> | there's no example... |
| 15:32:08 | × | matthewmosior quits (~matthewmo@173.170.253.91) (Ping timeout: 255 seconds) |
| 15:32:13 | → | mimmy joins (~mimmy@38.126.149.170) |
| 15:33:17 | → | eggplantade joins (~Eggplanta@2600:1700:bef1:5e10:5546:a014:fe40:2124) |
| 15:34:31 | → | mc47 joins (~mc47@xmonad/TheMC47) |
| 15:35:03 | <hpc> | geekosaur: iirc it was ? -> ?? -> * |
| 15:35:24 | <hpc> | ? is * or any unboxed, and ?? was * and unboxed (except for unboxed tuples) |
| 15:35:31 | <hpc> | but don't quote me on that, it's been forever for me too |
| 15:36:43 | → | OscarZ joins (~oscarz@85.194.207.119) |
| 15:36:47 | <int-e> | hmm, unboxed tuples should be in the return type, so I think you've swapped the explanation of ? and ?? |
| 15:37:33 | <hpc> | possibly |
| 15:37:49 | <[exa]> | albet70: https://hackage.haskell.org/package/wai-3.0.2.3/docs/Network-Wai.html#v:responseStream |
| 15:38:21 | <[exa]> | albet70: your function is given 2 handler (write & flush) and you can do whatever you want with them |
| 15:40:47 | <albet70> | [exa]: I want to stream a media file, is that ok? like a x.mp4 |
| 15:41:30 | <albet70> | I saw that readFile which read entire file, it could be used in this? |
| 15:42:18 | × | pgass quits (~pg@190.247.245.154) (Ping timeout: 276 seconds) |
| 15:42:32 | × | brence quits (~brence@2a01:4b00:895f:3d00:ccf8:b008:7015:50b0) (Ping timeout: 252 seconds) |
| 15:43:01 | <albet70> | I need a readFile which can read specific count from a file? |
| 15:43:01 | <int-e> | hpc: Actually, no, it's the arguments of (->) that are swapped. It was (->) :: ?? -> ? -> *. Yeah, it's been a long time. |
| 15:43:25 | × | ByronJohnson quits (~bairyn@50-250-232-19-static.hfc.comcastbusiness.net) (Remote host closed the connection) |
| 15:47:50 | × | cyphase_eviltwin quits (~cyphase@user/cyphase) (Ping timeout: 240 seconds) |
| 15:51:39 | <hpc> | a simpler time, when nobody knew how functions worked |
| 15:51:50 | <merijn> | albet70: You want hRead from bytestring |
| 15:52:55 | × | mon_aaraj quits (~MonAaraj@user/mon-aaraj/x-4416475) (Ping timeout: 260 seconds) |
| 15:53:03 | <merijn> | eh, wait, hGetSome I mean |
| 15:53:21 | <merijn> | albet70: See https://hackage.haskell.org/package/bytestring-0.11.3.1/docs/Data-ByteString.html#v:hGet |
| 15:53:53 | <merijn> | albet70: Going to the right offset can be done via hSeek https://hackage.haskell.org/package/base-4.16.2.0/docs/System-IO.html#v:hSeek |
| 15:54:52 | → | mon_aaraj joins (~MonAaraj@user/mon-aaraj/x-4416475) |
| 15:58:13 | → | Guest58452222224 joins (~Guest5845@modemcable048.16-160-184.mc.videotron.ca) |
| 15:58:25 | × | kazaf quits (~kazaf@94.180.63.53) (Quit: Konversation terminated!) |
| 16:02:21 | → | safinaskar joins (~quassel@178.160.244.66) |
| 16:02:32 | <albet70> | merijn: could hGet do that? |
| 16:02:41 | → | matthewmosior joins (~matthewmo@173.170.253.91) |
| 16:03:37 | <safinaskar> | is there any work on GHC2022? |
| 16:04:07 | <albet70> | do {handle <- openBinaryFile "./Downloads/30.mp4" ReadMode;bytestring <- hGet handle 1000} |
| 16:04:28 | → | pgass joins (~pg@190.247.245.154) |
| 16:04:52 | <albet70> | but this hGet could return empty::ByteString, how I can detect it? there's no isEmtpy :: ByteString -> Bool |
| 16:07:14 | × | matthewmosior quits (~matthewmo@173.170.253.91) (Ping timeout: 255 seconds) |
| 16:07:20 | <albet70> | hSeek return IO() not ByteString |
| 16:07:23 | <geekosaur> | (BS.length == 0) seems entirely usable? |
| 16:07:38 | <geekosaur> | hSeek doesn't return data, it just moves to a partoicular offset in a file |
| 16:08:02 | <albet70> | hSeek then hGet? |
| 16:08:08 | <geekosaur> | yes |
| 16:08:18 | × | merijn quits (~merijn@c-001-001-023.client.esciencecenter.eduvpn.nl) (Ping timeout: 276 seconds) |
| 16:08:32 | <geekosaur> | hSeek h offset >> hGet h 1000 |
| 16:10:26 | <albet70> | x <- liftIO (hSeek h offset >> hGet h 1000) is ok? |
| 16:12:03 | <geekosaur> | yes |
| 16:13:41 | × | bitmapper quits (uid464869@id-464869.lymington.irccloud.com) (Quit: Connection closed for inactivity) |
| 16:14:26 | <geekosaur> | well, hSeek is actually a little more complex than that, yuou can specify absolute or relative positioning |
| 16:15:10 | <geekosaur> | https://downloads.haskell.org/ghc/8.10.7/docs/html/libraries/base-4.14.3.0/System-IO.html#g:13 |
| 16:16:44 | × | alternateved quits (~user@staticline-31-183-144-54.toya.net.pl) (Ping timeout: 255 seconds) |
| 16:16:58 | → | econo joins (uid147250@user/econo) |
| 16:18:28 | × | nate4 quits (~nate@98.45.169.16) (Ping timeout: 244 seconds) |
| 16:19:35 | → | Infinite joins (~Infinite@2405:201:6014:10d3:37af:d7b8:df9e:4b8b) |
| 16:20:45 | → | ByronJohnson joins (~bairyn@50-250-232-19-static.hfc.comcastbusiness.net) |
| 16:21:23 | → | gdown joins (~gavin@h69-11-149-231.kndrid.broadband.dynamic.tds.net) |
| 16:21:45 | → | matthewmosior joins (~matthewmo@173.170.253.91) |
| 16:23:20 | × | eggplantade quits (~Eggplanta@2600:1700:bef1:5e10:5546:a014:fe40:2124) (Remote host closed the connection) |
| 16:30:17 | <maerwald> | https://hackage.haskell.org/package/unix-2.7.2.2/docs/System-Posix-IO.html#g:5 |
| 16:30:24 | × | mon_aaraj quits (~MonAaraj@user/mon-aaraj/x-4416475) (Ping timeout: 276 seconds) |
| 16:31:09 | → | kenran joins (~kenran@200116b82bf92200813e311e2ff66f2d.dip.versatel-1u1.de) |
| 16:32:12 | → | mon_aaraj joins (~MonAaraj@user/mon-aaraj/x-4416475) |
| 16:32:31 | → | segfaultfizzbuzz joins (~segfaultf@157-131-253-58.fiber.dynamic.sonic.net) |
| 16:32:41 | × | kenran quits (~kenran@200116b82bf92200813e311e2ff66f2d.dip.versatel-1u1.de) (Client Quit) |
| 16:34:18 | → | merijn joins (~merijn@c-001-001-023.client.esciencecenter.eduvpn.nl) |
| 16:35:07 | × | benin0 quits (~benin@183.82.24.82) (Quit: The Lounge - https://thelounge.chat) |
| 16:36:18 | × | mimmy quits (~mimmy@38.126.149.170) (Ping timeout: 240 seconds) |
| 16:36:55 | → | alternateved joins (~user@staticline-31-183-144-54.toya.net.pl) |
| 16:37:10 | → | `2jt joins (~jtomas@141.red-88-17-65.dynamicip.rima-tde.net) |
| 16:37:44 | × | ByronJohnson quits (~bairyn@50-250-232-19-static.hfc.comcastbusiness.net) (Remote host closed the connection) |
| 16:40:13 | × | merijn quits (~merijn@c-001-001-023.client.esciencecenter.eduvpn.nl) (Ping timeout: 272 seconds) |
| 16:40:44 | <albet70> | the number with hGet, what it unit? |
| 16:41:04 | <albet70> | hGet with 1024 mean 1KB? |
| 16:42:23 | → | brence joins (~brence@2a01:4b00:895f:3d00:ccf8:b008:7015:50b0) |
| 16:44:01 | × | `2jt quits (~jtomas@141.red-88-17-65.dynamicip.rima-tde.net) (Ping timeout: 272 seconds) |
| 16:45:49 | <geekosaur> | should be bytes |
| 16:49:00 | → | cyphase_eviltwin joins (~cyphase@user/cyphase) |
| 16:51:21 | → | eggplantade joins (~Eggplanta@2600:1700:bef1:5e10:5546:a014:fe40:2124) |
| 16:54:33 | → | zebrag joins (~chris@user/zebrag) |
| 17:01:07 | × | mon_aaraj quits (~MonAaraj@user/mon-aaraj/x-4416475) (Ping timeout: 272 seconds) |
| 17:01:21 | ← | safinaskar parts (~quassel@178.160.244.66) () |
| 17:02:39 | → | mon_aaraj joins (~MonAaraj@user/mon-aaraj/x-4416475) |
| 17:05:22 | → | yauhsien joins (~yauhsien@61-231-46-226.dynamic-ip.hinet.net) |
| 17:06:30 | × | Guest58452222224 quits (~Guest5845@modemcable048.16-160-184.mc.videotron.ca) (Ping timeout: 252 seconds) |
| 17:09:32 | → | tzh joins (~tzh@c-24-21-73-154.hsd1.or.comcast.net) |
| 17:09:48 | → | ByronJohnson joins (~bairyn@50-250-232-19-static.hfc.comcastbusiness.net) |
| 17:10:45 | → | maroloccio joins (~marolocci@37.100.36.239) |
| 17:11:15 | × | segfaultfizzbuzz quits (~segfaultf@157-131-253-58.fiber.dynamic.sonic.net) (Ping timeout: 272 seconds) |
| 17:14:56 | × | Infinite quits (~Infinite@2405:201:6014:10d3:37af:d7b8:df9e:4b8b) (Ping timeout: 252 seconds) |
| 17:15:28 | × | ByronJohnson quits (~bairyn@50-250-232-19-static.hfc.comcastbusiness.net) (Remote host closed the connection) |
| 17:18:41 | × | gdown quits (~gavin@h69-11-149-231.kndrid.broadband.dynamic.tds.net) (Remote host closed the connection) |
| 17:24:07 | × | maroloccio quits (~marolocci@37.100.36.239) (Quit: WeeChat 3.0) |
| 17:24:23 | <tomsmeding> | edwardk: oof https://github.com/ekmett/unboxed/blob/main/src/Unboxed/Class.hs |
| 17:25:07 | × | matthewmosior quits (~matthewmo@173.170.253.91) (Ping timeout: 244 seconds) |
| 17:25:29 | <tomsmeding> | geekosaur: brence: https://github.com/ekmett/unboxed/blob/main/internal/Unboxed/Internal/Class.hs#L146 |
| 17:26:18 | × | brence quits (~brence@2a01:4b00:895f:3d00:ccf8:b008:7015:50b0) (Ping timeout: 252 seconds) |
| 17:26:37 | → | zxx7529 joins (~Thunderbi@user/zxx7529) |
| 17:33:05 | → | matthewmosior joins (~matthewmo@173.170.253.91) |
| 17:33:05 | × | zxx7529 quits (~Thunderbi@user/zxx7529) (Read error: Connection reset by peer) |
| 17:33:44 | → | zxx7529 joins (~Thunderbi@user/zxx7529) |
| 17:34:12 | → | azimut joins (~azimut@gateway/tor-sasl/azimut) |
| 17:37:41 | × | matthewmosior quits (~matthewmo@173.170.253.91) (Ping timeout: 255 seconds) |
| 17:40:06 | × | machinedgod quits (~machinedg@d172-219-86-154.abhsia.telus.net) (Ping timeout: 244 seconds) |
| 17:40:28 | <[itchyjunk]> | Hm, sorry i didn't work on the problem earlier. I am writing a helper function called `go` do deal with `Either`. But I am stuck with the signature of `go` already. |
| 17:41:14 | <[itchyjunk]> | i want `go :: Either -> Int` in pseudo code, i think. I wanna take this Either data type and turn it all into Int datatype so i can add it, right? |
| 17:41:48 | <geekosaur> | it can't simply be Either; it's Either Something SomethingElse |
| 17:42:20 | → | Pickchea joins (~private@user/pickchea) |
| 17:42:45 | <[itchyjunk]> | `go :: Either String Int -> Int` ? |
| 17:43:07 | <geekosaur> | yes |
| 17:43:24 | <Pickchea> | Hey, I'm using stack for my project and it's been working find but all of a sudden I get "Prelude.chr: bad argument: 4127195140" every time I try `stack ghci` or `stack exec ...`. Any clue what the problem could be? |
| 17:43:57 | <Pickchea> | *working fine |
| 17:44:01 | <[itchyjunk]> | So `go Right x = x` seems like the easy part because i just get the Int for free |
| 17:44:17 | <[itchyjunk]> | so my only missing case is `go Left x = ?` i think |
| 17:44:18 | <geekosaur> | you need parentheses |
| 17:44:39 | <geekosaur> | and you should already know how to parse a String |
| 17:46:11 | <[itchyjunk]> | ah for the string i'd want `go Left "x" = ?` ? or was the parentheses needed somewhere else? |
| 17:46:35 | <maerwald> | Pickchea: https://gitlab.haskell.org/ghc/ghc/-/issues/19452 |
| 17:46:55 | <geekosaur> | go (Left x) = |
| 17:46:56 | → | matthewmosior joins (~matthewmo@173.170.253.91) |
| 17:47:07 | <geekosaur> | `go Left x` is two parameters, one of which is a function |
| 17:47:11 | × | raehik quits (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net) (Ping timeout: 255 seconds) |
| 17:47:15 | <[itchyjunk]> | oh right.. |
| 17:47:33 | → | ByronJohnson joins (~bairyn@50-250-232-19-static.hfc.comcastbusiness.net) |
| 17:47:46 | × | ByronJohnson quits (~bairyn@50-250-232-19-static.hfc.comcastbusiness.net) (Remote host closed the connection) |
| 17:48:06 | <Pickchea> | maerwald, thanks! |
| 17:49:48 | → | mimmy joins (~mimmy@37.19.212.128) |
| 17:49:49 | × | mimmy quits (~mimmy@37.19.212.128) (Client Quit) |
| 17:52:22 | <qrpnxz> | there a way to do max/min on type level naturals? the ones that ghc comes with anyway |
| 17:52:41 | <[itchyjunk]> | I found a solution with google and then looked at what tomsmeding said. he seems to have also used `read`. https://bpa.st/EFZQ |
| 17:52:49 | <[itchyjunk]> | Time to try and understand his one liner solution i guess |
| 17:53:41 | <tomsmeding> | [itchyjunk]: my one-liner is something that I might write in my code, but is probably not suitable to learn from directly |
| 17:53:42 | → | christiansen joins (~christian@83-95-137-75-dynamic.dk.customer.tdc.net) |
| 17:54:00 | <[itchyjunk]> | ah |
| 17:54:03 | <tomsmeding> | Ah I see you got a solution yourself now too |
| 17:54:26 | <[itchyjunk]> | is my solution similar to yours? I see you use `sum` and looking up, seems like it's good for lists |
| 17:54:28 | <tomsmeding> | [itchyjunk]: have you seen `case` expressions already? |
| 17:54:47 | <qrpnxz> | sum . fmap go? |
| 17:54:49 | <[itchyjunk]> | Yes i have. but haven't used it comfortably yet |
| 17:54:54 | <tomsmeding> | Yeah I'm using sum and map instead of your explicit recursion and (+) |
| 17:55:24 | <tomsmeding> | sumMix l = ... |
| 17:55:28 | <qrpnxz> | [itchyjunk]: sum work on any foldable |
| 17:55:35 | <tomsmeding> | Here l is of type [Either String Int] |
| 17:56:17 | <tomsmeding> | qrpnxz: they aren't even comfortable with `sum` at all, it's not a good idea to start talking about Foldable at this point |
| 17:56:32 | <geekosaur> | or with `either` apparently |
| 17:56:50 | <qrpnxz> | lol |
| 17:56:59 | <[itchyjunk]> | I'd not seen `Either` before. :x but this is one of the "fundamental" problems apparently |
| 17:57:26 | <tomsmeding> | [itchyjunk]: the idea is to split the walking of the list in two parts: first applying `go` to every element of the list (resulting in [Int], because go :: Either String Int -> Int), then sum this list of Int values to a single Int |
| 17:57:55 | <tomsmeding> | [itchyjunk]: data Either a b = Left a | Right b |
| 17:57:57 | <tomsmeding> | Does that help? |
| 17:58:06 | <tomsmeding> | It's literally the definition |
| 17:58:46 | <[itchyjunk]> | yes that makes sense. i go from [Either String Int] -> [Int] then i can `sum` to go from [Int]->Int |
| 17:59:01 | <qrpnxz> | 👍 |
| 17:59:16 | <tomsmeding> | :t map |
| 17:59:17 | <lambdabot> | (a -> b) -> [a] -> [b] |
| 18:00:01 | <tomsmeding> | % :t map @(Either String Int) @Int |
| 18:00:01 | <yahb2> | map @(Either String Int) @Int ; :: (Either String Int -> Int) -> [Either String Int] -> [Int] |
| 18:00:34 | × | zxx7529 quits (~Thunderbi@user/zxx7529) (Remote host closed the connection) |
| 18:00:56 | <tomsmeding> | (the @ stuf is something that you haven't seen yet, and don't need to understand yet. Intuitively: I'm specialising the type of `map` so that it gets precisely the type that I wanted to show) |
| 18:01:24 | <tomsmeding> | [itchyjunk]: now fill in the whole sumMix :) |
| 18:04:16 | × | pgass quits (~pg@190.247.245.154) (Ping timeout: 272 seconds) |
| 18:04:19 | <[itchyjunk]> | `sumMix xs = sum.map (go xs)` in the non empty case? |
| 18:05:11 | <[itchyjunk]> | i want to apply sum to the result of `map go xs` |
| 18:05:15 | <[itchyjunk]> | oh i didn't need the () |
| 18:08:15 | × | yauhsien quits (~yauhsien@61-231-46-226.dynamic-ip.hinet.net) (Ping timeout: 272 seconds) |
| 18:09:47 | <[itchyjunk]> | Next problem is much easier :x https://bpa.st/J24A |
| 18:11:27 | → | merijn joins (~merijn@c-001-001-023.client.esciencecenter.eduvpn.nl) |
| 18:11:34 | → | Sgeo joins (~Sgeo@user/sgeo) |
| 18:12:37 | × | phma quits (phma@2001:5b0:212a:ccf8:28d4:d0ee:6a25:5e66) (Read error: Connection reset by peer) |
| 18:13:18 | → | marcusxavier joins (~marcusxav@2804:6660:ff12:ef70:a1fe:a697:e665:8e0a) |
| 18:13:37 | <marcusxavier> | Do you think that exercism exercises are a good way to practice? |
| 18:15:50 | → | nate4 joins (~nate@98.45.169.16) |
| 18:16:10 | × | Haskelytic quits (~Haskelyti@118.179.211.17) (Ping timeout: 252 seconds) |
| 18:17:31 | <qrpnxz> | [itchyjunk]: watch out, (sum.map) (go xs) is not the same as (sum.map go) xs |
| 18:19:55 | <[Leary]> | [itchyjunk]: `product` alone is a complete solution there, suggesting they don't want you to use it, but rather to implement it. And I don't know why they keep saying 'array' when they're dealing with Haskell (linked) lists. The phrasing of the problems suggests a lack of familiarity with the language. |
| 18:20:44 | × | nate4 quits (~nate@98.45.169.16) (Ping timeout: 272 seconds) |
| 18:22:01 | × | bitdex quits (~bitdex@gateway/tor-sasl/bitdex) (Ping timeout: 268 seconds) |
| 18:30:26 | × | epolanski quits (uid312403@id-312403.helmsley.irccloud.com) (Quit: Connection closed for inactivity) |
| 18:33:16 | × | Pickchea quits (~private@user/pickchea) (Quit: Leaving) |
| 18:33:22 | → | bitdex joins (~bitdex@gateway/tor-sasl/bitdex) |
| 18:33:39 | → | ByronJohnson joins (~bairyn@50-250-232-19-static.hfc.comcastbusiness.net) |
| 18:35:33 | → | pgass joins (~pg@190.247.245.154) |
| 18:41:38 | × | merijn quits (~merijn@c-001-001-023.client.esciencecenter.eduvpn.nl) (Ping timeout: 272 seconds) |
| 18:43:08 | × | sammelweis quits (~quassel@2601:401:8200:2d4c:bd9:d04c:7f69:eb10) (Ping timeout: 244 seconds) |
| 18:44:27 | → | MoC joins (~moc@user/moc) |
| 18:44:38 | → | sammelweis joins (~quassel@2601:401:8200:2d4c:bd9:d04c:7f69:eb10) |
| 18:45:53 | → | yauhsien joins (~yauhsien@61-231-46-226.dynamic-ip.hinet.net) |
| 18:46:53 | × | alternateved quits (~user@staticline-31-183-144-54.toya.net.pl) (Ping timeout: 272 seconds) |
| 18:47:41 | → | John_Ivan joins (~John_Ivan@user/john-ivan/x-1515935) |
| 18:47:51 | × | yauhsien quits (~yauhsien@61-231-46-226.dynamic-ip.hinet.net) (Remote host closed the connection) |
| 18:48:43 | → | __monty__ joins (~toonn@user/toonn) |
| 18:48:46 | → | yauhsien joins (~yauhsien@61-231-46-226.dynamic-ip.hinet.net) |
| 18:49:13 | <John_Ivan> | hi. could anyone explain to me the insight of how functional programming is laid out **from a mathematical point of view?** because I don't seem to understand the structure of an expression |
| 18:49:37 | <monochrom> | Who were that exercise? It is also missing out the teaching moment that multiplying an empty list is also valid. |
| 18:49:49 | <monochrom> | err, s/Who were/Who wrote/ |
| 18:49:59 | × | matthewmosior quits (~matthewmo@173.170.253.91) (Ping timeout: 244 seconds) |
| 18:51:13 | <geekosaur> | John_Ivan, if you're talking about Haskell expressions, that has less to do with mathematics as such than about partial application |
| 18:51:34 | <geekosaur> | which often has more to do with convenience |
| 18:51:45 | <John_Ivan> | geekosaur, well, maybe I should present an example. let's the following: |
| 18:52:04 | <John_Ivan> | myFunction :: Int -> String -> IO () |
| 18:52:13 | <John_Ivan> | myFunction x y = do ... |
| 18:52:27 | <John_Ivan> | geekosaur, this layout in particular. |
| 18:52:46 | <John_Ivan> | what does it "mean" and what is my goal/scope? |
| 18:53:27 | <John_Ivan> | I'm referring to the 2nd line. |
| 18:54:06 | × | yauhsien quits (~yauhsien@61-231-46-226.dynamic-ip.hinet.net) (Ping timeout: 264 seconds) |
| 18:54:09 | × | marcusxavier quits (~marcusxav@2804:6660:ff12:ef70:a1fe:a697:e665:8e0a) (Quit: WeeChat 3.6) |
| 18:54:17 | <John_Ivan> | geekosaur, I know what it does. I don't know what it means or why it is like that. |
| 18:54:23 | <geekosaur> | as I said, this has more to do with partial application. it's the same as `myFunction = \x -> \y -> do …` and if you only provide the `x` then its result is the `\y -> do ...` |
| 18:55:10 | <John_Ivan> | geekosaur, https://en.wikipedia.org/wiki/Partial_application this? |
| 18:55:16 | → | coot joins (~coot@213.134.190.95) |
| 18:55:31 | <geekosaur> | yes |
| 18:55:57 | <geekosaur> | it's a fundamental aspect of Haskell but not most other languages, including other functional programming languages |
| 18:56:34 | <geekosaur> | (and notably is also absent from lambda calculus whoich is usually taken as the basis for functional programming) |
| 18:57:55 | → | tdodrlt^ joins (~tdodrlt@12.187.69.131) |
| 18:58:03 | → | sammelweis_ joins (~quassel@2601:401:8200:2d4c:bd9:d04c:7f69:eb10) |
| 18:58:08 | <John_Ivan> | hmm |
| 18:58:10 | <John_Ivan> | "The practical motivation for partial application is that very often the functions obtained by supplying some but not all of the arguments to a function are useful; for example, many languages have a function or operator similar to plus_one. Partial application makes it easy to define these functions, for example by creating a function that represents the addition operator with 1 bound as its first argument." |
| 18:58:24 | <John_Ivan> | ok. I get that aspect |
| 18:59:12 | <John_Ivan> | geekosaur, what would the ultimate goal of functional programming be? |
| 18:59:22 | <int-e> | geekosaur: hmpf, what's the distinction that makes it present in Haskell but absent in lambda calculus? |
| 18:59:28 | × | sammelweis quits (~quassel@2601:401:8200:2d4c:bd9:d04c:7f69:eb10) (Read error: Connection reset by peer) |
| 19:00:06 | <geekosaur> | John_Ivan, I'm not sure iut has a specific goal distinct from other languages. It's an approach, not a goal |
| 19:00:37 | <John_Ivan> | sure. but approaches themselves have smaller goals. for example, in imperative programming, the ultimate goal is assignment. |
| 19:00:49 | <geekosaur> | just as OOP has its own distinct approach (well, several approaches) but the same goals as other general purpose languages |
| 19:00:51 | <monochrom> | That escalated to meta philosophy quickly. |
| 19:01:24 | <int-e> | (If you worry about this at a low enough level... you can do the same kind of arity analysis that GHC does in any lambda calculus, and then you get /actual/ partial applications.) |
| 19:01:42 | <geekosaur> | int-e, yeh, I've been considering how true that actually was. I think I was focusing more on combinator calculus, where it's less than obvious how to partially apply, say, `S` |
| 19:01:54 | <monochrom> | All languages have as ultimate goal "do it my way and get off my lawn". |
| 19:02:01 | <John_Ivan> | every single line of code in an imperative language, be it a function call, an expression, a declaration, or whatever, falls down to the goal of "assignment" or making "permanent" changes to variables. |
| 19:02:29 | <John_Ivan> | I don't really see what the goal is in functional. |
| 19:02:53 | <EvanR> | your program is an expression, and expressions are composed of more expressions, until you have the primitives |
| 19:03:15 | <EvanR> | like (previously introduced by binders) variables, numeric literals |
| 19:03:20 | <John_Ivan> | EvanR, I "think" that might be the answer to what I'm looking for. Why is that? |
| 19:03:29 | <int-e> | geekosaur: That's fair. Though... hmm, when I implemented a combinatory logic interpreter I did end up with explicit partial applications, ala data Term = S | S1 Term | S2 Term Term | K | K1 Term | I, precisely to capture partial applications during evaluation. |
| 19:03:57 | <EvanR> | expression languages are more easily amenable to denotational semantics |
| 19:04:13 | <EvanR> | don't quote me on that YMMV |
| 19:04:13 | <int-e> | geekosaur: Whoops, that's missing an App case. |
| 19:04:38 | <John_Ivan> | EvanR, my son. you give me answers to questions that are in need of further questions... |
| 19:04:52 | <John_Ivan> | what is denotational semantic? |
| 19:04:52 | <EvanR> | welcome to the jungle |
| 19:05:34 | <EvanR> | or as a random cameo by bruce banner at the end of shang chi put it, the circus |
| 19:05:49 | → | benin0 joins (~benin@183.82.24.82) |
| 19:05:56 | <monochrom> | Lambda calculus certainly has partial application. Maybe most people don't use it very often, but it's there. |
| 19:06:28 | <int-e> | monochrom: the philosophical angle on this is that when all functions are unary, you can't partially apply those |
| 19:06:48 | <John_Ivan> | EvanR, according to wikipedia, it's the basic block to mathematical objects to represent an expression |
| 19:06:49 | <int-e> | since then they are either unapplied or fully applied |
| 19:07:05 | <John_Ivan> | ok. this seems to be going towards the goal I'm after with my question :) |
| 19:07:08 | <monochrom> | Maybe most people use no-application at all. They get a function like (\x. \y. x) and they say "that's boolean true, I'm done, I'm not even giving it any argument, much less one argument!" |
| 19:07:11 | <John_Ivan> | will read soemore more. thanks. |
| 19:07:11 | <EvanR> | the word expression is a placeholder for some unit of currency in a syntax |
| 19:07:19 | <int-e> | anyway, that's not a *useful* angle. |
| 19:07:39 | × | bitdex quits (~bitdex@gateway/tor-sasl/bitdex) (Ping timeout: 268 seconds) |
| 19:07:45 | <int-e> | monochrom: who doesn't like arguments though? |
| 19:07:49 | <EvanR> | people use other words for the same thing, for example "term", esp if there is are different syntactic sorts to track |
| 19:07:57 | <geekosaur> | yeh, I reconsidered that aside from the shorthand of λxy being the same as λxλy there's not actually a context in which partial application is meaningful |
| 19:08:04 | <int-e> | ...especially inconsequential ones... |
| 19:08:30 | <monochrom> | Well, we don't have to say "partial application" in Haskell either. |
| 19:08:52 | <geekosaur> | (aside, I need to bind a key to one of the lambdas) |
| 19:08:56 | <int-e> | which is why I mentioned arity analysis earlier |
| 19:09:08 | → | bitdex joins (~bitdex@gateway/tor-sasl/bitdex) |
| 19:11:00 | <EvanR> | just bind it to λ. C:λUsersλEvanRλProgram FilesλEtc |
| 19:11:53 | <int-e> | /home/int-e/haskell/... |
| 19:12:01 | <int-e> | this is why Windows is inferior :P |
| 19:12:05 | <monochrom> | "(\x y -> x) (\z -> z)" is either "partial application" in both Haskell and lambda calculus or "simply application, there is only one kind" is both Haskell and lambda calculus. |
| 19:12:21 | <monochrom> | s/is both/in both/ |
| 19:12:25 | <int-e> | monochrom: yep |
| 19:13:43 | <EvanR> | in haskell there is only single argument functions. Also in haskell we have multiple argument functions xD |
| 19:13:56 | <EvanR> | after you get compiled at least |
| 19:14:26 | <int-e> | @quote fugue |
| 19:14:26 | <lambdabot> | monochrom says: Welcome to #haskell, where your questions are answered in contrapuntal fugues. |
| 19:15:12 | <EvanR> | mutually contradictory true facts don't help the case where people complain about the language being too hard xD |
| 19:15:54 | <int-e> | But it is part of what makes Haskell *fun*. :P |
| 19:15:58 | → | phma joins (~phma@host-67-44-208-65.hnremote.net) |
| 19:16:05 | <c_wraith> | Eh. One of those is language semantics, the other is a compilation detail that occasionally matters when optimizing code. |
| 19:16:07 | <EvanR> | in haskell we have functors, but also, we don't have functors |
| 19:16:18 | <monochrom> | No, it is the same fact but rendered under two competing definitions. |
| 19:16:32 | <EvanR> | set is a functor but also set can't be a functor |
| 19:16:52 | <int-e> | it's not a hard concept when you start with a typical operation like addition. |
| 19:17:07 | <int-e> | it's just hard to make formal :P |
| 19:17:42 | <int-e> | > id id id id id () -- what's the arity of `id` again |
| 19:17:44 | <lambdabot> | () |
| 19:18:22 | <int-e> | (arity is the hard one; once you have an arity larger than one, partial applications will make sense) |
| 19:18:22 | <monochrom> | Just like there is no conflict between "natural numbers are >= 1" and "natural numbers are >= 0" because they are using different definitions of "natural numbers". |
| 19:18:37 | <monochrom> | And that one won't be resolved for the next 1000 years. |
| 19:19:10 | × | aveltras[m] quits (~aveltrasm@2001:470:69fc:105::3ef9) (Ping timeout: 240 seconds) |
| 19:19:16 | <EvanR> | I was confronted by someone who demanded to know is pluto or is pluto not a planet |
| 19:19:30 | → | matthewmosior joins (~matthewmo@173.170.253.91) |
| 19:19:45 | <EvanR> | even if I was someone who could weigh in on this, the whole question is bad lol |
| 19:19:47 | <dolio> | The answer is, who cares? |
| 19:20:16 | <geekosaur> | "The only correct statement about Pluto is that it is jointly captured by the Sun and Neptune." |
| 19:20:29 | <geekosaur> | personally I think the whole notion of defining "planet" is a lose |
| 19:21:25 | <geekosaur> | move Mercury out past Neptune and it's just a rock, not a planet any more |
| 19:21:29 | <EvanR> | maybe arity in haskell is like pluto xD |
| 19:22:00 | <int-e> | It's fine either way, what's weird is that the status changed, and we cope with that in different ways :P |
| 19:22:42 | <EvanR> | so planethood is an exercise in cache invalidation? xD |
| 19:23:14 | <int-e> | In german, Pluto not being a planet broke a nice mnemoinic that in particular relied on Neptun[e] and "neun"="nine" having the same initial letters. |
| 19:23:49 | <int-e> | EvanR: hehe |
| 19:23:51 | × | Midjak quits (~Midjak@82.66.147.146) (Quit: This computer has gone to sleep) |
| 19:23:53 | × | matthewmosior quits (~matthewmo@173.170.253.91) (Ping timeout: 255 seconds) |
| 19:24:47 | <c_wraith> | Whenever they find the next planet out there, should it be given a name so that the german mnemonic works again? |
| 19:25:04 | <EvanR> | it's already called planet nine xD |
| 19:25:08 | <monochrom> | Move Mercury past Neptune and it's still a programming language, though. ;) |
| 19:25:34 | <c_wraith> | hmm.. is Pluto planet nein? |
| 19:25:41 | <monochrom> | hahaha |
| 19:25:53 | <int-e> | EvanR: Or... how many Teslas do we have to ship to Pluto to make it a planet. (Okay, what's our off-topic channel again? -blah?) |
| 19:26:06 | <monochrom> | -offtopic |
| 19:26:07 | <geekosaur> | -offtopic |
| 19:26:12 | <EvanR> | what happened to -blah |
| 19:26:14 | <monochrom> | But I'm biased :) |
| 19:26:23 | <monochrom> | I don't like -blah |
| 19:26:44 | <EvanR> | right there's still two even after the freenodalypse |
| 19:27:09 | <geekosaur> | how many people in it? |
| 19:28:13 | × | bitdex quits (~bitdex@gateway/tor-sasl/bitdex) (Remote host closed the connection) |
| 19:29:26 | → | bitdex joins (~bitdex@gateway/tor-sasl/bitdex) |
| 19:31:03 | → | aveltras[m] joins (~aveltrasm@2001:470:69fc:105::3ef9) |
| 19:33:45 | × | dos__^^ quits (~user@user/dos/x-1723657) (Ping timeout: 272 seconds) |
| 19:34:07 | → | merijn joins (~merijn@c-001-001-023.client.esciencecenter.eduvpn.nl) |
| 19:39:40 | → | segfaultfizzbuzz joins (~segfaultf@157-131-253-58.fiber.dynamic.sonic.net) |
| 19:39:50 | × | merijn quits (~merijn@c-001-001-023.client.esciencecenter.eduvpn.nl) (Ping timeout: 240 seconds) |
| 19:39:53 | → | matthewmosior joins (~matthewmo@173.170.253.91) |
| 19:52:51 | × | APic quits (apic@apic.name) (Read error: Connection reset by peer) |
| 19:54:18 | <[itchyjunk]> | [Leary], ah, i was going to do prod [] = 0; prod (x:xs) = x * prod xs but thought using inbuilts are better |
| 19:54:45 | <geekosaur> | why 0? |
| 19:55:09 | <[itchyjunk]> | hmm, empty list should evaluate to |
| 19:55:18 | × | foul_owl quits (~kerry@23.82.194.109) (Ping timeout: 264 seconds) |
| 19:55:21 | <[itchyjunk]> | hmmmmm i didn't put much thought into it i guess |
| 19:55:34 | → | waleee joins (~waleee@2001:9b0:213:7200:cc36:a556:b1e8:b340) |
| 19:55:35 | <geekosaur> | I'd go for the multiplicative identity |
| 19:55:36 | <[itchyjunk]> | oh, maybe i want 1. else i always get 0? |
| 19:55:40 | <[itchyjunk]> | right |
| 19:57:31 | <[itchyjunk]> | qrpnxz, i want to apply sum to the result of a function map go xs so i want sum.(map go xs) ? |
| 19:57:50 | <monochrom> | sum (map go xs) |
| 19:58:34 | <[itchyjunk]> | hmmm f.g x = f(g(x)) so your syntax is the RHS kind right? |
| 19:58:41 | <[itchyjunk]> | but how would i write it using the . operator? |
| 19:58:47 | <geekosaur> | also I'd beware of using (.) without a space in front, thanks to RecordDotSyntax |
| 19:58:56 | <monochrom> | If you want to use . you have to learn: map go xs = (map go) xs |
| 19:59:28 | <monochrom> | DO NOT USE INTUITION |
| 19:59:32 | <[itchyjunk]> | :x |
| 20:00:03 | <geekosaur> | and remember that (f . g) x = f (g x) |
| 20:01:02 | <[itchyjunk]> | (sum . map) go xs => sum (map go xs) so this would be the right syntax i think :x |
| 20:01:37 | <monochrom> | Well let's turn the crank on that one too. No intuition, just algebra. |
| 20:01:49 | <monochrom> | (sum . map) go xs = ((sum . map) go) xs |
| 20:02:05 | <monochrom> | = (sum (map go)) xs |
| 20:02:14 | <monochrom> | = sum (map go) xs |
| 20:02:57 | <monochrom> | You know what, maybe stick to "(f x) y" and don't write "f x y" for the few next days. |
| 20:04:10 | <monochrom> | Backus gave us two valuable inventions, and people are throwing both away. |
| 20:04:33 | <[itchyjunk]> | I'll try to be more explicit till I get the issue mentally sorted :x |
| 20:05:12 | <monochrom> | One is you can write "z = (x + y) * t", you don't have to write "tmp = x + y; z = tmp * t" |
| 20:05:21 | → | APic joins (apic@apic.name) |
| 20:05:59 | <monochrom> | The other is functional programming so you can use algebra to predict what your code means, you don't have to use misguided intuition. |
| 20:06:04 | → | merijn joins (~merijn@c-001-001-023.client.esciencecenter.eduvpn.nl) |
| 20:06:12 | <monochrom> | Well, OOP people hate the first, and all programmers hate the second. |
| 20:07:12 | <[itchyjunk]> | I shall surpass them both and hate both! |
| 20:07:33 | <monochrom> | Well yeah "all programmers" include OOP people too. |
| 20:08:22 | <monochrom> | Yes they truly testify that they prefer "tmp = x.add(y); z = tmp.mul(t)" |
| 20:08:52 | → | acidjnk joins (~acidjnk@p200300d6e705864588abf31f379d9ca5.dip0.t-ipconnect.de) |
| 20:09:07 | <monochrom> | They're like "do not even write x.add(y).mul(t) or t.mul(x.add(y))" |
| 20:09:22 | <geekosaur> | welcome back to cobol |
| 20:09:34 | <monochrom> | OK, the JQuery people are beginning to appreciate the benefits of the former. |
| 20:09:52 | <qrpnxz> | geekosaur: does anybody actually use recorddotsyntax knowing lenses are a thing? |
| 20:10:02 | <geekosaur> | yes, sadly |
| 20:10:24 | <qrpnxz> | 🥹 |
| 20:10:38 | × | segfaultfizzbuzz quits (~segfaultf@157-131-253-58.fiber.dynamic.sonic.net) (Ping timeout: 240 seconds) |
| 20:16:17 | × | cosimone quits (~user@93-44-186-171.ip98.fastwebnet.it) (Remote host closed the connection) |
| 20:21:02 | × | califax quits (~califax@user/califx) (Ping timeout: 268 seconds) |
| 20:22:06 | × | azimut quits (~azimut@gateway/tor-sasl/azimut) (Quit: ZNC - https://znc.in) |
| 20:22:16 | × | adanwan quits (~adanwan@gateway/tor-sasl/adanwan) (Ping timeout: 268 seconds) |
| 20:22:22 | → | azimut joins (~azimut@gateway/tor-sasl/azimut) |
| 20:23:00 | → | califax joins (~califax@user/califx) |
| 20:23:04 | → | adanwan joins (~adanwan@gateway/tor-sasl/adanwan) |
| 20:24:21 | × | _ht quits (~quassel@231-169-21-31.ftth.glasoperator.nl) (Remote host closed the connection) |
| 20:25:34 | × | coot quits (~coot@213.134.190.95) (Quit: coot) |
| 20:28:28 | → | segfaultfizzbuzz joins (~segfaultf@157-131-253-58.fiber.dynamic.sonic.net) |
| 20:30:17 | × | FinnElija quits (~finn_elij@user/finn-elija/x-0085643) (Ping timeout: 268 seconds) |
| 20:30:37 | × | [itchyjunk] quits (~itchyjunk@user/itchyjunk/x-7353470) (Ping timeout: 244 seconds) |
| 20:30:54 | × | bitdex quits (~bitdex@gateway/tor-sasl/bitdex) (Ping timeout: 268 seconds) |
| 20:30:54 | × | winny quits (~weechat@user/winny) (Ping timeout: 268 seconds) |
| 20:30:54 | × | stiell quits (~stiell@gateway/tor-sasl/stiell) (Ping timeout: 268 seconds) |
| 20:30:54 | × | jpds quits (~jpds@gateway/tor-sasl/jpds) (Ping timeout: 268 seconds) |
| 20:31:33 | × | califax quits (~califax@user/califx) (Remote host closed the connection) |
| 20:31:47 | <maerwald> | that's like saying "does anybody actually use debian, knowing nix is a thing?" |
| 20:32:25 | → | [itchyjunk] joins (~itchyjunk@user/itchyjunk/x-7353470) |
| 20:32:37 | → | FinnElija joins (~finn_elij@user/finn-elija/x-0085643) |
| 20:32:55 | → | califax joins (~califax@user/califx) |
| 20:32:55 | → | winny joins (~weechat@user/winny) |
| 20:33:24 | → | bitdex joins (~bitdex@gateway/tor-sasl/bitdex) |
| 20:34:19 | → | jpds joins (~jpds@gateway/tor-sasl/jpds) |
| 20:34:53 | → | stiell joins (~stiell@gateway/tor-sasl/stiell) |
| 20:36:22 | → | michalz joins (~michalz@185.246.204.77) |
| 20:39:13 | <monochrom> | I think I may disagree :) |
| 20:39:30 | × | merijn quits (~merijn@c-001-001-023.client.esciencecenter.eduvpn.nl) (Ping timeout: 240 seconds) |
| 20:39:54 | × | matthewmosior quits (~matthewmo@173.170.253.91) (Ping timeout: 244 seconds) |
| 20:39:56 | <monochrom> | But not strongly. I may see your point too. |
| 20:41:21 | × | gmg quits (~user@user/gehmehgeh) (Quit: Leaving) |
| 20:41:54 | <maerwald> | Many advanced haskellers use lenses only occasionally. Definitely not something you want to bother beginners with. If my code is simple, I'm not gonna import optics. So there's definitely a gap to be filled. |
| 20:42:09 | × | segfaultfizzbuzz quits (~segfaultf@157-131-253-58.fiber.dynamic.sonic.net) (Ping timeout: 272 seconds) |
| 20:42:50 | <monochrom> | Perhaps let's try: Does anyone actually use RecordDotNotation, knowing that selector application exists? >:) |
| 20:43:45 | <monochrom> | (Selector application means: whereas record dot notation says "o.f", selector application says "f o".) |
| 20:44:32 | <monochrom> | And I do take that attitude. I don't teach do-notation to my students, because >>= already exists. |
| 20:44:45 | → | machinedgod joins (~machinedg@d172-219-86-154.abhsia.telus.net) |
| 20:45:10 | <monochrom> | And it is especially because my students are beginners. |
| 20:45:35 | <monochrom> | No need to distract them with lenses, dot notation, or do notation >:) |
| 20:47:30 | × | christiansen quits (~christian@83-95-137-75-dynamic.dk.customer.tdc.net) (Ping timeout: 240 seconds) |
| 20:48:44 | <monochrom> | Oh yeah, in my unix-and-C course, I recommend students to install ubuntu, not debian or nix. :) |
| 20:49:04 | <monochrom> | But that's really just because school lab has gone for ubuntu. |
| 20:49:13 | <qrpnxz> | monochrom: selectors can't set :) |
| 20:49:24 | <monochrom> | If school lab uses Solaris, I might have recommended installing your own Solaris too haha. |
| 20:49:44 | <monochrom> | Does RecordDotNotation allow setting? Like o.f = 4? |
| 20:49:58 | <qrpnxz> | probably or it would be extremely useless |
| 20:50:08 | <monochrom> | OK so you don't actually know. |
| 20:50:14 | <monochrom> | Well, I don't actually know either. |
| 20:50:19 | <qrpnxz> | i'll look one sec |
| 20:50:39 | <monochrom> | I wouldn't be surprised either way though. |
| 20:51:03 | <qrpnxz> | i'd be very surprised if it didn't because then it would just be the worse extension ever lol |
| 20:51:06 | <monochrom> | I have seen how pointless OOP-minded people can be when they just whine about syntax. |
| 20:52:00 | <qrpnxz> | ya know, the GHC manual doesn't actually say. Maybe it's get only i can't believe it |
| 20:52:20 | <monochrom> | OK sorry, s/people/ideas/ |
| 20:52:27 | <qrpnxz> | lol |
| 20:53:17 | → | merijn joins (~merijn@c-001-001-023.client.esciencecenter.eduvpn.nl) |
| 20:53:31 | <exarkun> | https://github.com/ghc-proposals/ghc-proposals/pull/282/files#diff-05d6456bad56dfbda9ecf23d6daa02dd50f13df533fefd56bdbb1de11dc7a1d8R52 |
| 20:53:42 | <exarkun> | I guess it does allow setting? |
| 20:54:01 | <qrpnxz> | seems so |
| 20:54:04 | × | takuan quits (~takuan@178-116-218-225.access.telenet.be) (Remote host closed the connection) |
| 20:54:06 | <qrpnxz> | given a quick skim |
| 20:54:49 | <geekosaur> | it's pointless. it steals syntax to do what can already be done multiple ways |
| 20:55:01 | <monochrom> | OK but it is restricted to a fairly specific context. |
| 20:55:10 | <geekosaur> | just to make people happy who expect . to be a record separator |
| 20:55:40 | <monochrom> | It doesn't do standalone "o.f = 4", it only does "r(o.f = 4)" when o is a field of and outer record r. |
| 20:56:21 | <monochrom> | Not to deny that it helps that use case. |
| 20:56:56 | × | __monty__ quits (~toonn@user/toonn) (Quit: leaving) |
| 20:57:03 | → | segfaultfizzbuzz joins (~segfaultf@157-131-253-58.fiber.dynamic.sonic.net) |
| 20:57:50 | × | merijn quits (~merijn@c-001-001-023.client.esciencecenter.eduvpn.nl) (Ping timeout: 240 seconds) |
| 21:00:16 | × | mc47 quits (~mc47@xmonad/TheMC47) (Remote host closed the connection) |
| 21:00:20 | <monochrom> | SML has record dot syntax but it has that since day 1 together with the decision to use o for function application. That's right you write "(sum o map f) xs". |
| 21:00:21 | × | eggplantade quits (~Eggplanta@2600:1700:bef1:5e10:5546:a014:fe40:2124) (Remote host closed the connection) |
| 21:00:53 | <monochrom> | Whereas in the Haskell case it is duct-taped. |
| 21:00:56 | <qrpnxz> | an infix op that is just a letter. Seems like a smell for the parser |
| 21:01:05 | <qrpnxz> | but looks nice for the most part |
| 21:01:32 | <monochrom> | I would not call it duct-taped if the proponents made a concession and chose a different symbol so that the parser didn't have to suck. |
| 21:02:01 | <monochrom> | Yeah I think I heard that writing a parser for SML was not easy :) |
| 21:02:31 | <monochrom> | Whereas Haskell says you can write like x `div` y, |
| 21:02:45 | → | matthewmosior joins (~matthewmo@173.170.253.91) |
| 21:02:56 | → | laman joins (~laman@rego.ai) |
| 21:02:58 | <qrpnxz> | we have so few symbols on standard keyboard that every character is overloaded to hell unfortunately. I wish using more unicode was norm. Like i put my keyboard into haskell mode and my numpad gets keys for lambda symbol, composition symbol and so on |
| 21:02:59 | <monochrom> | SML says you make a declaration "infixl 6 div" and now you write x div y |
| 21:03:30 | × | tdodrlt^ quits (~tdodrlt@12.187.69.131) (Ping timeout: 240 seconds) |
| 21:04:33 | <qrpnxz> | monochrom: oh wow lol |
| 21:06:10 | <monochrom> | So basically the parser builds a preliminary parse tree that is known to be likely wrong and later fix it after knowing that div and o are infix operators. |
| 21:06:25 | <monochrom> | err, maybe s/parse tree/abstract syntax tree/ |
| 21:06:40 | × | stiell quits (~stiell@gateway/tor-sasl/stiell) (Ping timeout: 268 seconds) |
| 21:06:54 | × | matthewmosior quits (~matthewmo@173.170.253.91) (Ping timeout: 244 seconds) |
| 21:07:01 | <monochrom> | It's doable because "wrong" just means wrong shape, the data are OK. |
| 21:07:31 | <geekosaur> | ghc does the same in a sense, because it can't know fixities until it has parsed the whole thing |
| 21:07:39 | <tomsmeding> | In agda you can: if_then_else_ : Bool -> t -> t -> t ; if True x _ = x ; if False _ y = y. And then you can write `if a == b then 1 else 2` |
| 21:07:54 | <monochrom> | I think you also have to do something like that to Haskell, on the ground that operator precedence declarations can also come in late. |
| 21:07:57 | <tomsmeding> | Talking about weird fixities |
| 21:08:03 | <monochrom> | Yeah, that. |
| 21:08:11 | <qrpnxz> | that's some smalltalk level idioms right there haha |
| 21:08:30 | → | acidjnk_new joins (~acidjnk@p200300d6e705864510d29662a0d17642.dip0.t-ipconnect.de) |
| 21:09:06 | hpc | . o O ( breadth-first parser ) |
| 21:09:24 | <tomsmeding> | This is also the reason why you have to write (1 , 2) for a pair in agda, as opposed to (1, 2). Indeed, the pair construction operator is defined as _,_ and (1, 2) would be parsed as two tokens: 1, and 2 |
| 21:09:42 | <monochrom> | :'( |
| 21:09:54 | <tomsmeding> | Or maybe it only holds for letters, a , b |
| 21:10:05 | × | adanwan quits (~adanwan@gateway/tor-sasl/adanwan) (Remote host closed the connection) |
| 21:10:17 | <tomsmeding> | Numbers _might_ be excluded from the game, not sure |
| 21:10:30 | → | acidjnk_new3 joins (~acidjnk@p200300d6e705864510d29662a0d17642.dip0.t-ipconnect.de) |
| 21:10:30 | → | adanwan joins (~adanwan@gateway/tor-sasl/adanwan) |
| 21:12:10 | → | stiell joins (~stiell@gateway/tor-sasl/stiell) |
| 21:12:23 | × | acidjnk quits (~acidjnk@p200300d6e705864588abf31f379d9ca5.dip0.t-ipconnect.de) (Ping timeout: 255 seconds) |
| 21:12:56 | <qrpnxz> | given that if then else example, pretty sure that language is super not context-free. What are compile times like? |
| 21:13:10 | × | acidjnk_new quits (~acidjnk@p200300d6e705864510d29662a0d17642.dip0.t-ipconnect.de) (Ping timeout: 240 seconds) |
| 21:13:35 | <hpc> | parsing isn't the slow part of agda |
| 21:13:46 | × | adanwan quits (~adanwan@gateway/tor-sasl/adanwan) (Remote host closed the connection) |
| 21:13:48 | <monochrom> | I think this is just a small deviation from CFG, it won't cost really a lot of parsing time. |
| 21:14:06 | → | adanwan joins (~adanwan@gateway/tor-sasl/adanwan) |
| 21:15:03 | → | jpds1 joins (~jpds@gateway/tor-sasl/jpds) |
| 21:15:06 | → | tdodrlt^ joins (~tdodrlt@12.187.69.131) |
| 21:16:57 | <int-e> | qrpnxz: Here's a little secret... virtually no programming languages are context-free. The CFG is just a first approximation which is useful because programmers tend to understand the grammar, and because with some care, you can feed it to a parser generator and get a kind of pre-parser. You'll still need to check a ton of things... like matching identifiers, declarations and definitions... |
| 21:17:09 | × | jpds quits (~jpds@gateway/tor-sasl/jpds) (Ping timeout: 268 seconds) |
| 21:17:19 | <monochrom> | :) |
| 21:17:29 | <monochrom> | As long as the post-processing is linear-time we're fine. |
| 21:17:37 | <int-e> | https://en.wikipedia.org/wiki/Brainfuck *is* a context-free language ;-) |
| 21:17:55 | <monochrom> | http://www.vex.net/~trebla/weblog/declare-before-use.xhtml |
| 21:22:51 | <darkling> | int-e: But not regular. :) |
| 21:23:58 | × | Kaiepi quits (~Kaiepi@156.34.47.253) (Read error: Connection reset by peer) |
| 21:24:10 | → | matthewmosior joins (~matthewmo@173.170.253.91) |
| 21:26:23 | → | foul_owl joins (~kerry@174-21-132-202.tukw.qwest.net) |
| 21:28:40 | × | michalz quits (~michalz@185.246.204.77) (Remote host closed the connection) |
| 21:30:52 | → | eggplantade joins (~Eggplanta@2600:1700:bef1:5e10:5546:a014:fe40:2124) |
| 21:31:35 | <qrpnxz> | int-e: what's why i said "super". Though i think Go is context-free, or about as context-free as you get |
| 21:31:41 | <qrpnxz> | :) |
| 21:32:35 | <qrpnxz> | forth and scheme also context free afaik |
| 21:34:05 | <Rembane> | IIRC APL is contectful |
| 21:34:12 | <Rembane> | *contextful |
| 21:35:51 | <monochrom> | Scheme still has a define-before-use condition, so it is not context-free. |
| 21:36:01 | <monochrom> | Shell scripting and Python though... |
| 21:36:02 | × | MoC quits (~moc@user/moc) (Quit: Konversation terminated!) |
| 21:38:22 | <qrpnxz> | that's only relevant in the interpretation of the program, not the parsing |
| 21:40:34 | <int-e> | monochrom: python has indentation, try capturing that :P |
| 21:40:58 | <hpc> | python has define-before-use too, just in a much sillier way |
| 21:41:34 | <hpc> | functions get defined in order, but the functions they call don't need to be valid until you actually call that function |
| 21:41:49 | <hpc> | so you can define two functions out of order just fine, but you can't do |
| 21:41:53 | <hpc> | foo(); def foo(): ... |
| 21:42:06 | <qrpnxz> | worse of both static and dynamic, nice |
| 21:42:57 | × | tdodrlt^ quits (~tdodrlt@12.187.69.131) (Ping timeout: 272 seconds) |
| 21:43:35 | <monochrom> | Oh oops I forgot python layout hehe |
| 21:46:08 | <qrpnxz> | i refuse to use python. I think i haven't touched it in many years |
| 21:47:05 | → | pavonia joins (~user@user/siracusa) |
| 21:47:06 | <geekosaur> | every time I touch it I get forcibly reminded of why I don't use it |
| 21:47:08 | <hpc> | i like to say i learned haskell because i was too stupid for python |
| 21:47:21 | <hpc> | only half joking |
| 21:47:32 | <hpc> | *and that's only half joking |
| 21:47:43 | <exarkun> | What's the non-joke half |
| 21:48:04 | <qrpnxz> | lol |
| 21:49:02 | <exarkun> | (err maybe that's the opposite of what I meant to say) |
| 21:49:11 | <monochrom> | I have a similar sentiment. I choose static typing because I'm too stupid for everything Alan Kay boasts about being dynamic and oh so flexible. |
| 21:50:30 | <monochrom> | Dijkstra has a similar sentiment too. He promotes doing algebra because he (and I) is too stupid for "intuitive" thinking. ("thinking") |
| 21:52:07 | <hpc> | fun fact, the latin root of "intuitive" is "no teaching" |
| 21:52:42 | <hpc> | try not to think about the etymology of "amused" while being amused by that fact :P |
| 21:53:25 | <monochrom> | heh now you've got me curious. But I'll ask m-w.com |
| 21:53:31 | <hpc> | also try not to think about how that fact is wrong |
| 21:53:41 | hpc | . o O ( next time google it first ) |
| 21:54:18 | <maerwald> | hpc: the trick when writing python is not to try to write *correct* code. That's why it's hard for you |
| 21:54:41 | <qrpnxz> | dynamism can be nice, but having *everything* be dynamic is like too much desert. Just gives you tummy ache. Haskell has deferred type error and Data.Dynamic and such, and i'm sure it gets used, but it's just a totally waste to not specify actual type in 99.999% of cases |
| 21:54:51 | <qrpnxz> | i'm too lazy for dynamic typing xD |
| 21:55:16 | <maerwald> | qrpnxz: well, Haskells complete lack for good structural typing is not so amusing |
| 21:55:19 | → | wombat875 joins (~wombat875@pool-141-155-7-175.nycmny.fios.verizon.net) |
| 21:55:20 | <qrpnxz> | well, i say specify but i don't even have to do that lol |
| 21:55:31 | × | cheater quits (~Username@user/cheater) (Quit: (BitchX) Size DOES matter) |
| 21:55:47 | <maerwald> | but these things are more important when doing frontend stuff... I don't do frontend in Haskell. |
| 21:55:54 | <hpc> | maerwald: my problem with python is the opposite, i spend 10 minutes typing out a thing and then another hour and a half trying to find all the dumb type errors |
| 21:56:00 | <monochrom> | Haha OK, I haven't found the etymology of "amused", but yeah "intuitive" does not trace back to "no teaching". |
| 21:56:06 | <qrpnxz> | maerwald: i think you can do that with Generic |
| 21:56:14 | <maerwald> | qrpnxz: not really |
| 21:56:14 | → | cheater joins (~Username@user/cheater) |
| 21:56:15 | <geekosaur> | a-muse |
| 21:56:15 | <hpc> | if i tried to be more correct in python maybe it would work better |
| 21:56:18 | <qrpnxz> | you can also safely coerce types with same rep |
| 21:56:34 | <hpc> | or maybe i would just spend 6 hours typing out a thing and another 3 trying to find all the dumb type errors |
| 21:56:37 | <geekosaur> | (without a muse, remembering that the muses were quasideities) |
| 21:56:46 | <qrpnxz> | but really the only duck-typing i care about type classes can do so |
| 22:01:31 | ← | jakalx parts (~jakalx@base.jakalx.net) (Error from remote client) |
| 22:03:24 | → | gdown joins (~gavin@h69-11-149-231.kndrid.broadband.dynamic.tds.net) |
| 22:03:49 | ChanServ | sets mode +o litharge |
| 22:03:49 | litharge | sets mode -bo $a:pleo litharge |
| 22:04:50 | × | aweinstock quits (~aweinstoc@cpe-74-76-189-75.nycap.res.rr.com) (Ping timeout: 240 seconds) |
| 22:06:52 | → | tdodrlt^ joins (~tdodrlt@12.187.69.131) |
| 22:06:52 | → | aweinstock joins (~aweinstoc@cpe-74-76-189-75.nycap.res.rr.com) |
| 22:07:56 | → | jakalx joins (~jakalx@base.jakalx.net) |
| 22:16:56 | → | nate4 joins (~nate@98.45.169.16) |
| 22:17:10 | × | acidjnk_new3 quits (~acidjnk@p200300d6e705864510d29662a0d17642.dip0.t-ipconnect.de) (Ping timeout: 240 seconds) |
| 22:20:57 | × | hiredman quits (~hiredman@frontier1.downey.family) (Remote host closed the connection) |
| 22:22:13 | × | nate4 quits (~nate@98.45.169.16) (Ping timeout: 272 seconds) |
| 22:22:36 | → | merijn joins (~merijn@c-001-001-023.client.esciencecenter.eduvpn.nl) |
| 22:24:20 | × | matthewmosior quits (~matthewmo@173.170.253.91) (Ping timeout: 255 seconds) |
| 22:32:02 | × | mon_aaraj quits (~MonAaraj@user/mon-aaraj/x-4416475) (Ping timeout: 255 seconds) |
| 22:32:06 | → | lys joins (sid194105@user/lys) |
| 22:34:05 | → | mon_aaraj joins (~MonAaraj@user/mon-aaraj/x-4416475) |
| 22:36:23 | → | jmorris joins (uid537181@id-537181.uxbridge.irccloud.com) |
| 22:38:02 | → | matthewmosior joins (~matthewmo@173.170.253.91) |
| 22:39:39 | × | phma quits (~phma@host-67-44-208-65.hnremote.net) (Read error: Connection reset by peer) |
| 22:40:35 | × | merijn quits (~merijn@c-001-001-023.client.esciencecenter.eduvpn.nl) (Ping timeout: 272 seconds) |
| 22:42:38 | → | phma joins (~phma@2001:5b0:212a:f318:9888:9b59:ea41:c1c) |
| 22:43:28 | × | hgolden quits (~hgolden2@cpe-172-251-233-141.socal.res.rr.com) (Ping timeout: 268 seconds) |
| 22:43:53 | × | Tuplanolla quits (~Tuplanoll@91-159-69-97.elisa-laajakaista.fi) (Quit: Leaving.) |
| 22:44:19 | → | Kaiepi joins (~Kaiepi@156.34.47.253) |
| 22:47:10 | → | zeenk joins (~zeenk@2a02:2f04:a311:2d00:6865:d863:4c93:799f) |
| 22:49:54 | × | YoungFrog quits (~youngfrog@39.129-180-91.adsl-dyn.isp.belgacom.be) (Ping timeout: 272 seconds) |
| 22:50:42 | → | hiredman joins (~hiredman@frontier1.downey.family) |
| 22:51:06 | × | machinedgod quits (~machinedg@d172-219-86-154.abhsia.telus.net) (Ping timeout: 264 seconds) |
| 22:51:42 | → | YoungFrog joins (~youngfrog@2a02:a03f:c21b:f900:5132:e9ea:441f:a48f) |
| 22:56:03 | × | jpds1 quits (~jpds@gateway/tor-sasl/jpds) (Remote host closed the connection) |
| 22:56:32 | → | jpds1 joins (~jpds@gateway/tor-sasl/jpds) |
| 22:57:41 | × | YoungFrog quits (~youngfrog@2a02:a03f:c21b:f900:5132:e9ea:441f:a48f) (Ping timeout: 272 seconds) |
| 22:59:18 | → | YoungFrog joins (~youngfrog@39.129-180-91.adsl-dyn.isp.belgacom.be) |
| 23:03:39 | × | segfaultfizzbuzz quits (~segfaultf@157-131-253-58.fiber.dynamic.sonic.net) (Ping timeout: 276 seconds) |
| 23:04:50 | × | [itchyjunk] quits (~itchyjunk@user/itchyjunk/x-7353470) (Ping timeout: 240 seconds) |
| 23:06:38 | × | YoungFrog quits (~youngfrog@39.129-180-91.adsl-dyn.isp.belgacom.be) (Ping timeout: 244 seconds) |
| 23:07:04 | × | zeenk quits (~zeenk@2a02:2f04:a311:2d00:6865:d863:4c93:799f) (Quit: Konversation terminated!) |
| 23:08:48 | → | segfaultfizzbuzz joins (~segfaultf@157-131-253-58.fiber.dynamic.sonic.net) |
| 23:09:11 | → | [itchyjunk] joins (~itchyjunk@user/itchyjunk/x-7353470) |
| 23:09:32 | → | YoungFrog joins (~youngfrog@39.129-180-91.adsl-dyn.isp.belgacom.be) |
| 23:11:24 | → | merijn joins (~merijn@c-001-001-023.client.esciencecenter.eduvpn.nl) |
| 23:14:24 | × | YoungFrog quits (~youngfrog@39.129-180-91.adsl-dyn.isp.belgacom.be) (Ping timeout: 244 seconds) |
| 23:15:40 | → | YoungFrog joins (~youngfrog@39.129-180-91.adsl-dyn.isp.belgacom.be) |
| 23:16:31 | × | adanwan quits (~adanwan@gateway/tor-sasl/adanwan) (Remote host closed the connection) |
| 23:16:56 | → | adanwan joins (~adanwan@gateway/tor-sasl/adanwan) |
| 23:25:39 | × | eggplantade quits (~Eggplanta@2600:1700:bef1:5e10:5546:a014:fe40:2124) (Remote host closed the connection) |
| 23:28:50 | × | segfaultfizzbuzz quits (~segfaultf@157-131-253-58.fiber.dynamic.sonic.net) (Ping timeout: 240 seconds) |
| 23:36:02 | × | toluene quits (~toluene@user/toulene) (Read error: Connection reset by peer) |
| 23:36:54 | <yin> | maerwald: haskell lacks good structural typing? |
| 23:38:33 | <maerwald> | yeah, see typescript or purescript |
| 23:39:10 | × | Lord_of_Life quits (~Lord@user/lord-of-life/x-2819915) (Ping timeout: 240 seconds) |
| 23:39:13 | → | Lord_of_Life_ joins (~Lord@user/lord-of-life/x-2819915) |
| 23:40:03 | × | merijn quits (~merijn@c-001-001-023.client.esciencecenter.eduvpn.nl) (Ping timeout: 276 seconds) |
| 23:40:18 | → | toluene joins (~toluene@user/toulene) |
| 23:40:27 | Lord_of_Life_ | is now known as Lord_of_Life |
| 23:41:15 | × | matthewmosior quits (~matthewmo@173.170.253.91) (Ping timeout: 244 seconds) |
| 23:41:50 | → | dlock joins (~dlock@213.205.241.187) |
| 23:42:11 | <dlock> | is there a way to run a haskell code snippet in a haskell program? |
| 23:42:57 | <dlock> | like with a Read and Show instance? |
| 23:42:57 | <geekosaur> | strictly speaking, yes. if you expect ot to be able to access the running program, no |
| 23:43:11 | <geekosaur> | (it would run in its own execution context) |
| 23:43:15 | <dlock> | the program is rerun on different snippets |
| 23:43:18 | <geekosaur> | *it to |
| 23:43:34 | <geekosaur> | take a look at the hint library, or Mueval if you want sandboxing |
| 23:43:35 | <c_wraith> | I mean, ghci exists. You can do anything ghci does. That doesn't mean it's *easy*... |
| 23:43:49 | <dlock> | "i can do anything ghci does" |
| 23:43:54 | <dlock> | this sounds promising |
| 23:44:22 | <geekosaur> | working with the ghc api directly is also possible but is noticeably harder than using hint or mueval |
| 23:45:08 | <dlock> | ah, used for lambdabot, perfect |
| 23:45:33 | <dlock> | im not sure if hacking with the GHC tools is a good idea, id rather keep them to a minimal |
| 23:46:02 | <dlock> | i doubt they would be good to work with unless on some really powerful footing, which might bloat them |
| 23:46:11 | <dlock> | i guess these other packages provide user functionality |
| 23:46:25 | <geekosaur> | they're friendlier wrappers for ghc-api |
| 23:46:49 | <hpc> | > "mueval is how lambdabot " ++ "does this" |
| 23:46:51 | <lambdabot> | "mueval is how lambdabot does this" |
| 23:47:05 | <dlock> | so suppose i want not only to save some data inupts and outputs to a function, but also the function that was run to produce the outputs from the inputs |
| 23:47:43 | <geekosaur> | you would only be able to save it in source form; there's no way to serialize or load bytecode |
| 23:48:00 | <dlock> | id expect this to be something like "the Show instance is valid haskell |
| 23:48:04 | <dlock> | " |
| 23:48:11 | <geekosaur> | hypothetically you might be able to do the equivalent of -fobject-code, but that puts you squarely into direct ghc-api territory |
| 23:48:30 | <dlock> | i dont want to have to save whole modules |
| 23:48:47 | <dlock> | and i dont want the interface to incorperating to be done at the linking stage |
| 23:49:14 | <dlock> | basically i just want the program to read the "function" the same way as it reads the "value" |
| 23:49:37 | <c_wraith> | by contrast, hint gives you tools to pass values from your code into and out of evaluated code, but they're rather awkward |
| 23:49:45 | <dlock> | basically because trying to output a module you use to where you want to save them to is difficult |
| 23:50:31 | <dlock> | c_wraith: i cant picture this concept of passing functions through evaluated code? |
| 23:50:48 | <dlock> | or values |
| 23:51:13 | <dlock> | i wouldnt expect it could be evaluated before it recieves input |
| 23:51:15 | <c_wraith> | well, I suppose that's not quite accurate. It's easy to evaluate things which produce functions that run on any value you want. |
| 23:51:40 | <dlock> | ok like some partially evaluated expression stuck awaiting an input arg |
| 23:51:52 | <dlock> | do we lazily consume inputs like that? |
| 23:52:00 | <c_wraith> | I mean.. it's just.. functions. |
| 23:52:08 | → | segfaultfizzbuzz joins (~segfaultf@157-131-253-58.fiber.dynamic.sonic.net) |
| 23:52:10 | <dlock> | anyway, thats probably not how these libraries are going to have me write it |
| 23:52:51 | × | pretty_dumm_guy quits (trottel@gateway/vpn/protonvpn/prettydummguy/x-88029655) (Quit: WeeChat 3.5) |
| 23:52:54 | <dlock> | ok, so the function in question is eg. either a net or a matrix |
| 23:53:13 | <dlock> | and we dont know, but we want to save matricies with matrix input output pairs, and nets with net input output pairs |
| 23:53:23 | <dlock> | so the user never tries to apply the inputs to the wrong function |
| 23:54:04 | <dlock> | its a version control thing. i cant just save the input output pairs and have the function be part of changing code |
| 23:54:19 | <dlock> | ill never know which function they were for, so i need to save the functions |
| 23:55:27 | <dlock> | imagine if it was the memory state for a markov trading model, and i train something that gives me good matrix and when i uplaod it it tries to parametrise a net with it... must provide actual model encoding along with state |
| 23:56:01 | → | matthewmosior joins (~matthewmo@173.170.253.91) |
| 23:56:14 | <dlock> | my task seems like its using hint or mueval to express matrix multiplication and net evaluation |
| 23:56:18 | × | tdodrlt^ quits (~tdodrlt@12.187.69.131) (Ping timeout: 240 seconds) |
| 23:56:33 | <dlock> | and anything else i might want to use as a parametric model but havent yet thought of, which is important |
| 23:57:26 | <dlock> | parametric models is a big thing, might be worth a package of its own seeing how this haskell infrastructure seems particularly well suited |
| 23:58:19 | <dlock> | so can i do something like f = readFromFile "pathToFunction.notHs" |
| 23:58:42 | <dlock> | and get like IO (?) |
All times are in UTC on 2022-07-17.