Logs on 2022-07-31 (liberachat/#haskell)
| 00:01:38 | → | matthewmosior joins (~matthewmo@173.170.253.91) |
| 00:01:41 | × | califax quits (~califax@user/califx) (Remote host closed the connection) |
| 00:03:13 | → | califax joins (~califax@user/califx) |
| 00:04:15 | × | gurkenglas quits (~gurkengla@p548ac71b.dip0.t-ipconnect.de) (Ping timeout: 252 seconds) |
| 00:07:08 | → | sandy_doo joins (~sandydoo@185.209.196.136) |
| 00:08:15 | → | wroathe joins (~wroathe@206-55-188-8.fttp.usinternet.com) |
| 00:08:15 | × | wroathe quits (~wroathe@206-55-188-8.fttp.usinternet.com) (Changing host) |
| 00:08:15 | → | wroathe joins (~wroathe@user/wroathe) |
| 00:09:21 | × | califax quits (~califax@user/califx) (Ping timeout: 268 seconds) |
| 00:09:49 | <dolio> | > sequence (Just ("a", 1)) |
| 00:09:50 | <lambdabot> | ("a",Just 1) |
| 00:11:08 | → | dcoutts__ joins (~duncan@host86-151-44-186.range86-151.btcentralplus.com) |
| 00:11:18 | → | nate4 joins (~nate@98.45.169.16) |
| 00:12:01 | → | califax joins (~califax@user/califx) |
| 00:13:47 | × | dcoutts_ quits (~duncan@host109-149-1-189.range109-149.btcentralplus.com) (Ping timeout: 252 seconds) |
| 00:19:24 | yin | shrugs |
| 00:21:36 | × | phma quits (~phma@host-67-44-208-231.hnremote.net) (Read error: Connection reset by peer) |
| 00:26:05 | <monochrom> | Haha I see the true life hack now. |
| 00:26:45 | <monochrom> | "The inverse of sequence is... sequence!" |
| 00:27:13 | × | nate4 quits (~nate@98.45.169.16) (Ping timeout: 268 seconds) |
| 00:34:41 | → | GuerrillaMonkey joins (~Jeanne-Ka@142.147.89.233) |
| 00:35:49 | × | tubogram44 quits (~tubogram@user/tubogram) (Quit: See ya later!) |
| 00:35:58 | <yin> | > sequence . sequence $ Just ("a",1) |
| 00:36:01 | <lambdabot> | Just ("a",1) |
| 00:37:07 | × | Jeanne-Kamikaze quits (~Jeanne-Ka@142.147.89.198) (Ping timeout: 245 seconds) |
| 00:38:24 | → | tubogram44 joins (~tubogram@user/tubogram) |
| 00:43:10 | × | albet70 quits (~xxx@2400:8902::f03c:92ff:fe60:98d8) (Remote host closed the connection) |
| 00:44:06 | <mrianbloom> | Where is a good place to see the Data.Constraint library in action if one is trying to learn to use it? |
| 00:45:04 | → | machinedgod joins (~machinedg@d172-219-86-154.abhsia.telus.net) |
| 00:46:26 | → | phma joins (~phma@host-67-44-208-60.hnremote.net) |
| 00:49:18 | → | albet70 joins (~xxx@2400:8902::f03c:92ff:fe60:98d8) |
| 00:50:11 | → | tstat joins (~user@user/tstat) |
| 01:04:59 | × | matthewmosior quits (~matthewmo@173.170.253.91) (Ping timeout: 255 seconds) |
| 01:09:12 | × | zebrag quits (~chris@user/zebrag) (Ping timeout: 245 seconds) |
| 01:13:50 | → | zebrag joins (~chris@user/zebrag) |
| 01:14:45 | × | pretty_dumm_guy quits (trottel@gateway/vpn/protonvpn/prettydummguy/x-88029655) (Quit: WeeChat 3.5) |
| 01:16:24 | → | kimjetwav joins (~user@2607:fea8:235e:b600:4fe5:aa4:5bfb:2ba6) |
| 01:17:03 | → | bontaq joins (~user@ool-45779fe5.dyn.optonline.net) |
| 01:18:14 | <dmj`> | is there a library that generates haskell types from a json schema definition? |
| 01:19:48 | × | crazazy quits (~user@130.89.171.62) (Ping timeout: 244 seconds) |
| 01:22:36 | → | bilegeek joins (~bilegeek@2600:1008:b052:7d02:5779:f1d9:cfbf:c1a3) |
| 01:24:05 | → | naso joins (~naso@193-116-244-197.tpgi.com.au) |
| 01:24:31 | → | Inst joins (~Inst@2601:6c4:4080:3f80:d998:768b:c35b:a535) |
| 01:24:40 | → | matthewmosior joins (~matthewmo@173.170.253.91) |
| 01:33:58 | × | yin quits (~yin@user/zero) (Quit: leaving) |
| 01:37:07 | × | xff0x quits (~xff0x@ap007189.d.east.v6connect.net) (Ping timeout: 245 seconds) |
| 01:44:30 | → | xff0x joins (~xff0x@ap007189.d.east.v6connect.net) |
| 01:44:58 | × | Typedfern quits (~Typedfern@202.red-83-37-35.dynamicip.rima-tde.net) (Ping timeout: 240 seconds) |
| 01:48:38 | → | Typedfern joins (~Typedfern@202.red-83-37-35.dynamicip.rima-tde.net) |
| 01:49:32 | → | yauhsien joins (~yauhsien@61-231-30-230.dynamic-ip.hinet.net) |
| 01:55:21 | × | yauhsien quits (~yauhsien@61-231-30-230.dynamic-ip.hinet.net) (Ping timeout: 252 seconds) |
| 02:00:29 | × | tstat quits (~user@user/tstat) (Ping timeout: 252 seconds) |
| 02:12:44 | → | mvk joins (~mvk@2607:fea8:5ce3:8500::311d) |
| 02:21:56 | × | jpds1 quits (~jpds@gateway/tor-sasl/jpds) (Ping timeout: 268 seconds) |
| 02:23:29 | × | FinnElija quits (~finn_elij@user/finn-elija/x-0085643) (Killed (NickServ (Forcing logout FinnElija -> finn_elija))) |
| 02:23:29 | → | finn_elija joins (~finn_elij@user/finn-elija/x-0085643) |
| 02:23:29 | finn_elija | is now known as FinnElija |
| 02:24:04 | → | jpds1 joins (~jpds@gateway/tor-sasl/jpds) |
| 02:28:47 | × | matthewmosior quits (~matthewmo@173.170.253.91) (Ping timeout: 245 seconds) |
| 02:32:20 | × | ystael quits (~ystael@user/ystael) (Ping timeout: 268 seconds) |
| 02:32:49 | → | [_] joins (~itchyjunk@user/itchyjunk/x-7353470) |
| 02:32:57 | × | [itchyjunk] quits (~itchyjunk@user/itchyjunk/x-7353470) (Ping timeout: 245 seconds) |
| 02:33:06 | [_] | is now known as [itchyjunk] |
| 02:34:33 | → | matthewmosior joins (~matthewmo@173.170.253.91) |
| 02:41:40 | → | jargon joins (~jargon@184.101.188.251) |
| 02:44:03 | × | td_ quits (~td@94.134.91.248) (Ping timeout: 268 seconds) |
| 02:45:33 | → | td_ joins (~td@94.134.91.252) |
| 02:52:38 | × | GuerrillaMonkey quits (~Jeanne-Ka@142.147.89.233) (Quit: Leaving) |
| 02:52:54 | → | Jeanne-Kamikaze joins (~Jeanne-Ka@142.147.89.233) |
| 02:52:56 | × | [itchyjunk] quits (~itchyjunk@user/itchyjunk/x-7353470) (Remote host closed the connection) |
| 02:54:37 | → | yin joins (~yin@user/zero) |
| 03:06:00 | → | tromp joins (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) |
| 03:06:35 | × | tromp quits (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Client Quit) |
| 03:15:58 | × | funsafe quits (~funsafe@2601:1c1:4200:9ac:84cb:185c:2a3c:c92c) (Ping timeout: 272 seconds) |
| 03:17:38 | → | funsafe joins (~funsafe@2601:1c1:4200:9ac:84cb:185c:2a3c:c92c) |
| 03:20:25 | → | nate4 joins (~nate@98.45.169.16) |
| 03:24:49 | × | yin quits (~yin@user/zero) (Ping timeout: 252 seconds) |
| 03:25:43 | → | yin joins (~yin@user/zero) |
| 03:27:48 | × | Haskelytic quits (~Haskelyti@118.179.211.17) (Quit: Client closed) |
| 03:30:32 | × | johnw quits (~johnw@76-234-69-149.lightspeed.frokca.sbcglobal.net) (Quit: ZNC - http://znc.in) |
| 03:32:45 | × | zebrag quits (~chris@user/zebrag) (Quit: Konversation terminated!) |
| 03:35:13 | × | naso quits (~naso@193-116-244-197.tpgi.com.au) (Remote host closed the connection) |
| 03:36:29 | → | naso joins (~naso@193-116-244-197.tpgi.com.au) |
| 03:37:05 | × | matthewmosior quits (~matthewmo@173.170.253.91) (Ping timeout: 255 seconds) |
| 03:40:52 | × | naso quits (~naso@193-116-244-197.tpgi.com.au) (Ping timeout: 245 seconds) |
| 03:41:42 | × | nate4 quits (~nate@98.45.169.16) (Ping timeout: 245 seconds) |
| 03:45:19 | → | naso joins (~naso@193-116-244-197.tpgi.com.au) |
| 03:51:22 | → | vglfr joins (~vglfr@194.9.14.33) |
| 03:59:51 | → | matthewmosior joins (~matthewmo@173.170.253.91) |
| 04:01:42 | × | vglfr quits (~vglfr@194.9.14.33) (Ping timeout: 245 seconds) |
| 04:01:42 | × | wroathe quits (~wroathe@user/wroathe) (Ping timeout: 245 seconds) |
| 04:01:50 | → | vglfr joins (~vglfr@194.9.14.33) |
| 04:04:06 | × | matthewmosior quits (~matthewmo@173.170.253.91) (Ping timeout: 244 seconds) |
| 04:06:15 | × | jao quits (~jao@cpc103048-sgyl39-2-0-cust502.18-2.cable.virginm.net) (Ping timeout: 252 seconds) |
| 04:07:43 | → | nate4 joins (~nate@98.45.169.16) |
| 04:12:07 | × | nate4 quits (~nate@98.45.169.16) (Ping timeout: 252 seconds) |
| 04:14:23 | → | matthewmosior joins (~matthewmo@173.170.253.91) |
| 04:17:56 | × | vglfr quits (~vglfr@194.9.14.33) (Read error: Connection reset by peer) |
| 04:18:39 | → | vglfr joins (~vglfr@194.9.14.33) |
| 04:24:48 | → | nate4 joins (~nate@98.45.169.16) |
| 04:25:27 | → | benin0 joins (~benin@183.82.177.174) |
| 04:25:48 | × | vglfr quits (~vglfr@194.9.14.33) (Ping timeout: 268 seconds) |
| 04:26:04 | → | vglfr joins (~vglfr@194.9.14.33) |
| 04:34:21 | × | foul_owl quits (~kerry@23.82.194.108) (Read error: Connection reset by peer) |
| 04:37:03 | × | vglfr quits (~vglfr@194.9.14.33) (Ping timeout: 252 seconds) |
| 04:37:03 | × | nate4 quits (~nate@98.45.169.16) (Ping timeout: 252 seconds) |
| 04:37:23 | → | vglfr joins (~vglfr@194.9.14.33) |
| 04:39:22 | × | machinedgod quits (~machinedg@d172-219-86-154.abhsia.telus.net) (Ping timeout: 268 seconds) |
| 04:41:14 | <naso> | how can i open a cabal repl so my test modules are in scope |
| 04:42:10 | <sclv> | cabl repl test-suite-name or test:test-suite-name |
| 04:43:21 | <naso> | thank you |
| 04:45:27 | × | Kaiepi quits (~Kaiepi@156.34.47.253) (Quit: Leaving) |
| 04:53:29 | → | foul_owl joins (~kerry@23.82.194.108) |
| 04:54:53 | × | Jeanne-Kamikaze quits (~Jeanne-Ka@142.147.89.233) (Quit: Leaving) |
| 05:00:57 | × | naso quits (~naso@193-116-244-197.tpgi.com.au) (Remote host closed the connection) |
| 05:03:06 | → | naso joins (~naso@193-116-244-197.tpgi.com.au) |
| 05:04:55 | × | xff0x quits (~xff0x@ap007189.d.east.v6connect.net) (Ping timeout: 252 seconds) |
| 05:05:18 | → | xff0x joins (~xff0x@ap007189.d.east.v6connect.net) |
| 05:09:42 | → | mbuf joins (~Shakthi@122.165.55.71) |
| 05:12:03 | × | vglfr quits (~vglfr@194.9.14.33) (Ping timeout: 268 seconds) |
| 05:12:40 | → | vglfr joins (~vglfr@194.9.14.33) |
| 05:15:10 | × | naso quits (~naso@193-116-244-197.tpgi.com.au) (Remote host closed the connection) |
| 05:15:56 | → | naso joins (~naso@193-116-244-197.tpgi.com.au) |
| 05:16:42 | × | matthewmosior quits (~matthewmo@173.170.253.91) (Ping timeout: 245 seconds) |
| 05:18:58 | × | naso quits (~naso@193-116-244-197.tpgi.com.au) (Remote host closed the connection) |
| 05:19:13 | → | naso joins (~naso@193-116-244-197.tpgi.com.au) |
| 05:27:33 | × | monochrom quits (trebla@216.138.220.146) (Read error: Connection reset by peer) |
| 05:30:04 | → | matthewmosior joins (~matthewmo@173.170.253.91) |
| 05:31:51 | × | naso quits (~naso@193-116-244-197.tpgi.com.au) (Remote host closed the connection) |
| 05:32:53 | → | naso joins (~naso@193-116-244-197.tpgi.com.au) |
| 05:32:57 | × | naso quits (~naso@193-116-244-197.tpgi.com.au) (Remote host closed the connection) |
| 05:33:22 | → | naso joins (~naso@193-116-244-197.tpgi.com.au) |
| 05:34:15 | × | mon_aaraj quits (~MonAaraj@user/mon-aaraj/x-4416475) (Ping timeout: 252 seconds) |
| 05:36:45 | → | azimut joins (~azimut@gateway/tor-sasl/azimut) |
| 05:43:04 | → | monochrom joins (trebla@216.138.220.146) |
| 05:43:36 | → | Pickchea joins (~private@user/pickchea) |
| 05:55:31 | × | rembo10 quits (~rembo10@main.remulis.com) (Quit: ZNC 1.8.2 - https://znc.in) |
| 05:56:29 | → | rembo10 joins (~rembo10@main.remulis.com) |
| 05:56:35 | → | mon_aaraj joins (~MonAaraj@user/mon-aaraj/x-4416475) |
| 05:59:34 | × | Batzy quits (~quassel@user/batzy) (Read error: Connection reset by peer) |
| 06:07:36 | × | bilegeek quits (~bilegeek@2600:1008:b052:7d02:5779:f1d9:cfbf:c1a3) (Ping timeout: 244 seconds) |
| 06:22:12 | → | tromp joins (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) |
| 06:23:36 | × | myme1 quits (~myme@2a01:799:d5a:cd00:c77:b8df:327d:c96f) (Ping timeout: 244 seconds) |
| 06:24:28 | → | myme1 joins (~myme@2a01:799:d5a:cd00:f235:66bd:b223:d95e) |
| 06:26:31 | ← | winny parts (~weechat@user/winny) (WeeChat 3.2) |
| 06:28:16 | × | mvk quits (~mvk@2607:fea8:5ce3:8500::311d) (Ping timeout: 244 seconds) |
| 06:31:39 | × | tromp quits (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…) |
| 06:33:26 | × | matthewmosior quits (~matthewmo@173.170.253.91) (Ping timeout: 244 seconds) |
| 06:37:36 | → | z0k joins (~z0k@206.84.140.97) |
| 06:39:15 | × | naso quits (~naso@193-116-244-197.tpgi.com.au) (Remote host closed the connection) |
| 06:39:21 | × | obabo1 quits (~obabo@20014C4C1C5409000000000000001000.catv.pool.telekom.hu) (Quit: WeeChat 3.6) |
| 06:40:18 | → | naso joins (~naso@193-116-244-197.tpgi.com.au) |
| 06:42:05 | × | Pickchea quits (~private@user/pickchea) (Ping timeout: 252 seconds) |
| 06:53:12 | → | acidjnk joins (~acidjnk@p200300d6e70586358424384a1bd111e9.dip0.t-ipconnect.de) |
| 06:53:38 | → | tromp joins (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) |
| 06:57:57 | × | mon_aaraj quits (~MonAaraj@user/mon-aaraj/x-4416475) (Ping timeout: 245 seconds) |
| 06:59:20 | → | matthewmosior joins (~matthewmo@173.170.253.91) |
| 07:01:36 | → | mon_aaraj joins (~MonAaraj@user/mon-aaraj/x-4416475) |
| 07:02:37 | × | sandy_doo quits (~sandydoo@185.209.196.136) (Ping timeout: 252 seconds) |
| 07:03:41 | × | ChaiTRex quits (~ChaiTRex@user/chaitrex) (Remote host closed the connection) |
| 07:04:25 | → | ChaiTRex joins (~ChaiTRex@user/chaitrex) |
| 07:04:32 | × | matthewmosior quits (~matthewmo@173.170.253.91) (Ping timeout: 255 seconds) |
| 07:07:29 | → | Kaiepi joins (~Kaiepi@156.34.47.253) |
| 07:07:55 | → | retropikzel joins (9d1a4f9f46@2604:bf00:561:2000::ce) |
| 07:11:11 | → | chomwitt joins (~chomwitt@2a02:587:dc12:b700:9b5a:97ff:58b5:cbbb) |
| 07:12:36 | → | johnw joins (~johnw@76-234-69-149.lightspeed.frokca.sbcglobal.net) |
| 07:13:54 | × | johnw quits (~johnw@76-234-69-149.lightspeed.frokca.sbcglobal.net) (Client Quit) |
| 07:20:30 | × | chomwitt quits (~chomwitt@2a02:587:dc12:b700:9b5a:97ff:58b5:cbbb) (Ping timeout: 240 seconds) |
| 07:22:15 | → | coco joins (~coco@212-51-146-199.fiber7.init7.net) |
| 07:24:31 | → | bilegeek joins (~bilegeek@50.sub-174-209-38.myvzw.com) |
| 07:30:15 | × | mrmr quits (~mrmr@user/mrmr) (Quit: Ping timeout (120 seconds)) |
| 07:30:35 | → | mrmr joins (~mrmr@user/mrmr) |
| 07:30:52 | × | vglfr quits (~vglfr@194.9.14.33) (Ping timeout: 245 seconds) |
| 07:32:21 | → | ggVGc joins (~ggVGc@a.lowtech.earth) |
| 07:32:22 | → | matthewmosior joins (~matthewmo@173.170.253.91) |
| 07:34:21 | → | johnw joins (~johnw@76-234-69-149.lightspeed.frokca.sbcglobal.net) |
| 07:36:56 | × | matthewmosior quits (~matthewmo@173.170.253.91) (Ping timeout: 255 seconds) |
| 07:40:22 | <ggVGc> | What would be the most straightforward way to define a one-way relationship on the type-level? For example modelling null-casting, like: You can get a Null a from an a, but you can't go the other way. |
| 07:41:15 | <ggVGc> | actually, that's too simplistic |
| 07:41:57 | × | shriekingnoise quits (~shrieking@186.137.167.202) (Quit: Quit) |
| 07:42:57 | × | mon_aaraj quits (~MonAaraj@user/mon-aaraj/x-4416475) (Ping timeout: 245 seconds) |
| 07:44:00 | → | mon_aaraj joins (~MonAaraj@user/mon-aaraj/x-4416475) |
| 07:48:50 | <ggVGc> | For example: assign (Nullable a) (Nullable b) = ok, assign a (Nullable b) = ok, assign (Nullable a) b = type error |
| 07:52:28 | × | tromp quits (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…) |
| 07:52:37 | × | albet70 quits (~xxx@2400:8902::f03c:92ff:fe60:98d8) (Remote host closed the connection) |
| 07:55:28 | × | mon_aaraj quits (~MonAaraj@user/mon-aaraj/x-4416475) (Ping timeout: 268 seconds) |
| 07:57:23 | → | mon_aaraj joins (~MonAaraj@user/mon-aaraj/x-4416475) |
| 08:02:04 | → | vglfr joins (~vglfr@194.9.14.33) |
| 08:07:10 | → | matthewmosior joins (~matthewmo@173.170.253.91) |
| 08:11:17 | → | gurkenglas joins (~gurkengla@p548ac71b.dip0.t-ipconnect.de) |
| 08:11:17 | × | matthewmosior quits (~matthewmo@173.170.253.91) (Ping timeout: 245 seconds) |
| 08:18:10 | → | albet70 joins (~xxx@2400:8902::f03c:92ff:fe60:98d8) |
| 08:19:24 | → | yauhsien joins (~yauhsien@118-167-41-184.dynamic-ip.hinet.net) |
| 08:20:49 | → | chomwitt joins (~chomwitt@2a02:587:dc12:b700:569a:41be:aae6:a6d5) |
| 08:22:35 | → | kenran joins (~kenran@200116b82b2ba400dde0e2235d830ce2.dip.versatel-1u1.de) |
| 08:23:39 | × | yauhsien quits (~yauhsien@118-167-41-184.dynamic-ip.hinet.net) (Ping timeout: 252 seconds) |
| 08:24:29 | × | kenran quits (~kenran@200116b82b2ba400dde0e2235d830ce2.dip.versatel-1u1.de) (Client Quit) |
| 08:25:33 | × | dextaa quits (~DV@user/dextaa) (Ping timeout: 244 seconds) |
| 08:26:50 | → | matthewmosior joins (~matthewmo@173.170.253.91) |
| 08:27:45 | × | tzh quits (~tzh@c-24-21-73-154.hsd1.or.comcast.net) (Quit: zzz) |
| 08:30:43 | → | sonologico joins (~raphael@dhcp-077-251-118-129.chello.nl) |
| 08:32:50 | × | bilegeek quits (~bilegeek@50.sub-174-209-38.myvzw.com) (Remote host closed the connection) |
| 08:33:15 | → | bilegeek joins (~bilegeek@50.sub-174-209-38.myvzw.com) |
| 08:33:58 | × | chomwitt quits (~chomwitt@2a02:587:dc12:b700:569a:41be:aae6:a6d5) (Ping timeout: 240 seconds) |
| 08:34:10 | → | misterfish joins (~misterfis@ip214-130-173-82.adsl2.static.versatel.nl) |
| 08:36:55 | → | sandy_doo joins (~sandydoo@185.209.196.136) |
| 08:43:47 | ← | jakalx parts (~jakalx@base.jakalx.net) () |
| 08:46:05 | ← | retropikzel parts (9d1a4f9f46@2604:bf00:561:2000::ce) () |
| 08:49:11 | <tomsmeding> | Haskell doesn't do implicit casting |
| 08:49:48 | <tomsmeding> | But if explicit is fine: what about a type class that precisely models the allowed pairs? |
| 08:50:47 | <tomsmeding> | ggVGc: ^ |
| 08:51:37 | <tomsmeding> | Is `assign a b = ok` if neither a nor b are Nullable? |
| 08:56:46 | × | causal quits (~user@2001:470:ea0f:3:329c:23ff:fe3f:1e0e) (Quit: WeeChat 3.6) |
| 08:58:26 | <tomsmeding> | ggVGc: https://play-haskell.tomsmeding.com/play/paste/g0rxiCwN/1 |
| 08:59:38 | <tomsmeding> | In a closed type family, like this is (because of the use of 'where' instead of standalone 'type instance' statements), the equations are checked in-order from top to bottom |
| 09:00:09 | × | ereslibre[m] quits (~ereslibre@2001:470:69fc:105::1:8f90) (Quit: You have been kicked for being idle) |
| 09:00:09 | × | shiraeeshi[m] quits (~shiraeesh@2001:470:69fc:105::1:77) (Quit: You have been kicked for being idle) |
| 09:00:23 | → | jakalx joins (~jakalx@base.jakalx.net) |
| 09:00:27 | <tomsmeding> | Hence, for example, the second equation, F (Nullable a) b, will only get picked if ghc can prove that b does not match `Nullable c` for any c |
| 09:00:40 | → | ereslibre[m] joins (~ereslibre@2001:470:69fc:105::1:8f90) |
| 09:00:52 | → | shiraeeshi[m] joins (~shiraeesh@2001:470:69fc:105::1:77) |
| 09:01:01 | <tomsmeding> | You can model basically any relation you want this way, though it's a bit of a blunt hammer |
| 09:03:47 | × | sonologico quits (~raphael@dhcp-077-251-118-129.chello.nl) (Ping timeout: 245 seconds) |
| 09:04:41 | × | eggplantade quits (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Remote host closed the connection) |
| 09:06:43 | <ggVGc> | tomsmeding: thanks, was trying to achieve it through a type family (like you showed) but got stuck a few times. Your example helps a lot! |
| 09:07:19 | <ggVGc> | blunt hammer is fine for my use-case. I have the exact same "blunt hammer" implemented at the value level atm... |
| 09:08:18 | <ggVGc> | it validates subsets of ranges. Like, positive numbers being a subset of all numbers, and nullable ranges not being subsets of non-nullable ones etc. |
| 09:08:39 | <tomsmeding> | Sounds like a lattice |
| 09:08:46 | <ggVGc> | I've been meaning to move most of it to the type level for a long time but never got to it (and haven't been sure how to best achieve it) |
| 09:08:58 | <tomsmeding> | Though I doubt knowing that it's a lattice helps much :) |
| 09:09:52 | → | Tuplanolla joins (~Tuplanoll@91-159-68-204.elisa-laajakaista.fi) |
| 09:11:06 | <tomsmeding> | Doing it with a closed type family instead of a network of type class instances (if that's even possible -- definitely with overlapping instances, but eh) furthermore has the advantage that a malicious user can't just add an extra instance |
| 09:13:54 | <ggVGc> | yep, that's why I felt type families might be the right choice. I went down the type class path a bit, and it didn't feel like it'd work out well |
| 09:14:36 | <ggVGc> | this is my first actual usage of type families though, so it's good to finally understand them through a real-world use-case |
| 09:15:17 | → | Guest49 joins (~Guest49@5.214.214.80) |
| 09:15:20 | → | Jade30 joins (~Jade@ip-178-201-128-039.um46.pools.vodafone-ip.de) |
| 09:16:08 | <Jade30> | Hello, I'm trying to install the haskell toolstack but upon installing with ghcup I get |
| 09:16:08 | <Jade30> | ``` |
| 09:16:09 | <Jade30> | [ Error ] Process "make" with arguments ["DESTDIR=/home/jade/.ghcup/tmp/ghcup-a853bee7b96b6a44", |
| 09:16:09 | <Jade30> | [ ... ] "install"] failed with exit code 1. |
| 09:16:10 | <Jade30> | [ Error ] Also check the logs in /home/jade/.ghcup/logs |
| 09:16:10 | <Jade30> | "_eghcup --cache install ghc recommended" failed! |
| 09:16:11 | <Jade30> | ``` |
| 09:16:56 | <Guest49> | Hi there. I am 18 years old. I was wondering.whether haskell is a wide option as the first programming language for me? |
| 09:17:10 | <Guest49> | Wise* |
| 09:18:47 | <Rembane> | Guest49: Yes, but you'll have a very interesting experience learning other programming languages. |
| 09:19:02 | <ggVGc> | Guest49: your age probably doesn't matter much, but your past programming experience does. Haskell the language is somewhat okay as a first choice, although learning it from online resources is more challenging than other languages in my opinion. The bigger issue I think, for a beginner in programming in general, is that the tooling around haskell is still less than ideal, and it can be hard to |
| 09:19:03 | <ggVGc> | get started because of that |
| 09:19:37 | <ggVGc> | see for example what Jade30 just posted above... |
| 09:19:47 | → | Milan joins (~Milan@46.245.111.222) |
| 09:20:16 | <tomsmeding> | Jade30: can you post the most recent log file in /home/jade/.ghcup/logs ? |
| 09:20:22 | <tomsmeding> | @where paste |
| 09:20:22 | <lambdabot> | Help us help you: please paste full code, input and/or output at e.g. https://paste.tomsmeding.com |
| 09:22:02 | <ggVGc> | I'm gonna go out on a limb and suggest Elixir as a first programming language instead. Because it's incredibly easy to get setup and begin a first project, the documentation is superb, and it's designed to be quite simple and straight-forward. At the same time it's a functional language, and runs on a mature platform, and there's a proper (although still small) job market for it |
| 09:22:32 | <ggVGc> | Spending a month with Elixir as a beginner programmer would probably be a lot less frustrating than a first month with Haskell though |
| 09:22:44 | × | Guest49 quits (~Guest49@5.214.214.80) (Ping timeout: 252 seconds) |
| 09:22:50 | <ggVGc> | oh well |
| 09:22:55 | <ggVGc> | guess that was wasted text |
| 09:23:12 | → | Guest49 joins (~Guest49@5.214.214.80) |
| 09:23:37 | <ggVGc> | did you see my last comment about maybe looking at Elixir, Guest49? |
| 09:23:55 | <Guest49> | Oh no |
| 09:24:13 | <ggVGc> | 09:22:01 ggVGc | I'm gonna go out on a limb and suggest Elixir as a first programming language instead. Because it's incredibly easy to get setup and begin a first project, the documentation is |
| 09:24:15 | <ggVGc> | | superb, and it's designed to be quite simple and straight-forward. At the same time it's a functional language, and runs on a mature platform, and there's a proper (although |
| 09:24:17 | <ggVGc> | | still small) job market for it |
| 09:24:19 | <ggVGc> | 09:22:32 ggVGc | Spending a month with Elixir as a beginner programmer would probably be a lot less frustrating than a first month with Haskell though |
| 09:24:21 | <ggVGc> | Guest49: ^ |
| 09:25:18 | <Guest49> | Do you think that learning a functional program first is a good idea at all? |
| 09:26:20 | <ggVGc> | My personal input is that I was programming for a few years in C++, C# and Python, and at age 19 (not that age matters that much) I had my first go at Haskell. I didn't have a great time, and eventually gave up and started writing F# instead (which had just been released that year). A few years after that I started looking at haskell again and am using it today. But I don't think that the |
| 09:26:22 | <ggVGc> | developer experience of Haskell is |
| 09:26:31 | <ggVGc> | very good compared to other languages, even if I like the language itself now |
| 09:26:49 | <ggVGc> | Guest49: yes, definitely going the functinal path from the start is a good idea |
| 09:26:55 | <ggVGc> | that's why I think Elixir is a great stepping stone |
| 09:27:45 | <ggVGc> | It's a well designed, easy-to-use, functional programming language that is used in production by many companies (e.g it's mature, both in functionality and tooling) |
| 09:28:05 | <Rembane> | A lot of time and effort has gone into the developer experience of elixir. |
| 09:28:15 | <ggVGc> | it's definitely not as powerful as Haskell, but as a beginner (either in programming, or functional programming) that's mostly a good thing |
| 09:29:12 | × | matthewmosior quits (~matthewmo@173.170.253.91) (Ping timeout: 245 seconds) |
| 09:30:37 | <Milan> | if u were me , you would choose Elixir instead of something like python ? |
| 09:30:44 | <ggVGc> | Guest49: Haskell is a very interesting language to learn, and it has capabilities that are difficult to find elsewhere. But, that comes at a (sometimes huge) learning cost, and most of it is actually not really useful for the vast majority of things. So, my personal suggestion is to say "Haskell is interesting, I'll definitely look at it" but not as a first step, or even in the first years of |
| 09:30:46 | <ggVGc> | programming |
| 09:31:04 | <ggVGc> | Milan: 100%, but I also recently worked as an Elixir developer for almost 5 years |
| 09:33:01 | <jackdk> | Haskell is an excellent general-purpose programming language, and I used to TA a first-year computer science course which used it and assumed no prior programming experience |
| 09:33:25 | <ggVGc> | yeah, that might work. But for self-teaching it's quite a bad choice, imo |
| 09:34:31 | → | tromp joins (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) |
| 09:34:55 | <Guest49> | I live in a village and i dont afford attending university |
| 09:35:17 | <Guest49> | I must selfstudy |
| 09:36:00 | × | mbuf quits (~Shakthi@122.165.55.71) (Quit: Leaving) |
| 09:37:31 | <Guest49> | What book do u recommend to begin learning Elixir |
| 09:37:48 | <ggVGc> | Guest49: I would say this. Pick some choices, e.g Haskell, Elixir, maybe Go, or Python. Spend a few days with each of them and try to do something simple (like getting the initial environment up and writing a small program). Compare the experience of how comfortable the experience is, and how easy it is to find clear information. Then pick one |
| 09:38:13 | <ggVGc> | I think that's the most important thing in the beginning, being able to find good information (that you understand) and easily working with the language |
| 09:38:18 | <ggVGc> | not necessarily what language you use |
| 09:38:29 | <tomsmeding> | ggVGc++ |
| 09:38:45 | <ggVGc> | after a few months you'll be able to switch to some other language and have an easier time |
| 09:39:19 | <tomsmeding> | Trying multiple languages initially takes some time investment without much reward yet, though |
| 09:39:24 | <ggVGc> | Guest49: I would start here :) https://elixir-lang.org/getting-started/introduction.html |
| 09:39:50 | <ggVGc> | tomsmeding: yeah, but if you spend a day and can't get the initial workflow up, then maybe at least that one isn't a good choice |
| 09:39:57 | × | acidjnk quits (~acidjnk@p200300d6e70586358424384a1bd111e9.dip0.t-ipconnect.de) (Ping timeout: 272 seconds) |
| 09:40:00 | <ggVGc> | I would say it's clear after 1-2 days if it's gonna work out or not |
| 09:40:31 | <tomsmeding> | ggVGc: I'm curious, would you consider Haskell more suitable for self study if there was a compiler that strictly adhered to Haskell2010 instead of suggesting one enable DataKinds when mixing up type level and value level? |
| 09:41:06 | × | coco quits (~coco@212-51-146-199.fiber7.init7.net) (Quit: WeeChat 3.5) |
| 09:42:24 | <ggVGc> | tomsmeding: I honestly think, unfortunately, that what makes Haskell unsuitable for selfstufy as a beinnger is the same reason that it is what it is (a platform for language research). It's so wide, and so evolving, and people often come to it with significant background experience (but everyone from different pasts). So, the information you find when trying to learn something is often fragmented, |
| 09:42:26 | <ggVGc> | hard to grasp, unclear if it is actually what you're looking for or not etc. |
| 09:42:32 | <ggVGc> | no one sat down and wrote a propoer "Getting started" |
| 09:42:42 | <ggVGc> | and library documentation is atrocious |
| 09:43:12 | <tomsmeding> | ggVGc: I kind of agree :) |
| 09:43:22 | <ggVGc> | restricting to Haskell2010 definitely is better as a start, I think. But that doesn't help the issue of learning resources, which are not carrying that restriction |
| 09:43:29 | <tomsmeding> | Yeah |
| 09:44:39 | <ggVGc> | This is why I suggest Elixir (not because that's what I did for work lately). The whole community very much values clear documentation, avoids complexities as much as it can, and just tries to keep things simple and well-described |
| 09:44:47 | <ggVGc> | it makes for a very good grounds for learning |
| 09:45:03 | <tomsmeding> | "avoids complexities as much as it can" -- right |
| 09:45:26 | <tomsmeding> | So the language is less expressive than haskell, and they embrace that |
| 09:45:48 | <ggVGc> | I brought a frontend developer at work into our backend team in 2-3 months, in which he got comfortable with proper functional programming (not JS-"functional") and unit testing (which he never really did properly before) |
| 09:45:52 | <ggVGc> | and backend development in general |
| 09:45:55 | <tomsmeding> | That's a good thing and very nice until you need the extra functionality |
| 09:46:07 | <ggVGc> | yeah, but 99% of the time you don't |
| 09:46:21 | <tomsmeding> | But then I believe that a good programmer should know >1 language in the first place :) |
| 09:46:47 | <tomsmeding> | ggVGc: cool |
| 09:47:19 | <tomsmeding> | That's certainly a vote of confidence for elixir |
| 09:47:32 | × | misterfish quits (~misterfis@ip214-130-173-82.adsl2.static.versatel.nl) (Ping timeout: 245 seconds) |
| 09:48:34 | <Jade30> | tomsmeding: |
| 09:48:35 | <Jade30> | Debug: Identified Platform as: Linux UnknownLinux |
| 09:48:35 | <Jade30> | Debug: last access was 8.188348676s ago, cache interval is 300s |
| 09:48:36 | <Jade30> | Debug: Decoding yaml at: /home/jade/.ghcup/cache/ghcup-0.0.7.yaml |
| 09:48:36 | <Jade30> | Debug: Requested to install GHC with 8.10.7 |
| 09:48:37 | <Jade30> | Info: verifying digest of: ghc-8.10.7-x86_64-fedora27-linux.tar.xz |
| 09:48:37 | <Jade30> | Info: Unpacking: ghc-8.10.7-x86_64-fedora27-linux.tar.xz to /home/jade/.ghcup/tmp/ghcup-415eb58728e758d9 |
| 09:48:38 | <Jade30> | Info: Installing GHC (this may take a while) |
| 09:48:38 | <Jade30> | Debug: Running sh with arguments ["./configure","--prefix=/home/jade/.ghcup/ghc/8.10.7"] |
| 09:48:39 | <Jade30> | Debug: Running make with arguments ["DESTDIR=/home/jade/.ghcup/tmp/ghcup-a853bee7b96b6a44","install"] |
| 09:48:39 | <Jade30> | Error: Process "make" with arguments ["DESTDIR=/home/jade/.ghcup/tmp/ghcup-a853bee7b96b6a44", |
| 09:48:40 | <Jade30> | "install"] failed with exit code 1. |
| 09:48:40 | <Jade30> | Error: Also check the logs in /home/jade/.ghcup/logs |
| 09:48:44 | <tomsmeding> | Jade30: use a pastebin |
| 09:48:47 | <Jade30> | (it didn't let me send the file for whatever reason |
| 09:48:57 | <tomsmeding> | Irc doesn't support files, use a pastebin |
| 09:49:03 | <Jade30> | tomsmeding, ok |
| 09:49:15 | <tomsmeding> | @where paste |
| 09:49:15 | <lambdabot> | Help us help you: please paste full code, input and/or output at e.g. https://paste.tomsmeding.com |
| 09:49:23 | <Jade30> | https://pastebin.com/gaEYYYgA |
| 09:49:32 | <Jade30> | oh |
| 09:49:46 | <tomsmeding> | Jade30: "Error: Also check the logs in /home/jade/.ghcup/logs" |
| 09:50:03 | <tomsmeding> | Can you post the most recent file in that directory? |
| 09:50:24 | <Jade30> | ghc-configure.log ghc-make.log which of these? |
| 09:50:36 | <tomsmeding> | The make one |
| 09:51:07 | <Jade30> | ghcup: make: executeFile: does not exist (No such file or directory) |
| 09:51:11 | <Jade30> | that's the only line |
| 09:51:13 | <tomsmeding> | Lol ok |
| 09:51:16 | <tomsmeding> | What OS? |
| 09:51:17 | × | bilegeek quits (~bilegeek@50.sub-174-209-38.myvzw.com) (Ping timeout: 245 seconds) |
| 09:51:20 | <Jade30> | Arch linux |
| 09:51:31 | <tomsmeding> | sudo pacman -S base-devel |
| 09:51:42 | <tomsmeding> | And then try again |
| 09:52:16 | <ggVGc> | tomsmeding: another thing is that Elixir is, by design, "verbose" when compared to haskell. To be fair, Haskell is extremely terse, so it's not a super fair comparison, and I wouldn't call Elixir a very verbose language. But the point is, I think this is a pro when learning. fn a, b -> runSomething(a, b, 123) end isn't as terse as function composition, but it's very easy to read and very clear |
| 09:52:17 | <ggVGc> | what's going on |
| 09:52:51 | <Jade30> | tomsemding, it looks like it's working! |
| 09:52:54 | <Jade30> | Thanks |
| 09:53:21 | <tomsmeding> | ggVGc: It doesn't have automatic currying? (i.e. that a -> b -> c === a -> (b -> c)) |
| 09:53:25 | <tomsmeding> | Jade30: cool! :) |
| 09:53:32 | × | Guest49 quits (~Guest49@5.214.214.80) (Ping timeout: 252 seconds) |
| 09:53:43 | → | eggplantade joins (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) |
| 09:54:09 | <ggVGc> | there's a shorthand operator so you can write what I did as this instead: &(&1, &2, 123) |
| 09:54:53 | <tomsmeding> | &(&1, &2, 123) would be written in haskell as \f x y -> f x y 123 ? |
| 09:55:00 | <ggVGc> | yep |
| 09:55:20 | <tomsmeding> | How would you express \f x _ -> f x 123 |
| 09:55:33 | <ggVGc> | but, in general things are a lot less automatic, which again I think is a good thing for beginner programming, and honestly for long-term maintenance of production code also |
| 09:55:37 | <tomsmeding> | Not &(&1, 123) because that is \f x -> f x 123 :p |
| 09:57:00 | <tomsmeding> | I have mixed feelins about not having automatic currying -- I'm quite sure that it's easier to learn and that knowledge transfers more easily between elixir and most other languages. But on the other hand, power users at some point want power tools |
| 09:57:44 | <tomsmeding> | Terse syntax is bad for its learning curve and intelligibility for non-experts, but experts benefit from terse syntax |
| 09:57:53 | → | Everything joins (~Everythin@37.115.210.35) |
| 09:58:02 | → | matthewmosior joins (~matthewmo@173.170.253.91) |
| 09:58:05 | <tomsmeding> | But go also exists :p |
| 09:58:07 | → | zxx7529 joins (~Thunderbi@user/zxx7529) |
| 09:58:48 | × | eggplantade quits (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Ping timeout: 268 seconds) |
| 09:59:34 | <tomsmeding> | From just what you've told me, though (which is all I know about elixir :p), I do agree with your recommendation of it over haskell as a first language |
| 10:00:17 | <tomsmeding> | Not quite convinced yet it should necessarily be one's first _functional_ language if one already has a bunch of programming experience |
| 10:02:07 | <tomsmeding> | Jade30: curious, is haskell your first programming language? Most other things would not work either without base-devel, I think :p |
| 10:02:35 | <tomsmeding> | Perhaps the scripting languages might (js, python) |
| 10:02:44 | × | matthewmosior quits (~matthewmo@173.170.253.91) (Ping timeout: 255 seconds) |
| 10:02:50 | <Jade30> | No, idk how many languages I know. I just reinstalled arch and forgot `base-devel` |
| 10:02:59 | <tomsmeding> | Ah that also explains :) |
| 10:03:22 | <tomsmeding> | Yay arch btw |
| 10:03:36 | <Jade30> | I do that more often than I should, but a package list and a seperate home partition make it easy |
| 10:03:46 | <tomsmeding> | And good on you for using ghcup instead of the ghc package from the arch repos :p |
| 10:03:50 | <Jade30> | I'm a Java programmer "by trade" |
| 10:03:59 | <Jade30> | Also learning rust and haskell |
| 10:04:10 | <Jade30> | Been doing Java for 3 years now |
| 10:04:52 | <tomsmeding> | Good luck! Rust and Haskell can be a lot of fun, in related but somewhat different ways, if you like this kind of programming :) |
| 10:05:26 | <Jade30> | yeah, thanks! |
| 10:05:50 | × | econo quits (uid147250@user/econo) (Quit: Connection closed for inactivity) |
| 10:06:14 | <Jade30> | Now I still don't have ghcup working .. I think my failed install mesed with some caches. |
| 10:06:14 | <Jade30> | The only thing it installed was `ghc(i)`. No stack, cabal, HLS or `ghcup` binary |
| 10:06:29 | <tomsmeding> | Is there a ~/.ghcup directory? |
| 10:06:39 | <Jade30> | yes, there was even after the failed install |
| 10:06:41 | <maerwald> | Jade30: source ~/.ghcup/env |
| 10:06:42 | <tomsmeding> | If so, is there stuff in ~/.ghcup/bin |
| 10:07:03 | <tomsmeding> | What maerwald says, or just put that bin directory in your path however you wish |
| 10:07:50 | <Jade30> | oops, forgot to open a new terminal for the changes on path to take effect |
| 10:07:59 | <tomsmeding> | Though I wonder how ghc got in your path |
| 10:07:59 | <Jade30> | works now |
| 10:08:11 | <tomsmeding> | Jade30: do you have the ghc package installed from the arch repos? |
| 10:08:17 | <Jade30> | tomsmeding xmonad dependency |
| 10:08:22 | <tomsmeding> | Ah rip |
| 10:08:48 | <Jade30> | is that "bad"? |
| 10:08:51 | <ggVGc> | tomsmeding: yeah, you couldn't use & for that, since you can't create a 2-ary function where you only use one argument using it. So, in that situation you'd just write it out as in haskell, just that you have fn and end instead of \... |
| 10:08:53 | <tomsmeding> | The two installations _should_ not interfere as long as .ghcup/bin is before /usr/bin in your path |
| 10:09:16 | <Jade30> | it is |
| 10:09:27 | <tomsmeding> | Jade30: they should not interfere, but if your path is not as you expect it sometimes, then it might create confusing situations |
| 10:09:43 | <Jade30> | ok I'll keep it in mind. |
| 10:09:55 | <Jade30> | Now I can finally continue my bf interpreter on desktop |
| 10:10:04 | <Jade30> | Coding on my phone for two weeks was a pain |
| 10:10:15 | <tomsmeding> | Jade30: symptom: "there are files missing in package `...'" or something similar :) |
| 10:10:15 | <Jade30> | haha |
| 10:10:25 | <Jade30> | got it! |
| 10:10:33 | <tomsmeding> | Jade30: what did you use for haskell on phone? |
| 10:10:48 | <tomsmeding> | ggVGc: makes sense :) |
| 10:10:51 | <Jade30> | Termux with a virtual arch installation that ran ghc as a native package |
| 10:11:02 | <tomsmeding> | ggVGc: Not even necessarily a bad thing |
| 10:11:03 | <Jade30> | it was barely working haha |
| 10:11:10 | <tomsmeding> | Jade30: native termux now has a ghc package too! |
| 10:11:16 | <tomsmeding> | Since a few months or so |
| 10:11:17 | <Jade30> | oh, neat! |
| 10:11:29 | <tomsmeding> | And cabal and friends |
| 10:11:29 | <Jade30> | won't need it anymore thankfully |
| 10:11:53 | <tomsmeding> | BF interpreter is top notch first project though :) |
| 10:12:17 | <Jade30> | I'm basically done, I only need to parse the source into an AST |
| 10:12:23 | <Jade30> | the evaluation thing is done |
| 10:12:43 | <ggVGc> | after you write the BF interpreter you can drop all other languages and just use that |
| 10:12:54 | → | sandydoo joins (~sandydoo@185.209.196.136) |
| 10:13:00 | × | Milan quits (~Milan@46.245.111.222) (Quit: Client closed) |
| 10:13:04 | <Jade30> | true |
| 10:13:18 | <Jade30> | tomsmeding https://paste.tomsmeding.com/8e9rE9MR |
| 10:13:31 | × | sandy_doo quits (~sandydoo@185.209.196.136) (Ping timeout: 272 seconds) |
| 10:13:53 | <ggVGc> | Jade30: disappointed it's not all at the type level |
| 10:13:54 | <Jade30> | I'm a little proud for coming up with the `interpret'` function entirely without help |
| 10:14:11 | <Jade30> | ggVGc hm? |
| 10:14:18 | <ggVGc> | :) just joking |
| 10:14:36 | <Jade30> | ok haha |
| 10:14:37 | <ggVGc> | but, I think it'd be possible to implement a BF interpreter on the type-level in haskell |
| 10:14:47 | <ggVGc> | e.g your BF proram would "run" at compile time |
| 10:15:09 | <Jade30> | oh wow |
| 10:15:15 | <Jade30> | that's interesting |
| 10:15:32 | <ggVGc> | yes, but not necessarily good :) |
| 10:15:32 | <Jade30> | that'd mean the compiler as a "language" is turing complete? |
| 10:15:34 | <Jade30> | haha |
| 10:15:43 | → | matthewmosior joins (~matthewmo@173.170.253.91) |
| 10:15:48 | <ggVGc> | yeah, I think it is by now |
| 10:15:56 | <Jade30> | damn that's interesting |
| 10:15:59 | <ggVGc> | but I'm not expert enough to say for sure |
| 10:16:13 | <ggVGc> | but, you can have type-level functions and type-level data so... |
| 10:17:03 | <tomsmeding> | Jade30: looking good! |
| 10:17:10 | <Jade30> | ok now I wanna set up HLS for neovim |
| 10:17:18 | <Jade30> | that gave me trouble last time |
| 10:17:28 | <Jade30> | after the installation it would always immediatly crash |
| 10:18:01 | <ggVGc> | Jade30: https://www.reddit.com/r/haskell/comments/g6ea8j/a_brainfuck_interpreter_written_in_haskell/ |
| 10:18:31 | <ggVGc> | not... as nice as on the value level |
| 10:18:33 | <ggVGc> | :) |
| 10:18:47 | <Jade30> | Jesus haha |
| 10:19:08 | <tomsmeding> | Jade30: some minor suggestions https://paste.tomsmeding.com/choqRSjR |
| 10:19:08 | → | lisbeths joins (uid135845@id-135845.lymington.irccloud.com) |
| 10:19:25 | <tomsmeding> | Jade30: how long ago was that hls crashing issue? |
| 10:19:35 | <Jade30> | hm? |
| 10:19:37 | <tomsmeding> | There is a crashing issue that was resolved recently |
| 10:19:51 | <Jade30> | Oh I didn't boot my desktop for over 14 days |
| 10:19:55 | <Jade30> | It was before that+ |
| 10:20:02 | <tomsmeding> | Oh not _that_ recently :p |
| 10:20:07 | <tomsmeding> | A month or two or so |
| 10:21:05 | <naso> | anyone familiar with using Gen.discard or Gen.filter in hedgehog? i'm trying to get an element from a list that can possibly be empty, using https://paste.tomsmeding.com/Bd6DBwtd , but it is not working -- sometimes it has an error that the list is empty |
| 10:21:28 | <ggVGc> | I often wonder why we need a different set of stuff for type-level calculations, if the type system is turing complete anyway. Why not just write normal haskell in special blocks, using types as the values? |
| 10:21:54 | <naso> | (that's not the actual code, just trying to demonstrarte the issue) |
| 10:22:01 | <tomsmeding> | naso: if null xs then Gen.discard else Gen.element f ? |
| 10:22:38 | <tomsmeding> | ggVGc: Have you ever tried programming in Idris or Agda :p |
| 10:22:58 | <ggVGc> | no, only looked at it a little bit a long time ago. But, is that the case there? |
| 10:23:06 | <tomsmeding> | Haakell's type system is turing complete only accidentally due to a bunch of extensions, I believe |
| 10:23:34 | <ggVGc> | I don't think we need to go as far as dependent types to do what I suggested |
| 10:23:37 | <tomsmeding> | ggVGc: The point of a dependently typed language is that the language of types is the same as the language of values |
| 10:23:43 | <Jade30> | Thanks for the suggestions! I actually told my friend about just that, rewriting the `>>` using do-notation :D |
| 10:23:44 | <Jade30> | Is there any case where manual monad operations should *not* be replaced with `do`? |
| 10:23:48 | <tomsmeding> | Hence you have types of types, types of types of types, etc |
| 10:24:05 | <ggVGc> | tomsmeding: well, it's more than that though. It's that you can influence typing based on runtime values, right? Which is more powerful than what I am talkin about |
| 10:24:19 | <tomsmeding> | Jade30: it's equivalent, so in principle no |
| 10:24:26 | <tomsmeding> | Except for style, which is subjective |
| 10:24:32 | <ggVGc> | I just mean that instead of "type family" we can have a special block of haskell and say "Foo :: TypeA -> TypeB" |
| 10:24:54 | <tomsmeding> | ggVGc: Can you partially apply a type family in your system? |
| 10:24:54 | <Jade30> | Yeah I was referring to style |
| 10:25:10 | <naso> | tomsmeding: thanks, sorry my example was too simple and i'm not sure how to apply your suggestion. this is more like it https://paste.tomsmeding.com/92hW7UUa |
| 10:25:13 | <tomsmeding> | Jade30: asking 5 haskell programmers about style will give 6 different answers |
| 10:25:30 | <Jade30> | hahaha |
| 10:25:30 | <ggVGc> | tomsmeding: no, not initially, since I don't think current Haskell supports that? :) |
| 10:25:34 | <Jade30> | yeah I see |
| 10:25:40 | <tomsmeding> | ggVGc: indeed :p |
| 10:25:54 | <ggVGc> | I am talking about having exactly the features we have now, but with the same syntax, just in different blocks |
| 10:26:03 | <ggVGc> | and in this special block, there can be restrictions |
| 10:26:08 | <ggVGc> | like no partial application |
| 10:26:18 | <ggVGc> | it would still be easier to use than the current combination of stuff |
| 10:26:24 | <ggVGc> | I think... |
| 10:29:02 | → | Milan joins (~Milan@46.245.111.222) |
| 10:29:23 | <tomsmeding> | naso: two suggestions https://paste.tomsmeding.com/uSg01xns (when is from Control.Monad) |
| 10:29:31 | × | Milan quits (~Milan@46.245.111.222) (Client Quit) |
| 10:29:38 | <tomsmeding> | ggVGc: probably |
| 10:29:54 | <tomsmeding> | Probably too late for that now, though |
| 10:30:06 | <ggVGc> | can be implemented in... Another extension! |
| 10:30:33 | <tomsmeding> | :D |
| 10:31:03 | <Jade30> | Is there an easier way to do default/starting args than defining `f` as `f' default_arg` where `f'` takes all args? |
| 10:31:13 | → | radhika joins (uid560836@id-560836.helmsley.irccloud.com) |
| 10:31:35 | <naso> | tomsmeding: perfect! thank u |
| 10:32:04 | <tomsmeding> | Jade30: not really, though you can put the f' in a where block on f; this is a common pattern, where that f' is then typically called "go" |
| 10:32:32 | <Jade30> | I see, thanks |
| 10:33:59 | <Jade30> | ok, maybe I did something wrong; running `stack run` is downloading `GHC` again (?) |
| 10:34:12 | <tomsmeding> | Jade30: stack manages its own ghcs |
| 10:34:20 | <tomsmeding> | Use cabal if you want to use the ghcup-installed ghc |
| 10:34:38 | <tomsmeding> | Or use stack and remove the ghcup-installed ghcs to save disk space :p |
| 10:34:41 | <Jade30> | oh ok, this is fine I think |
| 10:34:52 | <tomsmeding> | (or use system-ghc: true in stack.yaml, but please don't) |
| 10:34:59 | <Jade30> | I have plenty of disk space, this shouldn't be too bad haha |
| 10:35:05 | <Jade30> | Do you think Stack or Cabal is better? |
| 10:35:15 | <tomsmeding> | How to start a flame war in haskell land |
| 10:35:25 | <maerwald> | :D |
| 10:35:33 | <tomsmeding> | Stack was born out of frustration with cabal, but then cabal improved a lot |
| 10:35:53 | <tomsmeding> | These days it doesn't matter all that much, details are different but overall preference is subjective |
| 10:35:58 | <Jade30> | haha, looks like a lot of things make everything go up in flames in haskell land |
| 10:36:24 | <tomsmeding> | I personally prefer cabal, but feel free to use stack if you wish |
| 10:36:39 | <tomsmeding> | Getting started easily trumps ideological perfection |
| 10:37:00 | <ggVGc> | I use stack still, but cabal build times are faster... |
| 10:37:13 | <ggVGc> | there are somethings with stack I don't know how to do with cabal |
| 10:37:19 | <ggVGc> | like 'stack ghci' |
| 10:37:23 | <tomsmeding> | cabal repl |
| 10:37:42 | → | malte joins (~malte@mal.tc) |
| 10:37:49 | <Jade30> | Ok, all the advantages of neovim aside, this is too much of a pain rn, I'll just use `vscode(ium)` |
| 10:37:54 | <ggVGc> | I had some issues with that in the past if I remember correctly... relating to it not loading all the modules I wanted or something |
| 10:38:01 | <ggVGc> | might look into making the switch again sometimes |
| 10:38:03 | <ggVGc> | sometime* |
| 10:38:05 | <tomsmeding> | Ah |
| 10:38:21 | <Jade30> | Unless theres something better than vsc? some plugin for a jetbrains ide/something similar? |
| 10:38:39 | <Jade30> | I think theres an IntelliJ plugin but idk how good it is |
| 10:38:42 | <tomsmeding> | Vscode is the best in integration with hls currently |
| 10:38:46 | <Jade30> | ok cool |
| 10:38:53 | <tomsmeding> | I have neovim working, but if you can stand vscode... :) |
| 10:38:57 | <ggVGc> | vim+coc+haskell-language-server works quite well for me |
| 10:39:00 | <tomsmeding> | Probably easier |
| 10:39:16 | <Jade30> | I'm rather new to vim so I need to get used to a lot of stuff |
| 10:43:48 | → | misterfish joins (~misterfis@87.215.131.98) |
| 10:54:36 | × | Jade30 quits (~Jade@ip-178-201-128-039.um46.pools.vodafone-ip.de) (Quit: Connection closed) |
| 10:59:44 | → | sonologico joins (~raphael@dhcp-077-251-118-129.chello.nl) |
| 11:02:26 | <ggVGc> | tomsmeding: why can't I do this? :( https://gist.github.com/c42f38018667a78949e07da10ba7962b |
| 11:04:46 | <ggVGc> | ah, wait... I need a type class also I guess? |
| 11:06:29 | → | Milan joins (~Milan@46.245.111.222) |
| 11:09:41 | <tomsmeding> | ggVGc: not everything is a Range :p |
| 11:09:59 | <tomsmeding> | In fact a Positive doesn't contain any data at all |
| 11:10:48 | <tomsmeding> | ggVGc: Suggestion: data Range ty = Range Int Int |
| 11:11:08 | <tomsmeding> | And then have `ty` be Positive, Nullable Negative, etc |
| 11:11:32 | <tomsmeding> | And just make Positive etc. types without constructors (data Positive) |
| 11:11:42 | → | MajorBiscuit joins (~MajorBisc@86-88-79-148.fixed.kpn.net) |
| 11:11:42 | → | eggplantade joins (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) |
| 11:11:51 | → | chomwitt joins (~chomwitt@2a02:587:dc12:b700:678b:e1a:f7b:532c) |
| 11:11:59 | × | naso quits (~naso@193-116-244-197.tpgi.com.au) (Read error: Connection reset by peer) |
| 11:12:38 | <tomsmeding> | For more fanciness, with DataKinds: data Ty = Positive | NonNull Ty | ... ; data Range (ty :: Ty) = Range Int Int ; and then use `Range 1 2 :: Range ('NonNull 'Positive)` |
| 11:12:46 | → | naso joins (~naso@193-116-244-197.tpgi.com.au) |
| 11:13:02 | <tomsmeding> | To ensure a troll can't make a `Range String` |
| 11:13:51 | × | chomwitt quits (~chomwitt@2a02:587:dc12:b700:678b:e1a:f7b:532c) (Remote host closed the connection) |
| 11:14:10 | → | chomwitt joins (~chomwitt@2a02:587:dc12:b700:3d3:74d8:b5ce:c91f) |
| 11:15:52 | × | eggplantade quits (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Ping timeout: 245 seconds) |
| 11:17:57 | × | matthewmosior quits (~matthewmo@173.170.253.91) (Ping timeout: 245 seconds) |
| 11:18:07 | × | naso quits (~naso@193-116-244-197.tpgi.com.au) (Ping timeout: 272 seconds) |
| 11:18:31 | <tomsmeding> | Alternative is indeed to make a type class HasRange r where getRange :: r -> Range; but then you still need to put some data in a Positive :p |
| 11:28:22 | × | sonologico quits (~raphael@dhcp-077-251-118-129.chello.nl) (Ping timeout: 245 seconds) |
| 11:29:51 | × | chomwitt quits (~chomwitt@2a02:587:dc12:b700:3d3:74d8:b5ce:c91f) (Ping timeout: 276 seconds) |
| 11:29:52 | × | Sgeo quits (~Sgeo@user/sgeo) (Read error: Connection reset by peer) |
| 11:30:47 | → | acidjnk joins (~acidjnk@p200300d6e70586358424384a1bd111e9.dip0.t-ipconnect.de) |
| 11:36:04 | → | sonologico joins (~raphael@dhcp-077-251-118-129.chello.nl) |
| 11:36:11 | <ggVGc> | tomsmeding: yeah, datakinds is probably what I want... Stuck again :( https://gist.github.com/c42f38018667a78949e07da10ba7962b |
| 11:36:22 | <ggVGc> | I feel I'm missing a crucial piece of understanding |
| 11:41:46 | → | Guest49 joins (~Guest49@5.214.242.88) |
| 11:41:48 | → | naso joins (~naso@193-116-244-197.tpgi.com.au) |
| 11:42:55 | × | Guest49 quits (~Guest49@5.214.242.88) (Client Quit) |
| 11:43:26 | → | yauhsien joins (~yauhsien@118-167-41-184.dynamic-ip.hinet.net) |
| 11:43:33 | → | wootehfoot joins (~wootehfoo@user/wootehfoot) |
| 11:45:11 | <tomsmeding> | ggVGc: What about: valueSubset :: RangeSubset a b ~ 'True => Range a -> Range b -> Bool |
| 11:45:26 | <tomsmeding> | And then remove the Range from all your RangeSubset equations |
| 11:46:18 | <ggVGc> | ahhh, that makes a lot more sense |
| 11:46:22 | <ggVGc> | haha... thanks |
| 11:47:17 | <tomsmeding> | ggVGc: why does AnyNumber have a constructor |
| 11:47:31 | <ggVGc> | by accident :) |
| 11:47:43 | → | matthewmosior joins (~matthewmo@173.170.253.91) |
| 11:47:58 | <ggVGc> | nice, this is starting to get close to fulfilling my basic use-case, even if it can be implemented nicer |
| 11:48:07 | <ggVGc> | thanks a lot for the help |
| 11:50:44 | <tomsmeding> | ggVGc: This is how to restrict ty to just these things https://paste.tomsmeding.com/Jr374Yor |
| 11:50:48 | <ggVGc> | ah... but I messed up, because I actually need to be able to have a list of [a, Range] or equivalent... |
| 11:50:53 | × | Milan quits (~Milan@46.245.111.222) (Quit: Client closed) |
| 11:51:05 | <ggVGc> | of (a, Range), I mean |
| 11:51:08 | <tomsmeding> | Oops typo on line 14 |
| 11:51:47 | <tomsmeding> | ggVGc: What do you mean? What a? |
| 11:51:49 | → | eggplantade joins (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) |
| 11:52:12 | × | matthewmosior quits (~matthewmo@173.170.253.91) (Ping timeout: 244 seconds) |
| 11:54:54 | × | naso quits (~naso@193-116-244-197.tpgi.com.au) (Remote host closed the connection) |
| 11:55:11 | → | tstat joins (~tstat@user/tstat) |
| 11:55:32 | → | Guest49 joins (~Guest49@5.214.242.88) |
| 11:55:44 | → | naso joins (~naso@193-116-244-197.tpgi.com.au) |
| 11:55:45 | × | Guest49 quits (~Guest49@5.214.242.88) (Client Quit) |
| 11:55:57 | × | eggplantade quits (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Ping timeout: 252 seconds) |
| 11:55:57 | × | bontaq quits (~user@ool-45779fe5.dyn.optonline.net) (Ping timeout: 252 seconds) |
| 11:56:25 | → | merijn joins (~merijn@86-86-29-250.fixed.kpn.net) |
| 11:59:11 | → | Guest49 joins (~Guest49@5.214.242.88) |
| 11:59:25 | × | Guest49 quits (~Guest49@5.214.242.88) (Client Quit) |
| 11:59:32 | → | pretty_dumm_guy joins (trottel@gateway/vpn/protonvpn/prettydummguy/x-88029655) |
| 12:02:23 | × | yauhsien quits (~yauhsien@118-167-41-184.dynamic-ip.hinet.net) (Remote host closed the connection) |
| 12:03:27 | × | califax quits (~califax@user/califx) (Ping timeout: 268 seconds) |
| 12:03:39 | × | wootehfoot quits (~wootehfoo@user/wootehfoot) (Ping timeout: 252 seconds) |
| 12:04:30 | × | mon_aaraj quits (~MonAaraj@user/mon-aaraj/x-4416475) (Read error: Connection reset by peer) |
| 12:05:32 | → | califax joins (~califax@user/califx) |
| 12:06:50 | × | mikail quits (~mikail@2a02:c7f:bc47:8c00:5aa7:b193:11e3:d108) (Remote host closed the connection) |
| 12:08:54 | → | matthewmosior joins (~matthewmo@173.170.253.91) |
| 12:11:38 | → | mikail joins (~mikail@2a02:c7f:bc47:8c00:5aa7:b193:11e3:d108) |
| 12:12:40 | → | yauhsien joins (~yauhsien@118-167-41-184.dynamic-ip.hinet.net) |
| 12:12:51 | → | Milan joins (~Milan@46.245.111.222) |
| 12:13:17 | × | Milan quits (~Milan@46.245.111.222) (Client Quit) |
| 12:20:36 | × | yauhsien quits (~yauhsien@118-167-41-184.dynamic-ip.hinet.net) (Remote host closed the connection) |
| 12:21:51 | → | yauhsien joins (~yauhsien@118-167-41-184.dynamic-ip.hinet.net) |
| 12:24:25 | × | ChaiTRex quits (~ChaiTRex@user/chaitrex) (Ping timeout: 268 seconds) |
| 12:25:06 | → | ChaiTRex joins (~ChaiTRex@user/chaitrex) |
| 12:28:26 | → | mon_aaraj joins (~MonAaraj@user/mon-aaraj/x-4416475) |
| 12:28:47 | × | lisbeths quits (uid135845@id-135845.lymington.irccloud.com) (Quit: Connection closed for inactivity) |
| 12:32:50 | × | ChaiTRex quits (~ChaiTRex@user/chaitrex) (Remote host closed the connection) |
| 12:33:23 | → | ChaiTRex joins (~ChaiTRex@user/chaitrex) |
| 12:33:43 | × | mon_aaraj quits (~MonAaraj@user/mon-aaraj/x-4416475) (Ping timeout: 252 seconds) |
| 12:34:45 | → | mon_aaraj joins (~MonAaraj@user/mon-aaraj/x-4416475) |
| 12:36:28 | × | jargon quits (~jargon@184.101.188.251) (Remote host closed the connection) |
| 12:38:11 | × | sonologico quits (~raphael@dhcp-077-251-118-129.chello.nl) (Ping timeout: 244 seconds) |
| 12:38:38 | → | eggplantade joins (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) |
| 12:40:20 | × | radhika quits (uid560836@id-560836.helmsley.irccloud.com) (Quit: Connection closed for inactivity) |
| 12:41:26 | × | yauhsien quits (~yauhsien@118-167-41-184.dynamic-ip.hinet.net) (Remote host closed the connection) |
| 12:42:00 | × | notzmv quits (~zmv@user/notzmv) (Ping timeout: 276 seconds) |
| 12:42:57 | × | eggplantade quits (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Ping timeout: 245 seconds) |
| 12:43:04 | → | yauhsien joins (~yauhsien@118-167-41-184.dynamic-ip.hinet.net) |
| 12:43:53 | <ggVGc> | tomsmeding: the usecase is basically this: data Thing = Thing {inputs :: [(String, Range)]} |
| 12:44:30 | <ggVGc> | and the ranges are for checking of something can be connected to a certain input |
| 12:45:37 | <tomsmeding> | ggVGc: is your problem that the various Range objects need to have different type tags? |
| 12:46:26 | <ggVGc> | yeah, so I need to rethink how to model this I guess. Basically "input1" could have Positive range, and "input2" could have a Nullable (Range Int Int) |
| 12:46:48 | <tomsmeding> | Right, then you can't model this in the type system |
| 12:47:26 | → | Kikroz joins (~Kikroz@5.214.242.88) |
| 12:47:34 | <tomsmeding> | Well, what you could do is move Ty to the value level, but then make Ty a gadt so that pattern matching on a Ty can reconstruct the type-level info |
| 12:48:10 | <ggVGc> | hm, yeah, that might work |
| 12:49:32 | <mon_aaraj> | hello, i have something like: ``\x y z -> max (show x) (y <> z)``, but I want to write it in a point-free manner, and I distinctly remember some combinator similar to this |
| 12:50:22 | <tomsmeding> | @pl \x y z -> max (show x) (y <> z) |
| 12:50:22 | <lambdabot> | (. (<>)) . (.) . max . show |
| 12:50:27 | <tomsmeding> | Useful! |
| 12:50:35 | × | jmdaemon quits (~jmdaemon@user/jmdaemon) (Ping timeout: 252 seconds) |
| 12:50:42 | <mon_aaraj> | oh wow, thank you very much.. i wonder how much more readable that would be if blackbird was used |
| 12:51:05 | <tomsmeding> | Well it's hard to be less readable than this |
| 12:52:03 | <ggVGc> | Pointfree Considered Harmful |
| 12:53:06 | <tomsmeding> | Pointfree style is like strong herbs, a little goes a long way |
| 12:55:04 | <tomsmeding> | mon_aaraj: \x -> blackbird (max (show x)) (<>), if I'm not mistaken |
| 12:55:39 | <tomsmeding> | @pl blackbird (max (show x)) (<>) |
| 12:55:39 | <lambdabot> | blackbird (max (show x)) (<>) |
| 12:56:03 | <tomsmeding> | @pl \x -> blackbird (max (show x)) (<>) |
| 12:56:03 | <lambdabot> | flip blackbird (<>) . max . show |
| 12:56:11 | <tomsmeding> | Which is inscrutable again |
| 12:56:15 | <mon_aaraj> | well, i suppose blackbird just makes it ``((.: (<>)) . max . show)`` |
| 12:56:26 | <tomsmeding> | Right |
| 13:00:10 | × | Kikroz quits (~Kikroz@5.214.242.88) (Ping timeout: 252 seconds) |
| 13:00:27 | × | mon_aaraj quits (~MonAaraj@user/mon-aaraj/x-4416475) (Ping timeout: 245 seconds) |
| 13:02:49 | → | mon_aaraj joins (~MonAaraj@user/mon-aaraj/x-4416475) |
| 13:05:15 | <mon_aaraj> | oops, sorry, my last message arrived late |
| 13:06:07 | × | yauhsien quits (~yauhsien@118-167-41-184.dynamic-ip.hinet.net) (Remote host closed the connection) |
| 13:06:59 | → | yauhsien joins (~yauhsien@118-167-41-184.dynamic-ip.hinet.net) |
| 13:10:23 | × | matthewmosior quits (~matthewmo@173.170.253.91) (Ping timeout: 255 seconds) |
| 13:10:25 | <mon_aaraj> | anyways, it seems that the point-free code produces different output than ``(\x y z -> max (show x) (y <> z))`` somehow |
| 13:11:09 | <mon_aaraj> | ah, wait, nope, only when i try to forcefully shove blackbird in |
| 13:11:28 | → | wootehfoot joins (~wootehfoo@user/wootehfoot) |
| 13:12:05 | <geekosaur> | either you're doing ot wrong or you're running into something unrelated e.g. monomorphism restriction from removing an explicit parameter |
| 13:14:04 | × | whatsupboy quits (~whatsupbo@user/scobydoo) (Quit: WeeChat 2.8) |
| 13:16:45 | <hasbae> | :t blackbird |
| 13:16:46 | <lambdabot> | error: Variable not in scope: blackbird |
| 13:18:04 | <geekosaur[m]> | Actually it wouldn't be MMR because that affects the type not the value, but there are other traps |
| 13:18:13 | → | whatsupboy joins (~whatsupbo@user/scobydoo) |
| 13:18:36 | × | wootehfoot quits (~wootehfoo@user/wootehfoot) (Ping timeout: 268 seconds) |
| 13:19:15 | <hasbae> | whats the command for lambdabot to show the type of blackbird? |
| 13:19:31 | <geekosaur[m]> | hasbae: it's not there. See the paper "To Mock a Mockingbird" iirc |
| 13:19:31 | × | whatsupboy quits (~whatsupbo@user/scobydoo) (Quit: brb) |
| 13:19:32 | → | sonologico joins (~raphael@dhcp-077-251-118-129.chello.nl) |
| 13:20:00 | × | naso quits (~naso@193-116-244-197.tpgi.com.au) () |
| 13:20:17 | <mon_aaraj> | yeah, the first thing i stumbled into was ``(<>) .: max . show``, but.. well, it always appends the number to the 2nd string, so ``((<>) .: max . shohw) 5 "" "buzz"`` would result in ``5buzz`` |
| 13:20:21 | <geekosaur[m]> | Someone collected a bunch of point-free combinators |
| 13:20:30 | <hasbae> | ok. this disucssion came up the other day. blackbird is not in To Mock a Mockingbird, at least not in the index where all the birds are listed |
| 13:20:32 | → | whatsupboy joins (~whatsupbo@user/scobydoo) |
| 13:21:00 | × | haritz quits (~hrtz@user/haritz) (Remote host closed the connection) |
| 13:21:25 | × | yauhsien quits (~yauhsien@118-167-41-184.dynamic-ip.hinet.net) (Remote host closed the connection) |
| 13:22:30 | → | yauhsien joins (~yauhsien@118-167-41-184.dynamic-ip.hinet.net) |
| 13:22:47 | <mon_aaraj> | in here http://revue.sesamath.net/IMG/pdf/mockingbird3.pdf it's number 6, but i don't know if that's what you guys are talking about |
| 13:25:52 | × | sonologico quits (~raphael@dhcp-077-251-118-129.chello.nl) (Ping timeout: 245 seconds) |
| 13:28:22 | × | mon_aaraj quits (~MonAaraj@user/mon-aaraj/x-4416475) (Ping timeout: 245 seconds) |
| 13:30:20 | → | mon_aaraj joins (~MonAaraj@user/mon-aaraj/x-4416475) |
| 13:32:38 | <hasbae> | yes, that's the one |
| 13:39:35 | → | Jade1 joins (~Jade1@ip-178-201-128-039.um46.pools.vodafone-ip.de) |
| 13:39:58 | <Jade1> | Hello, how can I utilize the autocomplete with vim, coc and HLS? |
| 13:40:21 | <Jade1> | It shows me the suggestion with a `[A]` but I have no idea how to "use" it |
| 13:41:09 | → | matthewmosior joins (~matthewmo@173.170.253.91) |
| 13:43:09 | × | yauhsien quits (~yauhsien@118-167-41-184.dynamic-ip.hinet.net) (Ping timeout: 272 seconds) |
| 13:44:48 | <ggVGc> | tomsmeding: do you know how I could do this without UndecidableInstance? https://gist.github.com/77f1468484702783b1ea0176d1980304 |
| 13:47:48 | <tomsmeding> | @hackage data-aviary |
| 13:47:48 | <lambdabot> | https://hackage.haskell.org/package/data-aviary |
| 13:47:53 | <tomsmeding> | hasbae: ^ |
| 13:48:02 | → | lisbeths joins (uid135845@id-135845.lymington.irccloud.com) |
| 13:49:01 | <tomsmeding> | ggVGc: Not |
| 13:49:10 | <ggVGc> | hah... |
| 13:49:31 | <tomsmeding> | Standard rules are quite conservative, and sufficient to guarantee convergence, if I remember correctly |
| 13:49:49 | <tomsmeding> | But there are plenty of convergent things that aren't covered by those rules |
| 13:50:07 | <tomsmeding> | Where with "convergent" I mean "doesn't loop indefinitely" |
| 13:50:43 | <tomsmeding> | UndecidableInstances doesn't break semantics, it just allows inference to not terminate, possibly |
| 13:50:56 | <tomsmeding> | If inference terminates, the result is still correct |
| 13:51:01 | <tomsmeding> | So it's quite safe |
| 13:53:11 | <merijn> | ggVGc: UndecidableInstances (despite the same) is safe in the sense that "code that finishes compiling will be correct" |
| 13:53:17 | <merijn> | s/same/name |
| 13:53:32 | <merijn> | (correct in a typing sense, not necessarily behaviour :p) |
| 13:55:54 | <ggVGc> | ah, cool. Have to admit I never really fully understood the caveats of it |
| 13:56:33 | <merijn> | ggVGc: By default GHC is very conservative in type level functions and typeclass tomfoolery, meaning it only allows things that provably always terminate |
| 13:57:31 | <merijn> | ggVGc: UndecidableInstances allows things for which it is undecidable if they (the typeclass tomfoolery) terminates. So, hypothetically, you can end up with code which does not terminate and compilation never finishes |
| 13:57:48 | <merijn> | (in practice, GHC has a maximum number of evaluation steps before it gives up and says "no") |
| 13:58:08 | → | zebrag joins (~chris@user/zebrag) |
| 13:58:41 | <Jade1> | !paste |
| 13:58:47 | <geekosaur> | @where paste |
| 13:58:47 | <lambdabot> | Help us help you: please paste full code, input and/or output at e.g. https://paste.tomsmeding.com |
| 13:58:51 | <Jade1> | thx |
| 13:59:30 | <geekosaur> | I saw your question earlier but can't help with it; I only use nvim for quick edits and stick to vs code for HLS stuff |
| 13:59:51 | <ggVGc> | merijn: right, thanks, that makes sense |
| 14:00:34 | <ggVGc> | it's too bad about the compilation termination. That's what prevents us from writing all our software in type-level BF |
| 14:01:16 | <Jade1> | https://paste.tomsmeding.com/OBy4d1Xh How can I write the `bf_parser`? |
| 14:01:33 | <geekosaur> | enh. actually it's just making type leel as complete as value level by adding bottoms 🙂 |
| 14:01:45 | <Jade1> | Parsers and Parser combinators are new to me so I'm struggling a littöe |
| 14:03:11 | → | sonologico joins (~raphael@dhcp-077-251-118-129.chello.nl) |
| 14:04:12 | <ggVGc> | tomsmeding: I tried understanding you GADT suggestion, but I'm not sure I am able to apply it. How were you thinking I could reconstruct the types? :/ |
| 14:07:36 | × | Vajb quits (~Vajb@hag-jnsbng11-58c3ad-40.dhcp.inet.fi) (Read error: Connection reset by peer) |
| 14:08:04 | → | Vajb joins (~Vajb@n1zigc3rgo9mpde2w-1.v6.elisa-mobile.fi) |
| 14:09:41 | → | eggplantade joins (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) |
| 14:12:41 | → | Kikroz joins (~Kikroz@5.214.242.88) |
| 14:13:19 | × | Kikroz quits (~Kikroz@5.214.242.88) (Client Quit) |
| 14:14:18 | × | eggplantade quits (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Ping timeout: 276 seconds) |
| 14:16:54 | <tomsmeding> | ggVGc: data Ty = Positive | Nullable Ty | ... ; data STy ty where { SPositive :: STy 'Positive ; SNullable :: STy ty -> STy ('Nullable ty) ; ... } |
| 14:17:16 | <tomsmeding> | data SomeSTy = forall ty. SomeSTy (STy ty) |
| 14:18:06 | <tomsmeding> | Then use SomeSTy if you want to forget the type info; pattern matching on an STy, if you know in advance what it should be (but ghc doesn't), will allow you to prove your expectation |
| 14:18:13 | × | zxx7529 quits (~Thunderbi@user/zxx7529) (Ping timeout: 252 seconds) |
| 14:18:22 | <tomsmeding> | S comes from "singleton" |
| 14:19:08 | <tomsmeding> | The singletons library can generate STy from Ty for you, I think, but I've never used it and there is some more complexity to it due to the library's generality |
| 14:22:58 | → | zxx7529 joins (~Thunderbi@user/zxx7529) |
| 14:25:33 | × | sonologico quits (~raphael@dhcp-077-251-118-129.chello.nl) (Ping timeout: 252 seconds) |
| 14:26:25 | → | kenran joins (~kenran@200116b82b2ba400703212b2a68ff598.dip.versatel-1u1.de) |
| 14:27:32 | × | yin quits (~yin@user/zero) (Ping timeout: 245 seconds) |
| 14:31:11 | → | jao joins (~jao@cpc103048-sgyl39-2-0-cust502.18-2.cable.virginm.net) |
| 14:31:49 | <onosendi> | How is this function called? https://gist.github.com/onosendi/fa35bc76d43e57369cf2d6ba7041d76d |
| 14:33:26 | <geekosaur> | `greet (Person aName anAge)` or `greet (Person {name = aName, age = anAge})` |
| 14:33:42 | <geekosaur> | (the parentheses are actually unnecessary in the second one, but then it's more confusing) |
| 14:34:04 | × | califax quits (~califax@user/califx) (Remote host closed the connection) |
| 14:35:04 | <onosendi> | Thank you. I feel like this Tutorial skipped over a bunch of stuff, heh. |
| 14:35:37 | <geekosaur> | in general you create values the same way you declare them |
| 14:35:57 | → | califax joins (~califax@user/califx) |
| 14:36:41 | <geekosaur> | so if you have `data Person = Person {name :: String, age :: Int}` then a value of type Person is `person {name = "Fred", age = 50}` |
| 14:37:33 | <geekosaur> | and similarly for yesterday when you had `calc` and needed a value to go with it, and had it declared as `Add Int Int | Sub Int Int` |
| 14:37:34 | × | vglfr quits (~vglfr@194.9.14.33) (Read error: Connection reset by peer) |
| 14:37:42 | → | vglfr joins (~vglfr@194.9.14.33) |
| 14:37:49 | <mon_aaraj> | well, i suppose i can show my little cancerous creation: |
| 14:37:52 | <mon_aaraj> | ``(zipWith3 (\x y z -> max (show x) (y <> z)) [1..100] `on` cycle) ["","","Fizz"] ["","","","","Buzz"]`` |
| 14:38:03 | <geekosaur> | but for that one you needed parentheses because `Add` and `Sub` can be used directly as values with function types |
| 14:38:12 | <ggVGc> | tomsmeding: thanks, will have a crack |
| 14:38:30 | <onosendi> | I think I need to go to another tutorial and learn more about types before I proceed. It's confusing why the second `Person` is there, `data Person = Person`. It's also confusing in the function declaration why `person` is at the end: `greet person = "Hi " ++ name person` |
| 14:38:38 | <mon_aaraj> | i'm not quite sure how i'd make it shorter but still readable... but I think that's good enough for now |
| 14:38:54 | → | machinedgod joins (~machinedg@d172-219-86-154.abhsia.telus.net) |
| 14:39:14 | → | sonologico joins (~raphael@dhcp-077-251-118-129.chello.nl) |
| 14:40:02 | × | raym quits (~raym@user/raym) (Ping timeout: 245 seconds) |
| 14:40:15 | → | eggplantade joins (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) |
| 14:40:48 | → | Inst_ joins (~Inst@2601:6c4:4080:3f80:d998:768b:c35b:a535) |
| 14:40:54 | → | raym joins (~raym@user/raym) |
| 14:41:15 | × | vglfr quits (~vglfr@194.9.14.33) (Remote host closed the connection) |
| 14:41:55 | → | vglfr joins (~vglfr@194.9.14.33) |
| 14:43:44 | × | Inst quits (~Inst@2601:6c4:4080:3f80:d998:768b:c35b:a535) (Ping timeout: 244 seconds) |
| 14:44:37 | × | eggplantade quits (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Ping timeout: 252 seconds) |
| 14:45:36 | <ggVGc> | tomsmeding: man, that's great :) Thanks a lot! |
| 14:45:47 | <ggVGc> | today has been a day of much learning |
| 14:47:48 | → | sammelweis joins (~quassel@2601:401:8200:2d4c:bd9:d04c:7f69:eb10) |
| 14:48:24 | <hasbae> | onosendi: terms and types have different namespaces, and therefore you can have the same name in both. Person on the left is a type, and Person on the right is a terml, which is an element of the type Person |
| 14:48:40 | <hasbae> | s/terml/term |
| 14:49:10 | <geekosaur> | especially when learning, it may be better to name the term and type level ones differently to help keep them separate |
| 14:49:20 | → | gmg joins (~user@user/gehmehgeh) |
| 14:49:41 | <geekosaur> | especially since ghc has some fun type level stuff that is well beyond beginner, but which it will innocently suggest to you if you get the levels confused |
| 14:50:05 | × | kenran quits (~kenran@200116b82b2ba400703212b2a68ff598.dip.versatel-1u1.de) (Quit: WeeChat info:version) |
| 14:50:32 | <onosendi> | So that's not considered recursive datatypes? A few videos before there was an example `data PeaNum = Succ PeaNum | Zero`, which was recursive? |
| 14:51:00 | <geekosaur> | that one is recursive because `Succ PraNum` refers to the type, not a value |
| 14:51:06 | × | sonologico quits (~raphael@dhcp-077-251-118-129.chello.nl) (Ping timeout: 268 seconds) |
| 14:51:09 | <onosendi> | Ah, okay. |
| 14:51:25 | <geekosaur> | compare `Maybe Int` which refers to a type (data Maybe a = Nothing | Just a) |
| 14:51:39 | → | notzmv joins (~zmv@user/notzmv) |
| 14:53:51 | <geekosaur> | so when you declare that PeaNum, the constructor Succ takes a type as a parameter which happens to be the same as the type you're declaring |
| 14:54:23 | <geekosaur> | when you make a value, you use a value there instead (`(Succ (Succ Zero))` for example) |
| 14:56:53 | → | [itchyjunk] joins (~itchyjunk@user/itchyjunk/x-7353470) |
| 14:56:53 | × | vglfr quits (~vglfr@194.9.14.33) (Read error: Connection reset by peer) |
| 14:56:57 | × | ChaiTRex quits (~ChaiTRex@user/chaitrex) (Remote host closed the connection) |
| 14:58:09 | → | vglfr joins (~vglfr@194.9.14.33) |
| 14:58:20 | <[itchyjunk]> | Can the bot remove sugar syntax? Like "a" -> Cons (a Nil) maybe? |
| 14:59:25 | × | Jade1 quits (~Jade1@ip-178-201-128-039.um46.pools.vodafone-ip.de) (Quit: Client closed) |
| 14:59:34 | <tomsmeding> | [itchyjunk]: the desugared version of "a" would be 'a' : [] |
| 14:59:55 | <[itchyjunk]> | I wanted to see it for ["a"], list of lists |
| 15:00:09 | <tomsmeding> | > ('a' : []) : [] |
| 15:00:11 | <lambdabot> | ["a"] |
| 15:00:16 | × | matthewmosior quits (~matthewmo@173.170.253.91) (Ping timeout: 244 seconds) |
| 15:00:20 | <[itchyjunk]> | I wanted to start with [[]] and get ["a"] , ["ab"], etc |
| 15:00:28 | <geekosaur> | not generally. there are some commands which can add or remove specific kinds of syntax, but nothing general |
| 15:00:31 | <[itchyjunk]> | but i seem to keep getting ["a","b"] and i am not sure why |
| 15:01:15 | <[itchyjunk]> | > "b" : ["a"] |
| 15:01:16 | <lambdabot> | ["b","a"] |
| 15:01:20 | → | Milan joins (~Milan@46.245.111.222) |
| 15:01:24 | <tomsmeding> | > inits ['a'..] |
| 15:01:26 | <lambdabot> | ["","a","ab","abc","abcd","abcde","abcdef","abcdefg","abcdefgh","abcdefghi",... |
| 15:01:38 | × | Milan quits (~Milan@46.245.111.222) (Client Quit) |
| 15:01:59 | <[itchyjunk]> | hmm |
| 15:02:24 | → | ChaiTRex joins (~ChaiTRex@user/chaitrex) |
| 15:02:28 | <tomsmeding> | [itchyjunk]: ["a"] == "a" : [], so "b" : ["a"] == "b" : "a" : [] == ["b", "a"] |
| 15:02:50 | Inst_ | is now known as Inst |
| 15:02:59 | <[itchyjunk]> | ah that makes sense |
| 15:03:18 | <tomsmeding> | > map ('a' :) ["hi", "some", "text"] |
| 15:03:19 | <lambdabot> | ["ahi","asome","atext"] |
| 15:03:30 | <tomsmeding> | > map ("a" ++) ["hi", "some", "text"] |
| 15:03:32 | <lambdabot> | ["ahi","asome","atext"] |
| 15:03:46 | <[itchyjunk]> | so if i have `["a"]` i would want ` ('b' : 'a' : []) : []` ? |
| 15:03:47 | <tomsmeding> | > ["a"] : ["hi", "some", "text"] |
| 15:03:49 | <lambdabot> | error: |
| 15:03:49 | <lambdabot> | • Couldn't match type ‘Char’ with ‘[Char]’ |
| 15:03:49 | <lambdabot> | Expected type: [[Char]] |
| 15:04:03 | <[itchyjunk]> | > ('b' : 'a' : []) : [] |
| 15:04:03 | <tomsmeding> | > "a" : ["hi", "some", "text"] |
| 15:04:05 | <lambdabot> | ["a","hi","some","text"] |
| 15:04:05 | <lambdabot> | ["ba"] |
| 15:04:19 | <[itchyjunk]> | hmmmmmm |
| 15:12:41 | × | vglfr quits (~vglfr@194.9.14.33) (Read error: Connection reset by peer) |
| 15:12:54 | → | vglfr joins (~vglfr@194.9.14.33) |
| 15:13:10 | <[itchyjunk]> | if x is a char `x : []` should give me a string, y should be a string so ` (x:[]):y` should give in concated string and `((x:[]):y):ys` should give me [String] ? |
| 15:13:12 | <[itchyjunk]> | https://bpa.st/R4LQ |
| 15:13:47 | <[itchyjunk]> | i think i'll have to take care of g _ [[]] case at some point |
| 15:14:30 | <merijn> | [itchyjunk]: "(x:[]):y" is a type error if y is a string |
| 15:14:43 | <[itchyjunk]> | hmmmmm |
| 15:14:56 | <[itchyjunk]> | > ('a':[]) : "b" |
| 15:14:58 | <lambdabot> | error: |
| 15:14:58 | <lambdabot> | • Couldn't match type ‘Char’ with ‘[Char]’ |
| 15:14:58 | <lambdabot> | Expected type: [[Char]] |
| 15:15:01 | <merijn> | [itchyjunk]: Pretty sure you just mean "(x:y)" |
| 15:15:04 | <[itchyjunk]> | :( |
| 15:15:18 | <merijn> | [itchyjunk]: : is "append" (or prepend, if you will), not concatenate |
| 15:15:23 | <merijn> | :t (:) |
| 15:15:24 | <lambdabot> | a -> [a] -> [a] |
| 15:15:38 | <[itchyjunk]> | ah append, right |
| 15:15:45 | <merijn> | so if "x :: Char" and "y :: String" you just want "x:y" to put x in front of y |
| 15:15:46 | × | ChaiTRex quits (~ChaiTRex@user/chaitrex) (Remote host closed the connection) |
| 15:16:03 | → | ChaiTRex joins (~ChaiTRex@user/chaitrex) |
| 15:16:20 | <[itchyjunk]> | right, makes sense |
| 15:16:58 | <[itchyjunk]> | i also am not sure what do do when my y is [[]] |
| 15:17:20 | <merijn> | [itchyjunk]: Don't you want [] as final case? |
| 15:17:21 | <[itchyjunk]> | since i am trying to do (y:ys), i need to know what to do when (y:ys) is an empty list of string :< |
| 15:17:33 | <merijn> | [[]] is "that last (empty) element of the ys list" |
| 15:18:03 | <merijn> | I would also use guards instead of if/then/else |
| 15:18:16 | <[itchyjunk]> | ah yes, i do want empty to append an empty list |
| 15:18:27 | <[itchyjunk]> | i forgot syntax for guards but remembered them for if else xD |
| 15:19:43 | <[itchyjunk]> | Hm, I am getting a non exhaustive pattern error. |
| 15:19:43 | <[itchyjunk]> | https://bpa.st/S5OA |
| 15:21:20 | × | Everything quits (~Everythin@37.115.210.35) (Quit: leaving) |
| 15:21:46 | <[itchyjunk]> | hmm i've 2 inputs and i've handled empty case for both |
| 15:22:09 | <merijn> | [itchyjunk]: You're not handling the empty case for second argument |
| 15:22:22 | <merijn> | [itchyjunk]: You're handling the "one element that is an empty list" case |
| 15:22:44 | <[itchyjunk]> | oh, the case where it has no element would be [] ? |
| 15:23:28 | <merijn> | [itchyjunk]: Something like: https://paste.tomsmeding.com/NOnl8dq2 |
| 15:24:40 | <[itchyjunk]> | g _ [] = [] is an issue because my accumulator always starts as [] |
| 15:24:42 | <[itchyjunk]> | oh maybe |
| 15:24:50 | <tomsmeding> | [itchyjunk]: what function are you trying to implement |
| 15:25:06 | × | azimut quits (~azimut@gateway/tor-sasl/azimut) (Ping timeout: 268 seconds) |
| 15:25:12 | <[itchyjunk]> | "hello world" -> ["hello","world"] |
| 15:25:22 | <tomsmeding> | so, reimplementing 'words'? |
| 15:25:39 | <[itchyjunk]> | ah, maybe. i don't remember which inbuilt one did it :D |
| 15:25:44 | <tomsmeding> | > words "hello world" |
| 15:25:46 | <lambdabot> | ["hello","world"] |
| 15:25:50 | <[itchyjunk]> | ah! yes |
| 15:25:56 | <[itchyjunk]> | g "hello world" [[]] |
| 15:25:57 | <[itchyjunk]> | ["dlrowolleh"] |
| 15:26:01 | <tomsmeding> | > unwords ["hello", "world"] |
| 15:26:03 | <[itchyjunk]> | it's not doing what i want :x |
| 15:26:04 | <lambdabot> | "hello world" |
| 15:26:46 | <[itchyjunk]> | oh wait, maybe it's doing what i want |
| 15:26:55 | <tomsmeding> | right, so you're saying: words s = g s [[]], right? |
| 15:26:58 | → | eggplantade joins (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) |
| 15:27:04 | <[itchyjunk]> | yes! |
| 15:27:10 | → | azimut joins (~azimut@gateway/tor-sasl/azimut) |
| 15:27:15 | <tomsmeding> | I'm not sure that's the right way to start |
| 15:27:47 | <[itchyjunk]> | oh :( |
| 15:27:53 | <[itchyjunk]> | i think i made progress though, in some way |
| 15:28:03 | <[itchyjunk]> | g "hello world" [[]] |
| 15:28:03 | <[itchyjunk]> | ["dlrow","olleh"] |
| 15:28:41 | <tomsmeding> | right, except you're producing the result in reverse, somehow |
| 15:28:51 | <tomsmeding> | which is very related to starting with [[]] :) |
| 15:29:18 | <tomsmeding> | let's try writing the function directly, so let's write f :: String -> [String] |
| 15:29:28 | <tomsmeding> | where f "hello world" == ["hello", "world"] |
| 15:29:56 | <tomsmeding> | if we use recursion directly, we have to answer: what is f [], and what is f (x:xs)? |
| 15:30:12 | <tomsmeding> | (your turn) |
| 15:30:54 | <[itchyjunk]> | f [] = [], since you're just passing empty string, i think. unless it has to be [[]] list of empty string |
| 15:31:17 | × | eggplantade quits (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Ping timeout: 245 seconds) |
| 15:31:35 | <tomsmeding> | it doesn't matter a whole lot which one you choose -- does "" have one empty word, or no words at all? |
| 15:32:16 | <tomsmeding> | let's say it has no words at all, so f [] = [] |
| 15:32:20 | <[itchyjunk]> | hmm, " " would be ' ' : []. but what would "" be i wonder |
| 15:32:28 | <tomsmeding> | [] |
| 15:32:33 | <tomsmeding> | > [] :: String |
| 15:32:33 | <[itchyjunk]> | ah! |
| 15:32:35 | <lambdabot> | "" |
| 15:32:55 | <tomsmeding> | "hi" == ['h', 'i'] == 'h' : 'i' : [] |
| 15:33:19 | × | tromp quits (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…) |
| 15:33:26 | <tomsmeding> | now that we have 'f [] = []', we look at 'f (x:xs) = ...' |
| 15:33:52 | <tomsmeding> | now the trick is, we can already apply f to xs if we want |
| 15:34:10 | <tomsmeding> | can you somehow express the desired word splitting of x:xs in terms of x and the word splitting of xs? |
| 15:37:06 | <[itchyjunk]> | check if x /= ' ' then take that x, turn it into a string and attach it to the first string of xs if it's first char is not ' ' or somesuch |
| 15:38:02 | <[itchyjunk]> | oh ohhh |
| 15:38:14 | <[itchyjunk]> | f "hello world" |
| 15:38:14 | <[itchyjunk]> | ["h","e","l","l","o","w","o","r","l","d"] |
| 15:38:34 | <[itchyjunk]> | i guess i am not attaching it to the first charater like i wanted to |
| 15:39:24 | <tomsmeding> | [itchyjunk]: "if its first char is not ' '" why that? |
| 15:39:35 | <tomsmeding> | also, not xs but 'f xs', right? |
| 15:39:43 | <tomsmeding> | xs is just the rest of the string |
| 15:39:53 | <[itchyjunk]> | | x /= ' ' = (x : []) : (f xs) is what i used |
| 15:39:56 | <tomsmeding> | 'f xs' is the word-splitted version of the rest of the string (assuming we implement f correctly) |
| 15:40:13 | <[itchyjunk]> | if it's ' ', then i want to start a new word so i want to start appending it to [] maybe |
| 15:40:13 | → | matthewmosior joins (~matthewmo@173.170.253.91) |
| 15:40:17 | <tomsmeding> | (x : []) : (f xs) == [x] : f xs == [[x]] ++ f xs |
| 15:40:34 | <tomsmeding> | right, if x == ' ' you want to start a new word: |
| 15:40:42 | <tomsmeding> | f (x:xs) = if isSpace x then [] : f xs else ... |
| 15:41:20 | <tomsmeding> | if x is _not_ a space, you want to prepend x to the first word in 'f xs', right? |
| 15:41:43 | <tomsmeding> | '[x] : f xs' just adds a new word, containing just the single character x |
| 15:41:43 | <[itchyjunk]> | right |
| 15:41:48 | <tomsmeding> | so that's not what you want |
| 15:41:57 | <tomsmeding> | in fact, what if 'f xs' is the empty list? |
| 15:42:16 | <tomsmeding> | --> you need to look at the result of 'f xs', and based on whether it is empty or not, do something different |
| 15:43:45 | → | eggplantade joins (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) |
| 15:44:07 | × | califax quits (~califax@user/califx) (Remote host closed the connection) |
| 15:46:08 | <tomsmeding> | (indeed, if 'f xs' _is_ the empty list, then there is no such first word! Perhaps you have to create it) |
| 15:46:09 | × | zxx7529 quits (~Thunderbi@user/zxx7529) (Remote host closed the connection) |
| 15:47:26 | <[itchyjunk]> | we did create "" in case the string was empty, now? |
| 15:47:29 | → | califax joins (~califax@user/califx) |
| 15:47:30 | <[itchyjunk]> | f [] = [] |
| 15:49:12 | → | Kikroz joins (~Kikroz@5.214.161.240) |
| 15:49:30 | × | Kikroz quits (~Kikroz@5.214.161.240) (Client Quit) |
| 15:49:48 | <merijn> | > [] == "" |
| 15:49:50 | <lambdabot> | True |
| 15:50:11 | <[itchyjunk]> | oh, maybe i want to use head to refer to first word of f xs |
| 15:50:29 | <[itchyjunk]> | i can't think of a easy way to refer to first word in my f xs |
| 15:50:45 | <merijn> | [itchyjunk]: You want the first chunk of non-spaces, yeah? |
| 15:51:30 | <[itchyjunk]> | yes |
| 15:52:08 | <merijn> | You probably want one of: |
| 15:52:12 | <merijn> | :t takeWhile |
| 15:52:13 | <lambdabot> | (a -> Bool) -> [a] -> [a] |
| 15:52:15 | <merijn> | :t dropWhile |
| 15:52:16 | <lambdabot> | (a -> Bool) -> [a] -> [a] |
| 15:52:20 | <merijn> | :t span |
| 15:52:21 | <lambdabot> | (a -> Bool) -> [a] -> ([a], [a]) |
| 15:52:32 | <merijn> | > span (<5) [1..10] |
| 15:52:33 | <lambdabot> | ([1,2,3,4],[5,6,7,8,9,10]) |
| 15:52:46 | <merijn> | > span (/= |
| 15:52:48 | <lambdabot> | <hint>:1:9: error: |
| 15:52:48 | <lambdabot> | parse error (possibly incorrect indentation or mismatched brackets) |
| 15:52:54 | <merijn> | > span (/=' ') "foo bar baz" |
| 15:52:56 | <lambdabot> | ("foo"," bar baz") |
| 15:55:08 | <monochrom> | You can use "case f xs of w : ws -> ... ; [] -> ..." to access the first word of f xs. |
| 15:55:29 | <monochrom> | Bonus: You can also access the rest of the words! You can also access the no-words case! |
| 15:55:31 | → | wootehfoot joins (~wootehfoo@user/wootehfoot) |
| 15:56:07 | <[itchyjunk]> | These are nice alternatives, but i felt like i was close to getting this done without additional functions |
| 15:56:18 | <[itchyjunk]> | i'll make a note to try it with span after this |
| 15:56:26 | <monochrom> | But mine is not an alternative. |
| 15:56:38 | <[itchyjunk]> | oh |
| 15:57:15 | <monochrom> | You wanna access the first word of f xs? Well first you have to address what happens if there is no first word. |
| 15:57:32 | <monochrom> | Then the logical conclusion is you need pattern matching. |
| 15:57:42 | <monochrom> | And cover all cases. |
| 15:58:03 | × | acidjnk quits (~acidjnk@p200300d6e70586358424384a1bd111e9.dip0.t-ipconnect.de) (Ping timeout: 272 seconds) |
| 15:58:41 | → | haritz joins (~hrtz@82-69-11-11.dsl.in-addr.zen.co.uk) |
| 15:58:41 | × | haritz quits (~hrtz@82-69-11-11.dsl.in-addr.zen.co.uk) (Changing host) |
| 15:58:41 | → | haritz joins (~hrtz@user/haritz) |
| 16:00:06 | × | jchia[m] quits (~jchiamatr@2001:470:69fc:105::c50b) (Quit: You have been kicked for being idle) |
| 16:00:17 | × | ereslibre[m] quits (~ereslibre@2001:470:69fc:105::1:8f90) (Quit: You have been kicked for being idle) |
| 16:00:17 | × | shiraeeshi[m] quits (~shiraeesh@2001:470:69fc:105::1:77) (Quit: You have been kicked for being idle) |
| 16:00:37 | <[itchyjunk]> | wouldn't f [] = [] one way of covering that case? i suppose i can drop that and go with case for the entire thing |
| 16:03:03 | <onosendi> | Is there a way to print anything to stdout, so I can `runhaskell foo.hs` instead of having to `:l foo.hs; somefunc;` ? |
| 16:03:04 | × | haritz quits (~hrtz@user/haritz) (Remote host closed the connection) |
| 16:03:16 | <[itchyjunk]> | `case f xs of w : ws` , so `case xs of []` says when xs is [] |
| 16:03:39 | <[itchyjunk]> | but how is `case f xs of w : ws` looking at xs as (w:ws) ? hmm |
| 16:04:08 | <[itchyjunk]> | onosendi, isn't that where you have to wrap you code around IO somesuch? |
| 16:04:17 | <[itchyjunk]> | that was one thing that i was meant to learn :< |
| 16:04:54 | <merijn> | onosendi: runhaskell will (like regular programs) run "main :: IO ()" |
| 16:05:04 | <merijn> | onosendi: So, yes, if you call the printing code from main :p |
| 16:05:17 | × | sandydoo quits (~sandydoo@185.209.196.136) (Ping timeout: 252 seconds) |
| 16:05:29 | <merijn> | onosendi: Simplest example would be having foo.hs with: main = putStrLn "Hello World!" |
| 16:05:40 | <merijn> | onosendi: Which should, well, print hello world when you use runhaskell |
| 16:05:48 | × | califax quits (~califax@user/califx) (Ping timeout: 268 seconds) |
| 16:07:37 | → | califax joins (~califax@user/califx) |
| 16:07:52 | × | lisbeths quits (uid135845@id-135845.lymington.irccloud.com) (Quit: Connection closed for inactivity) |
| 16:08:20 | × | hellwolf quits (~hellwolf@7-41-50-84.sta.estpak.ee) (Remote host closed the connection) |
| 16:08:30 | <ggVGc> | This is a great read :) https://aphyr.com/posts/342-typing-the-technical-interview |
| 16:08:48 | × | jespada quits (~jespada@181.80.249.105) (Ping timeout: 268 seconds) |
| 16:09:12 | × | misterfish quits (~misterfis@87.215.131.98) (Ping timeout: 245 seconds) |
| 16:09:22 | <[itchyjunk]> | https://paste.tomsmeding.com/Kvmw35xE |
| 16:09:24 | → | tromp joins (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) |
| 16:09:45 | <[itchyjunk]> | it's not handeling the cases yet but i think that's what it might look like |
| 16:11:03 | <[itchyjunk]> | oh wait |
| 16:11:03 | × | Vajb quits (~Vajb@n1zigc3rgo9mpde2w-1.v6.elisa-mobile.fi) (Read error: Connection reset by peer) |
| 16:12:32 | → | coot joins (~coot@2a02:a310:e241:1b00:ec1a:e9df:79ac:66ba) |
| 16:13:30 | → | jespada joins (~jespada@45.162.228.187) |
| 16:14:32 | <[itchyjunk]> | can i use guard inside a case? |
| 16:14:36 | <merijn> | yes |
| 16:15:00 | <[itchyjunk]> | https://paste.tomsmeding.com/bqnaDjnN |
| 16:15:16 | <[itchyjunk]> | so my caes it lessing me know if there is a first word w or not |
| 16:15:19 | → | Vajb joins (~Vajb@n1zigc3rgo9mpde2w-1.v6.elisa-mobile.fi) |
| 16:15:43 | <[itchyjunk]> | if there is, then check if the first char of (x:xs) is not ' ' then you can attach it to the first word w ? |
| 16:21:24 | → | acidjnk joins (~acidjnk@p200300d6e70586358424384a1bd111e9.dip0.t-ipconnect.de) |
| 16:22:48 | <onosendi> | merijn: Yeah, but I can't print any type but a string, right? I'd like to https://gist.github.com/onosendi/cc23301dd780b75da9e53edfccadc7ff |
| 16:24:04 | <merijn> | onosendi: print :) |
| 16:24:08 | → | dcoutts joins (~duncan@host86-151-44-186.range86-151.btcentralplus.com) |
| 16:24:09 | <merijn> | % putStrLn 5 |
| 16:24:10 | <yahb2> | <interactive>:78:10: error: ; • No instance for (Num String) arising from the literal ‘5’ ; • In the first argument of ‘putStrLn’, namely ‘5’ ; In the expression: putStrLn 5 ; I... |
| 16:24:12 | <merijn> | % print 5 |
| 16:24:13 | <yahb2> | 5 |
| 16:24:25 | <merijn> | :t putStrLn |
| 16:24:26 | <lambdabot> | String -> IO () |
| 16:24:27 | <merijn> | :t print |
| 16:24:29 | <lambdabot> | Show a => a -> IO () |
| 16:25:59 | <onosendi> | merijn: I swear I tried that :/ lol, thanks. |
| 16:27:22 | × | azimut quits (~azimut@gateway/tor-sasl/azimut) (Remote host closed the connection) |
| 16:27:33 | → | califax_ joins (~califax@user/califx) |
| 16:27:57 | → | azimut joins (~azimut@gateway/tor-sasl/azimut) |
| 16:28:37 | × | califax quits (~califax@user/califx) (Ping timeout: 268 seconds) |
| 16:28:42 | califax_ | is now known as califax |
| 16:36:33 | → | sandydoo joins (~sandydoo@185.209.196.136) |
| 16:41:03 | → | yauhsien joins (~yauhsien@118-167-41-184.dynamic-ip.hinet.net) |
| 16:42:07 | × | wootehfoot quits (~wootehfoo@user/wootehfoot) (Ping timeout: 245 seconds) |
| 16:42:33 | × | eggplantade quits (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Remote host closed the connection) |
| 16:43:13 | × | matthewmosior quits (~matthewmo@173.170.253.91) (Ping timeout: 244 seconds) |
| 16:45:48 | × | yauhsien quits (~yauhsien@118-167-41-184.dynamic-ip.hinet.net) (Ping timeout: 268 seconds) |
| 16:45:56 | → | tzh joins (~tzh@c-24-21-73-154.hsd1.wa.comcast.net) |
| 16:46:27 | <Inst> | also, a question |
| 16:46:36 | <Inst> | what advantages would a wordpress clone written in Haskell have? |
| 16:47:29 | <[exa]> | 0 exploits enabled by the sheer hackiness of PHP |
| 16:47:54 | <monochrom> | None. |
| 16:48:03 | <Inst> | I like monochrom's answer |
| 16:48:11 | <[exa]> | unfortunately PHP is a feature of wordpress |
| 16:48:33 | <[itchyjunk]> | the guard is breaking my function h i think |
| 16:48:34 | <[itchyjunk]> | https://bpa.st/36BQ |
| 16:48:38 | <Inst> | from what I've heard, apparently Warp/WAI is substantially faster than the PHP equivalent |
| 16:48:46 | <[itchyjunk]> | when i try just span on my ghci, it seems to somewhat work |
| 16:49:36 | <[itchyjunk]> | Prelude> fst (span (/= ' ') str) : snd (span (/= ' ') str) : [] |
| 16:49:37 | <[itchyjunk]> | ["hello"," world"] |
| 16:49:40 | <[exa]> | [itchyjunk]: why you have the same guard condition on lines 23 and 24? |
| 16:49:51 | <[itchyjunk]> | oops! |
| 16:50:00 | <Inst> | in reality IHP would supplant a Haskell wordpress clone, no? |
| 16:50:02 | <Inst> | https://ihp.digitallyinduced.com |
| 16:50:08 | <[itchyjunk]> | well, i fixed that |
| 16:50:26 | <[itchyjunk]> | but that doesn't fix the gazillion errors :x |
| 16:52:28 | → | eggplantade joins (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) |
| 16:54:04 | <[exa]> | Inst: that's a bit more general IMO but you should be able to emulate wordpress in that pretty quickly |
| 16:57:06 | × | eggplantade quits (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Ping timeout: 264 seconds) |
| 16:57:21 | × | machinedgod quits (~machinedg@d172-219-86-154.abhsia.telus.net) (Ping timeout: 252 seconds) |
| 16:58:23 | <Inst> | hmmm |
| 16:58:28 | <Inst> | actually, i thought about it |
| 16:58:40 | <Inst> | I had a start-up idea, just need about 300k to execute and I don't have that in pocket ;_; |
| 16:58:54 | → | eggplantade joins (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) |
| 16:58:57 | <Inst> | I can change part of the set-up to adapt it to a wordpress clone and actually extend the features |
| 16:59:13 | <Inst> | the start-up idea was intended as an attack on Upwork and FiveRR, which charge 20% |
| 17:00:01 | <Inst> | i.e, decentralizing their model |
| 17:00:06 | → | haritz joins (~hrtz@2a02:8010:65b5:0:6009:6384:e3cb:2220) |
| 17:00:06 | × | haritz quits (~hrtz@2a02:8010:65b5:0:6009:6384:e3cb:2220) (Changing host) |
| 17:00:06 | → | haritz joins (~hrtz@user/haritz) |
| 17:00:06 | <Inst> | a decentralized wordpress would fly |
| 17:00:20 | <Inst> | "no content? Borrow other people's content instead!" |
| 17:01:27 | <Inst> | I was originally thinking something lame like "Monadpress" or "Monado", but "Joinable" is a subtle reference to the Monad typeclass |
| 17:01:34 | → | nate4 joins (~nate@98.45.169.16) |
| 17:01:40 | <Inst> | and also suggests the collaborative nature of the software |
| 17:02:04 | <Rembane> | Sounds like a wiki hosted on many places |
| 17:02:17 | <pavonia> | @pl \f g x y -> f (g x) (g y) (f g y x) |
| 17:02:17 | <lambdabot> | ap (ap . (liftM2 ap .) . join . ((flip . ((.) .)) .) . (.)) (flip .) |
| 17:02:22 | <pavonia> | onosendi: ^ |
| 17:03:01 | <onosendi> | pavonia: I don't know what any of that is, lol. |
| 17:03:41 | <Inst> | so this one would effectively be an attack on Medium |
| 17:03:54 | <Inst> | say, you look up a specific topic, but we could make it "idealistic", i.e, allow people to break out of the bubble |
| 17:04:22 | <Inst> | instead of merely seeing a conservative / leftist view on a subject, you'd see multiple subjects |
| 17:04:37 | <Inst> | erm, multiple viewpoints |
| 17:05:02 | <Rembane> | Sounds like the old blogosphere before the social networks/platforms ate the internet |
| 17:05:18 | <Inst> | it's weird trying to save democracy when I don't believe in it, in the best case, Churchill's quip about democracy being the worst form of government except all the others invented |
| 17:05:48 | → | econo joins (uid147250@user/econo) |
| 17:09:10 | × | tromp quits (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…) |
| 17:09:26 | × | benin0 quits (~benin@183.82.177.174) (Quit: The Lounge - https://thelounge.chat) |
| 17:09:33 | <[exa]> | Inst: can you instead believe in improving the world for free? |
| 17:12:23 | <monochrom> | Ugh why is that conversation in this channel? |
| 17:12:51 | <[exa]> | yeah it's at least for #-offtopic |
| 17:14:46 | → | lisbeths joins (uid135845@id-135845.lymington.irccloud.com) |
| 17:16:17 | × | motherfsck quits (~motherfsc@user/motherfsck) (Ping timeout: 245 seconds) |
| 17:21:48 | × | pavonia quits (~user@user/siracusa) (Quit: Bye!) |
| 17:21:57 | → | matthewmosior joins (~matthewmo@173.170.253.91) |
| 17:28:03 | <Inst> | thanks |
| 17:29:41 | → | motherfsck joins (~motherfsc@user/motherfsck) |
| 17:37:01 | → | tromp joins (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) |
| 17:38:53 | → | Kikroz joins (~Kikroz@5.214.144.252) |
| 17:39:10 | × | Kikroz quits (~Kikroz@5.214.144.252) (Client Quit) |
| 17:39:33 | <Inst> | why don't you get nested lists, itchyjunk? |
| 17:40:07 | <Inst> | the actual plan of the start-up idea, btw, is to allow companies to giggify their work environment in order to increase labor exploitation |
| 17:40:14 | <Inst> | while being kosher with overtime laws |
| 17:40:34 | <Inst> | also why do you even have nested lists |
| 17:42:34 | <geekosaur> | lists of String are necessarily nested lists |
| 17:43:05 | <Inst> | just as lists of Text are nested arrays? |
| 17:43:32 | <geekosaur> | it's more direct than thatm since a String is literally just a list of Char |
| 17:43:41 | <geekosaur> | s/thatm/that, |
| 17:44:05 | <geekosaur> | whereas Text hides its internal array (which differs from a list) |
| 17:44:53 | × | motherfsck quits (~motherfsc@user/motherfsck) (Ping timeout: 255 seconds) |
| 17:46:00 | <c_wraith> | Does anyone else feel like describing Haskell as "declarative" doesn't really make sense? |
| 17:47:26 | <c_wraith> | I keep seeing people do that. It's confusing. Operational semantics are a huge part of writing good code. |
| 17:47:28 | → | joo-_ joins (~joo-_@172-105-65-159.ip.linodeusercontent.com) |
| 17:47:28 | × | joo-_ quits (~joo-_@172-105-65-159.ip.linodeusercontent.com) (Changing host) |
| 17:47:28 | → | joo-_ joins (~joo-_@fsf/member/joo--) |
| 17:47:30 | × | joo-__ quits (~joo-_@fsf/member/joo--) (Quit: leaving) |
| 17:48:53 | → | jinsun__ joins (~jinsun@user/jinsun) |
| 17:48:54 | jinsun | is now known as Guest4466 |
| 17:48:54 | × | Guest4466 quits (~jinsun@user/jinsun) (Killed (sodium.libera.chat (Nickname regained by services))) |
| 17:48:54 | jinsun__ | is now known as jinsun |
| 17:53:28 | → | Guest3 joins (~textual@pool-100-11-18-203.phlapa.fios.verizon.net) |
| 17:54:06 | <[itchyjunk]> | Inst, i don't know why i don't get them. |
| 17:54:21 | → | jinsun__ joins (~jinsun@user/jinsun) |
| 17:54:21 | × | jinsun quits (~jinsun@user/jinsun) (Killed (tungsten.libera.chat (Nickname regained by services))) |
| 17:54:21 | jinsun__ | is now known as jinsun |
| 17:54:31 | <Inst> | think of a string as not a nested list |
| 17:54:34 | <Inst> | even though it is |
| 17:54:40 | <Inst> | think of a nested list as some other type within the list |
| 17:54:42 | <Inst> | oh |
| 17:54:44 | <Inst> | you don't get fmap |
| 17:54:47 | <Inst> | no? |
| 17:55:00 | <[itchyjunk]> | hmm i've used fmap and map once or twice |
| 17:55:02 | <Inst> | you don't get higher order functions in the context of a functor (which you haven't learned it) |
| 17:55:08 | → | ubert joins (~Thunderbi@178.165.165.213.wireless.dyn.drei.com) |
| 17:55:08 | <[itchyjunk]> | but i am not comfertable using them uet |
| 17:55:24 | × | Guest3 quits (~textual@pool-100-11-18-203.phlapa.fios.verizon.net) (Changing host) |
| 17:55:24 | → | Guest3 joins (~textual@user/polo) |
| 17:55:27 | Guest3 | is now known as Gambino |
| 17:55:29 | × | merijn quits (~merijn@86-86-29-250.fixed.kpn.net) (Ping timeout: 268 seconds) |
| 17:55:30 | <[itchyjunk]> | higher order function as in functions taking functions as parameter? |
| 17:55:43 | <Inst> | eventually you stop noticing that they're HOF |
| 17:55:43 | <[itchyjunk]> | that i have some understanding of. not sure how well i can use it but. |
| 17:55:46 | <Inst> | it's just natural |
| 17:55:56 | <Inst> | with lists you want to map them all the time |
| 17:56:04 | <Inst> | and if you're comfortable with foldr, you don't use manual recursion |
| 17:56:11 | <Inst> | apparently with continuation passing style |
| 17:56:29 | <Inst> | you can even operate on two lists, or operate on a single list, taking multiple elements as arguments |
| 17:57:27 | <Inst> | does that make any sense to you? |
| 17:57:52 | <Inst> | if you're not working on recursion, and just want to transform nested stuff within the list, get something that transforms nested stuff within the list and map / fmap onto the list |
| 18:01:19 | → | misterfish joins (~misterfis@ip214-130-173-82.adsl2.static.versatel.nl) |
| 18:02:05 | → | Lycurgus joins (~juan@user/Lycurgus) |
| 18:03:10 | × | Lord_of_Life quits (~Lord@user/lord-of-life/x-2819915) (Ping timeout: 240 seconds) |
| 18:03:21 | → | Lord_of_Life_ joins (~Lord@user/lord-of-life/x-2819915) |
| 18:03:43 | × | nate4 quits (~nate@98.45.169.16) (Ping timeout: 252 seconds) |
| 18:03:45 | × | Lycurgus quits (~juan@user/Lycurgus) (Client Quit) |
| 18:04:35 | Lord_of_Life_ | is now known as Lord_of_Life |
| 18:08:02 | → | motherfsck joins (~motherfsc@user/motherfsck) |
| 18:08:29 | × | misterfish quits (~misterfis@ip214-130-173-82.adsl2.static.versatel.nl) (Ping timeout: 252 seconds) |
| 18:11:21 | → | jinsun__ joins (~jinsun@user/jinsun) |
| 18:11:21 | jinsun | is now known as Guest5051 |
| 18:11:21 | × | Guest5051 quits (~jinsun@user/jinsun) (Killed (molybdenum.libera.chat (Nickname regained by services))) |
| 18:11:21 | jinsun__ | is now known as jinsun |
| 18:11:27 | × | vglfr quits (~vglfr@194.9.14.33) (Ping timeout: 244 seconds) |
| 18:12:31 | × | dknite quits (~dknite@223.176.55.39) (Ping timeout: 252 seconds) |
| 18:12:49 | × | jinsun quits (~jinsun@user/jinsun) (Client Quit) |
| 18:13:37 | → | vglfr joins (~vglfr@194.9.14.33) |
| 18:16:39 | → | sonologico joins (~raphael@dhcp-077-251-118-129.chello.nl) |
| 18:17:57 | × | vglfr quits (~vglfr@194.9.14.33) (Ping timeout: 245 seconds) |
| 18:18:37 | → | zxx7529 joins (~Thunderbi@user/zxx7529) |
| 18:19:34 | × | Gambino quits (~textual@user/polo) (Killed (zirconium.libera.chat (Nickname regained by services))) |
| 18:21:49 | → | merijn joins (~merijn@86-86-29-250.fixed.kpn.net) |
| 18:22:56 | → | vglfr joins (~vglfr@194.9.14.33) |
| 18:23:48 | → | ystael joins (~ystael@user/ystael) |
| 18:24:21 | × | Igloo quits (~ian@matrix.chaos.earth.li) (Ping timeout: 272 seconds) |
| 18:24:31 | → | Igloo joins (~ian@matrix.chaos.earth.li) |
| 18:24:38 | × | coot quits (~coot@2a02:a310:e241:1b00:ec1a:e9df:79ac:66ba) (Quit: coot) |
| 18:26:17 | × | matthewmosior quits (~matthewmo@173.170.253.91) (Ping timeout: 245 seconds) |
| 18:26:58 | → | Pickchea joins (~private@user/pickchea) |
| 18:28:08 | × | vglfr quits (~vglfr@194.9.14.33) (Read error: Connection reset by peer) |
| 18:29:54 | → | vglfr joins (~vglfr@194.9.14.33) |
| 18:30:43 | → | hellwolf joins (~hellwolf@7-41-50-84.sta.estpak.ee) |
| 18:31:26 | × | hellwolf quits (~hellwolf@7-41-50-84.sta.estpak.ee) (Remote host closed the connection) |
| 18:32:01 | → | Guest3 joins (~textual@pool-100-11-18-203.phlapa.fios.verizon.net) |
| 18:32:01 | × | vglfr quits (~vglfr@194.9.14.33) (Read error: Connection reset by peer) |
| 18:32:28 | → | vglfr joins (~vglfr@194.9.14.33) |
| 18:32:44 | × | Guest3 quits (~textual@pool-100-11-18-203.phlapa.fios.verizon.net) (Changing host) |
| 18:32:44 | → | Guest3 joins (~textual@user/polo) |
| 18:32:46 | Guest3 | is now known as Gambino |
| 18:35:01 | → | hellwolf joins (~hellwolf@7-41-50-84.sta.estpak.ee) |
| 18:36:21 | → | jmdaemon joins (~jmdaemon@user/jmdaemon) |
| 18:37:57 | × | sonologico quits (~raphael@dhcp-077-251-118-129.chello.nl) (Ping timeout: 245 seconds) |
| 18:38:47 | × | vglfr quits (~vglfr@194.9.14.33) (Ping timeout: 245 seconds) |
| 18:39:03 | → | jinsun joins (~jinsun@user/jinsun) |
| 18:39:11 | → | vglfr joins (~vglfr@194.9.14.33) |
| 18:39:17 | × | azimut quits (~azimut@gateway/tor-sasl/azimut) (Remote host closed the connection) |
| 18:39:26 | → | matthewmosior joins (~matthewmo@173.170.253.91) |
| 18:40:00 | → | azimut joins (~azimut@gateway/tor-sasl/azimut) |
| 18:43:44 | × | Gambino quits (~textual@user/polo) (Killed (tungsten.libera.chat (Nickname regained by services))) |
| 18:43:59 | × | matthewmosior quits (~matthewmo@173.170.253.91) (Ping timeout: 244 seconds) |
| 18:50:23 | → | Guest3 joins (~textual@pool-100-11-18-203.phlapa.fios.verizon.net) |
| 18:50:24 | × | Guest3 quits (~textual@pool-100-11-18-203.phlapa.fios.verizon.net) (Changing host) |
| 18:50:24 | → | Guest3 joins (~textual@user/polo) |
| 18:50:28 | Guest3 | is now known as Gambino |
| 18:52:00 | × | gpncarl quits (uid562772@id-562772.ilkley.irccloud.com) (Quit: Connection closed for inactivity) |
| 18:52:55 | → | Sgeo joins (~Sgeo@user/sgeo) |
| 18:54:24 | Gambino | is now known as SINH |
| 18:55:53 | × | merijn quits (~merijn@86-86-29-250.fixed.kpn.net) (Ping timeout: 244 seconds) |
| 18:56:31 | → | matthewmosior joins (~matthewmo@173.170.253.91) |
| 18:56:37 | SINH | is now known as Gambino |
| 18:56:55 | × | z0k quits (~z0k@206.84.140.97) (Quit: WeeChat 3.5) |
| 18:58:20 | × | Gambino quits (~textual@user/polo) (Quit: Textual IRC Client: www.textualapp.com) |
| 18:58:27 | → | Milan joins (~Milan@46.245.111.222) |
| 18:59:39 | → | coot joins (~coot@213.134.190.95) |
| 19:03:58 | × | zxx7529 quits (~Thunderbi@user/zxx7529) (Quit: zxx7529) |
| 19:06:25 | → | kenran joins (~kenran@200116b82b2ba4000565c63a08218b7b.dip.versatel-1u1.de) |
| 19:07:53 | × | mon_aaraj quits (~MonAaraj@user/mon-aaraj/x-4416475) (Ping timeout: 252 seconds) |
| 19:09:05 | → | merijn joins (~merijn@86-86-29-250.fixed.kpn.net) |
| 19:12:10 | × | azimut quits (~azimut@gateway/tor-sasl/azimut) (Remote host closed the connection) |
| 19:13:48 | × | merijn quits (~merijn@86-86-29-250.fixed.kpn.net) (Ping timeout: 268 seconds) |
| 19:13:53 | → | azimut joins (~azimut@gateway/tor-sasl/azimut) |
| 19:18:14 | × | tromp quits (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…) |
| 19:18:25 | × | Milan quits (~Milan@46.245.111.222) (Quit: Client closed) |
| 19:23:21 | → | tromp joins (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) |
| 19:23:50 | → | Jeanne-Kamikaze joins (~Jeanne-Ka@142.147.89.233) |
| 19:24:56 | <monochrom> | c_wraith: I used to say that Haskell was declarative. Now I say that relatively it's a bit more declarative than let's say the Algol kind of languages, but of course compared to Prolog Haskell doesn't look declarative. |
| 19:25:16 | <dolio> | Is prolog really declarative, though? |
| 19:25:17 | → | bontaq joins (~user@ool-45779fe5.dyn.optonline.net) |
| 19:25:31 | × | sandydoo quits (~sandydoo@185.209.196.136) (Ping timeout: 268 seconds) |
| 19:26:21 | <monochrom> | I'm tall when I stand next to someone 5-feet. And it's just because I'm like 1 or 2 inches taller. |
| 19:26:39 | <monochrom> | Then when I stand next to a 6-feet person I'm not tall at all. |
| 19:26:59 | <monochrom> | But is 6-feet really tall though? >:) |
| 19:27:25 | <darkling> | Depends on whether you're Dutch or not. |
| 19:27:26 | <dolio> | The argument above kind of applies to anything. |
| 19:27:50 | <dolio> | Prolog is declarative, but if you want to write good programs, you need to care about its operational semantics. |
| 19:28:06 | <c_wraith> | I was just thinking this morning - one of my favorite comedy groups had a former member who was like 6'9", but nobody realized it because everyone else in the group was also really tall, so he just looked a little tall relatively. |
| 19:28:48 | <dolio> | Same with SQL. |
| 19:29:55 | <c_wraith> | conclusion: you will always eventually care about performance, at which point operational concerns start showing up where you care about the "how" as much as the "what" |
| 19:29:59 | × | Pickchea quits (~private@user/pickchea) (Ping timeout: 244 seconds) |
| 19:30:02 | × | vglfr quits (~vglfr@194.9.14.33) (Ping timeout: 245 seconds) |
| 19:30:22 | → | mon_aaraj joins (~MonAaraj@user/mon-aaraj/x-4416475) |
| 19:30:24 | <dolio> | Yeah, I'm not sure we're anywhere close to "declarative" programming if that's the criteria. |
| 19:31:33 | <dolio> | You need something like the Conor McBride dream, where you just write the types, and the computer is good enough to figure out a good program. |
| 19:32:24 | <EvanR> | there's this niche area of programming where you write in dynamic webdev languages with terrible performance, with no possibility of making it perform better, and it somehow works xD |
| 19:32:59 | <dolio> | Eventually you have to care even with those. |
| 19:33:04 | <EvanR> | if they were simply declarative instead of imperative it would seem to defy this logic that you eventually need operational semantics |
| 19:33:42 | <monochrom> | My dream exceeds that. In my dream, the type also includes time bounds. |
| 19:34:01 | <dolio> | Sure, that's even better. |
| 19:34:07 | × | dos__^^ quits (~user@user/dos/x-1723657) (Ping timeout: 244 seconds) |
| 19:34:31 | <monochrom> | 20 years ago I thought my dream would come true in my life time. Now I don't think so. :) |
| 19:34:41 | <EvanR> | the type includes the time bounds, the space bounds, the whatever I care about this week bounds, ...? |
| 19:34:53 | <monochrom> | But it's my fault! I procrastinated and didn't work on it! |
| 19:35:12 | × | gmg quits (~user@user/gehmehgeh) (Quit: Leaving) |
| 19:35:36 | <dolio> | Some people right now probably think that it'll happen in your lifetime. But I think they're probably wrong. |
| 19:36:28 | <monochrom> | EvanR: My dream stops at time and space bounds. One day someone will add electricity bounds and/or "no variation so side-channel attacks are eliminated". |
| 19:36:53 | <monochrom> | Hell, I think I was wrong :) |
| 19:37:38 | <EvanR> | yeah security bounds |
| 19:38:05 | <EvanR> | which patents this does or does not infringe on bounds |
| 19:38:18 | <EvanR> | DRM type system xD |
| 19:38:37 | <EvanR> | compiler guarantees you never compute any illegal primes |
| 19:38:38 | <Rembane> | There should be loads of money in it |
| 19:40:19 | × | martin02 quits (~silas@141.84.69.76) (Ping timeout: 244 seconds) |
| 19:42:07 | <hpc> | thanks to relativity, sufficiently large electricity bounds are indistinguishable from time and space bounds :D |
| 19:44:25 | → | causal joins (~user@50.35.83.177) |
| 19:44:33 | × | azimut quits (~azimut@gateway/tor-sasl/azimut) (Remote host closed the connection) |
| 19:44:59 | → | azimut joins (~azimut@gateway/tor-sasl/azimut) |
| 19:45:01 | <monochrom> | hahaha |
| 19:45:38 | <hololeap> | using parsec, when you run a parser inside a parser e.g. you parse some string fragment and want to run another parser on it, is there a way to throw any resulting ParseError inside the larger parser? |
| 19:45:48 | <hololeap> | sorry if the question is confusing |
| 19:45:51 | → | sandydoo joins (~sandydoo@185.209.196.136) |
| 19:46:47 | → | machinedgod joins (~machinedg@d172-219-86-154.abhsia.telus.net) |
| 19:47:20 | <hololeap> | it really boils down to: ? :: ParseError -> ParsecT s u m a |
| 19:47:41 | <monochrom> | ParsecT is an instance of MonadError, so I guess throwError |
| 19:48:04 | <monochrom> | Err no, I misread. |
| 19:48:12 | <hololeap> | the best I have so far is `fail . show` |
| 19:48:51 | → | azimut_ joins (~azimut@gateway/tor-sasl/azimut) |
| 19:50:02 | × | tromp quits (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…) |
| 19:50:16 | × | azimut quits (~azimut@gateway/tor-sasl/azimut) (Ping timeout: 268 seconds) |
| 19:53:16 | × | Henkru quits (henkru@kapsi.fi) (Ping timeout: 268 seconds) |
| 19:53:24 | → | martin02 joins (~silas@141.84.69.76) |
| 19:55:20 | → | yauhsien joins (~yauhsien@118-167-41-184.dynamic-ip.hinet.net) |
| 19:56:35 | → | Henkru joins (henkru@kapsi.fi) |
| 19:58:21 | <monochrom> | Given ParseError, you can make Reply s u a, then you can make Consumed (m (Reply s u a)), then you can use mkPT. "Low-level creation of the ParsecT type. You really shouldn't have to do this." >:) |
| 19:58:47 | × | matthewmosior quits (~matthewmo@173.170.253.91) (Ping timeout: 245 seconds) |
| 19:59:57 | × | yauhsien quits (~yauhsien@118-167-41-184.dynamic-ip.hinet.net) (Ping timeout: 244 seconds) |
| 20:00:55 | <hpc> | there's a more direct way with Text.Parsec.Prim - https://hackage.haskell.org/package/parsec-3.1.15.1/docs/src/Text.Parsec.Prim.html#parserFail |
| 20:01:04 | <hpc> | write a function like that, but without all the "turn string into error" stuff |
| 20:02:00 | <hpc> | \err -> ParsecT $ \_ _ _ h -> h err |
| 20:02:07 | <hpc> | pretty sure that should work? |
| 20:03:54 | <monochrom> | yeah |
| 20:04:38 | → | pavonia joins (~user@user/siracusa) |
| 20:05:05 | × | ubert quits (~Thunderbi@178.165.165.213.wireless.dyn.drei.com) (Ping timeout: 252 seconds) |
| 20:06:46 | <hololeap> | ok, but where do I get an exported ParsecT constructor? |
| 20:08:07 | → | Pickchea joins (~private@user/pickchea) |
| 20:08:50 | <monochrom> | Hrm, I think none. I guess back to the mkPT idea :) |
| 20:09:17 | <hololeap> | haha, maybe there's a bug about this |
| 20:11:14 | × | azimut_ quits (~azimut@gateway/tor-sasl/azimut) (Ping timeout: 268 seconds) |
| 20:11:55 | × | mon_aaraj quits (~MonAaraj@user/mon-aaraj/x-4416475) (Ping timeout: 260 seconds) |
| 20:14:10 | <sm> | switch to megaparsec ? |
| 20:17:52 | × | lisbeths quits (uid135845@id-135845.lymington.irccloud.com) (Quit: Connection closed for inactivity) |
| 20:20:41 | <sm> | how would you debug this: "cabal: Failed to build hledger-1.26.1 ... The build process segfaulted (i.e. SIGSEGV).", on github actions ? |
| 20:24:10 | → | Lycurgus joins (~juan@user/Lycurgus) |
| 20:24:47 | <Lycurgus> | identify what actually segfaulted? |
| 20:25:38 | <Lycurgus> | btw if I hadn't looked at hledger in about 5 y what would be the bullet points? |
| 20:26:01 | <Lycurgus> | also are you, sm, the author of haddock? |
| 20:26:45 | <sm> | here's a log, https://github.com/simonmichael/hledger/runs/7599626109?check_suite_focus=true . There's no other error output. It fails on different packages at different times. |
| 20:26:46 | <Lycurgus> | i don't really want stuff like build processes entangled with somebody else's shit |
| 20:26:48 | → | tromp joins (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) |
| 20:26:59 | <Lycurgus> | in this case microsoft i take it |
| 20:27:03 | <sm> | no, I didn't write haddock |
| 20:27:08 | <Lycurgus> | (the owner of github) |
| 20:27:10 | <Lycurgus> | ah |
| 20:27:19 | <Lycurgus> | another simon i think |
| 20:27:24 | <sm> | and I deny all other allegations |
| 20:27:39 | <sm> | Simon Marlow perhaps |
| 20:27:48 | → | matthewmosior joins (~matthewmo@173.170.253.91) |
| 20:27:57 | <Lycurgus> | who is not you |
| 20:28:12 | <sm> | Lycurgus re hledger, what are you familiar with ? Ledger ? old hledger ? gnucash ? |
| 20:28:18 | <Lycurgus> | being simon michael |
| 20:28:38 | <Lycurgus> | hledger c. '2014/5 |
| 20:29:07 | <Lycurgus> | and the cli ledger ecosys generally of that time |
| 20:29:43 | <sm> | whew, 8 years.. summarising that is a bit of work |
| 20:29:59 | <Lycurgus> | alpine looks like bad news |
| 20:30:10 | <sm> | its like Ledger implemented in more depth, more robustly, with better UX |
| 20:30:31 | <Lycurgus> | well i was running hledger-web at one point |
| 20:30:45 | <Lycurgus> | it used to be a pain to build |
| 20:30:55 | <Lycurgus> | well not a pain but not a snap either |
| 20:31:05 | <sm> | building should be routine on non-exotic platforms |
| 20:31:16 | <sm> | and there are more binaries these days |
| 20:31:43 | <Lycurgus> | yesod based iirc |
| 20:32:05 | <Lycurgus> | (the web part) |
| 20:32:24 | <Lycurgus> | maybe misremember and it was just wai |
| 20:32:27 | <sm> | back then building yesod was a bit scary probably, not today |
| 20:32:34 | → | michalz joins (~michalz@185.246.204.97) |
| 20:33:46 | <Lycurgus> | anyway that's my guess base OS elements not playing nice with your build/ci intentions |
| 20:34:40 | <sm> | thanks.. that doesn't narrow it down too much. It was building fine before of course |
| 20:35:03 | <sm> | guess I'll try an older ghc |
| 20:36:00 | → | merijn joins (~merijn@86-86-29-250.fixed.kpn.net) |
| 20:36:07 | <sm> | and indeed I don't know why it needs to be alpine, I could try changing that |
| 20:37:05 | <monochrom> | If you didn't choose alpine but something/someone did, it's probably because alpine is reputed to be a very minimal and friendly-to-static-linking linux. |
| 20:41:34 | <sm> | yes that sounds right monochrom |
| 20:42:08 | <sm> | looking more carefully, it mostly does fail in the same place, Hledger.Cli.DocFiles, or another package, both of which probably involve TH/QQ. That could be a clue |
| 20:42:30 | <sm> | more troubleshooting next time |
| 20:49:34 | × | bitdex quits (~bitdex@gateway/tor-sasl/bitdex) (Remote host closed the connection) |
| 20:49:34 | × | califax quits (~califax@user/califx) (Remote host closed the connection) |
| 20:49:34 | × | noteness quits (~noteness@user/noteness) (Remote host closed the connection) |
| 20:49:34 | × | stiell_ quits (~stiell@gateway/tor-sasl/stiell) (Remote host closed the connection) |
| 20:49:34 | × | ChaiTRex quits (~ChaiTRex@user/chaitrex) (Remote host closed the connection) |
| 20:50:14 | → | stiell_ joins (~stiell@gateway/tor-sasl/stiell) |
| 20:50:20 | → | califax joins (~califax@user/califx) |
| 20:50:25 | → | noteness joins (~noteness@user/noteness) |
| 20:50:38 | → | ChaiTRex joins (~ChaiTRex@user/chaitrex) |
| 20:50:44 | → | bitdex joins (~bitdex@gateway/tor-sasl/bitdex) |
| 20:51:51 | × | tromp quits (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…) |
| 20:54:42 | → | tromp joins (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) |
| 20:55:09 | × | jpds1 quits (~jpds@gateway/tor-sasl/jpds) (Remote host closed the connection) |
| 20:55:09 | × | ChaiTRex quits (~ChaiTRex@user/chaitrex) (Write error: Connection reset by peer) |
| 20:55:09 | × | califax quits (~califax@user/califx) (Write error: Connection reset by peer) |
| 20:55:09 | × | FinnElija quits (~finn_elij@user/finn-elija/x-0085643) (Write error: Connection reset by peer) |
| 20:55:42 | → | ChaiTRex joins (~ChaiTRex@user/chaitrex) |
| 20:55:45 | → | FinnElija joins (~finn_elij@user/finn-elija/x-0085643) |
| 20:55:53 | → | jpds1 joins (~jpds@gateway/tor-sasl/jpds) |
| 20:58:05 | → | califax joins (~califax@user/califx) |
| 21:00:54 | × | Inst quits (~Inst@2601:6c4:4080:3f80:d998:768b:c35b:a535) (Ping timeout: 244 seconds) |
| 21:00:57 | × | johnw quits (~johnw@76-234-69-149.lightspeed.frokca.sbcglobal.net) (Quit: ZNC - http://znc.in) |
| 21:02:26 | × | Pickchea quits (~private@user/pickchea) (Quit: Leaving) |
| 21:04:06 | × | michalz quits (~michalz@185.246.204.97) (Remote host closed the connection) |
| 21:08:09 | × | phma quits (~phma@host-67-44-208-60.hnremote.net) (Read error: Connection reset by peer) |
| 21:10:21 | × | merijn quits (~merijn@86-86-29-250.fixed.kpn.net) (Ping timeout: 252 seconds) |
| 21:10:21 | × | kenran quits (~kenran@200116b82b2ba4000565c63a08218b7b.dip.versatel-1u1.de) (Quit: WeeChat info:version) |
| 21:13:17 | × | Jeanne-Kamikaze quits (~Jeanne-Ka@142.147.89.233) (Quit: Leaving) |
| 21:19:03 | × | hellwolf quits (~hellwolf@7-41-50-84.sta.estpak.ee) (Remote host closed the connection) |
| 21:19:18 | → | hellwolf joins (~hellwolf@7-41-50-84.sta.estpak.ee) |
| 21:20:27 | → | shriekingnoise joins (~shrieking@186.137.167.202) |
| 21:24:21 | <pavonia> | Is it worth optimizing Integer operations for bit operations (bitshifts etc.)? I'm not sure if they are even implemented efficiently for Integer or if the compiler optimizes them on its own |
| 21:25:02 | → | phma joins (phma@2001:5b0:2144:59f8:a0f0:98d:a9a7:a552) |
| 21:25:18 | × | phma quits (phma@2001:5b0:2144:59f8:a0f0:98d:a9a7:a552) (Read error: Connection reset by peer) |
| 21:25:41 | sm | thinks it's probably https://gitlab.haskell.org/ghc/ghc/-/issues/20266 |
| 21:25:46 | → | phma joins (~phma@host-67-44-208-130.hnremote.net) |
| 21:32:08 | × | matthewmosior quits (~matthewmo@173.170.253.91) (Ping timeout: 255 seconds) |
| 21:38:03 | → | jonathanx joins (~jonathan@h-178-174-176-109.A357.priv.bahnhof.se) |
| 21:40:14 | × | FinnElija quits (~finn_elij@user/finn-elija/x-0085643) (Remote host closed the connection) |
| 21:42:43 | × | tromp quits (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…) |
| 21:43:47 | → | FinnElija joins (~finn_elij@user/finn-elija/x-0085643) |
| 21:46:22 | → | matthewmosior joins (~matthewmo@173.170.253.91) |
| 21:50:36 | × | eggplantade quits (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Remote host closed the connection) |
| 21:52:58 | × | jpds1 quits (~jpds@gateway/tor-sasl/jpds) (Remote host closed the connection) |
| 21:53:37 | → | jpds1 joins (~jpds@gateway/tor-sasl/jpds) |
| 21:59:12 | <dsal> | pavonia: Does the profiler tell you that you're spending enough time on these operations that optimizing them would yield a noticeable performance improvement to your user? |
| 21:59:35 | → | waleee joins (~waleee@2001:9b0:213:7200:cc36:a556:b1e8:b340) |
| 22:00:30 | → | eggplantade joins (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) |
| 22:01:26 | <pavonia> | I didnt do any profiling actually, but those Integer operations are the only ones the functions perform |
| 22:01:51 | <monochrom> | Are the functions known to be hot spots? |
| 22:03:05 | <pavonia> | Yeah |
| 22:03:35 | × | Lycurgus quits (~juan@user/Lycurgus) (Quit: Exeunt juan@acm.org) |
| 22:04:58 | × | eggplantade quits (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Ping timeout: 244 seconds) |
| 22:10:36 | <monochrom> | OK I did an experiment with "f :: Int -> Int; f x = x * 16" or 17. |
| 22:10:52 | <monochrom> | 16 becomes shlq $4, %rax |
| 22:11:18 | <monochrom> | 17 becomes imulq $17, %rax |
| 22:11:37 | <monochrom> | This is both -O and -O2 |
| 22:11:41 | <geekosaur> | Integer, though? |
| 22:12:05 | <geekosaur> | especially given switchable (even if not at runtime) backend |
| 22:13:44 | × | coot quits (~coot@213.134.190.95) (Quit: coot) |
| 22:13:53 | <monochrom> | Integer is going to be just calling up GHC.Integer.Type.timesInteger_info |
| 22:14:15 | <monochrom> | (16 or 17) |
| 22:15:02 | <monochrom> | But you do not know that GMP does not optimize that :) |
| 22:15:25 | × | Midjak quits (~Midjak@82.66.147.146) (Quit: This computer has gone to sleep) |
| 22:15:30 | <dolio> | For Integer it has multiple branches, too. |
| 22:15:35 | <geekosaur> | right, but I also don't know with certainty that it's the GMP backend (and more to the point, neither does ghc) |
| 22:15:40 | <dolio> | One looks similar to Int, and the other uses GMP. |
| 22:15:56 | <dolio> | Except the Int branch will have to promote sometimes. |
| 22:16:26 | <monochrom> | "What are birds? We just don't know." :) |
| 22:18:30 | → | eggplantade joins (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) |
| 22:20:09 | × | kimjetwav quits (~user@2607:fea8:235e:b600:4fe5:aa4:5bfb:2ba6) (Remote host closed the connection) |
| 22:20:54 | → | vglfr joins (~vglfr@194.9.14.33) |
| 22:24:43 | → | renzhi joins (~xp@2607:fa49:6500:b100::47a5) |
| 22:26:24 | × | ChaiTRex quits (~ChaiTRex@user/chaitrex) (Remote host closed the connection) |
| 22:27:33 | × | acidjnk quits (~acidjnk@p200300d6e70586358424384a1bd111e9.dip0.t-ipconnect.de) (Ping timeout: 272 seconds) |
| 22:27:38 | × | haritz quits (~hrtz@user/haritz) (Ping timeout: 240 seconds) |
| 22:27:47 | → | ChaiTRex joins (~ChaiTRex@user/chaitrex) |
| 22:30:24 | → | merijn joins (~merijn@86-86-29-250.fixed.kpn.net) |
| 22:34:29 | × | MajorBiscuit quits (~MajorBisc@86-88-79-148.fixed.kpn.net) (Quit: WeeChat 3.5) |
| 22:37:04 | <sm> | (yes, it was 20266) |
| 22:42:45 | × | jonathanx quits (~jonathan@h-178-174-176-109.A357.priv.bahnhof.se) (Ping timeout: 252 seconds) |
| 22:49:43 | × | califax quits (~califax@user/califx) (Remote host closed the connection) |
| 22:50:33 | → | califax joins (~califax@user/califx) |
| 22:51:00 | <pavonia> | I wasn't aware there are different Integer backends. Looking at the code is quite interesting, e.g. the integerLogBase implementation by repeated squaring is magnitudes faster than the naive version wiith repreated division |
| 22:51:13 | <pavonia> | https://hackage.haskell.org/package/integer-gmp-1.0.3.0/docs/src/GHC.Integer.Logarithms.html#integerLogBase%23 |
| 22:51:42 | × | matthewmosior quits (~matthewmo@173.170.253.91) (Ping timeout: 245 seconds) |
| 22:52:18 | → | Jeanne-Kamikaze joins (~Jeanne-Ka@142.147.89.203) |
| 22:52:38 | <monochrom> | No wonder everyone was saying "bottom-up is faster than top-down" :) |
| 22:54:43 | <geekosaur> | not only are there different backends, but the alternate backend changed in 9.2.x |
| 22:55:10 | <geekosaur> | (the original was lists of Int and extremely slow; the new one is orders of magnitude faster if not quite as fast as GMP) |
| 22:55:46 | <geekosaur> | the intent is that the backend will be runtime selectable in a future ghc version, which is one reason optimization is tricky |
| 22:55:54 | <dolio> | GHC definitely knows which Haskell library it's building against, though. |
| 22:56:25 | × | califax quits (~califax@user/califx) (Remote host closed the connection) |
| 22:56:43 | → | califax joins (~califax@user/califx) |
| 23:04:20 | × | noteness quits (~noteness@user/noteness) (Remote host closed the connection) |
| 23:04:37 | × | merijn quits (~merijn@86-86-29-250.fixed.kpn.net) (Ping timeout: 245 seconds) |
| 23:05:09 | → | noteness joins (~noteness@user/noteness) |
| 23:08:38 | × | renzhi quits (~xp@2607:fa49:6500:b100::47a5) (Ping timeout: 240 seconds) |
| 23:09:15 | <geekosaur> | hm, actually the release notes don't mention the new backend. wonder if it got bumped to 9.4 and I missed it? thought the first phase was already active |
| 23:09:58 | → | haritz joins (~hrtz@2a02:8010:65b5:0:6009:6384:e3cb:2220) |
| 23:09:58 | × | haritz quits (~hrtz@2a02:8010:65b5:0:6009:6384:e3cb:2220) (Changing host) |
| 23:09:58 | → | haritz joins (~hrtz@user/haritz) |
| 23:12:34 | <geekosaur> | right, ghc-bignum has been released but current ghc releases don't use it yet, sorry. |
| 23:12:42 | <geekosaur> | @hackage ghc-bignum |
| 23:12:42 | <lambdabot> | https://hackage.haskell.org/package/ghc-bignum |
| 23:12:57 | × | haritz quits (~hrtz@user/haritz) (Remote host closed the connection) |
| 23:18:24 | × | Tuplanolla quits (~Tuplanoll@91-159-68-204.elisa-laajakaista.fi) (Quit: Leaving.) |
| 23:20:21 | → | matthewmosior joins (~matthewmo@173.170.253.91) |
| 23:23:15 | × | bontaq quits (~user@ool-45779fe5.dyn.optonline.net) (Ping timeout: 260 seconds) |
| 23:33:48 | → | yauhsien joins (~yauhsien@118-167-41-184.dynamic-ip.hinet.net) |
| 23:38:29 | × | yauhsien quits (~yauhsien@118-167-41-184.dynamic-ip.hinet.net) (Ping timeout: 252 seconds) |
| 23:44:37 | → | Guest3 joins (~textual@pool-100-11-18-203.phlapa.fios.verizon.net) |
| 23:46:22 | × | gurkenglas quits (~gurkengla@p548ac71b.dip0.t-ipconnect.de) (Ping timeout: 268 seconds) |
| 23:46:52 | → | haritzondo joins (~hrtz@82-69-11-11.dsl.in-addr.zen.co.uk) |
| 23:47:11 | × | Guest3 quits (~textual@pool-100-11-18-203.phlapa.fios.verizon.net) (Client Quit) |
| 23:50:37 | × | haritzondo quits (~hrtz@82-69-11-11.dsl.in-addr.zen.co.uk) (Client Quit) |
| 23:50:50 | → | bilegeek joins (~bilegeek@2600:1008:b008:7f81:14bd:cb07:613d:3322) |
| 23:50:56 | → | haritz joins (~hrtz@2a02:8010:65b5:0:6009:6384:e3cb:2220) |
| 23:50:56 | × | haritz quits (~hrtz@2a02:8010:65b5:0:6009:6384:e3cb:2220) (Changing host) |
| 23:50:56 | → | haritz joins (~hrtz@user/haritz) |
| 23:53:31 | × | cheater quits (~Username@user/cheater) (Ping timeout: 252 seconds) |
| 23:53:55 | → | cheater joins (~Username@user/cheater) |
| 23:56:41 | <Axman6> | pavonia: you might also want to look at using Natural as well, if everything is positive - avoids the branches on signs |
All times are in UTC on 2022-07-31.