2023/10/20

2023-10-20 00:00:59 +0200 <EvanR> Inst, read this https://wiki.haskell.org/Impredicative_types
2023-10-20 00:01:26 +0200Pickchea(~private@user/pickchea) (Quit: Leaving)
2023-10-20 00:01:54 +0200 <monochrom> Right, the argument cannot assert its own type.
2023-10-20 00:03:12 +0200 <monochrom> As in, if "f :: (forall a. a -> a) -> Whatever", I cannot use it like "f not" which would assert a=Bool.
2023-10-20 00:03:36 +0200 <EvanR> without imperedicative types, rank 2 polymorphism only comes up when forall is nested in the left side of ->
2023-10-20 00:04:08 +0200 <EvanR> with impredicative types, it's a free-for-all
2023-10-20 00:04:55 +0200 <EvanR> free forall?
2023-10-20 00:05:51 +0200 <monochrom> :)
2023-10-20 00:06:39 +0200__monty__(~toonn@user/toonn) (Quit: leaving)
2023-10-20 00:06:46 +0200 <geekosaur> forall free.
2023-10-20 00:06:53 +0200 <monochrom> It is not free! You have to accept Quick Look (shallow subsumption), which gives type errors for some old code.
2023-10-20 00:07:31 +0200 <Unicorn_Princess> still trying to use ghci(+shelly) as my shell - how can i keep modules loaded while i change working dir? :cd unloads them, and shelly $ cd ".." only has effect within the shelly monad
2023-10-20 00:08:00 +0200 <Unicorn_Princess> i.e. i can't shelly $ cd, enter, and then ls to see what's in the directory
2023-10-20 00:08:27 +0200 <Unicorn_Princess> or if i can, i don't know how
2023-10-20 00:10:18 +0200 <geekosaur> I did warn you ghci makes a poor shell environment…
2023-10-20 00:11:36 +0200winny(~weechat@user/winny) (trimming chats)
2023-10-20 00:12:22 +0200 <EvanR> does that happen because ghci treats the current directory as the root for modules
2023-10-20 00:12:48 +0200 <EvanR> (or a root)
2023-10-20 00:13:12 +0200 <Unicorn_Princess> geekosaur, what kind of tragedy would this be if the protagonist heeded warnings?
2023-10-20 00:13:29 +0200 <geekosaur> yes, see `-i`
2023-10-20 00:13:38 +0200 <geekosaur> default is current directory
2023-10-20 00:14:47 +0200mikoto-chan(~mikoto-ch@ip-212-239-236-59.dsl.scarlet.be) (Ping timeout: 246 seconds)
2023-10-20 00:16:04 +0200 <monochrom> Perhaps shelly replaces shell scripting, but not shell REPL prompt.
2023-10-20 00:16:46 +0200 <Unicorn_Princess> how do i see '-i'? not having much luck finding a list of ghci startup arguments, if that's what it is
2023-10-20 00:17:16 +0200Inst(~Inst@120.244.192.250) (Ping timeout: 248 seconds)
2023-10-20 00:18:19 +0200 <Unicorn_Princess> ah found it
2023-10-20 00:19:06 +0200 <geekosaur> https://downloads.haskell.org/ghc/9.8.1/docs/users_guide/separate_compilation.html#search-path
2023-10-20 00:21:24 +0200 <Unicorn_Princess> hrmmm. but even if i add the absolute path to my helper scripts with -i, they'll _still_ get unloaded when I :cd, no?
2023-10-20 00:22:08 +0200 <geekosaur> yes; :cd doesn't change its behavior based on -i
2023-10-20 00:23:16 +0200 <Unicorn_Princess> i am not remotely done banging my head against this wall
2023-10-20 00:26:12 +0200 <Unicorn_Princess> HA! take that, wall! System.setCurrentDirectory did the trick :)
2023-10-20 00:32:11 +0200vglfr(~vglfr@88.155.170.213) (Read error: Connection reset by peer)
2023-10-20 00:46:31 +0200oo_miguel(~Thunderbi@78-11-179-96.static.ip.netia.com.pl) (Ping timeout: 252 seconds)
2023-10-20 00:54:02 +0200Unicorn_Princess(~Unicorn_P@user/Unicorn-Princess/x-3540542) (Remote host closed the connection)
2023-10-20 01:24:16 +0200pretty_dumm_guy(trottel@gateway/vpn/protonvpn/prettydummguy/x-88029655)
2023-10-20 01:27:25 +0200azimut(~azimut@gateway/tor-sasl/azimut)
2023-10-20 01:30:51 +0200nate2(~nate@c-98-45-169-16.hsd1.ca.comcast.net)
2023-10-20 01:31:52 +0200iteratee_(~kyle@162.218.222.207)
2023-10-20 01:33:18 +0200iteratee(~kyle@162.218.222.207) (Read error: Connection reset by peer)
2023-10-20 01:35:07 +0200nate2(~nate@c-98-45-169-16.hsd1.ca.comcast.net) (Ping timeout: 255 seconds)
2023-10-20 01:49:11 +0200thegeekinside(~thegeekin@189.180.124.118)
2023-10-20 01:53:25 +0200Vajb(~Vajb@207.61.167.122)
2023-10-20 01:54:55 +0200Tuplanolla(~Tuplanoll@91-159-68-236.elisa-laajakaista.fi) (Ping timeout: 264 seconds)
2023-10-20 02:03:20 +0200bitdex(~bitdex@gateway/tor-sasl/bitdex)
2023-10-20 02:06:13 +0200emmanuelux(~emmanuelu@user/emmanuelux)
2023-10-20 02:12:04 +0200emmanuelux(~emmanuelu@user/emmanuelux) (Quit: au revoir)
2023-10-20 02:18:04 +0200notzmv(~zmv@user/notzmv)
2023-10-20 02:23:02 +0200pointlessslippe1(~pointless@212.82.82.3) (Ping timeout: 255 seconds)
2023-10-20 02:28:13 +0200ystael(~ystael@user/ystael) (Ping timeout: 255 seconds)
2023-10-20 02:32:01 +0200ddellacosta(~ddellacos@ool-44c738de.dyn.optonline.net) (Ping timeout: 260 seconds)
2023-10-20 02:32:45 +0200ddellacosta(~ddellacos@ool-44c738de.dyn.optonline.net)
2023-10-20 02:39:59 +0200myxos(~myxos@cpe-65-28-251-121.cinci.res.rr.com) (Remote host closed the connection)
2023-10-20 02:42:52 +0200pointlessslippe1(~pointless@212.82.82.3)
2023-10-20 02:43:04 +0200L29Ah(~L29Ah@wikipedia/L29Ah)
2023-10-20 02:47:12 +0200machinedgod(~machinedg@d198-53-218-113.abhsia.telus.net)
2023-10-20 02:49:44 +0200myxos(~myxos@cpe-65-28-251-121.cinci.res.rr.com)
2023-10-20 02:52:44 +0200Pozyomka(~pyon@user/pyon) (Quit: Pozyomka, my beloved: https://i.imgur.com/BMmVfTq.png)
2023-10-20 02:58:23 +0200Lord_of_Life_(~Lord@user/lord-of-life/x-2819915)
2023-10-20 02:59:02 +0200Lord_of_Life(~Lord@user/lord-of-life/x-2819915) (Ping timeout: 255 seconds)
2023-10-20 02:59:46 +0200Lord_of_Life_Lord_of_Life
2023-10-20 03:00:38 +0200Vajb(~Vajb@207.61.167.122) (Read error: Connection reset by peer)
2023-10-20 03:01:28 +0200Vajb(~Vajb@207.61.167.122)
2023-10-20 03:05:51 +0200Vajb(~Vajb@207.61.167.122) (Ping timeout: 260 seconds)
2023-10-20 03:12:12 +0200otto_s(~user@p5de2fa05.dip0.t-ipconnect.de) (Ping timeout: 240 seconds)
2023-10-20 03:13:58 +0200otto_s(~user@p5b0443cb.dip0.t-ipconnect.de)
2023-10-20 03:31:05 +0200infinity0(~infinity0@pwned.gg) (Ping timeout: 240 seconds)
2023-10-20 03:38:27 +0200Alleria(~JohnGalt@user/alleria)
2023-10-20 03:57:24 +0200bilegeek(~bilegeek@2600:1008:b092:8609:420e:1a54:5cd5:c60f)
2023-10-20 04:00:07 +0200myxos(~myxos@cpe-65-28-251-121.cinci.res.rr.com) (Remote host closed the connection)
2023-10-20 04:02:27 +0200Ranhir(~Ranhir@157.97.53.139) (Quit: KVIrc 5.0.0 Aria http://www.kvirc.net/)
2023-10-20 04:04:40 +0200td_(~td@i53870930.versanet.de) (Ping timeout: 258 seconds)
2023-10-20 04:06:30 +0200td_(~td@i5387093B.versanet.de)
2023-10-20 04:13:45 +0200Ranhir(~Ranhir@157.97.53.139)
2023-10-20 04:14:44 +0200xff0x(~xff0x@ai101218.d.east.v6connect.net) (Ping timeout: 255 seconds)
2023-10-20 04:15:22 +0200waleee(~waleee@2001:9b0:21c:e600:f2f3:f744:435d:137c) (Ping timeout: 272 seconds)
2023-10-20 04:22:13 +0200thegeekinside(~thegeekin@189.180.124.118) (Ping timeout: 255 seconds)
2023-10-20 04:27:55 +0200finn_elija(~finn_elij@user/finn-elija/x-0085643)
2023-10-20 04:27:55 +0200FinnElija(~finn_elij@user/finn-elija/x-0085643) (Killed (NickServ (Forcing logout FinnElija -> finn_elija)))
2023-10-20 04:27:55 +0200finn_elijaFinnElija
2023-10-20 04:30:16 +0200eggplantade(~Eggplanta@2600:1700:38c5:d800:a042:5d7c:7cf4:626d) (Remote host closed the connection)
2023-10-20 04:30:32 +0200eggplantade(~Eggplanta@2600:1700:38c5:d800:e1a3:648c:fb34:72ec)
2023-10-20 04:30:36 +0200machinedgod(~machinedg@d198-53-218-113.abhsia.telus.net) (Ping timeout: 248 seconds)
2023-10-20 04:31:22 +0200Alleria(~JohnGalt@user/alleria) (Quit: Textual IRC Client: www.textualapp.com)
2023-10-20 04:48:18 +0200ddellacosta(~ddellacos@ool-44c738de.dyn.optonline.net) (Ping timeout: 255 seconds)
2023-10-20 04:49:59 +0200ddellacosta(~ddellacos@ool-44c738de.dyn.optonline.net)
2023-10-20 04:50:32 +0200[itchyjunk](~itchyjunk@user/itchyjunk/x-7353470) (Remote host closed the connection)
2023-10-20 04:52:09 +0200sabino(~sabino@user/sabino) (Quit: Lambda _ -> x)
2023-10-20 04:52:36 +0200pretty_dumm_guy(trottel@gateway/vpn/protonvpn/prettydummguy/x-88029655) (Quit: WeeChat 3.5)
2023-10-20 04:59:31 +0200sm(~sm@plaintextaccounting/sm)
2023-10-20 05:00:03 +0200sm(~sm@plaintextaccounting/sm) (Client Quit)
2023-10-20 05:02:43 +0200xff0x(~xff0x@125x103x176x34.ap125.ftth.ucom.ne.jp)
2023-10-20 05:02:47 +0200td_(~td@i5387093B.versanet.de) (Ping timeout: 255 seconds)
2023-10-20 05:04:34 +0200td_(~td@i5387090C.versanet.de)
2023-10-20 05:11:29 +0200arahael(~arahael@119-18-2-212.771202.syd.nbn.aussiebb.net)
2023-10-20 05:14:22 +0200JuanDaugherty(~juan@98.4.112.204)
2023-10-20 05:17:53 +0200aforemny(~aforemny@2001:9e8:6cc3:2a00:a85b:4589:39bf:9c93) (Ping timeout: 258 seconds)
2023-10-20 05:18:32 +0200aforemny(~aforemny@2001:9e8:6cea:d00:75b1:1f0b:5b86:9d9f)
2023-10-20 05:29:24 +0200thegeekinside(~thegeekin@189.180.124.118)
2023-10-20 05:31:55 +0200nate2(~nate@c-98-45-169-16.hsd1.ca.comcast.net)
2023-10-20 05:36:35 +0200nate2(~nate@c-98-45-169-16.hsd1.ca.comcast.net) (Ping timeout: 240 seconds)
2023-10-20 05:44:37 +0200JuanDaugherty(~juan@98.4.112.204) (Quit: DCP disconnect)
2023-10-20 05:47:26 +0200Vajb(~Vajb@207.61.167.122)
2023-10-20 05:51:45 +0200zmt01(~zmt00@user/zmt00)
2023-10-20 05:53:32 +0200ft(~ft@p3e9bc680.dip0.t-ipconnect.de) (Ping timeout: 272 seconds)
2023-10-20 05:54:48 +0200zmt00(~zmt00@user/zmt00) (Ping timeout: 272 seconds)
2023-10-20 05:54:56 +0200ft(~ft@p4fc2a529.dip0.t-ipconnect.de)
2023-10-20 05:55:05 +0200infinity0(~infinity0@pwned.gg)
2023-10-20 05:55:18 +0200JuanDaugherty(~juan@user/JuanDaugherty)
2023-10-20 05:56:43 +0200JuanDaugherty(~juan@user/JuanDaugherty) (Client Quit)
2023-10-20 06:08:26 +0200JuanDaugherty(~juan@user/JuanDaugherty)
2023-10-20 06:08:53 +0200_ht(~Thunderbi@28-52-174-82.ftth.glasoperator.nl)
2023-10-20 06:09:16 +0200hugo(znc@verdigris.lysator.liu.se) (Ping timeout: 248 seconds)
2023-10-20 06:13:23 +0200jargon(~jargon@174-22-221-150.phnx.qwest.net)
2023-10-20 06:14:53 +0200thegeekinside(~thegeekin@189.180.124.118) (Ping timeout: 255 seconds)
2023-10-20 06:15:36 +0200bliminse(~bliminse@user/bliminse) (Quit: leaving)
2023-10-20 06:19:18 +0200JuanDaugherty(~juan@user/JuanDaugherty) (Quit: JuanDaugherty)
2023-10-20 06:19:18 +0200euleritian(~euleritia@ip4d16fc38.dynamic.kabel-deutschland.de) (Read error: Connection reset by peer)
2023-10-20 06:19:52 +0200euleritian(~euleritia@ip4d16fc38.dynamic.kabel-deutschland.de)
2023-10-20 06:23:34 +0200phma(phma@2001:5b0:210b:f338:ff94:b91f:1e4:46fd) (Read error: Connection reset by peer)
2023-10-20 06:24:17 +0200phma(~phma@host-67-44-208-191.hnremote.net)
2023-10-20 06:24:23 +0200hugo(znc@verdigris.lysator.liu.se)
2023-10-20 06:26:33 +0200euleritian(~euleritia@ip4d16fc38.dynamic.kabel-deutschland.de) (Read error: Connection reset by peer)
2023-10-20 06:26:45 +0200euleritian(~euleritia@ip4d16fc38.dynamic.kabel-deutschland.de)
2023-10-20 06:29:14 +0200ChaiTRex(~ChaiTRex@user/chaitrex) (Ping timeout: 256 seconds)
2023-10-20 06:31:50 +0200ChaiTRex(~ChaiTRex@user/chaitrex)
2023-10-20 06:33:53 +0200P1RATEZ(piratez@user/p1ratez)
2023-10-20 06:37:14 +0200P1RATEZ(piratez@user/p1ratez) (Remote host closed the connection)
2023-10-20 06:40:32 +0200bilegeek(~bilegeek@2600:1008:b092:8609:420e:1a54:5cd5:c60f) (Quit: Leaving)
2023-10-20 06:42:56 +0200vglfr(~vglfr@88.155.170.213)
2023-10-20 06:46:26 +0200Vajb(~Vajb@207.61.167.122) (Ping timeout: 258 seconds)
2023-10-20 06:48:44 +0200Fischmiep(~Fischmiep@user/Fischmiep) (Ping timeout: 248 seconds)
2023-10-20 06:49:17 +0200L29Ah(~L29Ah@wikipedia/L29Ah) (Ping timeout: 248 seconds)
2023-10-20 07:00:45 +0200vglfr(~vglfr@88.155.170.213) (Read error: Connection reset by peer)
2023-10-20 07:01:06 +0200vglfr(vglfr@gateway/vpn/protonvpn/vglfr)
2023-10-20 07:01:46 +0200td_(~td@i5387090C.versanet.de) (Ping timeout: 258 seconds)
2023-10-20 07:02:37 +0200td_(~td@i5387091B.versanet.de)
2023-10-20 07:03:40 +0200Fischmiep(~Fischmiep@user/Fischmiep)
2023-10-20 07:07:34 +0200vglfr(vglfr@gateway/vpn/protonvpn/vglfr) (Remote host closed the connection)
2023-10-20 07:08:10 +0200vglfr(vglfr@gateway/vpn/protonvpn/vglfr)
2023-10-20 07:13:26 +0200harveypwca(~harveypwc@2601:246:c280:6a90:837d:db39:3eea:f7db)
2023-10-20 07:13:53 +0200vglfr(vglfr@gateway/vpn/protonvpn/vglfr) (Remote host closed the connection)
2023-10-20 07:14:28 +0200vglfr(vglfr@gateway/vpn/protonvpn/vglfr)
2023-10-20 07:17:42 +0200takuan(~takuan@178-116-218-225.access.telenet.be)
2023-10-20 07:21:58 +0200bliminse(~bliminse@user/bliminse)
2023-10-20 07:28:16 +0200vglfr(vglfr@gateway/vpn/protonvpn/vglfr) (Remote host closed the connection)
2023-10-20 07:29:01 +0200vglfr(vglfr@gateway/vpn/protonvpn/vglfr)
2023-10-20 07:35:08 +0200euleritian(~euleritia@ip4d16fc38.dynamic.kabel-deutschland.de) (Ping timeout: 248 seconds)
2023-10-20 07:35:25 +0200euleritian(~euleritia@dynamic-046-114-203-116.46.114.pool.telefonica.de)
2023-10-20 07:45:26 +0200rosco(~rosco@yp-150-69.tm.net.my)
2023-10-20 07:49:56 +0200vglfr(vglfr@gateway/vpn/protonvpn/vglfr) (Ping timeout: 260 seconds)
2023-10-20 07:50:19 +0200vglfr(~vglfr@88.155.170.213)
2023-10-20 08:01:35 +0200thegeekinside(~thegeekin@189.180.124.118)
2023-10-20 08:04:41 +0200dcoutts(~duncan@net77-43-75-226.mclink.it) (Remote host closed the connection)
2023-10-20 08:06:16 +0200dcoutts(~duncan@net77-43-75-226.mclink.it)
2023-10-20 08:06:34 +0200monochrom(trebla@216.138.220.146) (Quit: ZNC 1.8.2+deb3build2 - https://znc.in)
2023-10-20 08:09:32 +0200stiell_(~stiell@gateway/tor-sasl/stiell) (Remote host closed the connection)
2023-10-20 08:09:59 +0200stiell_(~stiell@gateway/tor-sasl/stiell)
2023-10-20 08:12:07 +0200rosco(~rosco@yp-150-69.tm.net.my) (Read error: Connection reset by peer)
2023-10-20 08:12:59 +0200dcoutts(~duncan@net77-43-75-226.mclink.it) (Ping timeout: 245 seconds)
2023-10-20 08:20:44 +0200Unicorn_Princess(~Unicorn_P@user/Unicorn-Princess/x-3540542)
2023-10-20 08:23:22 +0200monochrom(trebla@216.138.220.146)
2023-10-20 08:23:55 +0200dcoutts(~duncan@net77-43-75-226.mclink.it)
2023-10-20 08:24:21 +0200coot(~coot@89-69-206-216.dynamic.chello.pl)
2023-10-20 08:24:46 +0200Inst(~Inst@120.244.192.250)
2023-10-20 08:26:31 +0200bitdex(~bitdex@gateway/tor-sasl/bitdex) (Read error: Connection reset by peer)
2023-10-20 08:26:31 +0200FinnElija(~finn_elij@user/finn-elija/x-0085643) (Read error: Connection reset by peer)
2023-10-20 08:26:31 +0200ec(~ec@gateway/tor-sasl/ec) (Read error: Connection reset by peer)
2023-10-20 08:26:31 +0200chiselfuse(~chiselfus@user/chiselfuse) (Read error: Connection reset by peer)
2023-10-20 08:26:57 +0200ec(~ec@gateway/tor-sasl/ec)
2023-10-20 08:26:58 +0200FinnElija(~finn_elij@user/finn-elija/x-0085643)
2023-10-20 08:27:08 +0200chiselfuse(~chiselfus@user/chiselfuse)
2023-10-20 08:27:31 +0200bitdex(~bitdex@gateway/tor-sasl/bitdex)
2023-10-20 08:28:23 +0200euleritian(~euleritia@dynamic-046-114-203-116.46.114.pool.telefonica.de) (Read error: Connection reset by peer)
2023-10-20 08:28:33 +0200sm(~sm@plaintextaccounting/sm)
2023-10-20 08:28:40 +0200dcoutts(~duncan@net77-43-75-226.mclink.it) (Ping timeout: 255 seconds)
2023-10-20 08:28:45 +0200euleritian(~euleritia@77.22.252.56)
2023-10-20 08:35:27 +0200euleritian(~euleritia@77.22.252.56) (Ping timeout: 240 seconds)
2023-10-20 08:35:47 +0200euleritian(~euleritia@dynamic-046-114-203-116.46.114.pool.telefonica.de)
2023-10-20 08:43:36 +0200euleritian(~euleritia@dynamic-046-114-203-116.46.114.pool.telefonica.de) (Read error: Connection reset by peer)
2023-10-20 08:43:53 +0200euleritian(~euleritia@77.22.252.56)
2023-10-20 08:47:32 +0200echoreply(~echoreply@2001:19f0:9002:1f3b:5400:ff:fe6f:8b8d) (Quit: WeeChat 2.8)
2023-10-20 08:48:51 +0200echoreply(~echoreply@45.32.163.16)
2023-10-20 08:50:53 +0200thegeekinside(~thegeekin@189.180.124.118) (Ping timeout: 248 seconds)
2023-10-20 08:51:16 +0200oo_miguel(~Thunderbi@78-11-179-96.static.ip.netia.com.pl)
2023-10-20 08:52:42 +0200pretty_dumm_guy(trottel@gateway/vpn/protonvpn/prettydummguy/x-88029655)
2023-10-20 08:52:56 +0200euleritian(~euleritia@77.22.252.56) (Ping timeout: 260 seconds)
2023-10-20 08:53:08 +0200euleritian(~euleritia@dynamic-046-114-203-116.46.114.pool.telefonica.de)
2023-10-20 08:53:33 +0200vpan(~vpan@212.117.1.172)
2023-10-20 09:01:22 +0200arahael(~arahael@119-18-2-212.771202.syd.nbn.aussiebb.net) (Ping timeout: 258 seconds)
2023-10-20 09:10:23 +0200todi(~todi@p4fd1a3e6.dip0.t-ipconnect.de) (Quit: ZNC - https://znc.in)
2023-10-20 09:17:09 +0200mastarija(~mastarija@141-136-135-70.dsl.iskon.hr)
2023-10-20 09:18:28 +0200 <mastarija> So, I know I can use the TypeOperators to define e.g. `type (∧) a b = (a, b)`. But is there a way to do the negation, e.g. `type (¬) a = a -> Void`?
2023-10-20 09:19:11 +0200 <mastarija> This would be unary operator, so GHC complains I'm missing an argument to the ¬ when I try to use it.
2023-10-20 09:27:10 +0200idgaen(~idgaen@2a01:e0a:498:fd50:fcc6:bb5d:489a:ce8c)
2023-10-20 09:27:34 +0200euleritian(~euleritia@dynamic-046-114-203-116.46.114.pool.telefonica.de) (Read error: Connection reset by peer)
2023-10-20 09:27:51 +0200euleritian(~euleritia@77.22.252.56)
2023-10-20 09:30:10 +0200danza_(~francesco@151.35.112.73)
2023-10-20 09:33:27 +0200nate2(~nate@c-98-45-169-16.hsd1.ca.comcast.net)
2023-10-20 09:34:52 +0200tcard(~tcard@2400:4051:5801:7500:cf17:befc:ff82:5303) (Quit: Leaving)
2023-10-20 09:36:40 +0200tcard(~tcard@2400:4051:5801:7500:cf17:befc:ff82:5303)
2023-10-20 09:38:43 +0200nate2(~nate@c-98-45-169-16.hsd1.ca.comcast.net) (Ping timeout: 264 seconds)
2023-10-20 09:39:12 +0200 <[exa]> mastarija: unary minus is sufficiently scary
2023-10-20 09:39:55 +0200 <mastarija> Yes :)
2023-10-20 09:40:23 +0200 <mastarija> But still. You know that hearts whants what heart wants, right? ;)
2023-10-20 09:40:25 +0200 <[exa]> how is unary minus even declared as an operator? isn't it a completely special case?
2023-10-20 09:40:34 +0200 <mastarija> Yes, I think it is.
2023-10-20 09:40:40 +0200 <mastarija> It's just syntax sugar for negate
2023-10-20 09:40:56 +0200 <[exa]> i've got a bad feeling you'd need to add to the syntax sugar then
2023-10-20 09:41:10 +0200 <[exa]> but yeah it's ;_;
2023-10-20 09:41:24 +0200Nixkernal_(~Nixkernal@115.16.194.178.dynamic.wline.res.cust.swisscom.ch) (Read error: Connection reset by peer)
2023-10-20 09:41:27 +0200 <mastarija> Is there a way to do this perhaps? Asking for a friend :)
2023-10-20 09:41:34 +0200 <mastarija> Something like rebindable syntax?
2023-10-20 09:43:04 +0200Nixkernal(~Nixkernal@115.16.194.178.dynamic.wline.res.cust.swisscom.ch)
2023-10-20 09:47:09 +0200Inst(~Inst@120.244.192.250) (Ping timeout: 245 seconds)
2023-10-20 09:48:16 +0200gmg(~user@user/gehmehgeh)
2023-10-20 09:53:01 +0200Nixkernal(~Nixkernal@115.16.194.178.dynamic.wline.res.cust.swisscom.ch) (Ping timeout: 260 seconds)
2023-10-20 09:53:43 +0200danza_(~francesco@151.35.112.73) (Ping timeout: 264 seconds)
2023-10-20 09:54:56 +0200mastarija(~mastarija@141-136-135-70.dsl.iskon.hr) (Quit: Ping timeout (120 seconds))
2023-10-20 09:55:53 +0200wagle(~wagle@quassel.wagle.io) (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.)
2023-10-20 09:56:37 +0200machinedgod(~machinedg@d198-53-218-113.abhsia.telus.net)
2023-10-20 09:56:45 +0200Square(~Square@user/square)
2023-10-20 09:56:46 +0200wagle(~wagle@quassel.wagle.io)
2023-10-20 09:59:06 +0200vglfr(~vglfr@88.155.170.213) (Remote host closed the connection)
2023-10-20 09:59:16 +0200 <jackdk> `type Not a = a -> Void`
2023-10-20 09:59:45 +0200chele(~chele@user/chele)
2023-10-20 09:59:51 +0200vglfr(~vglfr@88.155.170.213)
2023-10-20 09:59:57 +0200Nixkernal(~Nixkernal@115.16.194.178.dynamic.wline.res.cust.swisscom.ch)
2023-10-20 10:02:49 +0200 <mauke> % type (¬) a = a -> Void
2023-10-20 10:02:50 +0200 <yahb2> <interactive>:19:19: error: ; Not in scope: type constructor or class ‘Void’
2023-10-20 10:03:21 +0200 <mauke> % data Void; type (¬) a = a -> Void
2023-10-20 10:03:21 +0200 <yahb2> <no output>
2023-10-20 10:03:49 +0200 <mauke> % id :: (¬) Int
2023-10-20 10:03:49 +0200 <yahb2> <interactive>:23:1: error: ; • Couldn't match type ‘Int’ with ‘Void’ ; Expected: (¬) Int ; Actual: Int -> Int ; • In the expression: id :: (¬) Int ; In an equation for ‘...
2023-10-20 10:04:08 +0200 <mauke> % id :: (¬) Void
2023-10-20 10:04:08 +0200 <yahb2> <interactive>:25:1: error: ; • No instance for (Show ((¬) Void)) ; arising from a use of ‘Yahb2Defs.limitedPrint’ ; (maybe you haven't applied a function to enough arguments?) ;...
2023-10-20 10:04:17 +0200 <mauke> % id :: (Void ¬)
2023-10-20 10:04:17 +0200 <yahb2> <interactive>:27:14: error: parse error on input ‘)’
2023-10-20 10:04:21 +0200 <mauke> ah
2023-10-20 10:05:22 +0200CiaoSen(~Jura@2a05:5800:282:6600:664b:f0ff:fe37:9ef)
2023-10-20 10:05:52 +0200Inst(~Inst@120.244.192.250)
2023-10-20 10:06:06 +0200dhruvasagar(~dhruvasag@49.207.194.211)
2023-10-20 10:10:45 +0200cfricke(~cfricke@user/cfricke)
2023-10-20 10:15:30 +0200mc47(~mc47@xmonad/TheMC47)
2023-10-20 10:17:01 +0200idgaen(~idgaen@2a01:e0a:498:fd50:fcc6:bb5d:489a:ce8c) (Quit: WeeChat 4.0.5)
2023-10-20 10:18:47 +0200 <albet70> is there a article about priority of operator?
2023-10-20 10:19:40 +0200 <albet70> reverse <$> recv sock 1024 which is eval first?
2023-10-20 10:21:29 +0200tzh(~tzh@c-71-193-181-0.hsd1.or.comcast.net) (Quit: zzz)
2023-10-20 10:22:39 +0200eggplantade(~Eggplanta@2600:1700:38c5:d800:e1a3:648c:fb34:72ec) (Remote host closed the connection)
2023-10-20 10:22:50 +0200__monty__(~toonn@user/toonn)
2023-10-20 10:25:00 +0200fendor(~fendor@2a02:8388:1640:be00:aab:1226:f274:5021)
2023-10-20 10:25:21 +0200Jackneill(~Jackneill@20014C4E1E0E6F00109B8E55CC0410BC.dsl.pool.telekom.hu)
2023-10-20 10:25:23 +0200 <dminuoso> albet70: The evaluation order is unspecified in Haskell.
2023-10-20 10:26:02 +0200 <dminuoso> I dont quite understand your question, however.
2023-10-20 10:28:02 +0200 <albet70> reverse <$> recv sock 1024 is reverse <$> (recv sock 2014) or (reverse <$> recv) sock 1024?
2023-10-20 10:28:16 +0200 <ncf> function application has the highest precedence
2023-10-20 10:28:23 +0200 <ncf> so the former
2023-10-20 10:29:34 +0200 <dminuoso> albet70: Evaluation order is different from operator precedence.
2023-10-20 10:29:40 +0200 <dminuoso> Do not conflate these two.
2023-10-20 10:30:34 +0200 <albet70> sendAll sock =<< reverse <$> recv sock 1024 is?
2023-10-20 10:30:47 +0200 <dminuoso> albet70: So take a look at their hackage documentation
2023-10-20 10:30:50 +0200 <dminuoso> Or use ghci with :i
2023-10-20 10:30:54 +0200 <dminuoso> % :i (=<<)
2023-10-20 10:30:54 +0200 <yahb2> (=<<) :: Monad m => (a -> m b) -> m a -> m b ; -- Defined in ‘GHC.Base’ ; infixr 1 =<<
2023-10-20 10:30:58 +0200 <dminuoso> % :i (<$>)
2023-10-20 10:30:59 +0200 <yahb2> (<$>) :: Functor f => (a -> b) -> f a -> f b ; -- Defined in ‘Data.Functor’ ; infixl 4 <$>
2023-10-20 10:31:07 +0200 <dminuoso> =<< is right associative, with a precedence of 1
2023-10-20 10:31:14 +0200 <dminuoso> <$> is left associative, with a predence of 4
2023-10-20 10:31:42 +0200 <dminuoso> =<< binds more tightly
2023-10-20 10:32:49 +0200 <mauke> record update is higher than function application
2023-10-20 10:32:51 +0200 <dminuoso> Sorry my brain is exploding, I mislooked. <$> is of coure tighter because 4 is larger.
2023-10-20 10:33:26 +0200 <dminuoso> albet70: operator predecence goes from 0 to 9, and function application (the space between a function and its argument) has a predence of 10 (so it binds more tightly than anything else)
2023-10-20 10:33:43 +0200 <albet70> I can't find operator precedence on hackage, link please?
2023-10-20 10:33:46 +0200 <dminuoso> And function application is left associative, which is why `foo x y z` associates as `((foo x) y) z`
2023-10-20 10:34:04 +0200 <dminuoso> albet70: https://hoogle.haskell.org/?hoogle=(%3C$%3E)
2023-10-20 10:34:16 +0200 <dminuoso> https://hackage.haskell.org/package/base-4.19.0.0/docs/Prelude.html#v:-60--36--62-
2023-10-20 10:34:21 +0200 <dminuoso> See `infixl 4`
2023-10-20 10:36:48 +0200 <albet70> I should just use ()
2023-10-20 10:37:14 +0200 <albet70> () is more easy to use
2023-10-20 10:37:19 +0200 <dminuoso> If you're unsure, yes, use explicit parenthesis.
2023-10-20 10:39:01 +0200 <mauke> (recv sock >=> reverse >>> sendAll sock) 1042
2023-10-20 10:39:48 +0200 <dminuoso> do { buf <- recv dsock; sendAll sock (reverse buf) }
2023-10-20 10:39:50 +0200 <dminuoso> Im a sucker for simple.
2023-10-20 10:40:20 +0200 <dminuoso> Its not meaningfully longer, but much easier to read.
2023-10-20 10:40:33 +0200 <dminuoso> Especially in imperative code
2023-10-20 10:41:28 +0200 <mauke> do (reverse -> fub) <- recv sock 4210; sendAll sock fub
2023-10-20 10:42:28 +0200danse-nr3_(~francesco@151.37.109.164)
2023-10-20 10:42:28 +0200 <dminuoso> Personally dont like it, because it requires changing reading directions multiple times when trying to follow the data flow *shrugs*
2023-10-20 10:42:31 +0200 <dminuoso> But thats just me
2023-10-20 10:43:21 +0200 <albet70> mauke , >>> is new to me, where it's from?
2023-10-20 10:43:32 +0200 <jackdk> @hoogle (>>>)
2023-10-20 10:43:32 +0200 <lambdabot> Control.Arrow (>>>) :: Category cat => cat a b -> cat b c -> cat a c
2023-10-20 10:43:32 +0200 <lambdabot> Control.Category (>>>) :: Category cat => cat a b -> cat b c -> cat a c
2023-10-20 10:43:32 +0200 <lambdabot> GHC.Desugar (>>>) :: forall arr . Arrow arr => forall a b c . arr a b -> arr b c -> arr a c
2023-10-20 10:43:46 +0200 <jackdk> Control.Category is the canonical location IIRC
2023-10-20 10:45:40 +0200 <dminuoso> Its just a generalization of a flipped (.)
2023-10-20 10:46:13 +0200 <dminuoso> Maybe `do fub <- reverse <- recv sock 4210; ...` should be a thing.
2023-10-20 10:46:40 +0200 <dminuoso> Seems a bit nicer than `(reverse -> fub) <- rev sock 4210 ...`
2023-10-20 10:48:49 +0200 <albet70> flipped (.) is cool
2023-10-20 10:49:23 +0200hsw(~hsw@125-229-105-158.hinet-ip.hinet.net)
2023-10-20 10:51:01 +0200ft(~ft@p4fc2a529.dip0.t-ipconnect.de) (Quit: leaving)
2023-10-20 10:52:03 +0200hsw(~hsw@125-229-105-158.hinet-ip.hinet.net) (Client Quit)
2023-10-20 10:52:32 +0200econo_(uid147250@id-147250.tinside.irccloud.com) (Quit: Connection closed for inactivity)
2023-10-20 10:52:33 +0200zer0bitz(~zer0bitz@user/zer0bitz) ()
2023-10-20 10:53:10 +0200 <albet70> dminuoso , why you can use two <- in one line?
2023-10-20 10:53:34 +0200 <dminuoso> You cant, I was just thinking it reads nice.
2023-10-20 10:53:55 +0200eggplantade(~Eggplanta@2600:1700:38c5:d800:e1a3:648c:fb34:72ec)
2023-10-20 10:55:17 +0200 <albet70> mauke , not easy to get the operator precedence in this >=>
2023-10-20 10:57:47 +0200zer0bitz(~zer0bitz@user/zer0bitz)
2023-10-20 10:58:20 +0200eggplantade(~Eggplanta@2600:1700:38c5:d800:e1a3:648c:fb34:72ec) (Ping timeout: 248 seconds)
2023-10-20 10:59:42 +0200arahael(~arahael@119-18-2-212.771202.syd.nbn.aussiebb.net)
2023-10-20 11:09:38 +0200 <albet70> \x -> f x >> g x could this use point free? f >> g?
2023-10-20 11:10:15 +0200 <probie> @pl \x -> f x >> g x
2023-10-20 11:10:15 +0200 <lambdabot> liftM2 (>>) f g
2023-10-20 11:17:22 +0200 <albet70> is liftM2 equal liftA2?
2023-10-20 11:18:07 +0200 <danse-nr3_> :t (>>)
2023-10-20 11:18:08 +0200 <lambdabot> Monad m => m a -> m b -> m b
2023-10-20 11:18:46 +0200hugo(znc@verdigris.lysator.liu.se) (Ping timeout: 255 seconds)
2023-10-20 11:19:34 +0200 <dminuoso> albet70: liftM2 is constrained to Monad, liftAt to Applicative.
2023-10-20 11:19:37 +0200 <dminuoso> Beyond that, yes.
2023-10-20 11:20:13 +0200 <dminuoso> liftM2 merely exists because it was thought, there might be some Monad-only types that could provide a slightly more optimized version.
2023-10-20 11:20:36 +0200 <dminuoso> It never really happened, the idea was floated to remove liftM2 - but the idea was forgotten.
2023-10-20 11:20:52 +0200 <dminuoso> I just use liftA2.
2023-10-20 11:21:39 +0200 <albet70> yes, I use liftA2 too
2023-10-20 11:21:47 +0200stiell_(~stiell@gateway/tor-sasl/stiell) (Remote host closed the connection)
2023-10-20 11:22:11 +0200stiell_(~stiell@gateway/tor-sasl/stiell)
2023-10-20 11:23:17 +0200Square(~Square@user/square) (Ping timeout: 246 seconds)
2023-10-20 11:24:56 +0200ubert(~Thunderbi@77.119.205.197.wireless.dyn.drei.com) (Ping timeout: 255 seconds)
2023-10-20 11:25:01 +0200ubert1(~Thunderbi@77.119.196.197.wireless.dyn.drei.com)
2023-10-20 11:25:20 +0200 <probie> dminuoso: that sounds plausible, but it's not true. `liftM2` simply predates `Applicative`
2023-10-20 11:25:55 +0200 <dminuoso> probie: It was discussed on various mailing lists with Simon Marlow a long time ago.
2023-10-20 11:26:07 +0200 <dminuoso> Oh hold on.
2023-10-20 11:26:25 +0200 <dminuoso> I might be confusing liftA2 with forM/traverse
2023-10-20 11:26:30 +0200harveypwca(~harveypwc@2601:246:c280:6a90:837d:db39:3eea:f7db) (Quit: Leaving)
2023-10-20 11:27:18 +0200ubert1ubert
2023-10-20 11:28:07 +0200 <probie> you might still be right - it may not be defined as `liftM2 = liftA2` for the reason you've given, but the reason it exists in the first place is historical
2023-10-20 11:29:09 +0200 <dminuoso> Fair.
2023-10-20 11:36:09 +0200sm(~sm@plaintextaccounting/sm) (Quit: sm)
2023-10-20 11:36:23 +0200Inst(~Inst@120.244.192.250) (Ping timeout: 260 seconds)
2023-10-20 11:38:01 +0200rosco(~rosco@yp-150-69.tm.net.my)
2023-10-20 11:39:45 +0200Inst(~Inst@120.244.192.250)
2023-10-20 11:40:55 +0200hugo(znc@verdigris.lysator.liu.se)
2023-10-20 11:46:09 +0200eggplantade(~Eggplanta@2600:1700:38c5:d800:e1a3:648c:fb34:72ec)
2023-10-20 11:52:05 +0200hugo(znc@verdigris.lysator.liu.se) (Ping timeout: 240 seconds)
2023-10-20 11:55:09 +0200Sgeo(~Sgeo@user/sgeo) (Read error: Connection reset by peer)
2023-10-20 11:59:06 +0200hugo(znc@verdigris.lysator.liu.se)
2023-10-20 12:01:22 +0200zer0bitz(~zer0bitz@user/zer0bitz) ()
2023-10-20 12:05:43 +0200hugo(znc@verdigris.lysator.liu.se) (Ping timeout: 264 seconds)
2023-10-20 12:07:11 +0200xff0x(~xff0x@125x103x176x34.ap125.ftth.ucom.ne.jp) (Ping timeout: 260 seconds)
2023-10-20 12:12:37 +0200driib5(~driib@vmi931078.contaboserver.net) (Quit: The Lounge - https://thelounge.chat)
2023-10-20 12:13:15 +0200driib5(~driib@vmi931078.contaboserver.net)
2023-10-20 12:16:29 +0200hugo(znc@verdigris.lysator.liu.se)
2023-10-20 12:30:51 +0200kuribas(~user@ip-188-118-57-242.reverse.destiny.be)
2023-10-20 12:32:27 +0200mc47(~mc47@xmonad/TheMC47) (Remote host closed the connection)
2023-10-20 12:38:19 +0200lisbeths(uid135845@id-135845.lymington.irccloud.com)
2023-10-20 12:41:15 +0200elkcl(~elkcl@broadband-95-84-226-240.ip.moscow.rt.ru) (Ping timeout: 255 seconds)
2023-10-20 12:42:00 +0200sm(~sm@plaintextaccounting/sm)
2023-10-20 12:49:18 +0200danse-nr3_(~francesco@151.37.109.164) (Ping timeout: 260 seconds)
2023-10-20 12:49:22 +0200NinjaTrappeurpicnoir
2023-10-20 12:49:50 +0200Guest|99(~Guest|99@152.57.210.157)
2023-10-20 12:50:08 +0200Guest|99(~Guest|99@152.57.210.157) (Client Quit)
2023-10-20 12:50:21 +0200[itchyjunk](~itchyjunk@user/itchyjunk/x-7353470)
2023-10-20 12:51:21 +0200elkcl(~elkcl@broadband-95-84-226-240.ip.moscow.rt.ru)
2023-10-20 12:55:43 +0200arahael(~arahael@119-18-2-212.771202.syd.nbn.aussiebb.net) (Ping timeout: 260 seconds)
2023-10-20 12:59:24 +0200arahael(~arahael@119-18-2-212.771202.syd.nbn.aussiebb.net)
2023-10-20 13:04:26 +0200Pickchea(~private@user/pickchea)
2023-10-20 13:06:59 +0200euleritian(~euleritia@77.22.252.56) (Ping timeout: 255 seconds)
2023-10-20 13:08:19 +0200wib_jonas(~wib_jonas@business-37-191-60-209.business.broadband.hu)
2023-10-20 13:09:06 +0200fendor(~fendor@2a02:8388:1640:be00:aab:1226:f274:5021) (Remote host closed the connection)
2023-10-20 13:12:08 +0200euleritian(~euleritia@dynamic-046-114-204-225.46.114.pool.telefonica.de)
2023-10-20 13:14:57 +0200zer0bitz(~zer0bitz@user/zer0bitz)
2023-10-20 13:16:57 +0200myxos(~myxos@cpe-65-28-251-121.cinci.res.rr.com)
2023-10-20 13:21:00 +0200sm(~sm@plaintextaccounting/sm) (Quit: sm)
2023-10-20 13:21:07 +0200mikoto-chan(~mikoto-ch@ip-212-239-236-59.dsl.scarlet.be)
2023-10-20 13:26:29 +0200CiaoSen(~Jura@2a05:5800:282:6600:664b:f0ff:fe37:9ef) (Ping timeout: 246 seconds)
2023-10-20 13:26:38 +0200mikoto-chan(~mikoto-ch@ip-212-239-236-59.dsl.scarlet.be) (Ping timeout: 260 seconds)
2023-10-20 13:29:27 +0200arahael(~arahael@119-18-2-212.771202.syd.nbn.aussiebb.net) (Ping timeout: 240 seconds)
2023-10-20 13:32:38 +0200Vajb(~Vajb@207.61.167.122)
2023-10-20 13:34:57 +0200nate2(~nate@c-98-45-169-16.hsd1.ca.comcast.net)
2023-10-20 13:39:39 +0200nate2(~nate@c-98-45-169-16.hsd1.ca.comcast.net) (Ping timeout: 245 seconds)
2023-10-20 13:41:42 +0200 <Inst> jesus christ, Nick sounds like he wants to get rid of polymorphic bind.
2023-10-20 13:41:43 +0200euleritian(~euleritia@dynamic-046-114-204-225.46.114.pool.telefonica.de) (Read error: Connection reset by peer)
2023-10-20 13:42:00 +0200euleritian(~euleritia@ip4d16fc38.dynamic.kabel-deutschland.de)
2023-10-20 13:43:07 +0200 <Inst> adding -XMonomorphicBind might be good as a GHC extension, though
2023-10-20 13:44:02 +0200 <int-e> who where?
2023-10-20 13:44:29 +0200 <Inst> forget it, someone we don't want to talk about, it's my other daily source of WTFs per minute
2023-10-20 13:47:35 +0200jargon(~jargon@174-22-221-150.phnx.qwest.net) (Ping timeout: 255 seconds)
2023-10-20 13:49:58 +0200bitdex(~bitdex@gateway/tor-sasl/bitdex) (Quit: = "")
2023-10-20 13:55:20 +0200danse-nr3_(~francesco@151.37.109.164)
2023-10-20 13:56:11 +0200 <kuribas> what's polymorphic bind?
2023-10-20 13:56:20 +0200 <Inst> <- and >>=
2023-10-20 13:57:00 +0200 <Inst> I like ideas like -XNamedLambdas, etc.
2023-10-20 13:57:12 +0200 <kuribas> That's just "bind".
2023-10-20 13:57:28 +0200Unicorn_Princess(~Unicorn_P@user/Unicorn-Princess/x-3540542) (Remote host closed the connection)
2023-10-20 13:58:01 +0200euleritian(~euleritia@ip4d16fc38.dynamic.kabel-deutschland.de) (Ping timeout: 260 seconds)
2023-10-20 13:58:06 +0200 <kuribas> And yes, it's polymorphic, since it requires a `Monad m` constraint.
2023-10-20 13:58:22 +0200 <Inst> But it's polymorphic, i.e, bind is defined for a Monad m. A monomorphic bind would be, instead of (>>= :: Monad m => m a -> (a -> m b) -> m b), (>>=? :: Maybe a -> (a -> Maybe b) -> Maybe b)
2023-10-20 13:58:45 +0200 <kuribas> and get rid of do-notation as well?
2023-10-20 13:58:55 +0200euleritian(~euleritia@dynamic-046-114-204-225.46.114.pool.telefonica.de)
2023-10-20 13:59:13 +0200Pickchea(~private@user/pickchea) (Quit: Leaving)
2023-10-20 13:59:40 +0200 <kuribas> why would anyone want to do that?
2023-10-20 13:59:42 +0200 <Inst> Presumably not, because it'd align with his goals. This is really rubbernecking for me.
2023-10-20 14:00:11 +0200 <Inst> I can accept return as a synonym for id
2023-10-20 14:00:35 +0200 <Inst> because Haskell's polymorphism is confusing for newbies
2023-10-20 14:01:08 +0200califax(~califax@user/califx)
2023-10-20 14:01:26 +0200 <Inst> This is the first time I've had a real yetch response since a doctor gave me an endoscopy without general anesthesia yesterday.
2023-10-20 14:01:30 +0200 <Inst> :)
2023-10-20 14:01:48 +0200CiaoSen(~Jura@2a05:5800:282:6600:664b:f0ff:fe37:9ef)
2023-10-20 14:02:11 +0200 <kuribas> Inst: then write in a dynamic language where you don't worry about types, and neither about runtime errors and good validation?
2023-10-20 14:02:39 +0200 <Inst> tbh the proper solution is, imo, teach more about Haskell's type system and teach more carefully
2023-10-20 14:03:11 +0200 <Inst> I can see why someone might want a monomorphic bind even if they're comfortable with Haskell's polymorphism, in order to more specify what's actually going on
2023-10-20 14:03:17 +0200 <Inst> IIRC, that was why Rust rejected do notation
2023-10-20 14:03:45 +0200 <kuribas> It sounds like a newbee who doesn't understand the language, but finds it necessary to comment on everything.
2023-10-20 14:03:51 +0200 <kuribas> Not realising any of the implications.
2023-10-20 14:03:59 +0200 <int-e> Inst: ...but if you don't want to talk about it then why did you mention it...
2023-10-20 14:04:22 +0200 <Inst> i mean that others don't want to talk about it, it's mainly rubbernecking value right now
2023-10-20 14:04:43 +0200 <int-e> Honestly the least you could do is actually link the source. (Or did I miss it in the scrollback?)
2023-10-20 14:05:37 +0200 <Inst> it's on NH Discord, I took a visit to see what's happening right now, and, ummm
2023-10-20 14:05:44 +0200 <kuribas> I can't care less about people claiming that haskell or static types are bad, then not showing any understanding of the language or theory.
2023-10-20 14:06:34 +0200 <kuribas> I am more interested in *actual pain points* and *actual* ways to improve the language.
2023-10-20 14:06:43 +0200 <Inst> https://media.discordapp.net/attachments/968989726633779215/1164897369595322490/image.png?ex=6544e…
2023-10-20 14:07:26 +0200 <Inst> This is... ummm, way too far for me
2023-10-20 14:07:50 +0200 <kuribas> Inst: don't let him go near idris, there you can even overload '>>=' and do notation.
2023-10-20 14:08:00 +0200 <kuribas> Haskell is still fairly conservative in that regards.
2023-10-20 14:08:38 +0200 <kuribas> "Yesterday I spent ~3hrs with junior TS devs talking about <- and how it is similar to await in JS..."
2023-10-20 14:08:43 +0200 <kuribas> That's the problem already.
2023-10-20 14:08:49 +0200 <int-e> Oh I see, he only wants one fuzzy warm thing at a time.
2023-10-20 14:09:06 +0200 <kuribas> problem 1) talking to junior TS devs about monads.
2023-10-20 14:09:16 +0200 <kuribas> problem 2) talling them that <- is similar to await.
2023-10-20 14:09:37 +0200 <int-e> It's a burrito!
2023-10-20 14:09:46 +0200 <danse-nr3_> Inst, see, you upset kuribas :P
2023-10-20 14:09:59 +0200 <kuribas> problem 3) being surprised that they are confused
2023-10-20 14:09:59 +0200 <int-e> (This really is an instance of the monad tutorial fallacy.)
2023-10-20 14:10:35 +0200califax(~califax@user/califx) (Remote host closed the connection)
2023-10-20 14:10:48 +0200 <int-e> Inst: Anyway, thanks for the link, now I know what you were upset about.
2023-10-20 14:10:51 +0200califax(~califax@user/califx)
2023-10-20 14:12:21 +0200 <kuribas> danse-nr3_: nah, I just had too much tea.
2023-10-20 14:12:42 +0200 <Inst> kuribas: well, how would you feel about -XMonomorphicBind as a language extension, i.e, being able to stuff an operator or function next to <- to specify a specific monadic type?
2023-10-20 14:12:53 +0200 <Inst> others have complained about nested do
2023-10-20 14:12:55 +0200 <int-e> SCNR: Obviously the reason why you have to 'await' that `var 42` is lazy evaluation.
2023-10-20 14:13:20 +0200int-etimes himself out.
2023-10-20 14:13:21 +0200 <kuribas> Inst: I feel it's solving a problem that doesn't exist.
2023-10-20 14:16:54 +0200 <moni> Yknow, I am exceedingly new to this (thus far I've only just gotten through the chapter on type classes from Haskell From First Principles, and I still have not gotten around to the category-theoretic parts of the language); but even with what little experience I have, I've found that the more I understand the type system, the easier it is for me to reason with the semantics of a given program
2023-10-20 14:17:09 +0200Vajb(~Vajb@207.61.167.122) (Ping timeout: 245 seconds)
2023-10-20 14:17:51 +0200 <kuribas> moni: there are no "category-theoretic parts" ;-)
2023-10-20 14:18:01 +0200 <danse-nr3_> this neohaskell seems so detached from haskell that advocating for its ideas gets close to trolling
2023-10-20 14:18:15 +0200ahri(~ahri@164.39.15.195)
2023-10-20 14:18:58 +0200 <danse-nr3_> i wonder whether it could end like java and javascript, with management thinking they had anything to do with each other
2023-10-20 14:19:00 +0200 <kuribas> moni: but yeah, that is the idea :)
2023-10-20 14:19:43 +0200 <Inst> tbh i sort of hope NH fails quickly at this point, because it's so divorced from Haskell, it's more like Nick coming up with weird ideas and field-testing them on the unsuspecting
2023-10-20 14:19:55 +0200 <moni> I plead "exceedingly-new" in that respect kuribas ;) but yeah, I feel like most people who actively recoil from static typing simply do not understand how the type system works (and therefore don't understand how to reason with haskell code generally)
2023-10-20 14:19:58 +0200 <Inst> he seems to be tilting toward _ `div` 0 = 0
2023-10-20 14:21:39 +0200xff0x(~xff0x@2405:6580:b080:900:c8ed:9e9f:452a:3637)
2023-10-20 14:22:33 +0200 <int-e> moni: You can use concrete monads like IO or Maybe or Reader or State or the list monad without knowing any category theory. All you're missing out on is the naming, that is why it's called a monad.
2023-10-20 14:22:58 +0200connrs(~connrs@user/connrs) (Read error: Connection reset by peer)
2023-10-20 14:23:04 +0200 <kuribas> moni: not only that, they don't recognize how types can make you "more productive", instead of being there just to provide extra constraints.
2023-10-20 14:24:07 +0200 <moni> int-e: ah that makes sense lol, thanks for the clarification
2023-10-20 14:25:10 +0200connrs(~connrs@user/connrs)
2023-10-20 14:25:39 +0200 <Inst> kuribas: why say that types can make you more productive?
2023-10-20 14:26:06 +0200 <Inst> One example I can think of is "Parse, don't validate"
2023-10-20 14:26:15 +0200 <kuribas> for example, using typed holes.
2023-10-20 14:26:17 +0200 <Inst> a dynamically typed language, you can give any function any input
2023-10-20 14:26:19 +0200 <Inst> ah
2023-10-20 14:26:40 +0200 <Inst> meaning, you'll have to code behavior if a function gets the wrong input type
2023-10-20 14:26:47 +0200 <kuribas> And also refactoring dynamic code is a major pain in the **s.
2023-10-20 14:27:24 +0200 <int-e> yeah, refactoring by chasing type errors tends to just work
2023-10-20 14:27:56 +0200 <Inst> another thing I notice is that people working in dynamic types tend to be way too tolerant of exceptions
2023-10-20 14:28:17 +0200 <kuribas> yeah, especially Python
2023-10-20 14:28:25 +0200 <Inst> they also don't have a habit of trying to think through all possible inputs
2023-10-20 14:28:35 +0200 <int-e> (static type checking covers all your code; with dynamic types you have to hope that you've covered all cases or get funny runtime behavior (hopefully just an error))
2023-10-20 14:28:44 +0200danse-nr3__(~francesco@151.47.100.98)
2023-10-20 14:28:50 +0200 <Inst> because if you try to do that, there are too many types to think through
2023-10-20 14:29:39 +0200vglfr(~vglfr@88.155.170.213) (Read error: Connection reset by peer)
2023-10-20 14:31:01 +0200danse-nr3_(~francesco@151.37.109.164) (Read error: Connection reset by peer)
2023-10-20 14:33:55 +0200 <int-e> Maybe this makes a good slogan: Every type error you fix is a bug you won't have to chase down later.
2023-10-20 14:34:33 +0200 <kuribas> For me it's not just that. Types are also a way of expressing problems in an algebraic way.
2023-10-20 14:35:06 +0200 <kuribas> It's the "algebraic way" of programming that IMO gives you code with low bug count.
2023-10-20 14:35:07 +0200 <int-e> Absolutely, but I suspect that's hard to get across to somebody who hasn't used types much.
2023-10-20 14:35:08 +0200 <Rembane> And documenting the expressed problems in a way that a computer can check.
2023-10-20 14:35:55 +0200 <danse-nr3__> yeah it feels basically like embedded proof checking (excluding partial functions)
2023-10-20 14:36:26 +0200 <int-e> Just like the fact that writing down a type for a function covers a significant part of the function's specification... easily said, but I'm not sure I would be convinced if I didn't have the first-hand experience.
2023-10-20 14:37:06 +0200 <int-e> (refuting the idea that writing down type signatures is wasted effort)
2023-10-20 14:37:52 +0200 <kuribas> IMO convincing someone to use types, if they don't already show some interest is impossible.
2023-10-20 14:38:11 +0200 <Rembane> Indeed, TDD as in Typesomethingsomething is a very nice way of coding imo
2023-10-20 14:43:06 +0200 <Inst> I wish someone would write an equivalent to Thinking with Types for Haskell98 or Haskell2010
2023-10-20 14:43:59 +0200 <Rembane> Inst: Which version of Haskell is it written for?
2023-10-20 14:44:17 +0200 <Inst> 2010 would be better, but implies 0 language extensions
2023-10-20 14:44:29 +0200 <Inst> I think someone already wrote a paper trying to cover Haskell's type system, but it's not accessible
2023-10-20 14:45:02 +0200euleritian(~euleritia@dynamic-046-114-204-225.46.114.pool.telefonica.de) (Read error: Connection reset by peer)
2023-10-20 14:45:20 +0200euleritian(~euleritia@ip4d16fc38.dynamic.kabel-deutschland.de)
2023-10-20 14:47:52 +0200lisbeths(uid135845@id-135845.lymington.irccloud.com) (Quit: Connection closed for inactivity)
2023-10-20 14:48:02 +0200mikoto-chan(~mikoto-ch@ip-212-239-236-59.dsl.scarlet.be)
2023-10-20 14:52:23 +0200euleritian(~euleritia@ip4d16fc38.dynamic.kabel-deutschland.de) (Read error: Connection reset by peer)
2023-10-20 14:53:07 +0200euleritian(~euleritia@ip4d16fc38.dynamic.kabel-deutschland.de)
2023-10-20 14:56:17 +0200ahri(~ahri@164.39.15.195) (Quit: Client closed)
2023-10-20 14:57:38 +0200euleritian(~euleritia@ip4d16fc38.dynamic.kabel-deutschland.de) (Ping timeout: 260 seconds)
2023-10-20 14:58:38 +0200dcoutts(~duncan@ip-185-104-136-31.ptr.icomera.net)
2023-10-20 14:59:40 +0200euleritian(~euleritia@dynamic-046-114-204-225.46.114.pool.telefonica.de)
2023-10-20 15:07:36 +0200dcoutts_(~duncan@ip-185-104-136-31.ptr.icomera.net)
2023-10-20 15:08:43 +0200dcoutts(~duncan@ip-185-104-136-31.ptr.icomera.net) (Ping timeout: 260 seconds)
2023-10-20 15:13:32 +0200Inst(~Inst@120.244.192.250) (Ping timeout: 255 seconds)
2023-10-20 15:14:25 +0200rosco(~rosco@yp-150-69.tm.net.my) (Quit: Lost terminal)
2023-10-20 15:17:48 +0200L29Ah(~L29Ah@wikipedia/L29Ah)
2023-10-20 15:24:02 +0200vpan(~vpan@212.117.1.172) (Quit: Leaving.)
2023-10-20 15:24:12 +0200vglfr(~vglfr@88.155.240.63)
2023-10-20 15:26:13 +0200cpressey(~cpressey@host-92-10-146-234.as13285.net)
2023-10-20 15:29:19 +0200Inst(~Inst@120.244.192.250)
2023-10-20 15:36:07 +0200euleritian(~euleritia@dynamic-046-114-204-225.46.114.pool.telefonica.de) (Read error: Connection reset by peer)
2023-10-20 15:36:24 +0200euleritian(~euleritia@ip4d16fc38.dynamic.kabel-deutschland.de)
2023-10-20 15:38:13 +0200euleritian(~euleritia@ip4d16fc38.dynamic.kabel-deutschland.de) (Read error: Connection reset by peer)
2023-10-20 15:40:42 +0200euleritian(~euleritia@ip4d16fc38.dynamic.kabel-deutschland.de)
2023-10-20 15:49:18 +0200ahri(~ahri@164.39.15.195)
2023-10-20 15:50:46 +0200dcoutts_(~duncan@ip-185-104-136-31.ptr.icomera.net) (Ping timeout: 258 seconds)
2023-10-20 15:52:02 +0200ahri(~ahri@164.39.15.195) (Client Quit)
2023-10-20 15:52:32 +0200ahri(~ahri@164.39.15.195)
2023-10-20 15:56:16 +0200alphacentauri(alphacenta@gateway/vpn/protonvpn/alphacentauri) (Quit: WeeChat 4.1.0)
2023-10-20 16:00:06 +0200sabino(~sabino@user/sabino)
2023-10-20 16:06:39 +0200ahri(~ahri@164.39.15.195) (Ping timeout: 248 seconds)
2023-10-20 16:08:52 +0200megaTherion(~therion@unix.io) (Quit: ZNC 1.8.2 - https://znc.in)
2023-10-20 16:10:02 +0200megaTherion(~therion@unix.io)
2023-10-20 16:11:53 +0200megaTherion(~therion@unix.io) (Client Quit)
2023-10-20 16:13:02 +0200megaTherion(~therion@unix.io)
2023-10-20 16:16:36 +0200Square(~Square@user/square)
2023-10-20 16:18:00 +0200econo_(uid147250@id-147250.tinside.irccloud.com)
2023-10-20 16:19:20 +0200megaTherion(~therion@unix.io) (Quit: ZNC 1.8.2 - https://znc.in)
2023-10-20 16:20:26 +0200megaTherion(~therion@unix.io)
2023-10-20 16:21:05 +0200thegeekinside(~thegeekin@189.180.124.118)
2023-10-20 16:23:26 +0200rgw(~R@2605:a601:a0df:5600:41e1:fde1:f907:ea46)
2023-10-20 16:26:43 +0200xff0x(~xff0x@2405:6580:b080:900:c8ed:9e9f:452a:3637) (Ping timeout: 264 seconds)
2023-10-20 16:28:29 +0200xff0x(~xff0x@ai101218.d.east.v6connect.net)
2023-10-20 16:28:57 +0200gatekempt(~gatekempt@user/gatekempt)
2023-10-20 16:31:51 +0200ahri(~ahri@164.39.15.195)
2023-10-20 16:33:28 +0200ahri(~ahri@164.39.15.195) (Client Quit)
2023-10-20 16:35:56 +0200wib_jonas(~wib_jonas@business-37-191-60-209.business.broadband.hu) (Quit: Client closed)
2023-10-20 16:38:09 +0200danse-nr3__is trying to read types as if they were documentation. That ought to be the haskell way
2023-10-20 16:39:23 +0200thegeekinside(~thegeekin@189.180.124.118) (Ping timeout: 255 seconds)
2023-10-20 16:39:29 +0200dcoutts(~duncan@167.98.155.156)
2023-10-20 16:40:21 +0200kuribas(~user@ip-188-118-57-242.reverse.destiny.be) (Remote host closed the connection)
2023-10-20 16:41:24 +0200thegeekinside(~thegeekin@189.180.124.118)
2023-10-20 16:42:40 +0200mc47(~mc47@xmonad/TheMC47)
2023-10-20 16:47:05 +0200 <Square> I'm working with "Validation" which is called a Monoidal sibling to Either. I wonder if its intentional its clumsy or if I lack basic knowledge on how to use it. Why doesn't it have practical things like "either" or "maybe" methods like Either resp Maybe has?
2023-10-20 16:47:17 +0200 <Square> https://hackage.haskell.org/package/either-5.0.2/docs/Data-Either-Validation.html
2023-10-20 16:49:37 +0200 <danse-nr3__> oh nice, i think i have been looking for this at times
2023-10-20 16:49:54 +0200 <Square> Like, am I forced to do pattern match to convert "Success" to "Just"
2023-10-20 16:51:22 +0200 <Rembane> Square: I think their idea is that you should use lenses or optics with this library.
2023-10-20 16:52:16 +0200 <Square> Rembane, oh ok
2023-10-20 16:52:22 +0200sm(~sm@plaintextaccounting/sm)
2023-10-20 16:52:26 +0200 <Rembane> Square: You can also use validationToEither the last thing in a validation and then use the Either functions
2023-10-20 16:52:58 +0200 <ncf> preview _Success :: Validation e a -> Maybe a
2023-10-20 16:53:08 +0200 <Square> ncf, nice!
2023-10-20 16:56:19 +0200dcoutts(~duncan@167.98.155.156) (Ping timeout: 258 seconds)
2023-10-20 17:05:37 +0200phma_(phma@2001:5b0:210f:118:12d5:66dc:e6c4:4af1)
2023-10-20 17:06:16 +0200phma(~phma@host-67-44-208-191.hnremote.net) (Read error: Connection reset by peer)
2023-10-20 17:09:32 +0200pavonia(~user@user/siracusa) (Quit: Bye!)
2023-10-20 17:12:40 +0200b_jonas(~x@89.134.28.176) (Ping timeout: 252 seconds)
2023-10-20 17:13:34 +0200b_jonas(~x@89.134.28.176)
2023-10-20 17:16:12 +0200cfricke(~cfricke@user/cfricke) (Quit: WeeChat 4.0.5)
2023-10-20 17:18:40 +0200Unicorn_Princess(~Unicorn_P@user/Unicorn-Princess/x-3540542)
2023-10-20 17:20:22 +0200 <rgw> why convert it to Just? isn't a Right result of a validation already signifying success?
2023-10-20 17:20:37 +0200kuribas(~user@ip-188-118-57-242.reverse.destiny.be)
2023-10-20 17:21:43 +0200yoyofreeman(~yoyofreem@176.97.76.178)
2023-10-20 17:25:56 +0200 <danse-nr3__> good question actually
2023-10-20 17:26:19 +0200 <danse-nr3__> probably to integrate with other Maybe functions
2023-10-20 17:28:55 +0200Pozyomka(~pyon@user/pyon)
2023-10-20 17:29:24 +0200chele(~chele@user/chele) (Remote host closed the connection)
2023-10-20 17:29:51 +0200euleritian(~euleritia@ip4d16fc38.dynamic.kabel-deutschland.de) (Read error: Connection reset by peer)
2023-10-20 17:30:41 +0200euleritian(~euleritia@ip4d16fc38.dynamic.kabel-deutschland.de)
2023-10-20 17:32:43 +0200danse-nr3__(~francesco@151.47.100.98) (Ping timeout: 255 seconds)
2023-10-20 17:33:20 +0200Tuplanolla(~Tuplanoll@91-159-68-236.elisa-laajakaista.fi)
2023-10-20 17:35:01 +0200 <Square> rgw, Just thought I'd get rid of the Failure info as it plays no role in the context I work. Sure, its one application away, but yeah just wanted to get as ergonomical as possible.
2023-10-20 17:36:27 +0200nate2(~nate@c-98-45-169-16.hsd1.ca.comcast.net)
2023-10-20 17:37:28 +0200mikoto-chan(~mikoto-ch@ip-212-239-236-59.dsl.scarlet.be) (Ping timeout: 260 seconds)
2023-10-20 17:41:12 +0200vglfr(~vglfr@88.155.240.63) (Read error: Connection reset by peer)
2023-10-20 17:41:29 +0200nate2(~nate@c-98-45-169-16.hsd1.ca.comcast.net) (Ping timeout: 255 seconds)
2023-10-20 17:41:33 +0200vglfr(vglfr@gateway/vpn/protonvpn/vglfr)
2023-10-20 17:42:10 +0200danse-nr3__(~francesco@151.47.100.98)
2023-10-20 17:44:18 +0200 <kuribas> WHy is fastCGI so unpopular? Doesn't it make sense to interface with established webservers?
2023-10-20 17:46:51 +0200Simikando(~Simikando@adsl-dyn158.91-127-59.t-com.sk)
2023-10-20 17:47:13 +0200nickiminjaj(~nickiminj@188.146.126.78)
2023-10-20 17:47:13 +0200nickiminjaj(~nickiminj@188.146.126.78) (Changing host)
2023-10-20 17:47:13 +0200nickiminjaj(~nickiminj@user/laxhh)
2023-10-20 17:49:48 +0200eggplantade(~Eggplanta@2600:1700:38c5:d800:e1a3:648c:fb34:72ec) (Remote host closed the connection)
2023-10-20 17:50:04 +0200eggplantade(~Eggplanta@2600:1700:38c5:d800:e1a3:648c:fb34:72ec)
2023-10-20 17:51:14 +0200 <geekosaur> maybe just its name? "CGI" sounds like 90s tech
2023-10-20 17:51:57 +0200 <danse-nr3__> oh gosh haven't heard about CGI (nor fastCGI) in a long time. I thought it was a nice protocol. Maybe the serialization/deserialization is too much overhead and embedding the server in the app became more popular?
2023-10-20 17:55:15 +0200 <EvanR> ruby on rails killed fastCGI because ruby is so slow fastCGI on top of that was so much worse. So they rewrote how web works to account for how inefficient ruby is
2023-10-20 17:55:38 +0200 <danse-nr3__> also not sure how CGI would work with persistent connections like websockets
2023-10-20 17:55:43 +0200 <EvanR> now everyone thinks the web app needs to be integrated with the webserver regardless of language
2023-10-20 17:56:19 +0200 <kuribas> EvanR: you mean because the fastCGI library was pure Ruby?
2023-10-20 17:57:14 +0200Simikando(~Simikando@adsl-dyn158.91-127-59.t-com.sk) (Ping timeout: 255 seconds)
2023-10-20 18:00:16 +0200 <c_wraith> so... CGI died because it wasn't good at global resource limits, like a database connection pool. It turns out launching a new process for every request just is awkward for performing coordination between requests.
2023-10-20 18:00:33 +0200 <kuribas> c_wraith: hence... fastCGI?
2023-10-20 18:00:48 +0200 <kuribas> It doesn't launch a new process for each request.
2023-10-20 18:01:39 +0200 <geekosaur> fastCGI was the first attempt to make CGI usable. it wasn't good enough
2023-10-20 18:02:35 +0200 <kuribas> why not?
2023-10-20 18:03:16 +0200 <c_wraith> amusingly, rails sort of reinvented fastCGI with rack
2023-10-20 18:03:32 +0200sm(~sm@plaintextaccounting/sm) (Quit: sm)
2023-10-20 18:03:35 +0200 <EvanR> fastCGI is still a viable way to set it up, but being web tech the popularity is based entirely on whims and not technicals
2023-10-20 18:03:57 +0200 <EvanR> the users don't care what you used in the backend as long as it works
2023-10-20 18:04:20 +0200 <EvanR> the rails scene reinvented a lot of that stuff
2023-10-20 18:04:25 +0200 <EvanR> then elixir reinvented it again
2023-10-20 18:04:31 +0200 <EvanR> the story continues
2023-10-20 18:05:07 +0200 <EvanR> I saw one startup trying to reinvent it all in rust, then later changing their mind (regaining their sanity?)
2023-10-20 18:05:14 +0200 <c_wraith> staying in-process is an easy way to get a big performance boost
2023-10-20 18:05:36 +0200 <c_wraith> Not having to serialize and parse the data is an easy win on small requests
2023-10-20 18:06:38 +0200machinedgod(~machinedg@d198-53-218-113.abhsia.telus.net) (Ping timeout: 260 seconds)
2023-10-20 18:07:51 +0200 <c_wraith> even in the middle-early days, staying in-process was cool. apache's mod_php ran PHP code directly instead of sending data to an external process.
2023-10-20 18:11:02 +0200EvanR(~EvanR@user/evanr) (Remote host closed the connection)
2023-10-20 18:11:57 +0200EvanR(~EvanR@user/evanr)
2023-10-20 18:12:25 +0200wib_jonas(~wib_jonas@business-37-191-60-209.business.broadband.hu)
2023-10-20 18:12:54 +0200tzh(~tzh@c-71-193-181-0.hsd1.or.comcast.net)
2023-10-20 18:13:26 +0200Vajb(~Vajb@207.61.167.122)
2023-10-20 18:14:36 +0200 <kuribas> man, http benchmarks are such lies, higher just means it implements less of the spec, IMO...
2023-10-20 18:14:51 +0200 <SrPx> using PHOAS, is it possible to normalize a term and then stringify the normal form? I see PHOAS usually implements norm as `eval :: Exp t -> t` rather than `eval :: Exp t -> Exp t` so it isn't clear to me how to quote the result. ref https://mail.haskell.org/pipermail/haskell-cafe/2008-November/050768.html
2023-10-20 18:15:36 +0200 <SrPx> complete file: https://gist.github.com/VictorTaelin/7d3b8b1cd6c400dfd9ff8ade1336f135
2023-10-20 18:16:15 +0200kuribas(~user@ip-188-118-57-242.reverse.destiny.be) (Remote host closed the connection)
2023-10-20 18:18:21 +0200Simikando(~Simikando@adsl-dyn158.91-127-59.t-com.sk)
2023-10-20 18:21:44 +0200Vajb(~Vajb@207.61.167.122) (Ping timeout: 245 seconds)
2023-10-20 18:22:26 +0200 <EvanR> you should be able to stringify any expression, right
2023-10-20 18:29:11 +0200danse-nr3_(~francesco@151.43.109.173)
2023-10-20 18:29:13 +0200danse-nr3__(~francesco@151.47.100.98) (Read error: Connection reset by peer)
2023-10-20 18:31:27 +0200 <SrPx> EvanR: yes, but eval doesn't return an expression, but rather just `t`
2023-10-20 18:31:49 +0200 <SrPx> so unless I'm missing something obvious there is no way to normalize a λ-term and print its normal form with PHOAS?
2023-10-20 18:31:51 +0200phma_phma
2023-10-20 18:31:55 +0200 <SrPx> moved this question to SO https://stackoverflow.com/questions/77332495/is-it-possible-using-phoas-to-evaluate-a-term-to-norm…
2023-10-20 18:44:29 +0200vglfr(vglfr@gateway/vpn/protonvpn/vglfr) (Ping timeout: 255 seconds)
2023-10-20 18:45:02 +0200waleee(~waleee@2001:9b0:21c:e600:f2f3:f744:435d:137c)
2023-10-20 18:45:19 +0200vglfr(~vglfr@88.155.240.63)
2023-10-20 18:47:49 +0200poscat(~poscat@user/poscat) (Quit: Bye)
2023-10-20 18:48:05 +0200CiaoSen(~Jura@2a05:5800:282:6600:664b:f0ff:fe37:9ef) (Ping timeout: 255 seconds)
2023-10-20 18:52:06 +0200poscat(~poscat@user/poscat)
2023-10-20 18:53:48 +0200Simikando(~Simikando@adsl-dyn158.91-127-59.t-com.sk) (Ping timeout: 272 seconds)
2023-10-20 18:57:19 +0200cpressey(~cpressey@host-92-10-146-234.as13285.net) (Quit: Client closed)
2023-10-20 18:59:53 +0200Simikando(~Simikando@adsl-dyn158.91-127-59.t-com.sk)
2023-10-20 18:59:54 +0200nickiminjaj(~nickiminj@user/laxhh) (Read error: Connection reset by peer)
2023-10-20 19:00:40 +0200dcoutts(~duncan@212.187.244.65)
2023-10-20 19:03:48 +0200vglfr(~vglfr@88.155.240.63) (Ping timeout: 240 seconds)
2023-10-20 19:03:58 +0200thegeekinside(~thegeekin@189.180.124.118) (Ping timeout: 258 seconds)
2023-10-20 19:04:55 +0200AlexNoo_(~AlexNoo@178.34.162.116)
2023-10-20 19:06:55 +0200dcoutts(~duncan@212.187.244.65) (Ping timeout: 264 seconds)
2023-10-20 19:07:21 +0200AlexZenon(~alzenon@178.34.161.78) (Ping timeout: 255 seconds)
2023-10-20 19:08:34 +0200AlexNoo(~AlexNoo@178.34.161.78) (Ping timeout: 255 seconds)
2023-10-20 19:08:47 +0200Vajb(~Vajb@207.61.167.122)
2023-10-20 19:10:49 +0200Vajb(~Vajb@207.61.167.122) (Read error: Connection reset by peer)
2023-10-20 19:10:52 +0200thegeekinside(~thegeekin@189.180.124.118)
2023-10-20 19:11:01 +0200Vajb(~Vajb@207.61.167.122)
2023-10-20 19:12:56 +0200Simikando(~Simikando@adsl-dyn158.91-127-59.t-com.sk) (Ping timeout: 255 seconds)
2023-10-20 19:14:15 +0200wib_jonas(~wib_jonas@business-37-191-60-209.business.broadband.hu) (Quit: Client closed)
2023-10-20 19:15:56 +0200paddymahoney(~paddymaho@cpe883d24bcf597-cmbc4dfb741f80.cpe.net.cable.rogers.com)
2023-10-20 19:17:22 +0200ft(~ft@p4fc2a529.dip0.t-ipconnect.de)
2023-10-20 19:17:59 +0200AlexNoo_AlexNoo
2023-10-20 19:18:23 +0200danse-nr3_(~francesco@151.43.109.173) (Ping timeout: 260 seconds)
2023-10-20 19:20:21 +0200alphacentauri(alphacenta@gateway/vpn/protonvpn/alphacentauri)
2023-10-20 19:21:10 +0200 <exarkun> Anyone have any suggestions for learning Hakyll? The project tutorial isn't doing much for me.
2023-10-20 19:21:21 +0200danse-nr3_(~francesco@151.43.109.173)
2023-10-20 19:21:44 +0200AlexZenon(~alzenon@178.34.162.116)
2023-10-20 19:26:58 +0200danse-nr3_(~francesco@151.43.109.173) (Ping timeout: 258 seconds)
2023-10-20 19:30:14 +0200Sgeo(~Sgeo@user/sgeo)
2023-10-20 19:34:26 +0200Vajb(~Vajb@207.61.167.122) (Ping timeout: 255 seconds)
2023-10-20 19:39:12 +0200 <[exa]> exarkun: I started learning it and then wrote my own version with a few functions (like directory sourcing) from hakyll + plain pandoc
2023-10-20 19:39:32 +0200 <[exa]> exarkun: anyway yeah the docs ain't super illustrative, just reading the source helps a lot there
2023-10-20 19:43:10 +0200dcoutts(~duncan@ip-185-104-136-51.ptr.icomera.net)
2023-10-20 19:48:20 +0200hugo(znc@verdigris.lysator.liu.se) (Quit: ZNC 1.8.2 - https://znc.in)
2023-10-20 19:51:56 +0200lortabac(~lortabac@185.238.219.14)
2023-10-20 19:52:54 +0200nickiminjaj(~nickiminj@188.146.126.78)
2023-10-20 19:52:54 +0200nickiminjaj(~nickiminj@188.146.126.78) (Changing host)
2023-10-20 19:52:54 +0200nickiminjaj(~nickiminj@user/laxhh)
2023-10-20 19:53:56 +0200alphacentauri(alphacenta@gateway/vpn/protonvpn/alphacentauri) (Quit: WeeChat 4.1.0)
2023-10-20 19:54:15 +0200eggplantade(~Eggplanta@2600:1700:38c5:d800:e1a3:648c:fb34:72ec) (Remote host closed the connection)
2023-10-20 19:54:57 +0200qqq(~qqq@92.43.167.61)
2023-10-20 19:58:59 +0200Guest86(~Guest86@14.139.128.51)
2023-10-20 20:02:05 +0200 <Guest86> Hi
2023-10-20 20:02:15 +0200 <Guest86> In haskell, how do we deal with subtypes?
2023-10-20 20:02:38 +0200 <Guest86> say, `data Day = Mon | Tue ... | Sun`
2023-10-20 20:02:59 +0200 <Guest86> how would I define `data Weekend = Sat | Sun`?
2023-10-20 20:03:10 +0200 <EvanR> haskell doesn't have subtypes
2023-10-20 20:03:42 +0200 <EvanR> but you can define a Weekend type which maps to Day if you want, it just requires applying a function
2023-10-20 20:04:38 +0200 <EvanR> then granular code which requires a Weekend can have the proper type
2023-10-20 20:05:28 +0200 <EvanR> to go backwards, Day to Weekend, you can use a "smart constructor" which is a function of type Day -> Maybe Weekend
2023-10-20 20:05:29 +0200nucranium(~nucranium@2a02:8010:6173:0:7d81:65c5:a598:8bba)
2023-10-20 20:05:33 +0200 <rgw> wouldn't weekend be [Sat, Sun]?
2023-10-20 20:05:59 +0200 <Guest86> rgw we can't use it as a type right?
2023-10-20 20:06:04 +0200 <EvanR> subsets vs subtypes
2023-10-20 20:06:27 +0200 <EvanR> [Sat, Sun] is a sort of subset
2023-10-20 20:06:36 +0200 <Inst> What is wrong with
2023-10-20 20:06:36 +0200euleritian(~euleritia@ip4d16fc38.dynamic.kabel-deutschland.de) (Read error: Connection reset by peer)
2023-10-20 20:06:48 +0200euleritian(~euleritia@77.22.252.56)
2023-10-20 20:06:56 +0200 <Inst> data Day = WeekdayDay Weekday | WeekendDay Weekend
2023-10-20 20:06:57 +0200 <rgw> well, i mean Weekend = Sat | Sun would be either Sat or Sun
2023-10-20 20:07:04 +0200thegeekinside(~thegeekin@189.180.124.118) (Ping timeout: 255 seconds)
2023-10-20 20:07:08 +0200 <Inst> I'm guessing that's the naive solution
2023-10-20 20:07:13 +0200thegeekinside(~thegeekin@189.180.4.84)
2023-10-20 20:07:20 +0200 <rgw> that seems more like a function like isWeekday
2023-10-20 20:07:24 +0200 <EvanR> you can do that but I don't think it'll be generally useful
2023-10-20 20:07:41 +0200 <EvanR> splitting the Day type up
2023-10-20 20:07:52 +0200 <Inst> Ergonomics feel terrible.
2023-10-20 20:08:00 +0200 <rgw> i guess you could implement it as a weekendable
2023-10-20 20:08:04 +0200 <EvanR> the next feature that comes along might require you split it up again, or worse, in a different way
2023-10-20 20:08:24 +0200 <EvanR> weekendable type class? That's almost certain even worse
2023-10-20 20:08:36 +0200 <Inst> but splitting the type afaik is the only way to get total sum types, by not being a sum type
2023-10-20 20:08:42 +0200 <Guest86> EvanR thanks. I will have to define weekend as `data Weekend = Sat' | Sun'` and then write a function to go from Weekend to Day right?
2023-10-20 20:08:50 +0200 <EvanR> Inst the first thing I said was "total"
2023-10-20 20:09:13 +0200 <rgw> why does it even have to be a type?
2023-10-20 20:09:15 +0200 <EvanR> Guest86, you can use the same constructor names if you want, in a different module
2023-10-20 20:10:12 +0200 <EvanR> Guest86, yeah you have an embedding function from Weekend to Day which always works. And this gets the classic feature of promoting OOP subclasses to the superclass
2023-10-20 20:10:21 +0200 <EvanR> just not implicitly
2023-10-20 20:11:34 +0200 <EvanR> this is all hypothetical I assume, because we might have actual good advice for a concrete problem
2023-10-20 20:11:44 +0200 <Inst> ummm, where did you say total?
2023-10-20 20:11:46 +0200 <EvanR> that's totally different
2023-10-20 20:11:56 +0200 <EvanR> Inst, why do you think it's not total
2023-10-20 20:12:13 +0200 <Guest86> EvanR we can't define multiple modules in the same file right?
2023-10-20 20:12:13 +0200 <Inst> I was talking about splitting a type up
2023-10-20 20:12:20 +0200 <EvanR> Guest86, correct
2023-10-20 20:12:22 +0200 <Inst> since partial records are notorious, no?
2023-10-20 20:12:48 +0200 <EvanR> records in sum types has nothing to do with any of this
2023-10-20 20:14:01 +0200jargon(~jargon@174-22-221-150.phnx.qwest.net)
2023-10-20 20:15:02 +0200 <Inst> What are the benefits of not having subtyping?
2023-10-20 20:15:22 +0200 <EvanR> subtyping is very complex to use and implement
2023-10-20 20:15:34 +0200 <rgw> probably messes with type inference
2023-10-20 20:15:40 +0200 <Guest86> rgw for an use case, say I want to define a function : `validPartyDates :: [(Int, Day)] -> [(Int, Weekend)]`
2023-10-20 20:15:43 +0200 <EvanR> or, because no one who really liked it was present when haskell was designed
2023-10-20 20:16:47 +0200 <rgw> you can't just pattern match on sat and sun?
2023-10-20 20:17:31 +0200 <EvanR> that type is totally valid, very precisely typed
2023-10-20 20:17:46 +0200 <EvanR> you will find increasing the precision of your types sometimes results in a lot of work
2023-10-20 20:18:02 +0200 <EvanR> but if the logic is sound, at least there's that
2023-10-20 20:18:06 +0200 <rgw> i don't really see the benefit of having a specific weekend type
2023-10-20 20:18:10 +0200Simikando(~Simikando@adsl-dyn158.91-127-59.t-com.sk)
2023-10-20 20:18:24 +0200 <EvanR> well, you know Guest86's function only returns weekends from looking at the type
2023-10-20 20:18:24 +0200bastelfreak(bastelfrea@libera/staff/VoxPupuli.bastelfreak) (Quit: WeeChat 4.0.0)
2023-10-20 20:18:30 +0200machinedgod(~machinedg@d198-53-218-113.abhsia.telus.net)
2023-10-20 20:18:39 +0200 <Guest86> Yeah '=D
2023-10-20 20:18:40 +0200 <rgw> well, weekenddays
2023-10-20 20:19:06 +0200 <rgw> not knowing the implementation, weekend would imply to me that it would be two days
2023-10-20 20:19:26 +0200 <EvanR> the name Day is also the name of the calendar date type in Data.Time
2023-10-20 20:19:45 +0200 <EvanR> so the names of these types might need review, but as it stands it's correct code
2023-10-20 20:20:25 +0200 <Inst> you can probably run a filter via (\(_,date) -> date `elem` [Saturday, Sunday]), then map to convert the Days to members of the Weekend datatype
2023-10-20 20:20:32 +0200 <rgw> validpartydates already tells me it does validification
2023-10-20 20:21:01 +0200 <Inst> actually, date should be day, but small typo
2023-10-20 20:21:28 +0200 <Inst> it's actually a bit more convenient since map on 2-tuples gets you access to the second data type
2023-10-20 20:21:30 +0200 <EvanR> names are good, but packing types, documentation, and whatever else into the variable names is the realm of ruby, python, php
2023-10-20 20:21:53 +0200 <Inst> because you don't have types to describe your data and functions
2023-10-20 20:22:25 +0200 <Inst> you can also write the boolean check in point free
2023-10-20 20:22:32 +0200eggplantade(~Eggplanta@2600:1700:38c5:d800:e1a3:648c:fb34:72ec)
2023-10-20 20:22:33 +0200 <EvanR> Inst, you're assuming validPartyDates does something specific, filtering out anything that's not a weekend
2023-10-20 20:22:44 +0200 <EvanR> who knows what valid means here
2023-10-20 20:23:07 +0200 <Inst> Well, it's Weekend, not (Maybe Weekend)
2023-10-20 20:23:08 +0200 <moni> Weekend would imply to you that Weekend is 2 days ... unless you're a weirdo (me) who thinks of Friday as part of the weekend
2023-10-20 20:23:25 +0200 <EvanR> Inst, list can be considered a kind of option type, empty means failure
2023-10-20 20:23:28 +0200 <rgw> i mean that's valid, maybe weekends differ by region
2023-10-20 20:23:38 +0200 <rgw> totally not futureproof if we colonize mars
2023-10-20 20:23:58 +0200 <Inst> yes, Maybe is isomorphic to a lists of up to 1 member
2023-10-20 20:24:01 +0200 <EvanR> naming aside, the "not subtype" pattern is sound
2023-10-20 20:25:33 +0200 <Inst> as an example, what else could valid mean?
2023-10-20 20:25:40 +0200 <Guest86> Is there anywhere I can see examples of handling such cases? That is handling subtypes in haskell way?
2023-10-20 20:25:45 +0200 <Inst> ah, you're right, it could also consider other exclusions
2023-10-20 20:25:54 +0200 <Guest86> Int and Integer are both instances of Enum class right?
2023-10-20 20:25:58 +0200 <Inst> for example, it could have a holiday register involved
2023-10-20 20:26:06 +0200 <Guest86> and both of them have the same constructors
2023-10-20 20:26:06 +0200 <geekosaur> or handle long weekends so Monday sometimes counts, etc.
2023-10-20 20:26:09 +0200 <geekosaur> that
2023-10-20 20:26:27 +0200 <EvanR> Guest86, numerics is a great place to show how subtypes often don't apply when people think they do
2023-10-20 20:26:28 +0200 <geekosaur> there's compiler magic involved there
2023-10-20 20:26:32 +0200 <geekosaur> :t 1
2023-10-20 20:26:32 +0200 <lambdabot> Num p => p
2023-10-20 20:26:40 +0200 <geekosaur> :t fromInteger
2023-10-20 20:26:41 +0200 <lambdabot> Num a => Integer -> a
2023-10-20 20:26:55 +0200 <Inst> Memorial Day in the United States is always a Monday, right?
2023-10-20 20:27:03 +0200 <EvanR> Guest86, for example, in many languages you are told that Int is a subtype of Double, but it's not even a subset. Or vice versa
2023-10-20 20:27:08 +0200 <rgw> is that still technically a weekend though?
2023-10-20 20:27:32 +0200 <geekosaur> `1` is compiled as `fromInteger (1 :: Integer)` where the `1 :: Integer` is directly compiled in
2023-10-20 20:27:42 +0200[exa]still not convinced that human calendar systems are more decidable than halting
2023-10-20 20:27:51 +0200 <geekosaur> Inst, there are 6 Monday holidays in the US
2023-10-20 20:28:02 +0200 <rgw> alternatively, every day is a party day
2023-10-20 20:28:03 +0200 <geekosaur> Memorial Day is one of them
2023-10-20 20:28:25 +0200 <rgw> how did we get from weekend days to holidays?
2023-10-20 20:28:42 +0200 <Inst> ? @geekosaur?
2023-10-20 20:28:43 +0200 <geekosaur> [20 18:25:58] <Inst> for example, it could have a holiday register involved
2023-10-20 20:28:48 +0200 <Inst> https://www.usa.gov/holidays
2023-10-20 20:28:54 +0200 <EvanR> Guest86, type classes are a way to say you will accept any type which supports a certain uniform interface. But there are other ways to get the same thing. And this isn't actually a subtyping thing.
2023-10-20 20:29:06 +0200 <geekosaur> (also that's complicated by the fact that not all of them are given as days off to most people)
2023-10-20 20:30:01 +0200 <EvanR> so you might be looking for that uniform interface pattern, instead of subtyping. Where in OOP there was an attempt to conflate them
2023-10-20 20:30:06 +0200 <geekosaur> yes. holidays are complex but there are 6 holidays which by law are placed on Mondays
2023-10-20 20:30:16 +0200 <Guest86> I will try out my use case with typeclasses and come back here to confirm if my solution is a good way '=D
2023-10-20 20:30:25 +0200 <monochrom> (And then laws are complicated, too. >:) )
2023-10-20 20:30:27 +0200 <EvanR> what is the uniform interface to weekends?
2023-10-20 20:30:30 +0200 <Inst> what is the 6th holiday? I only see 5 federal holidays on monday?
2023-10-20 20:30:36 +0200 <EvanR> er, days / weekdays
2023-10-20 20:30:40 +0200 <rgw> that's why i joked weekendable
2023-10-20 20:30:44 +0200 <EvanR> I think your goals need to be fleshed out
2023-10-20 20:30:54 +0200 <monochrom> Uniform interface to weekdays: :(
2023-10-20 20:30:57 +0200 <rgw> it's funny how haskell actually makes you think really hard about this
2023-10-20 20:31:05 +0200 <monochrom> Uniform interface to weekends: \o/
2023-10-20 20:31:34 +0200 <EvanR> rgw, the time library is surprisingly cogent on the subject of time keeping, it's kind of a relief
2023-10-20 20:31:41 +0200 <rgw> but what if a weekday is also pizzaday?
2023-10-20 20:31:49 +0200 <geekosaur> hm, right, I'm confused
2023-10-20 20:31:55 +0200 <monochrom> Joke among theoretical physicists: Scheduling a meeting on a Wednesday ruins both weekends. :)
2023-10-20 20:32:18 +0200 <moni> so real
2023-10-20 20:33:59 +0200 <Inst> @ geekosaur
2023-10-20 20:34:01 +0200 <Inst> no, I'm confused
2023-10-20 20:34:02 +0200 <Inst> https://vivacf.net/us-bank-holidays-list-and-description/
2023-10-20 20:34:20 +0200 <rgw> who says this is for the us?
2023-10-20 20:34:41 +0200dcoutts(~duncan@ip-185-104-136-51.ptr.icomera.net) (Ping timeout: 260 seconds)
2023-10-20 20:34:52 +0200 <EvanR> the 7 day cycle predates the gregorian and julian calendars
2023-10-20 20:34:52 +0200 <Inst> nope, indigenous people's day overlaps with columbus day?
2023-10-20 20:36:38 +0200 <geekosaur> yes. think about it
2023-10-20 20:36:57 +0200 <geekosaur> it was the start of wiping out North America's indigenous people
2023-10-20 20:37:21 +0200 <EvanR> validPartyDays = interleave [today ..] [yesterday, yesterday - 1 ..]
2023-10-20 20:37:23 +0200 <geekosaur> rgw, this started as a side discussion
2023-10-20 20:37:29 +0200nickiminjaj(~nickiminj@user/laxhh) (Read error: Connection reset by peer)
2023-10-20 20:37:33 +0200 <rgw> could have just called it discovery day
2023-10-20 20:37:40 +0200 <geekosaur> which I set off by pointing out that in the US some weekends extend through Monday
2023-10-20 20:37:49 +0200 <Inst> ehh, #haskell-offtopic
2023-10-20 20:38:03 +0200 <Inst> since this is pretty brutal politics
2023-10-20 20:38:09 +0200 <geekosaur> presumably it'll change in the future; see the history of some of the other holidays on the list
2023-10-20 20:38:30 +0200 <rgw> isn't that more of a problem that *weekend* doesn't have a specific definition?
2023-10-20 20:39:12 +0200 <geekosaur> well, yes. isn't there a 4 day work week in at least some parts of europe?
2023-10-20 20:39:28 +0200 <EvanR> they literally defined Weekend specifically as Sat | Sun
2023-10-20 20:39:42 +0200 <rgw> doesn't mean it's right
2023-10-20 20:39:44 +0200 <EvanR> lol
2023-10-20 20:39:52 +0200 <EvanR> wrong definitions
2023-10-20 20:39:59 +0200 <[exa]> friday ain't weekend?
2023-10-20 20:40:21 +0200 <EvanR> we shall not write any haskell code which contradicts the truth
2023-10-20 20:40:24 +0200cpressey(~cpressey@host-92-10-146-234.as13285.net)
2023-10-20 20:40:39 +0200 <Inst> How would dependent types factor into this?
2023-10-20 20:40:43 +0200 <EvanR> lol
2023-10-20 20:40:52 +0200 <geekosaur> there's a "what programmers get wrong about weekends" hiding somewhere in here
2023-10-20 20:41:09 +0200 <Inst> I guess, you could also use phantom types
2023-10-20 20:41:16 +0200nucranium(~nucranium@2a02:8010:6173:0:7d81:65c5:a598:8bba) (Ping timeout: 248 seconds)
2023-10-20 20:41:17 +0200 <rgw> "all i wanted to do is to party"
2023-10-20 20:41:34 +0200 <EvanR> in this channel, it's already the weekend apparently
2023-10-20 20:42:29 +0200 <Inst> I guess you could use GADTs with phantom typing, i.e, Monday :: Day Weekday
2023-10-20 20:42:55 +0200 <rgw> we still don't know what the specific application for this is
2023-10-20 20:43:32 +0200 <rgw> for a general partyday validation i would imagine you'd check for holidays too
2023-10-20 20:43:53 +0200 <rgw> if it's only weekend days, do you really need to put all this typing in the back?
2023-10-20 20:44:05 +0200 <monochrom> <monochrom> (And then laws are complicated, too. >:) )
2023-10-20 20:45:34 +0200hiyori(~hiyori@user/hiyori)
2023-10-20 20:45:52 +0200lortabac(~lortabac@185.238.219.14) (Quit: WeeChat 2.8)
2023-10-20 20:46:04 +0200 <Inst> how would you be able to stuff Day Weekday and Day Weekend into the same list, though?
2023-10-20 20:46:33 +0200pavonia(~user@user/siracusa)
2023-10-20 20:48:08 +0200 <EvanR> who cares
2023-10-20 20:48:15 +0200 <EvanR> don't do that
2023-10-20 20:49:21 +0200 <EvanR> keep your haskell simple unless the complicated version is actually right and actually helpful
2023-10-20 20:50:54 +0200 <Inst> I guess I don't understand the need for a Weekday or Weekend type.
2023-10-20 20:53:38 +0200mc47(~mc47@xmonad/TheMC47) (Remote host closed the connection)
2023-10-20 20:54:08 +0200 <EvanR> it's more of a "can do" than "is needed"
2023-10-20 20:54:30 +0200 <EvanR> modal logic?
2023-10-20 20:57:27 +0200 <Inst> But for the stuffing Day Weekday and Day Weekend into the same list, [Either (Day Weekday) (Day Weekend)]
2023-10-20 20:57:34 +0200 <Inst> woefully unergonomic
2023-10-20 20:59:32 +0200 <Inst> type a || b = Either a b is slightly better -> [ Day Weekday || Day Weekend ]
2023-10-20 20:59:49 +0200 <rgw> i wouldn't use either for that
2023-10-20 21:00:07 +0200 <Inst> What would you use instead?
2023-10-20 21:00:09 +0200 <EvanR> you can already include any weekday in the same list.... [Weekday]
2023-10-20 21:00:20 +0200 <rgw> just Day = Weekend | Weekday
2023-10-20 21:00:49 +0200 <EvanR> no
2023-10-20 21:01:13 +0200 <monochrom> newtype Day = Day Int >:)
2023-10-20 21:01:29 +0200 <Inst> Yeah, sorry, I don't really have much experience with typelevel, and I'm suspecting the reason typelevel can often go badly is because it's used by people using it for the novelty factor, not because there's an actual need for its use, hence lack of experience
2023-10-20 21:01:40 +0200 <monochrom> then just have a lot of smart constructors, smart predicates, and smart pattern synonyms.
2023-10-20 21:02:22 +0200 <rgw> i stilll fail to see the whole application of this
2023-10-20 21:03:25 +0200 <monochrom> Without loss of specificity, you can ask: If weekday values and weekend values have different types, how to put both in the same list. The answer is then existential type to cover both. Without loss of generality, an existential type with only finitely many cases is a sum type, so Either was a good example.
2023-10-20 21:03:28 +0200 <int-e> . o O ( Day = Leap | Standard )
2023-10-20 21:04:45 +0200 <Inst> I still annoyed someone by asking for data inference removing the need to use data / type / newtype keywords
2023-10-20 21:05:24 +0200 <Inst> so you could declare Day = Leap | Standard, and GHC would infer that, because you're defining what looks like a sum type, you mean a data declaration
2023-10-20 21:05:26 +0200 <EvanR> yeah that's pretty annoying
2023-10-20 21:05:37 +0200 <EvanR> do what I mean not what I say design
2023-10-20 21:06:01 +0200 <EvanR> newtypes and data types do different things, there's no way to know what you wanted
2023-10-20 21:06:27 +0200 <EvanR> same for aliases
2023-10-20 21:06:31 +0200 <Inst> you could have it default to newtype for any Foo a = MkFoo a declaration
2023-10-20 21:06:43 +0200 <rgw> does that actually matter though?
2023-10-20 21:06:54 +0200 <EvanR> yes, one is lifted one isn't
2023-10-20 21:07:05 +0200 <monochrom> Actually I would agree with that with a change: Add one more keyword "autoInferDataOrNewtype" for the auto version.
2023-10-20 21:07:27 +0200 <rgw> i thought the only differences were that it's more efficient for the compiler to use newtype when you only have one constructor
2023-10-20 21:07:42 +0200 <monochrom> Because I still want the freedom to say "data X = X Int" and yes I deliberately want X bottom /= bottom.
2023-10-20 21:07:48 +0200 <EvanR> one is lifted, one isn't
2023-10-20 21:08:04 +0200 <EvanR> which in some code can lead to a difference of working or freezing up
2023-10-20 21:08:30 +0200 <Inst> yeah, i know some guy got really pissed off over that, when using newtype broke his attempt to tie the knot on his first project
2023-10-20 21:08:50 +0200 <Inst> which is why cramming Haskell for 3 months before your first project isn't such a good idea
2023-10-20 21:08:58 +0200 <EvanR> imagine if that guy also didn't know which thing he was even specifying because you deleted the syntax xD
2023-10-20 21:09:03 +0200 <monochrom> Well, conversely, there was a time I changed "newtype" to "data" and that broke my recursion. :)
2023-10-20 21:09:31 +0200 <Inst> EvanR: I was more thinking of it as an additional feature, keeping the traditional data / newtype / type keywords
2023-10-20 21:09:37 +0200 <Inst> it'd break punning, though
2023-10-20 21:09:44 +0200 <rgw> weird, the way i've seen newtype explained is it's type but you can use it with classes
2023-10-20 21:09:48 +0200 <monochrom> So I would agree if both an auto way and a manual way were offered. Don't remove the manual way.
2023-10-20 21:09:59 +0200 <Inst> i guess i'm thinking too operationally
2023-10-20 21:10:26 +0200 <Inst> afaik newtype doesn't actually exist at compile-time, it's just a way to tell the compiler to treat values of the type as a separate type
2023-10-20 21:10:27 +0200 <EvanR> Inst, now you need to take a warning from javascript, where "just make more code do something instead of error" leads to less ability for the compiler to tell you you messed up.
2023-10-20 21:10:36 +0200 <rgw> and to prefer newtype when you just have one constructor for purely performance reasons
2023-10-20 21:10:37 +0200 <EvanR> or anything-goes HTML
2023-10-20 21:11:04 +0200 <geekosaur> newtype is a figment of the typechecker
2023-10-20 21:11:29 +0200 <EvanR> rgw, if it was purely performance, then it would have just been an optimization and not controllable
2023-10-20 21:11:33 +0200 <Inst> what do you mean by newtype is unlifted, btw?
2023-10-20 21:11:51 +0200 <geekosaur> X undefined /= undefined
2023-10-20 21:11:56 +0200 <rgw> hence why there is the confusion, i'm guessing
2023-10-20 21:11:59 +0200 <Inst> when you're talking data
2023-10-20 21:12:01 +0200 <geekosaur> sorry, it == undefined for newtype
2023-10-20 21:12:10 +0200 <monochrom> Consider "newtype N = N Int" and "data D = D Int". N bottom = bottom, D bottom /= bottom.
2023-10-20 21:12:11 +0200eggplantade(~Eggplanta@2600:1700:38c5:d800:e1a3:648c:fb34:72ec) (Read error: Connection reset by peer)
2023-10-20 21:12:16 +0200 <geekosaur> for data, X undefined /= undefined
2023-10-20 21:12:24 +0200cpressey(~cpressey@host-92-10-146-234.as13285.net) (Quit: Client closed)
2023-10-20 21:12:25 +0200 <Inst> yeah, data X a = X a; X undefined /= undefined
2023-10-20 21:12:26 +0200 <EvanR> Inst, it means not lifted. So you are asking what is lifted right. Int is a lifted type, it's the set of machine ints plus bottom
2023-10-20 21:12:42 +0200 <monochrom> And then there is something more subtle to tell why "data S = S !Int" is still different from N. >:D
2023-10-20 21:12:44 +0200 <Inst> is the literal definition of lifted implying that it includes bottom?
2023-10-20 21:13:20 +0200 <EvanR> an additional bottom on top of whatever was already there
2023-10-20 21:13:26 +0200 <EvanR> which doesn't happen with newtypes
2023-10-20 21:13:33 +0200 <monochrom> "lifting" means one more bottom, in mathematical contexts.
2023-10-20 21:14:08 +0200 <monochrom> there is also a meaning in operational contexts, consistent with the math meaning
2023-10-20 21:14:44 +0200 <monochrom> Int already has its bottom. D adds one more underneath.
2023-10-20 21:14:52 +0200 <rgw> so why would you use newtype over data?
2023-10-20 21:15:12 +0200 <EvanR> when you want to clone a type exactly, but make sure it's a new type
2023-10-20 21:15:23 +0200 <EvanR> and without any of its instances
2023-10-20 21:15:40 +0200 <Inst> I tried with ghci, but I couldn't validation of this behavior
2023-10-20 21:15:44 +0200 <geekosaur> the usual intent is to copy through via GND the original type's instances, then replace one or more of them
2023-10-20 21:15:46 +0200 <monochrom> When I have "newtype Temperature = T Int" for an easier-to-make-safe temperature type, so I don't need one more bottom.
2023-10-20 21:15:49 +0200 <Inst> newtype Foo a = MkFoo a
2023-10-20 21:15:56 +0200 <Inst> undefined is a member of Foo a
2023-10-20 21:16:23 +0200 <geekosaur> no, undefined is a member of a
2023-10-20 21:16:26 +0200 <Inst> oh, I'm being stupid
2023-10-20 21:16:29 +0200 <monochrom> When I have "newtype Parser a = P (String -> [(a, String)])". Dude, I already have enough bottoms from the function space, I don't need one more bottom.
2023-10-20 21:16:39 +0200 <geekosaur> you cannot habe an undefined in place of a `MkFoo a`
2023-10-20 21:16:51 +0200 <Inst> ghci is accepting undefined :: Foo a
2023-10-20 21:17:21 +0200 <EvanR> yeah bottom :: MkFoo a
2023-10-20 21:17:28 +0200 <EvanR> MkFoo bottom isn't one of them
2023-10-20 21:17:33 +0200 <monochrom> Conversely, I would be more hard pressed to give a good use case for D.
2023-10-20 21:17:36 +0200 <Inst> umm, it won't accept MkFoo because it's not a type
2023-10-20 21:17:50 +0200 <EvanR> oops
2023-10-20 21:18:13 +0200 <monochrom> I mean, apart from teaching my course in which I don't want to spend time explaining newtype so I stick to data. :)
2023-10-20 21:18:35 +0200 <geekosaur> if you specify undefined in place of MkFoo 1 it fires as soon as it's touched (it's strict instead of lazy)
2023-10-20 21:18:44 +0200euleritian(~euleritia@77.22.252.56) (Read error: Connection reset by peer)
2023-10-20 21:18:47 +0200 <monochrom> The purpose of the course is not really Haskell, so I couldn't care less about the benefit of newtype.
2023-10-20 21:18:56 +0200euleritian(~euleritia@ip4d16fc38.dynamic.kabel-deutschland.de)
2023-10-20 21:19:10 +0200 <EvanR> Inst, as an example where undefined won't work, look at Int#
2023-10-20 21:19:17 +0200 <EvanR> Int# has no bottoms
2023-10-20 21:19:24 +0200 <Inst> yeah, i know, because it has a...
2023-10-20 21:19:33 +0200 <EvanR> because it's not lifted
2023-10-20 21:19:45 +0200 <EvanR> and it's the wrong kind
2023-10-20 21:19:58 +0200 <monochrom> Yeah "data Int = I# Int#" gives you the sole bottom.
2023-10-20 21:20:21 +0200 <Inst> hmmm, i can't make a newtype over the prim, right?
2023-10-20 21:20:29 +0200 <monochrom> In the case of Int, the operational meaning is actually more helpful.
2023-10-20 21:20:52 +0200 <Inst> newtype's limited to Type
2023-10-20 21:21:05 +0200 <monochrom> The type Int# does not allow a thunk. The type Int, with a real data constructor, does.
2023-10-20 21:21:17 +0200 <monochrom> So Int can be lazy, Int# can't.
2023-10-20 21:22:45 +0200 <EvanR> Inst, I was able to newtype over Int# using UnliftedNewtypes
2023-10-20 21:22:55 +0200 <monochrom> :D
2023-10-20 21:23:01 +0200 <Inst> is that 9.8.1?
2023-10-20 21:23:05 +0200 <monochrom> "There is an extension for that."
2023-10-20 21:23:16 +0200 <Inst> oh, I misspelled it
2023-10-20 21:23:16 +0200 <Inst> :(
2023-10-20 21:23:22 +0200 <EvanR> 9.6.2
2023-10-20 21:25:23 +0200 <EvanR> semantic elements of Maybe Int... ⊥, Just ⊥, Just 3
2023-10-20 21:25:45 +0200 <EvanR> semantic elements of newtype N = N Int... ⊥, 3
2023-10-20 21:25:55 +0200 <EvanR> er, N 3
2023-10-20 21:26:00 +0200 <monochrom> :)
2023-10-20 21:26:39 +0200 <Inst> https://media.discordapp.net/attachments/968989726633779215/1165008083156729956/image.png?ex=65454…
2023-10-20 21:26:58 +0200 <EvanR> :t undefined
2023-10-20 21:26:59 +0200 <lambdabot> a
2023-10-20 21:27:16 +0200 <EvanR> uh bring forth the full polykinded signature
2023-10-20 21:27:28 +0200 <Inst> signature of what?
2023-10-20 21:27:31 +0200 <EvanR> undefined
2023-10-20 21:27:37 +0200 <Inst> :k undefined seems to be k
2023-10-20 21:27:38 +0200 <lambdabot> error: Not in scope: type variable ‘undefined’
2023-10-20 21:27:38 +0200 <lambdabot> error: Not in scope: type variable ‘seems’
2023-10-20 21:27:38 +0200 <lambdabot> error: Not in scope: type variable ‘to’
2023-10-20 21:27:39 +0200 <Inst> which is weird
2023-10-20 21:27:52 +0200 <Inst> :k undefined
2023-10-20 21:27:53 +0200 <lambdabot> error: Not in scope: type variable ‘undefined’
2023-10-20 21:28:05 +0200 <EvanR> :k takes a type
2023-10-20 21:28:23 +0200 <Inst> yeah, and here undefined is treated as a type variable of kind k
2023-10-20 21:28:31 +0200 <Inst> at least on ghci
2023-10-20 21:28:51 +0200 <tomsmeding> % :set -fprint-explicit-kinds -fprint-explicit-runtime-reps -fprint-explicit-foralls
2023-10-20 21:28:51 +0200 <yahb2> <no output>
2023-10-20 21:28:57 +0200 <geekosaur> :t undefined
2023-10-20 21:28:58 +0200 <tomsmeding> % :t undefined -- EvanR
2023-10-20 21:28:58 +0200 <yahb2> undefined -- EvanR ; :: forall (r :: GHC.Types.RuntimeRep) (a :: TYPE r). ; GHC.Stack.Types.HasCallStack => ; a
2023-10-20 21:28:58 +0200 <lambdabot> a
2023-10-20 21:29:09 +0200 <EvanR> thanks
2023-10-20 21:29:16 +0200 <monochrom> This is where the type system protects you. :)
2023-10-20 21:29:34 +0200 <tomsmeding> the HasCallStack is actually different though
2023-10-20 21:29:48 +0200 <tomsmeding> that changed in 9.2
2023-10-20 21:30:03 +0200 <monochrom> In particular, the levity subsystem.
2023-10-20 21:30:42 +0200 <monochrom> In "a :: *", the * means lifted types. Your unlifted newtype therefore is incompatible.
2023-10-20 21:31:10 +0200Simikando(~Simikando@adsl-dyn158.91-127-59.t-com.sk) (Quit: Leaving)
2023-10-20 21:31:14 +0200 <Inst> :i Type
2023-10-20 21:31:21 +0200 <geekosaur> no :i in lambdabot
2023-10-20 21:31:27 +0200 <geekosaur> it's not ghci
2023-10-20 21:31:28 +0200 <Inst> % :i
2023-10-20 21:31:28 +0200 <yahb2> syntax: ':i <thing-you-want-info-about>'
2023-10-20 21:31:38 +0200 <Inst> % :i Type
2023-10-20 21:31:39 +0200 <yahb2> <interactive>:1:1: error: Not in scope: ‘Type’
2023-10-20 21:31:44 +0200 <tomsmeding> % import Data.Kind
2023-10-20 21:31:45 +0200 <yahb2> <no output>
2023-10-20 21:31:47 +0200 <Inst> % import GHC.Types
2023-10-20 21:31:48 +0200 <yahb2> <no output>
2023-10-20 21:31:48 +0200 <Inst> % :i Type
2023-10-20 21:31:49 +0200 <yahb2> type Type :: * ; type Type = TYPE LiftedRep ; -- Defined in ‘GHC.Types’
2023-10-20 21:32:57 +0200 <Inst> by the way, is it irresponsible to point out that Setup.hs can be used to execute arbitrary code?
2023-10-20 21:33:17 +0200 <tomsmeding> tell me a build system where the build tool cannot be used to execute arbitrary code
2023-10-20 21:33:36 +0200 <tomsmeding> okay perhaps that's not too hard
2023-10-20 21:33:40 +0200 <EvanR> blockchain something or other
2023-10-20 21:33:45 +0200 <tomsmeding> but a lot of systems allow that somehow or other
2023-10-20 21:33:51 +0200 <tomsmeding> even Rust succumbed with build.rs
2023-10-20 21:34:04 +0200 <tomsmeding> and I mean, haskell has TemplateHaskell anyhow if you get past Setup.hs
2023-10-20 21:35:05 +0200 <darkling> That'd be because few applications consist *only* of compiling things in a single language.
2023-10-20 21:35:58 +0200 <darkling> You have to have extensibility of the build system to cope with those things that aren't just the code.
2023-10-20 21:36:16 +0200 <EvanR> Inst, software programming types can't realistically be kept ignorant of the vast number of security issues in basically every task they perform. But maybe the real answer is you're in dangerous of insulting the intelligence of whoever reads that warning
2023-10-20 21:36:32 +0200 <EvanR> danger*
2023-10-20 21:36:39 +0200 <darkling> Building docs, images for the UI, supporting scripts, ...
2023-10-20 21:37:24 +0200 <EvanR> any time anyone shares code anywhere, that is arbitrary code
2023-10-20 21:37:28 +0200 <darkling> (Sorry, pet peeve -- all language-specific build systems are crap. Make is only slightly less crap, in the general case.)
2023-10-20 21:37:55 +0200CiaoSen(~Jura@2a05:5800:282:6600:664b:f0ff:fe37:9ef)
2023-10-20 21:37:56 +0200nate2(~nate@c-98-45-169-16.hsd1.ca.comcast.net)
2023-10-20 21:38:48 +0200 <monochrom> tomsmeding: I forgot, does Ant count? (The Java build tool.) :)
2023-10-20 21:39:49 +0200 <tomsmeding> monochrom: why do you ask me? The only times I programmed java were for some uni assignment using the Play framework (shudder) and in Android Studio
2023-10-20 21:39:52 +0200 <tomsmeding> I know ~0 about java
2023-10-20 21:39:53 +0200 <darkling> Ant's extensible to arbitrary actions, IIRC.
2023-10-20 21:40:13 +0200 <darkling> And the only reason ant isn't the bottom of my all-time hated build systems is because maven.
2023-10-20 21:40:28 +0200 <Inst> nah, just off-handedly, I want to mention that the UserHooks datatype in Cabal's core Cabal package can have IO values injected into them via defaultMainWithHooks (and relatives) IO functions
2023-10-20 21:40:39 +0200 <monochrom> Its bottom all the way down. :)
2023-10-20 21:40:46 +0200 <monochrom> Err, It's!
2023-10-20 21:40:50 +0200 <EvanR> I compiled hello world in java once
2023-10-20 21:40:56 +0200 <Inst> and consequently it makes more sense to treat it relative to the default values
2023-10-20 21:42:34 +0200nate2(~nate@c-98-45-169-16.hsd1.ca.comcast.net) (Ping timeout: 245 seconds)
2023-10-20 21:48:12 +0200__monty__(~toonn@user/toonn) (Ping timeout: 240 seconds)
2023-10-20 21:48:41 +0200 <Guest86> Hi guys, I have pasted the exact problem I had and my solution for it here https://pastebin.com/iXcpME7m
2023-10-20 21:49:36 +0200 <Guest86> It is an exercise from chapter 3 of https://github.com/kowainik/learn4haskell
2023-10-20 21:50:29 +0200 <Guest86> My single line comments are what I wanted to do but couldn't
2023-10-20 21:50:51 +0200eggplantade(~Eggplanta@104-55-37-220.lightspeed.sntcca.sbcglobal.net)
2023-10-20 21:51:21 +0200 <EvanR> AcAttack used as constructor name in two types in the same module, can't be done
2023-10-20 21:52:19 +0200 <dminuoso> darkling: There are no beloved build systems.
2023-10-20 21:52:49 +0200 <Guest86> Yes. So do I have to define new constructors even though they mean the same thing and make function to convert between them? It seems too much to do for something simple
2023-10-20 21:53:10 +0200xigua(~xigua@user/xigua) (Remote host closed the connection)
2023-10-20 21:53:36 +0200 <dminuoso> Guest86: You could extract commonalities into separate data types.
2023-10-20 21:53:45 +0200xigua(~xigua@user/xigua)
2023-10-20 21:53:56 +0200 <dminuoso> Or use a higher kinded data type
2023-10-20 21:54:49 +0200 <Guest86> Here, `Action` is the union of `KnightAction` and `MonsterAction`. Or atleast, I would like it to be
2023-10-20 21:54:54 +0200 <dminuoso> Guest86: Or you use the HasX pattern.
2023-10-20 21:55:15 +0200 <dminuoso> (optics/lens can help with much of such access patterns)
2023-10-20 21:55:19 +0200 <EvanR> uhg
2023-10-20 21:55:30 +0200 <EvanR> yes it can get arbitrarily complicated
2023-10-20 21:55:46 +0200 <dminuoso> Guest86: I personally would probably stop trying to encode too much of game logic into data types.
2023-10-20 21:55:47 +0200 <ddellacosta> Guest86: consider making data CharacterAction = KnightAction Action | MonsterAction Action, which you can then dispatch on in functions without needing type classes
2023-10-20 21:56:17 +0200 <ddellacosta> but, lots of ways to slice it
2023-10-20 21:56:18 +0200azimut(~azimut@gateway/tor-sasl/azimut) (Ping timeout: 256 seconds)
2023-10-20 21:56:51 +0200 <EvanR> .oO( make 1 action type only some values of which are relevant to the player or the monster respectively )
2023-10-20 21:57:26 +0200 <EvanR> but it depends on if you want to get things done, or get into type system geekery
2023-10-20 21:57:26 +0200 <geekosaur> I suggested that in -beginners
2023-10-20 21:57:30 +0200 <dminuoso> Guest86: I think its more valuable to have one big action data type in this type of scenarios.
2023-10-20 21:58:44 +0200 <dminuoso> As long as the actions are, in principle, not breaking, it doesnt seem wrong to just not care about provenance too much.
2023-10-20 21:59:04 +0200 <dminuoso> Especially because you can control what actions are emitted on the entity side
2023-10-20 21:59:41 +0200 <dminuoso> Consider: The issuable actions might depend on surrounding conditions (maybe if you are *muted* you cant cast spells, or if you are *confused* you cant attack)
2023-10-20 22:00:02 +0200 <Guest86> I am doing this just to get accustomed to data, newtype and typeclasses. I just wanted to know if there is a simple way to get things done compared to what I have done
2023-10-20 22:00:15 +0200 <dminuoso> Guest86: The simple way is what you have done.
2023-10-20 22:00:43 +0200nickiminjaj(~nickiminj@188.146.126.78)
2023-10-20 22:00:43 +0200nickiminjaj(~nickiminj@188.146.126.78) (Changing host)
2023-10-20 22:00:43 +0200nickiminjaj(~nickiminj@user/laxhh)
2023-10-20 22:01:17 +0200 <Guest86> Ah, thanks.
2023-10-20 22:01:52 +0200 <Guest86> I have one part incomplete though, `-- duel :: (Fighter a, Fighter b) => a -> b -> Either a b`
2023-10-20 22:02:33 +0200 <Guest86> I would like the duel to take a knight and a monster as params but as per current implementation, both have to be of same type
2023-10-20 22:03:05 +0200 <EvanR> what happens if you uncomment that type signature
2023-10-20 22:03:40 +0200 <EvanR> well, you're not returning an Either so there's that issue
2023-10-20 22:03:54 +0200 <EvanR> on 85
2023-10-20 22:04:46 +0200__monty__(~toonn@user/toonn)
2023-10-20 22:06:05 +0200 <EvanR> I see you're swapping the sides of the combatants each recursive loop, so you're going to have a hard time returning the correct type, because you don't know who will when ahead of time
2023-10-20 22:06:32 +0200 <EvanR> if the monster wins on even or odd loops, you have to return a different Either
2023-10-20 22:06:41 +0200 <Guest86> Yeah ;(
2023-10-20 22:07:40 +0200darkling(~darkling@2001-ba8-1f1-f0e6-0-0-0-2.autov6rev.bitfolk.space) (Summoning his cosmic powers, and glowing slightly from his toes...)
2023-10-20 22:07:49 +0200darkling(~darkling@2001-ba8-1f1-f0e6-0-0-0-2.autov6rev.bitfolk.space)
2023-10-20 22:09:18 +0200myme(~myme@2a01:799:d60:e400:ffa9:e6a9:c6a3:3d47) (Quit: WeeChat 4.0.5)
2023-10-20 22:09:42 +0200 <EvanR> you can probably do something to make it work, but it's not going to be comprehensible by most mortals I'm thinking xD
2023-10-20 22:10:09 +0200 <EvanR> I'm leaning toward duel taking 2 of the same type instead of two different types
2023-10-20 22:10:26 +0200 <EvanR> unless you want to rewrite it to not do the swapping
2023-10-20 22:11:32 +0200_ht(~Thunderbi@28-52-174-82.ftth.glasoperator.nl) (Remote host closed the connection)
2023-10-20 22:11:55 +0200 <Guest86> by rewriting
2023-10-20 22:11:57 +0200 <Guest86> data Fighter = MkFighter
2023-10-20 22:11:58 +0200 <Guest86>   { health  :: Health
2023-10-20 22:11:58 +0200 <Guest86>   , attack  :: Attack
2023-10-20 22:11:59 +0200 <Guest86>   , defense :: Defense
2023-10-20 22:11:59 +0200 <Guest86>   , actions :: [Action]
2023-10-20 22:12:00 +0200 <Guest86>   }
2023-10-20 22:12:00 +0200 <Guest86> type Knight  = Fighter
2023-10-20 22:12:01 +0200 <Guest86> type Monster = Fighter
2023-10-20 22:12:01 +0200 <Guest86> act x = x { actions = tail $ actions x }
2023-10-20 22:12:02 +0200 <Guest86> duel :: Fighter -> Fighter -> Fighter
2023-10-20 22:12:02 +0200 <Guest86> duel x y = case head $ actions x of
2023-10-20 22:12:03 +0200 <Guest86>   AcAttack       xa -> duel (y { health = health y - (Health xa) }) (act y)
2023-10-20 22:12:03 +0200 <Guest86>   AcPotion       xa -> duel y (x { health = health x + (Health xa) })
2023-10-20 22:12:04 +0200 <Guest86>   AcDefenseSpell xa -> duel y (x { defense = defense x + (Defense xa) })
2023-10-20 22:12:04 +0200 <Guest86>   AcRunAway         -> y
2023-10-20 22:12:09 +0200 <geekosaur> please use a paste site
2023-10-20 22:12:13 +0200 <geekosaur> @where paste
2023-10-20 22:12:13 +0200 <lambdabot> Help us help you: please paste full code, input and/or output at e.g. https://paste.tomsmeding.com
2023-10-20 22:12:57 +0200ystael(~ystael@user/ystael)
2023-10-20 22:13:10 +0200 <Guest86> my bad. here it is https://pastebin.com/aRQ4Qs7V
2023-10-20 22:13:20 +0200 <EvanR> you seem to have lost fighter x in the AcAttack case
2023-10-20 22:13:32 +0200 <geekosaur> (you got lucky the spambot didn't kline you)
2023-10-20 22:14:05 +0200 <Guest86> EvanR ah the act y is act x
2023-10-20 22:14:24 +0200 <Guest86> geekosaur thanks for letting me know '=D
2023-10-20 22:15:05 +0200 <EvanR> to not do the swapping you can factor out the battle code to a non-recursive function which returns results
2023-10-20 22:15:19 +0200 <EvanR> then recurse based on that without swapping the positions
2023-10-20 22:15:53 +0200 <Guest86> it has to go on till the health reaches 0. though I forgot to add that case
2023-10-20 22:16:04 +0200 <Guest86> so it has to be a recursive function
2023-10-20 22:16:28 +0200 <EvanR> yes but it doesn't need to swap the order of arguments, as slick as that would be
2023-10-20 22:16:41 +0200 <EvanR> it's logically problematic
2023-10-20 22:17:03 +0200 <Guest86> Ah, I got what you mean, I will have to write 2 functions, one makes the first param act and the other makes the second param act
2023-10-20 22:17:39 +0200 <EvanR> duel fighter1 fighter2 OnesTurn = case doRound fighter1 fighte2 of...
2023-10-20 22:17:54 +0200 <EvanR> duel fighter1 fighter2 TwosTurn = case doRound fighter2 fighter1 of ...
2023-10-20 22:18:27 +0200 <Guest86> (y)
2023-10-20 22:19:05 +0200 <EvanR> I don't think I understand what you said, but certainly there's not one way to do it
2023-10-20 22:19:13 +0200Square(~Square@user/square) (Ping timeout: 260 seconds)
2023-10-20 22:19:28 +0200 <Guest86> for this particular problem, does using typeclasses bring any additional benifit?
2023-10-20 22:19:38 +0200 <EvanR> personally I doubt it xD
2023-10-20 22:19:48 +0200 <Guest86> My second solution was simple, far less code too
2023-10-20 22:20:08 +0200pixelmonk(~pixelmonk@173.46.79.26)
2023-10-20 22:20:35 +0200 <Guest86> Thanks a lot EvanR and geekosaur
2023-10-20 22:20:48 +0200lunalaya42(~kody@user/lunalaya42)
2023-10-20 22:21:13 +0200 <Guest86> I guess, I will have to try out more examples to get  when to use typeclasses and also the newtype
2023-10-20 22:21:39 +0200 <Guest86> at this moment, I don't see any benefit of using `newtype` over `data` and `type`
2023-10-20 22:22:12 +0200 <EvanR> they do 3 different things so it's usually not a bikesheddable choice
2023-10-20 22:22:38 +0200 <Guest86> I get the difference between data and type
2023-10-20 22:23:12 +0200 <EvanR> between newtype and data, only data lets you do e.g. data Two a = Two a a
2023-10-20 22:23:25 +0200 <Guest86> but isnt newtype just a special case of data
2023-10-20 22:23:25 +0200Maxdamantus(~Maxdamant@user/maxdamantus) (Ping timeout: 252 seconds)
2023-10-20 22:23:40 +0200 <EvanR> newtype is only allowed if there is 1 constructor with 1 component
2023-10-20 22:24:12 +0200 <Guest86> so any usecase where I would have to use newtype instead of data?
2023-10-20 22:24:50 +0200 <dminuoso> Guest86: newtype isnt quite a special case of data because it has no separate runtime representation
2023-10-20 22:24:57 +0200 <dminuoso> It's rather different in this respect.
2023-10-20 22:25:20 +0200 <dminuoso> Consequently a newtype doesnt provide a "layer" when it comes to lazyness
2023-10-20 22:25:32 +0200 <EvanR> you reach for newtypes when you want to clone a datatype and treat it as a new type for reasons
2023-10-20 22:25:49 +0200 <EvanR> with the benefit of having zero runtime cost
2023-10-20 22:26:31 +0200 <dminuoso> Guest86: So for instance is you wrap `Int` with `data` and then do arithmatic, you will probably tank the native computation speed. With newtype it will be just as fast as if you had used Int.
2023-10-20 22:26:33 +0200pixelmonk(~pixelmonk@173.46.79.26) (Quit: WeeChat 4.1.0)
2023-10-20 22:26:49 +0200 <dminuoso> (In reality its a bit more blurry, and there are exceptions to both sides)
2023-10-20 22:26:54 +0200 <dminuoso> But its a rough approximatino.
2023-10-20 22:27:35 +0200 <Guest86> just curious, why isn't `data` with a single constructor and a single type internally converted to `newtype`?
2023-10-20 22:27:50 +0200 <EvanR> that would make Int itself impossible
2023-10-20 22:27:52 +0200 <geekosaur> didnt we have this discussion earlier?
2023-10-20 22:27:54 +0200 <EvanR> yeah
2023-10-20 22:28:14 +0200 <geekosaur> `data X a = X a` has one more bottom than `newtype X a = X a`
2023-10-20 22:28:15 +0200 <Guest86> my bad. I missed it I guess
2023-10-20 22:28:32 +0200 <Guest86> what does bottom mean here?
2023-10-20 22:28:41 +0200 <EvanR> data Int = I# Int# where Int# is an unboxed machine int primitive type
2023-10-20 22:28:55 +0200 <EvanR> if you automatically make that a newtype, then you can't give Int to polymorphic functions anymore
2023-10-20 22:28:55 +0200 <geekosaur> a possibly nonterminating computation
2023-10-20 22:29:11 +0200 <geekosaur> which sounds bad but it also enables laziness
2023-10-20 22:29:41 +0200 <geekosaur> so for example `Int#` has no bottoms and can't be lazy, but `Int` has a bottom and can be lazy
2023-10-20 22:30:08 +0200 <geekosaur> `data` adds an additional possible level of laziness over te contained value
2023-10-20 22:31:28 +0200 <EvanR> Guest86, honestly, maybe scroll up and reread the section on bottoms and newtypes xD
2023-10-20 22:31:33 +0200 <geekosaur> given `data X = X Int`, you can have laziness at the X level and at the Int level but not at the underlying Int# level
2023-10-20 22:33:28 +0200 <lunalaya42> Is this an okay place to ask questions about category theory?
2023-10-20 22:33:30 +0200pixelmonk(~pixelmonk@173.46.79.26)
2023-10-20 22:33:35 +0200 <dminuoso> lunalaya42: Sure.
2023-10-20 22:34:14 +0200 <Inst> ...
2023-10-20 22:34:42 +0200 <geekosaur> Guest86, the relationship between laziness and nontermination is that we can have "infinite" but lazy actions, which therefore can be "interrupted"
2023-10-20 22:34:49 +0200 <geekosaur> > [0..]
2023-10-20 22:34:51 +0200 <lambdabot> [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,2...
2023-10-20 22:35:37 +0200 <geekosaur> when the bot reaches its output limit, it stops demanding values from the infinite sequence of Integers starting with 0, so we don't actually have the infinite loop it would otherwise imply
2023-10-20 22:38:38 +0200 <EvanR> though the list constructions have 2 components each, the number and the rest of the list, so it can't be a newtype anyway
2023-10-20 22:39:05 +0200 <EvanR> 0 : (1 : (2 : (3 : ...
2023-10-20 22:39:35 +0200 <geekosaur> and each colon / list constructor marks a point where laziness is injected into the result
2023-10-20 22:39:35 +0200 <lunalaya42> Going through Bartosz Milewski's book, what is the usefullness of the universal construction? Specifically the notion of product. Is it better than enumerating all the morphisms?
2023-10-20 22:39:36 +0200takuan(~takuan@178-116-218-225.access.telenet.be) (Remote host closed the connection)
2023-10-20 22:40:46 +0200Pickchea(~private@user/pickchea)
2023-10-20 22:42:02 +0200 <EvanR> I had a hard to identifying anything useful in Bartosz's book, it was like a pile of things that just are
2023-10-20 22:42:16 +0200 <Inst> which book, anyways?
2023-10-20 22:42:42 +0200__monty__(~toonn@user/toonn) (Quit: leaving)
2023-10-20 22:43:32 +0200pretty_dumm_guy(trottel@gateway/vpn/protonvpn/prettydummguy/x-88029655) (Ping timeout: 255 seconds)
2023-10-20 22:43:35 +0200 <Guest86> Thanks a lot geekosaur and EvanR, I went through all the previous conversation as well
2023-10-20 22:44:24 +0200 <EvanR> https://bartoszmilewski.com/2014/10/28/category-theory-for-programmers-the-preface/
2023-10-20 22:45:05 +0200 <lunalaya42> That's good to know too, any recommendations? I'm coming from an engineering background, so formal math is a bit rough
2023-10-20 22:45:06 +0200 <Inst> i mean, iirc, he has multiple books
2023-10-20 22:45:23 +0200 <EvanR> oh
2023-10-20 22:45:23 +0200pretty_dumm_guy(trottel@gateway/vpn/protonvpn/prettydummguy/x-88029655)
2023-10-20 22:45:59 +0200 <dolio> Universal constructions are the category theory version of (co)data types.
2023-10-20 22:46:17 +0200Guest86(~Guest86@14.139.128.51) (Quit: Client closed)
2023-10-20 22:46:58 +0200 <mauke> are you allowed to enumerate all morphisms? what if there are too many?
2023-10-20 22:47:02 +0200 <Inst> https://github.com/BartoszMilewski/Publications/blob/master/TheDaoOfFP/DaoFP.pdf
2023-10-20 22:47:05 +0200 <Inst> the other one i'm aware of
2023-10-20 22:49:34 +0200 <EvanR> oh, is the notion of a product to be compared to the notion of "enumerating" every pair of objects and associated projections. Like the idea of a function that squares a number vs giving a list of all possible squares
2023-10-20 22:49:51 +0200 <EvanR> recipe vs an infinite number of pies
2023-10-20 22:50:47 +0200 <EvanR> lunalaya42, have you see any of these youtube-ified talks by conal elliott about compiling functional programs to hardware "via categories" ? Seems more engineeringy
2023-10-20 22:52:07 +0200tomsmedingfeels that the compiling to categories work is overengineering a bit
2023-10-20 22:52:21 +0200 <EvanR> https://begriffs.com/posts/2015-06-28-haskell-to-hardware.html
2023-10-20 22:52:29 +0200 <tomsmeding> why move to categorical combinators when we have a perfectly fine pointful representation: the lambda calculus?
2023-10-20 22:53:11 +0200 <tomsmeding> certain things get a bit nicer because you have more explicit data flow, but you can do more explicit data flow in the lambda calculus as well if you use a linear type system
2023-10-20 22:53:34 +0200 <EvanR> lambdas are cool on paper
2023-10-20 22:54:00 +0200 <dminuoso> lunalaya42: Think of it as just a silly example to practice universal construction, really.
2023-10-20 22:54:05 +0200 <tomsmeding> I mean, the transformation from lambda calculus to categorical combinators is not work-preserving!
2023-10-20 22:54:13 +0200 <lunalaya42> mauke: I guess that makes sense, but then I don't see how you retain information. The example he gives is that the product in a poset is the minimum of objects. How does that maintain the information stored in both objects?
2023-10-20 22:54:37 +0200 <tomsmeding> variable references are O(1) in the lambda calculus but are O(number of variables in scope) in combinators naively, and O(log(number of variables in scope)) in the best case
2023-10-20 22:54:40 +0200 <dminuoso> Im not sure that universal construction makes much sense if you're not in the business of writing proofs, for instance.
2023-10-20 22:54:41 +0200megaTherion(~therion@unix.io) (Quit: ZNC 1.8.2 - https://znc.in)
2023-10-20 22:55:08 +0200 <EvanR> depending on the transformation you don't have variables?
2023-10-20 22:55:18 +0200 <EvanR> only combinators
2023-10-20 22:55:28 +0200 <EvanR> possibly a lot more
2023-10-20 22:55:51 +0200 <tomsmeding> EvanR: sure, but the point is that I can write a LC program that uses a lot of variables; the program you get if you convert that to categorical combinators will be less efficient
2023-10-20 22:56:03 +0200 <tomsmeding> because it'll need to encode the environment as a bunch of nested tuples
2023-10-20 22:56:13 +0200 <tomsmeding> projection of a single element from which is not O(1)
2023-10-20 22:57:38 +0200 <EvanR> it's possible there are optimizations to perform after the translation
2023-10-20 22:57:52 +0200megaTherion(~therion@unix.io)
2023-10-20 22:58:05 +0200 <EvanR> and the actual combinators you pick for all this makes a big difference
2023-10-20 22:58:55 +0200 <tomsmeding> I guess -- I only read the 'compiling to categories' paper, didn't watch the videos, maybe there's more stuff there
2023-10-20 22:59:03 +0200 <EvanR> and in their case that optimizer was GHC
2023-10-20 22:59:43 +0200 <EvanR> er, GHC happens before the categories
2023-10-20 22:59:50 +0200 <tomsmeding> well, and after
2023-10-20 23:00:00 +0200 <tomsmeding> if you generate code using it again
2023-10-20 23:02:12 +0200kimiamania4(~b4f4a2ab@user/kimiamania) (Quit: PegeLinux)
2023-10-20 23:02:45 +0200kimiamania46(~b4f4a2ab@user/kimiamania)
2023-10-20 23:08:04 +0200 <dolio> There's no guarantee that things like products in a category have some specific, suboptimal representation that you think might be suggested by a notation for them.
2023-10-20 23:08:24 +0200dhruvasagar(~dhruvasag@49.207.194.211) (Ping timeout: 245 seconds)
2023-10-20 23:08:24 +0200johnw(~johnw@69.62.242.138) (Quit: ZNC - http://znc.in)
2023-10-20 23:08:31 +0200 <tomsmeding> that's fair
2023-10-20 23:08:53 +0200 <tomsmeding> but a roundtrip to haskell would increase work -- that's the setting that I was tacitly assuming
2023-10-20 23:09:03 +0200 <tomsmeding> not much, to be sure
2023-10-20 23:10:11 +0200 <EvanR> haskell to categories, back to haskell for a minute, then finally hardware?
2023-10-20 23:10:16 +0200 <dolio> Like, even if you talk about arbitrary finite products as being built out of binary products A×B, a flat product with efficient projections is a product A×(B×(C×D)), and could be what that nested expression denotes. And you could recognize that the projection to C could be realized directly.
2023-10-20 23:11:43 +0200Jackneill(~Jackneill@20014C4E1E0E6F00109B8E55CC0410BC.dsl.pool.telekom.hu) (Ping timeout: 260 seconds)
2023-10-20 23:12:42 +0200 <dolio> Because A×B just means 'some' choice of products in the cateogry. It doesn't have to be systematically built inductively or something.
2023-10-20 23:13:25 +0200 <dolio> Or naively.
2023-10-20 23:13:35 +0200 <tomsmeding> hm, I guess that's fair
2023-10-20 23:15:17 +0200 <dolio> It's kind of unusual coming from a programming perspective, but that's part of the point of the categorical, 'up to isomorphism' sort of perspective.
2023-10-20 23:15:40 +0200eggplantade(~Eggplanta@104-55-37-220.lightspeed.sntcca.sbcglobal.net) (Ping timeout: 252 seconds)
2023-10-20 23:18:03 +0200srk_(~sorki@user/srk)
2023-10-20 23:18:32 +0200srk(~sorki@user/srk) (Ping timeout: 272 seconds)
2023-10-20 23:20:02 +0200 <dolio> You can imagine data types work that way, too. Although the lifting in Haskell limits how much flattening you could do while preserving semantics.
2023-10-20 23:20:40 +0200monochromis naughty and invents "the Curry-deCarte isomorphism" to mean merely how GHC often compiles Int->Bool->Char to Int×Bool->Char. >:)
2023-10-20 23:20:53 +0200srk_srk
2023-10-20 23:21:52 +0200monochromhas one last joke. co Carte says: coproduct ergo sum. >:D
2023-10-20 23:22:58 +0200megaTherion(~therion@unix.io) (Ping timeout: 272 seconds)
2023-10-20 23:23:29 +0200 <ncf> gito ergo product
2023-10-20 23:23:34 +0200FinnElija(~finn_elij@user/finn-elija/x-0085643) (Ping timeout: 256 seconds)
2023-10-20 23:24:07 +0200 <EvanR> if we change the assocativity of -> does Int->Bool->Char = Int->BoolxChar... *thinks* yes
2023-10-20 23:25:04 +0200FinnElija(~finn_elij@user/finn-elija/x-0085643)
2023-10-20 23:25:29 +0200megaTherion(~therion@unix.io)
2023-10-20 23:25:43 +0200 <EvanR> no
2023-10-20 23:25:50 +0200 <tomsmeding> no, right? char^(bool^int) != bool^int * char^int = (bool*char)^int
2023-10-20 23:26:00 +0200 <monochrom> :)
2023-10-20 23:26:49 +0200 <monochrom> "You may also like: The Yoneda lemma." >:)
2023-10-20 23:27:04 +0200 <EvanR> so suggestive lisp code (-> Int Bool Char) will have to wait
2023-10-20 23:32:06 +0200 <monochrom> In Scheme, (defun (f a b) (...)) actually gives you the uncurried version f :: A × B -> C, because (f a) is an error, you have to say like (curry f a) to get the curried version.
2023-10-20 23:32:20 +0200Unicorn_Princess(~Unicorn_P@user/Unicorn-Princess/x-3540542) (Remote host closed the connection)
2023-10-20 23:33:21 +0200 <EvanR> I kind of appreciate that, in lisp context
2023-10-20 23:33:22 +0200gatekempt(~gatekempt@user/gatekempt) (Quit: My MacBook has gone to sleep. ZZZzzz…)
2023-10-20 23:33:56 +0200 <EvanR> sometimes you just want a A × B × C × D -> E
2023-10-20 23:39:36 +0200oo_miguel(~Thunderbi@78-11-179-96.static.ip.netia.com.pl) (Ping timeout: 260 seconds)
2023-10-20 23:42:17 +0200pixelmonk(~pixelmonk@173.46.79.26) (Quit: WeeChat 4.1.0)
2023-10-20 23:42:31 +0200pixelmonk(~pixelmonk@173.46.79.26)
2023-10-20 23:54:41 +0200lunalaya42(~kody@user/lunalaya42) (Quit: WeeChat 4.0.4)
2023-10-20 23:55:20 +0200Maxdamantus(~Maxdamant@user/maxdamantus)