2024/04/28

2024-04-28 00:01:02 +0200sam113101(~sam@24.157.253.231) (Quit: WeeChat 4.2.2)
2024-04-28 00:01:22 +0200sam113101(~sam@24.157.253.231)
2024-04-28 00:08:40 +0200pavonia(~user@user/siracusa)
2024-04-28 00:11:06 +0200sam113101(~sam@24.157.253.231) (Quit: WeeChat 4.2.2)
2024-04-28 00:11:39 +0200sam113101(~sam@24.157.253.231)
2024-04-28 00:13:08 +0200__monty__(~toonn@user/toonn) (Quit: leaving)
2024-04-28 00:13:18 +0200sam113101(~sam@24.157.253.231) (Client Quit)
2024-04-28 00:13:51 +0200sam113101(~sam@24.157.253.231)
2024-04-28 00:17:28 +0200dispater-(~dispater@host-78-146-88-32.as13285.net)
2024-04-28 00:17:59 +0200orcus-(~orcus@host-78-146-88-32.as13285.net)
2024-04-28 00:18:10 +0200dispater-(~dispater@host-78-146-88-32.as13285.net) (Remote host closed the connection)
2024-04-28 00:18:11 +0200orcus-(~orcus@host-78-146-88-32.as13285.net) (Remote host closed the connection)
2024-04-28 00:21:42 +0200dispater-(~dispater@host-78-146-88-32.as13285.net)
2024-04-28 00:21:58 +0200dispater-(~dispater@host-78-146-88-32.as13285.net) (Remote host closed the connection)
2024-04-28 00:23:11 +0200yin(~yin@user/zero) (Ping timeout: 256 seconds)
2024-04-28 00:25:10 +0200 <dolio> ski gave the right answer. :þ
2024-04-28 00:27:17 +0200orcus-(~orcus@host-78-146-88-32.as13285.net)
2024-04-28 00:27:47 +0200orcus-(~orcus@host-78-146-88-32.as13285.net) (Remote host closed the connection)
2024-04-28 00:36:07 +0200gmg(~user@user/gehmehgeh) (Quit: Leaving)
2024-04-28 00:37:39 +0200yin(~yin@user/zero)
2024-04-28 00:37:52 +0200 <yin> huh?
2024-04-28 00:38:06 +0200 <yin> what is that list?
2024-04-28 00:38:41 +0200peterbecich(~Thunderbi@47.229.123.186) (Ping timeout: 252 seconds)
2024-04-28 00:38:48 +0200 <yin> is it just concurrent output or something else?
2024-04-28 00:41:05 +0200 <dolio> You can think of it as concurrency where the scheduling gets informed by the lazy evaluation.
2024-04-28 00:41:47 +0200 <dolio> When you need something, your thread gets interrupted and the one that was supposed to calculate it runs instead.
2024-04-28 00:42:12 +0200 <yin> got it
2024-04-28 00:45:16 +0200 <geekosaur> unprincipled coroutines
2024-04-28 00:48:41 +0200stiell_(~stiell@gateway/tor-sasl/stiell) (Remote host closed the connection)
2024-04-28 00:49:22 +0200stiell_(~stiell@gateway/tor-sasl/stiell)
2024-04-28 00:57:43 +0200acidjnk(~acidjnk@p200300d6e714dc03d4ff90a1ba0ea518.dip0.t-ipconnect.de) (Ping timeout: 260 seconds)
2024-04-28 00:57:57 +0200 <monochrom> Consider do { x <- unsafeInterleaveIO (writeIORef v 5 >> pure ()); y <- unsafeInterleaveIO (writeIORef v 6 >> pure ()) ; ... }
2024-04-28 00:59:08 +0200 <monochrom> Now v will be 5 or 6 or unchanged at unknown future times depending on when will x or y or neither is evaluated.
2024-04-28 01:03:56 +0200reki(~halloy490@broadband-5-228-80-43.ip.moscow.rt.ru)
2024-04-28 01:05:33 +0200tri(~tri@ool-18bc2e74.dyn.optonline.net)
2024-04-28 01:05:45 +0200reki(~halloy490@broadband-5-228-80-43.ip.moscow.rt.ru) (Remote host closed the connection)
2024-04-28 01:10:04 +0200tri(~tri@ool-18bc2e74.dyn.optonline.net) (Ping timeout: 255 seconds)
2024-04-28 01:12:34 +0200philopsos(~caecilius@user/philopsos)
2024-04-28 01:23:14 +0200[Leary](~Leary]@user/Leary/x-0910699) (Ping timeout: 252 seconds)
2024-04-28 01:25:26 +0200yin(~yin@user/zero) (Ping timeout: 256 seconds)
2024-04-28 01:29:41 +0200madeleine-sydney(~madeleine@c-76-155-235-153.hsd1.co.comcast.net)
2024-04-28 01:44:28 +0200hiredman(~hiredman@frontier1.downey.family) (Quit: Lost terminal)
2024-04-28 01:49:53 +0200smoge(~smoge@2603:7000:4b42:1100:d8aa:e17a:f1f9:f7b4)
2024-04-28 01:50:07 +0200dispater-(~dispater@host-78-146-88-32.as13285.net)
2024-04-28 01:50:50 +0200dispater-(~dispater@host-78-146-88-32.as13285.net) (Remote host closed the connection)
2024-04-28 01:51:23 +0200smoge(~smoge@2603:7000:4b42:1100:d8aa:e17a:f1f9:f7b4) (Client Quit)
2024-04-28 01:54:02 +0200smogeb(~smogeb@2603:7000:4b42:1100:d8aa:e17a:f1f9:f7b4)
2024-04-28 02:03:19 +0200machinedgod(~machinedg@d173-183-246-216.abhsia.telus.net)
2024-04-28 02:04:37 +0200 <EvanR> you could use IVar in the story. the value you get back from executing the unsafeInterleaveIO action could be an IVar behind the scenes. And some thread is responsible for doing the i/o and writing the IVar
2024-04-28 02:07:07 +0200 <smogeb> what's the best book to write a interpreter (that is not scheme) ??
2024-04-28 02:10:22 +0200zetef(~quassel@2a02:2f00:5202:1200:2128:605:71c4:66a4) (Remote host closed the connection)
2024-04-28 02:10:50 +0200euleritian(~euleritia@ip4d16fc38.dynamic.kabel-deutschland.de) (Ping timeout: 268 seconds)
2024-04-28 02:11:12 +0200smogeb(~smogeb@2603:7000:4b42:1100:d8aa:e17a:f1f9:f7b4) (Quit: Client closed)
2024-04-28 02:11:26 +0200 <dolio> EvanR: Right, exactly.
2024-04-28 02:13:21 +0200euleritian(~euleritia@ip4d16fc38.dynamic.kabel-deutschland.de)
2024-04-28 02:22:00 +0200madeleine-sydney(~madeleine@c-76-155-235-153.hsd1.co.comcast.net) (Quit: Konversation terminated!)
2024-04-28 02:28:40 +0200xff0x(~xff0x@2405:6580:b080:900:a359:eeea:f982:7525) (Ping timeout: 245 seconds)
2024-04-28 02:34:03 +0200Tuplanolla(~Tuplanoll@91-159-69-59.elisa-laajakaista.fi) (Quit: Leaving.)
2024-04-28 02:34:04 +0200tromp(~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl)
2024-04-28 02:34:37 +0200tromp(~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Client Quit)
2024-04-28 02:54:22 +0200madeleine-sydney(~madeleine@c-76-155-235-153.hsd1.co.comcast.net)
2024-04-28 02:57:05 +0200y04nn(~username@2a03:1b20:8:f011::e10d) (Ping timeout: 268 seconds)
2024-04-28 03:01:56 +0200mechap(~mechap@user/mechap) (Quit: WeeChat 4.2.2)
2024-04-28 03:07:31 +0200sawilagar(~sawilagar@user/sawilagar) (Ping timeout: 255 seconds)
2024-04-28 03:09:09 +0200jdbres(~jdbres@user/jdbres)
2024-04-28 03:12:09 +0200[Leary](~Leary]@user/Leary/x-0910699)
2024-04-28 03:19:36 +0200euleritian(~euleritia@ip4d16fc38.dynamic.kabel-deutschland.de) (Ping timeout: 268 seconds)
2024-04-28 03:31:23 +0200otto_s(~user@p4ff27de0.dip0.t-ipconnect.de) (Ping timeout: 252 seconds)
2024-04-28 03:33:07 +0200otto_s(~user@p5b0442ac.dip0.t-ipconnect.de)
2024-04-28 03:35:21 +0200waleee(~waleee@h-176-10-144-38.NA.cust.bahnhof.se) (Ping timeout: 272 seconds)
2024-04-28 03:36:00 +0200causal(~eric@50.35.88.207)
2024-04-28 03:37:12 +0200philopsos(~caecilius@user/philopsos) (Ping timeout: 255 seconds)
2024-04-28 03:44:25 +0200L29Ah(~L29Ah@wikipedia/L29Ah) (Read error: Connection reset by peer)
2024-04-28 03:45:28 +0200euleritian(~euleritia@ip4d16fc38.dynamic.kabel-deutschland.de)
2024-04-28 03:58:30 +0200hueso(~root@user/hueso) (Quit: hueso)
2024-04-28 04:00:48 +0200mindofjoe(~joe@user/lighthouse6)
2024-04-28 04:01:41 +0200hueso(~root@user/hueso)
2024-04-28 04:03:08 +0200hueso(~root@user/hueso) (Client Quit)
2024-04-28 04:05:03 +0200op_4(~tslil@user/op-4/x-9116473) (Remote host closed the connection)
2024-04-28 04:05:33 +0200op_4(~tslil@user/op-4/x-9116473)
2024-04-28 04:05:58 +0200machinedgod(~machinedg@d173-183-246-216.abhsia.telus.net) (Ping timeout: 246 seconds)
2024-04-28 04:06:23 +0200hueso(~root@user/hueso)
2024-04-28 04:15:16 +0200hueso(~root@user/hueso) (Quit: hueso)
2024-04-28 04:19:02 +0200hueso(~root@user/hueso)
2024-04-28 04:26:09 +0200xff0x(~xff0x@om126236141098.32.openmobile.ne.jp)
2024-04-28 04:31:57 +0200td_(~td@i5387091B.versanet.de) (Ping timeout: 256 seconds)
2024-04-28 04:33:32 +0200td_(~td@i53870914.versanet.de)
2024-04-28 04:48:11 +0200causal(~eric@50.35.88.207) (Quit: WeeChat 4.1.1)
2024-04-28 04:49:56 +0200causal(~eric@50.35.88.207)
2024-04-28 04:52:51 +0200y04nn(~username@2a03:1b20:8:f011::e10d)
2024-04-28 04:56:56 +0200mrmr1553343(~mrmr@user/mrmr) (Quit: Bye, See ya later!)
2024-04-28 05:01:10 +0200xff0x(~xff0x@om126236141098.32.openmobile.ne.jp) (Read error: Connection reset by peer)
2024-04-28 05:01:35 +0200machinedgod(~machinedg@d173-183-246-216.abhsia.telus.net)
2024-04-28 05:03:07 +0200mrmr1553343(~mrmr@user/mrmr)
2024-04-28 05:10:19 +0200aforemny_(~aforemny@i59f516da.versanet.de)
2024-04-28 05:11:35 +0200aforemny(~aforemny@i59F516DA.versanet.de) (Ping timeout: 260 seconds)
2024-04-28 05:29:05 +0200motherfsck(~motherfsc@user/motherfsck) (Ping timeout: 268 seconds)
2024-04-28 05:29:06 +0200sudden(~cat@user/sudden) (Ping timeout: 252 seconds)
2024-04-28 05:33:40 +0200mrmr1553343(~mrmr@user/mrmr) (Quit: Bye, See ya later!)
2024-04-28 05:39:34 +0200mrmr1553343(~mrmr@user/mrmr)
2024-04-28 05:39:46 +0200sudden(~cat@user/sudden)
2024-04-28 05:42:08 +0200_d0t(~{-d0t-}@user/-d0t-/x-7915216) (Ping timeout: 260 seconds)
2024-04-28 05:45:08 +0200_d0t(~{-d0t-}@user/-d0t-/x-7915216)
2024-04-28 05:50:01 +0200ocra8(ocra8@user/ocra8) (Quit: WeeChat 4.2.2)
2024-04-28 05:54:24 +0200dsrt^(~cd@c-98-242-74-66.hsd1.ga.comcast.net) (Remote host closed the connection)
2024-04-28 06:08:02 +0200jamegwaww(~jamegwaww@2406:4440:0:103::1:c0)
2024-04-28 06:09:02 +0200jamegwaww(~jamegwaww@2406:4440:0:103::1:c0) (Remote host closed the connection)
2024-04-28 06:18:24 +0200jdbres(~jdbres@user/jdbres) (Quit: leaving)
2024-04-28 06:21:57 +0200jdbres(~jdbres@user/jdbres)
2024-04-28 06:23:42 +0200jdbres(~jdbres@user/jdbres) (Client Quit)
2024-04-28 06:23:58 +0200sudden(~cat@user/sudden) (Ping timeout: 268 seconds)
2024-04-28 06:27:36 +0200mindofjoe(~joe@user/lighthouse6) (Quit: Lost terminal)
2024-04-28 06:31:48 +0200 <ski> @hackage ivar-simple
2024-04-28 06:31:48 +0200 <lambdabot> https://hackage.haskell.org/package/ivar-simple
2024-04-28 06:31:49 +0200 <ski> @hackage data-ivar
2024-04-28 06:31:50 +0200 <lambdabot> https://hackage.haskell.org/package/data-ivar
2024-04-28 06:32:29 +0200takuan(~takuan@178-116-218-225.access.telenet.be)
2024-04-28 06:35:59 +0200bilegeek(~bilegeek@2600:1008:b0ad:1165:c160:8ebf:90b8:5ca) (Quit: Leaving)
2024-04-28 06:37:15 +0200chiselfuse(~chiselfus@user/chiselfuse) (Remote host closed the connection)
2024-04-28 06:38:43 +0200chiselfuse(~chiselfus@user/chiselfuse)
2024-04-28 06:44:12 +0200chiselfuse(~chiselfus@user/chiselfuse) (Remote host closed the connection)
2024-04-28 06:45:01 +0200chiselfuse(~chiselfus@user/chiselfuse)
2024-04-28 06:51:10 +0200sudden(~cat@user/sudden)
2024-04-28 06:53:23 +0200szkl(uid110435@id-110435.uxbridge.irccloud.com) (Quit: Connection closed for inactivity)
2024-04-28 06:53:25 +0200jdbres(~jdbres@user/jdbres)
2024-04-28 06:55:04 +0200ddellacosta(~ddellacos@ool-44c73d29.dyn.optonline.net)
2024-04-28 06:55:06 +0200madeleine-sydney(~madeleine@c-76-155-235-153.hsd1.co.comcast.net) (Quit: Konversation terminated!)
2024-04-28 06:55:25 +0200bliminse(~bliminse@user/bliminse)
2024-04-28 07:02:02 +0200jdbres(~jdbres@user/jdbres) (Quit: leaving)
2024-04-28 07:21:41 +0200stiell_(~stiell@gateway/tor-sasl/stiell) (Remote host closed the connection)
2024-04-28 07:24:32 +0200motherfsck(~motherfsc@user/motherfsck)
2024-04-28 07:25:51 +0200stiell_(~stiell@gateway/tor-sasl/stiell)
2024-04-28 07:31:11 +0200motherfsck(~motherfsc@user/motherfsck) (Ping timeout: 268 seconds)
2024-04-28 07:41:55 +0200stiell_(~stiell@gateway/tor-sasl/stiell) (Remote host closed the connection)
2024-04-28 07:42:28 +0200stiell_(~stiell@gateway/tor-sasl/stiell)
2024-04-28 07:46:32 +0200euphores(~SASL_euph@user/euphores) (Quit: Leaving.)
2024-04-28 07:48:35 +0200y04nn(~username@2a03:1b20:8:f011::e10d) (Ping timeout: 256 seconds)
2024-04-28 07:48:41 +0200tabemann_(~tabemann@2600:1700:7990:24e0:42f1:a891:a658:f99d) (Ping timeout: 272 seconds)
2024-04-28 07:56:31 +0200machinedgod(~machinedg@d173-183-246-216.abhsia.telus.net) (Ping timeout: 256 seconds)
2024-04-28 07:56:44 +0200tabemann(~tabemann@172-13-49-137.lightspeed.milwwi.sbcglobal.net)
2024-04-28 07:57:11 +0200tromp(~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl)
2024-04-28 08:05:11 +0200motherfsck(~motherfsc@user/motherfsck)
2024-04-28 08:05:17 +0200philopsos(~caecilius@user/philopsos)
2024-04-28 08:06:41 +0200hammond(proscan@user/hammond2) (Read error: Connection reset by peer)
2024-04-28 08:07:17 +0200tromp(~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
2024-04-28 08:07:59 +0200euphores(~SASL_euph@user/euphores)
2024-04-28 08:11:59 +0200hammond(proscan@gateway02.insomnia247.nl)
2024-04-28 08:13:23 +0200peterbecich(~Thunderbi@47.229.123.186)
2024-04-28 08:14:25 +0200notzmv(~daniel@user/notzmv)
2024-04-28 08:22:11 +0200tromp(~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl)
2024-04-28 08:24:13 +0200famubu(~julinuser@user/famubu)
2024-04-28 08:25:22 +0200 <famubu> Hi. I had been trying to use megaparsec. I was trying use `satisfy` to accept a single upper-case ascii character. So I tried `satisfy Data.Char.isUpper` but that didn't work. The required type mentions `Token`.
2024-04-28 08:41:11 +0200yin(~yin@user/zero)
2024-04-28 09:00:03 +0200tt12310(~tt1231@2603:6010:8700:4a81:219f:50d3:618a:a6ee) (Quit: The Lounge - https://thelounge.chat)
2024-04-28 09:02:55 +0200tt123109(~tt1231@2603:6010:8700:4a81:219f:50d3:618a:a6ee)
2024-04-28 09:14:53 +0200ezzieyguywuf(~Unknown@user/ezzieyguywuf) (Ping timeout: 240 seconds)
2024-04-28 09:17:10 +0200 <[exa]> famubu: what is your parser type? might be the case you are using an overly generic satisfy, or that your stream is not directly compatible with Char (might happen if you parse from bytestrings or so)
2024-04-28 09:18:18 +0200 <[exa]> (if that's the case, I'd say there is a bytestring-compatible variant of isUpper somewhere)
2024-04-28 09:20:49 +0200jinsun(~jinsun@user/jinsun) (Read error: Connection reset by peer)
2024-04-28 09:21:06 +0200ezzieyguywuf(~Unknown@user/ezzieyguywuf)
2024-04-28 09:22:17 +0200philopsos(~caecilius@user/philopsos) (Ping timeout: 252 seconds)
2024-04-28 09:35:23 +0200causal(~eric@50.35.88.207) (Quit: WeeChat 4.1.1)
2024-04-28 09:38:14 +0200gmg(~user@user/gehmehgeh)
2024-04-28 09:38:56 +0200acidjnk(~acidjnk@p200300d6e714dc79605b18ab3e573168.dip0.t-ipconnect.de)
2024-04-28 09:41:32 +0200tromp(~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
2024-04-28 09:41:55 +0200yin(~yin@user/zero) (Ping timeout: 268 seconds)
2024-04-28 09:52:00 +0200peterbecich(~Thunderbi@47.229.123.186) (Ping timeout: 252 seconds)
2024-04-28 09:53:10 +0200_d0t(~{-d0t-}@user/-d0t-/x-7915216) (Ping timeout: 246 seconds)
2024-04-28 10:00:35 +0200yin(~yin@user/zero)
2024-04-28 10:01:35 +0200sawilagar(~sawilagar@user/sawilagar)
2024-04-28 10:02:54 +0200xff0x(~xff0x@softbank219059019218.bbtec.net)
2024-04-28 10:10:15 +0200xff0x(~xff0x@softbank219059019218.bbtec.net) (Ping timeout: 256 seconds)
2024-04-28 10:10:46 +0200Sgeo(~Sgeo@user/sgeo) (Read error: Connection reset by peer)
2024-04-28 10:11:17 +0200rvalue(~rvalue@user/rvalue) (Read error: Connection reset by peer)
2024-04-28 10:11:47 +0200rvalue(~rvalue@user/rvalue)
2024-04-28 10:12:16 +0200 <famubu> [exa]: Sorry, I just had to add an explicit type annotation. It somehow worked with that.
2024-04-28 10:13:16 +0200 <famubu> Now I'm trying to find an upto date tutorial for megaparsec. The official one mentions setting up an operator table with `Operator` type, but can't find that type at all in latest megaparsec repo..
2024-04-28 10:13:32 +0200 <famubu> Or maybe I'm not looking at the right place.
2024-04-28 10:16:25 +0200 <famubu> There seems to be no `import Text.Megaparsec.Expr` in the new megaparsec.
2024-04-28 10:16:32 +0200 <tomsmeding> seems to be gone since 6.0.0
2024-04-28 10:16:54 +0200 <famubu> Yeah.. I was wondering what to use in place of it.
2024-04-28 10:16:59 +0200 <tomsmeding> https://hackage.haskell.org/package/parser-combinators-1.3.0/docs/Control-Monad-Combinators-Expr.h…
2024-04-28 10:17:22 +0200 <tomsmeding> megaparsec was reorganised to depend on `parser-combinators` where most of the higher-level API comes from
2024-04-28 10:18:36 +0200 <famubu> Thanks! Let me try that.
2024-04-28 10:19:17 +0200 <tomsmeding> not sure if the API is _exactly_ the same as in the tutorial you found, but at least it's the same idea
2024-04-28 10:20:03 +0200Tuplanolla(~Tuplanoll@91-159-69-59.elisa-laajakaista.fi)
2024-04-28 10:24:28 +0200euleritian(~euleritia@ip4d16fc38.dynamic.kabel-deutschland.de) (Ping timeout: 268 seconds)
2024-04-28 10:24:40 +0200euleritian(~euleritia@dynamic-176-007-198-087.176.7.pool.telefonica.de)
2024-04-28 10:25:57 +0200tromp(~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl)
2024-04-28 10:27:33 +0200paddymahoney(~paddymaho@pool-99-250-26-190.cpe.net.cable.rogers.com) (Ping timeout: 268 seconds)
2024-04-28 10:28:23 +0200_d0t(~{-d0t-}@user/-d0t-/x-7915216)
2024-04-28 10:28:57 +0200euleritian(~euleritia@dynamic-176-007-198-087.176.7.pool.telefonica.de) (Ping timeout: 255 seconds)
2024-04-28 10:29:40 +0200euleritian(~euleritia@dynamic-176-007-168-231.176.7.pool.telefonica.de)
2024-04-28 10:32:02 +0200ph88(~ph88@ip5b403f30.dynamic.kabel-deutschland.de)
2024-04-28 10:35:03 +0200_ht(~Thunderbi@28-52-174-82.ftth.glasoperator.nl)
2024-04-28 10:37:36 +0200tzh(~tzh@c-73-164-206-160.hsd1.or.comcast.net) (Quit: zzz)
2024-04-28 10:37:50 +0200paddymahoney(~paddymaho@pool-99-250-26-190.cpe.net.cable.rogers.com)
2024-04-28 10:39:45 +0200 <[exa]> famubu: ok so that was likely an ambiguity killing it
2024-04-28 10:41:04 +0200 <[exa]> famubu: re the tutorial, there was a repo with relatively up-to-date examples somewhere (as in, there was a .cabal file and it compiled), I used that for reference
2024-04-28 10:41:40 +0200 <[exa]> (aaaaaaand I can't find it.)
2024-04-28 10:44:48 +0200Rodney_(~Rodney@176.254.244.83) (Ping timeout: 252 seconds)
2024-04-28 10:46:05 +0200 <[exa]> ._.
2024-04-28 10:46:44 +0200L29Ah(~L29Ah@wikipedia/L29Ah)
2024-04-28 10:50:18 +0200yin(~yin@user/zero) (Ping timeout: 252 seconds)
2024-04-28 11:00:02 +0200Rodney_(~Rodney@176.254.244.83)
2024-04-28 11:00:54 +0200poscat0x04(~poscat@user/poscat) (Ping timeout: 255 seconds)
2024-04-28 11:02:49 +0200yin(~yin@user/zero)
2024-04-28 11:09:25 +0200wootehfoot(~wootehfoo@user/wootehfoot) (Read error: Connection reset by peer)
2024-04-28 11:10:46 +0200poscat(~poscat@user/poscat)
2024-04-28 11:14:36 +0200wootehfoot(~wootehfoo@user/wootehfoot)
2024-04-28 11:38:47 +0200wootehfoot(~wootehfoo@user/wootehfoot) (Read error: Connection reset by peer)
2024-04-28 11:40:58 +0200mreh(~matthew@host86-160-168-68.range86-160.btcentralplus.com)
2024-04-28 11:52:47 +0200 <yin> assuming no language extensions other that the default ones, when are type annotations used in pattern matching?
2024-04-28 11:53:20 +0200 <tomsmeding> ScopedTypeVariables is in GHC2021 (if that's what you mean with "the default ones")
2024-04-28 11:54:24 +0200mima(~mmh@eduroam-pool4-264.wlan.uni-bremen.de)
2024-04-28 11:55:29 +0200 <yin> when do we use type annotations in pattern matching with it?
2024-04-28 11:55:46 +0200 <tomsmeding> I think it's never actually necessary
2024-04-28 11:56:15 +0200 <tomsmeding> but it can be helpful, in my experience, in two cases: 1. you want some kind of type annotation on a lambda function but are too lazy to make it a let-defined thing with a type signature
2024-04-28 11:56:30 +0200 <tomsmeding> so you just write (x :: Int) as the argument or something
2024-04-28 11:57:08 +0200 <tomsmeding> or 2. the argument's type has some instantiation of a type variable in it that you need on the type level, and you could get via other means but that would be very cumbersome
2024-04-28 11:57:23 +0200 <tomsmeding> and with ScopedTypeVariables you can bring that thing into scope with a type annotation in a pattern
2024-04-28 11:57:31 +0200 <yin> hmm
2024-04-28 11:57:51 +0200 <tomsmeding> note that type annotations in patterns are just that -- type _annotations_, they don't influence pattern matching, they can only constrain the overall type of the function or bring type variables into scope
2024-04-28 11:58:15 +0200 <tomsmeding> you can't pattern match on types in haskell
2024-04-28 11:58:23 +0200 <yin> in the first case, isn't it always inferred by the type system anyways?
2024-04-28 11:58:25 +0200 <famubu> Type annototaion had a 'type equivalence' thing from Token to Char. That had made the error go away. As in `Token ~ Char`
2024-04-28 11:58:40 +0200 <famubu> I'm sure I'm not using the right term here..
2024-04-28 11:58:49 +0200 <tomsmeding> yin: a typical example of (1.) is https://hackage.haskell.org/package/base-4.19.0.0/docs/Control-Exception.html#v:catch
2024-04-28 11:59:06 +0200 <tomsmeding> you need that e to infer to something specific, usually, and the body of the lambda is typically not enough for that
2024-04-28 11:59:33 +0200 <tomsmeding> famubu: that would be a type equality
2024-04-28 11:59:49 +0200 <famubu> [exa]: 🥴
2024-04-28 11:59:58 +0200 <tomsmeding> famubu: was the error something like "Cannot match type Foo a with Foo a0"?
2024-04-28 11:59:59 +0200 <famubu> tomsmeding: 👍
2024-04-28 12:00:09 +0200 <famubu> Yeah.
2024-04-28 12:00:15 +0200 <tomsmeding> right, that's an ambiguity error
2024-04-28 12:00:46 +0200 <tomsmeding> where ghc sees that your expression is polymorphic, but for some reason (typically a good one in general) it doesn't quite want to just infer that polymorphic type
2024-04-28 12:01:00 +0200 <tomsmeding> perhaps because the polymorphism is constrained in some weird way
2024-04-28 12:01:14 +0200 <yin> tomsmeding: where's the type annotation on pattern matching in 'catch'?
2024-04-28 12:01:34 +0200 <tomsmeding> so then ghc asks you to say precisely what you mean -- some specific instantiation, or an actual polymorphic type where it's then on you to write down what ghc should do
2024-04-28 12:01:54 +0200 <tomsmeding> yin: do you see the `(e :: IOException)` in the example in the haddocks?
2024-04-28 12:02:08 +0200 <yin> yes
2024-04-28 12:02:14 +0200 <tomsmeding> you typically have to manually constrain e somehow, and having to do that on some occurrence in the body is kind of clunky
2024-04-28 12:02:25 +0200 <tomsmeding> it's nicer to write `catch _ (\(e :: IOException) -> ...)`
2024-04-28 12:02:51 +0200 <yin> oh i see
2024-04-28 12:03:10 +0200 <int-e> tomsmeding: oh the cloudatacost.com fan page is gone, so sad. https://web.archive.org/web/20220811231349/https://cloudatacost.com/mystory/original-story-2014
2024-04-28 12:03:26 +0200wootehfoot(~wootehfoo@user/wootehfoot)
2024-04-28 12:03:38 +0200 <yin> somehow i don't consider that to be patter matching. it's just like
2024-04-28 12:03:43 +0200 <yin> > minBound :: Int
2024-04-28 12:03:45 +0200 <lambdabot> -9223372036854775808
2024-04-28 12:03:52 +0200 <int-e> (wrong channel)
2024-04-28 12:04:09 +0200 <tomsmeding> yin: indeed, it's a type annotation that you can put in a convenient spot
2024-04-28 12:05:36 +0200mima(~mmh@eduroam-pool4-264.wlan.uni-bremen.de) (Ping timeout: 268 seconds)
2024-04-28 12:07:19 +0200 <ski> "I think it's never actually necessary" -- introducing a type variable for an opened existential
2024-04-28 12:08:25 +0200 <tomsmeding> you could also write a helper function that you pass your matched things to
2024-04-28 12:08:34 +0200mima(~mmh@eduroam-pool4-264.wlan.uni-bremen.de)
2024-04-28 12:08:47 +0200 <tomsmeding> that helper function could have a type signature from which you can get your type variables with ScopedTypeVariables
2024-04-28 12:08:51 +0200 <tomsmeding> it's a workaround to be sure
2024-04-28 12:09:28 +0200wootehfoot(~wootehfoo@user/wootehfoot) (Read error: Connection reset by peer)
2024-04-28 12:12:32 +0200 <yin> i guess my question is: do we really need the ability to annotate on the function head?
2024-04-28 12:12:47 +0200 <yin> or is it just a convenience
2024-04-28 12:12:47 +0200 <tomsmeding> what does "function head" mean?
2024-04-28 12:12:54 +0200 <tomsmeding> a type annotation in a pattern?
2024-04-28 12:12:59 +0200 <yin> tomsmeding: left of the = on a function definition
2024-04-28 12:13:02 +0200 <yin> or |
2024-04-28 12:13:12 +0200wootehfoot(~wootehfoo@user/wootehfoot)
2024-04-28 12:13:13 +0200 <yin> i man
2024-04-28 12:13:13 +0200 <ski> the definiendum of the defining equation
2024-04-28 12:13:15 +0200 <tomsmeding> it's never strictly necessary, but can be very convenient in some cases
2024-04-28 12:13:15 +0200 <yin> *i mean
2024-04-28 12:13:21 +0200 <yin> forget the |
2024-04-28 12:13:46 +0200 <ski> .. i miss the ability to put a type ascription on the whole definiendum
2024-04-28 12:13:56 +0200 <yin> ski: wdym?
2024-04-28 12:14:13 +0200 <ski> map (f :: a -> b) (xs0 :: [a]) :: [b] = case xs0 of ...
2024-04-28 12:14:23 +0200 <ski> the ` :: [b]' there, specifically
2024-04-28 12:14:26 +0200 <tomsmeding> at that point just write a type signature :p
2024-04-28 12:14:41 +0200 <yin> we can't do that anymore?
2024-04-28 12:15:16 +0200 <yin> foo :: Bool = True -- works just fin
2024-04-28 12:15:21 +0200 <yin> e
2024-04-28 12:15:23 +0200 <ski> yea, but i'd rather have the option to express a full signature in this style, in addition to the usual separate type signature. rather than *almost*, but not quite, being able to do this
2024-04-28 12:15:35 +0200 <ski> yea, but that only works for pattern bindings, yin
2024-04-28 12:15:46 +0200 <ski> unlike in the MLs, where this works just fine
2024-04-28 12:16:02 +0200 <yin> i see
2024-04-28 12:16:55 +0200 <ski> (otoh, the MLs doesn't have separate type signatures, interleaved with implementation. you can only put those in signatures (/ module types))