2023/01/23

2023-01-23 00:03:02 +0100Unicorn_Princess(~Unicorn_P@user/Unicorn-Princess/x-3540542) (Remote host closed the connection)
2023-01-23 00:06:43 +0100mizlan(~mizlan@169.150.203.56)
2023-01-23 00:11:08 +0100mizlan(~mizlan@169.150.203.56) (Ping timeout: 260 seconds)
2023-01-23 00:12:25 +0100urdh(~urdh@user/urdh) (Ping timeout: 260 seconds)
2023-01-23 00:20:04 +0100takuan(~takuan@178-116-218-225.access.telenet.be) (Remote host closed the connection)
2023-01-23 00:22:13 +0100merijn(~merijn@c-001-001-014.client.esciencecenter.eduvpn.nl) (Ping timeout: 256 seconds)
2023-01-23 00:31:59 +0100Alex_test(~al_test@178.34.160.228) (Ping timeout: 264 seconds)
2023-01-23 00:34:44 +0100mizlan(~mizlan@169.150.203.43)
2023-01-23 00:34:49 +0100kimjetwav(~user@2607:fea8:235e:b600:2d68:2d7e:6ecb:730c) (Remote host closed the connection)
2023-01-23 00:35:47 +0100Alex_test(~al_test@178.34.160.228)
2023-01-23 00:43:46 +0100jinsun__(~jinsun@user/jinsun)
2023-01-23 00:43:46 +0100jinsun(~jinsun@user/jinsun) (Killed (molybdenum.libera.chat (Nickname regained by services)))
2023-01-23 00:43:46 +0100jinsun__jinsun
2023-01-23 00:44:46 +0100Katarushisu(~Katarushi@cpc147790-finc20-2-0-cust502.4-2.cable.virginm.net) (Quit: The Lounge - https://thelounge.chat)
2023-01-23 00:45:30 +0100Katarushisu(~Katarushi@cpc147790-finc20-2-0-cust502.4-2.cable.virginm.net)
2023-01-23 00:51:22 +0100tremon(~tremon@83-85-213-108.cable.dynamic.v4.ziggo.nl) (Quit: getting boxed in)
2023-01-23 01:03:35 +0100mizlan(~mizlan@169.150.203.43) (Ping timeout: 256 seconds)
2023-01-23 01:05:22 +0100slack1256(~slack1256@186.11.47.168)
2023-01-23 01:07:45 +0100 <slack1256> I have been reading a bit about free theorems, I want to check my understading of them: On parametric functions that roughtly look like _natural transformations_, a free theorem is a theorem that we get from expanding the naturality constraint, right?
2023-01-23 01:09:57 +0100mizlan(~mizlan@169.150.203.52)
2023-01-23 01:09:59 +0100bigtestaccount[m(~bigtestac@2001:470:69fc:105::2:fae3)
2023-01-23 01:13:12 +0100Tuplanolla(~Tuplanoll@91-159-68-152.elisa-laajakaista.fi) (Quit: Leaving.)
2023-01-23 01:15:36 +0100_leo92_(~emmanuelu@user/emmanuelux)
2023-01-23 01:16:11 +0100_leo92_(~emmanuelu@user/emmanuelux) (Remote host closed the connection)
2023-01-23 01:16:36 +0100nek0(~nek0@2a01:4f8:222:2b41::12) (Quit: The Lounge - https://thelounge.chat)
2023-01-23 01:19:04 +0100emmanuelux(~emmanuelu@user/emmanuelux) (Ping timeout: 256 seconds)
2023-01-23 01:22:00 +0100gnalzo(~gnalzo@2a01:e0a:498:fd50:fcc6:bb5d:489a:ce8c) (Quit: WeeChat 3.8)
2023-01-23 01:34:26 +0100gurkenglas(~gurkengla@dynamic-046-114-183-023.46.114.pool.telefonica.de) (Ping timeout: 252 seconds)
2023-01-23 01:34:31 +0100jumper149(~jumper149@base.felixspringer.xyz) (Quit: WeeChat 3.7.1)
2023-01-23 01:34:39 +0100azimut(~azimut@gateway/tor-sasl/azimut)
2023-01-23 01:37:25 +0100unit73e(~emanuel@184.37.249.5.rev.vodafone.pt) (Quit: Leaving)
2023-01-23 01:40:32 +0100chexum(~quassel@gateway/tor-sasl/chexum) (Remote host closed the connection)
2023-01-23 01:40:40 +0100abhixec(~abhinav@c-67-169-139-16.hsd1.ca.comcast.net) (Ping timeout: 252 seconds)
2023-01-23 01:41:29 +0100chexum(~quassel@gateway/tor-sasl/chexum)
2023-01-23 01:43:44 +0100mizlan_(~mizlan@169.150.203.52)
2023-01-23 01:44:03 +0100mizlan(~mizlan@169.150.203.52) (Ping timeout: 252 seconds)
2023-01-23 01:47:20 +0100merijn(~merijn@c-001-001-014.client.esciencecenter.eduvpn.nl)
2023-01-23 01:51:01 +0100 <hololeap> I've only ever heard of free functors vs forgetful functors in adjunctions, but my CT knowledge is pretty minimal
2023-01-23 01:51:56 +0100merijn(~merijn@c-001-001-014.client.esciencecenter.eduvpn.nl) (Ping timeout: 256 seconds)
2023-01-23 01:53:00 +0100 <hololeap> a list is a free monoid, there's the free monad/comonad/applicative from the 'free' package
2023-01-23 01:54:36 +0100 <geekosaur> isn't it only almost a free monoid, since the monoid operation isn't its constructor?
2023-01-23 01:55:01 +0100 <geekosaur> (well, semigroup operation)
2023-01-23 01:55:43 +0100 <hololeap> not sure, it could be a loose definition, or maybe there's some noise when it's implemented in haskell
2023-01-23 01:55:51 +0100angelore(~akly@5.46.161.208)
2023-01-23 01:55:54 +0100acidjnk_new(~acidjnk@p200300d6e715c429699c669626622ebf.dip0.t-ipconnect.de) (Ping timeout: 256 seconds)
2023-01-23 01:57:19 +0100hololeappokes edwardk
2023-01-23 02:00:12 +0100 <jackdk> hololeap: http://web.archive.org/web/20210805171347/https://comonad.com/reader/2015/free-monoids-in-haskell/
2023-01-23 02:00:35 +0100 <jackdk> edwardk: Links to comonad.com are currently broken, and redirect to another DNS name
2023-01-23 02:03:12 +0100califax(~califax@user/califx) (Remote host closed the connection)
2023-01-23 02:04:50 +0100califax(~califax@user/califx)
2023-01-23 02:09:53 +0100thongpv(~thongpv87@2001:ee0:5577:f0d0:cb62:6bc4:1a5d:d754)
2023-01-23 02:10:59 +0100albet70(~xxx@2400:8902::f03c:92ff:fe60:98d8) (Remote host closed the connection)
2023-01-23 02:11:24 +0100 <hololeap> it's still not clear to me what "introspection" is for Applicatives and why this gets lost for Monads
2023-01-23 02:12:14 +0100oldfashionedcow(~Rahul_San@user/oldfashionedcow) (Quit: WeeChat 3.7.1)
2023-01-23 02:13:05 +0100oldfashionedcow(~Rahul_San@user/oldfashionedcow)
2023-01-23 02:17:06 +0100albet70(~xxx@2400:8902::f03c:92ff:fe60:98d8)
2023-01-23 02:20:10 +0100Surobaki(~surobaki@user/surobaki)
2023-01-23 02:24:23 +0100 <hololeap> <c_wraith> hololeap: introspection in this context is examining the effect structure without actually performing the "result" computations
2023-01-23 02:24:30 +0100 <hololeap> I think I need an example
2023-01-23 02:26:15 +0100 <lyxia> slack1256: yes, for functions that look like natural transformations, the free theorem is that they are actually natural transformations.
2023-01-23 02:27:24 +0100AkechiShiro(~licht@user/akechishiro) (Quit: WeeChat 3.7.1)
2023-01-23 02:27:30 +0100jwiegley(~jwiegley@76-234-69-149.lightspeed.frokca.sbcglobal.net) (Quit: ZNC - http://znc.in)
2023-01-23 02:27:30 +0100johnw(~johnw@2600:1700:cf00:db0:217d:20b2:d1d1:18a9) (Quit: ZNC - http://znc.in)
2023-01-23 02:28:04 +0100 <energizer> is there a family of things that map/scanl/foldl/filter are all instances of?
2023-01-23 02:28:22 +0100 <energizer> s/map/fmap/
2023-01-23 02:29:01 +0100 <hololeap> witherable?
2023-01-23 02:29:15 +0100 <c_wraith> hololeap: https://hackage.haskell.org/package/config-schema-1.3.0.0/docs/Config-Schema-Docs.html is an example of introspection
2023-01-23 02:29:25 +0100johnw(~johnw@2600:1700:cf00:db0:9075:c524:5c52:5c42)
2023-01-23 02:29:47 +0100 <hololeap> thanks, c_wraith
2023-01-23 02:29:52 +0100ozkutuk53(~ozkutuk@176.240.174.60) (Ping timeout: 265 seconds)
2023-01-23 02:30:19 +0100 <c_wraith> hololeap: in particular, the ValueSpec that is created is never run with values for that use
2023-01-23 02:30:50 +0100 <c_wraith> hololeap: It looks at the structure created by the Applicative combinators, but it never actually applies any functions to values when you use <*>, for instance
2023-01-23 02:31:12 +0100oldfashionedcownotarat
2023-01-23 02:31:27 +0100notaratoldfashionedcow
2023-01-23 02:31:53 +0100 <c_wraith> hololeap: By contrast, https://hackage.haskell.org/package/config-schema-1.3.0.0/docs/Config-Schema-Load.html acually passes values around and applies functions to them
2023-01-23 02:34:07 +0100mechap1(~mechap@user/mechap)
2023-01-23 02:34:25 +0100 <hololeap> energizer, a Filterable (from the witherable package) has to be a Functor, Foldable, and Traversable, plus it adds filter
2023-01-23 02:34:32 +0100 <hololeap> so that checks all the boxes
2023-01-23 02:35:22 +0100 <hololeap> er, wait no it's a Witherable that checks all the boxes
2023-01-23 02:36:09 +0100 <hololeap> although I would think that any Functor that you could define filter on would have to be a Foldable as well
2023-01-23 02:36:48 +0100 <hololeap> but Filterable only requires it to be a Functor
2023-01-23 02:37:16 +0100mechap(~mechap@user/mechap) (Ping timeout: 256 seconds)
2023-01-23 02:37:46 +0100angelore(~akly@5.46.161.208) (Quit: angelore)
2023-01-23 02:41:46 +0100xff0x_(~xff0x@2405:6580:b080:900:21ca:a6c1:60fa:34e7) (Ping timeout: 252 seconds)
2023-01-23 02:44:16 +0100 <geekosaur> I think they're asking for something that any of those is a member of, not all
2023-01-23 02:45:01 +0100 <geekosaur> think the family of cata-, ana-, etc. -morphisms
2023-01-23 02:45:31 +0100Surobaki(~surobaki@user/surobaki) (Quit: Leaving)
2023-01-23 02:45:43 +0100Surobaki(~surobaki@user/surobaki)
2023-01-23 02:59:22 +0100thongpv(~thongpv87@2001:ee0:5577:f0d0:cb62:6bc4:1a5d:d754) (Ping timeout: 256 seconds)
2023-01-23 03:01:01 +0100beteigeuze(~Thunderbi@bl14-81-220.dsl.telepac.pt) (Ping timeout: 252 seconds)
2023-01-23 03:03:48 +0100Guest75(~Guest75@178.141.138.233) (Ping timeout: 260 seconds)
2023-01-23 03:15:37 +0100merijn(~merijn@c-001-001-014.client.esciencecenter.eduvpn.nl)
2023-01-23 03:18:23 +0100oldfashionedcownick
2023-01-23 03:18:35 +0100nickoldfashionedcow
2023-01-23 03:19:14 +0100ddellacosta(~ddellacos@86.106.143.117) (Ping timeout: 246 seconds)
2023-01-23 03:21:28 +0100ddellacosta(~ddellacos@143.244.47.76)
2023-01-23 03:27:31 +0100xff0x_(~xff0x@125x103x176x34.ap125.ftth.ucom.ne.jp)
2023-01-23 03:37:43 +0100barzo(~hd@31.223.41.44) (Ping timeout: 256 seconds)
2023-01-23 03:44:04 +0100eggplantade(~Eggplanta@2600:1700:38c5:d800:5d38:2665:17cb:f4aa) (Remote host closed the connection)
2023-01-23 03:45:42 +0100jero98772(~jero98772@2800:484:1d80:d8ce:3490:26c5:1782:da8c) (Remote host closed the connection)
2023-01-23 03:49:38 +0100merijn(~merijn@c-001-001-014.client.esciencecenter.eduvpn.nl) (Ping timeout: 246 seconds)
2023-01-23 04:07:22 +0100Surobaki(~surobaki@user/surobaki) (Ping timeout: 256 seconds)
2023-01-23 04:09:55 +0100khumba(~khumba@user/khumba)
2023-01-23 04:18:37 +0100mizlan_(~mizlan@169.150.203.52) (Ping timeout: 265 seconds)
2023-01-23 04:23:51 +0100jinsun__(~jinsun@user/jinsun)
2023-01-23 04:23:51 +0100jinsun(~jinsun@user/jinsun) (Killed (erbium.libera.chat (Nickname regained by services)))
2023-01-23 04:23:51 +0100jinsun__jinsun
2023-01-23 04:28:28 +0100paulpaul1076(~textual@95-29-5-111.broadband.corbina.ru)
2023-01-23 04:28:59 +0100tdammers(~tdammers@77.109.72.175.res.static.edpnet.net) (Ping timeout: 264 seconds)
2023-01-23 04:29:16 +0100tdammers(~tdammers@77.109.72.175.res.static.edpnet.net)
2023-01-23 04:30:30 +0100mizlan(~mizlan@169.150.203.43)
2023-01-23 04:35:02 +0100eggplantade(~Eggplanta@2600:1700:38c5:d800:5d38:2665:17cb:f4aa)
2023-01-23 04:35:17 +0100razetime(~Thunderbi@43.254.111.18)
2023-01-23 04:35:20 +0100razetime(~Thunderbi@43.254.111.18) (Client Quit)
2023-01-23 04:35:30 +0100mizlan(~mizlan@169.150.203.43) (Ping timeout: 268 seconds)
2023-01-23 04:41:32 +0100slack1256(~slack1256@186.11.47.168) (Remote host closed the connection)
2023-01-23 04:46:30 +0100finn_elija(~finn_elij@user/finn-elija/x-0085643)
2023-01-23 04:46:30 +0100FinnElija(~finn_elij@user/finn-elija/x-0085643) (Killed (NickServ (Forcing logout FinnElija -> finn_elija)))
2023-01-23 04:46:30 +0100finn_elijaFinnElija
2023-01-23 04:50:18 +0100td__(~td@83.135.9.13) (Ping timeout: 268 seconds)
2023-01-23 04:51:26 +0100mizlan(~mizlan@89.46.114.100)
2023-01-23 04:51:49 +0100td_(~td@83.135.9.19)
2023-01-23 04:53:17 +0100Lycurgus(~juan@user/Lycurgus)
2023-01-23 05:00:44 +0100mizlan(~mizlan@89.46.114.100) (Ping timeout: 246 seconds)
2023-01-23 05:02:09 +0100dagit(~dagit@2001:558:6025:38:6476:a063:d05a:44da) (Ping timeout: 256 seconds)
2023-01-23 05:08:00 +0100Surobaki(~surobaki@user/surobaki)
2023-01-23 05:08:03 +0100mbuf(~Shakthi@49.204.137.190)
2023-01-23 05:14:14 +0100opticblast(~Thunderbi@secure-165.caltech.edu)
2023-01-23 05:14:38 +0100thongpv(~thongpv87@2001:ee0:5577:f0d0:6f9:a080:d692:e79a)
2023-01-23 05:16:00 +0100merijn(~merijn@c-001-001-014.client.esciencecenter.eduvpn.nl)
2023-01-23 05:16:23 +0100razetime(~Thunderbi@43.254.111.18)
2023-01-23 05:19:46 +0100 <razetime> Hi, I'd like to know about research papers published about finding unused code, more specifically unused functions in ML like languages. So far google scholar has given https://dl.acm.org/doi/pdf/10.1145/3236792 and https://link.springer.com/chapter/10.1007/3-540-49201-1_16, are there any papers that may be closer in motive?
2023-01-23 05:26:53 +0100FinnElija(~finn_elij@user/finn-elija/x-0085643) (Ping timeout: 255 seconds)
2023-01-23 05:27:18 +0100razetime(~Thunderbi@43.254.111.18) (Quit: See You Space Cowboy)
2023-01-23 05:27:21 +0100FinnElija(~finn_elij@user/finn-elija/x-0085643)
2023-01-23 05:27:30 +0100razetime1(~Thunderbi@43.254.111.18)
2023-01-23 05:28:24 +0100 <Lycurgus> it's tool busy work rather than a research topic
2023-01-23 05:29:48 +0100razetime1razetime
2023-01-23 05:31:50 +0100[itchyjunk](~itchyjunk@user/itchyjunk/x-7353470) (Read error: Connection reset by peer)
2023-01-23 05:33:58 +0100jpds(~jpds@gateway/tor-sasl/jpds) (Remote host closed the connection)
2023-01-23 05:34:19 +0100machinedgod(~machinedg@d198-53-218-113.abhsia.telus.net) (Ping timeout: 252 seconds)
2023-01-23 05:34:26 +0100jpds(~jpds@gateway/tor-sasl/jpds)
2023-01-23 05:35:02 +0100Lycurgus(~juan@user/Lycurgus) (Quit: Exeunt: personae.ai-integration.biz)
2023-01-23 05:41:19 +0100ddellacosta(~ddellacos@143.244.47.76) (Ping timeout: 260 seconds)
2023-01-23 05:49:24 +0100nek0(~nek0@2a01:4f8:222:2b41::12)
2023-01-23 05:50:25 +0100merijn(~merijn@c-001-001-014.client.esciencecenter.eduvpn.nl) (Ping timeout: 252 seconds)
2023-01-23 05:55:45 +0100urdh(~urdh@user/urdh)
2023-01-23 06:06:09 +0100oldfashionedcow(~Rahul_San@user/oldfashionedcow) (Quit: WeeChat 3.7.1)
2023-01-23 06:12:52 +0100johnw(~johnw@2600:1700:cf00:db0:9075:c524:5c52:5c42) (Quit: ZNC - http://znc.in)
2023-01-23 06:39:56 +0100inversed(~inversed@bcdcac82.skybroadband.com)
2023-01-23 06:41:08 +0100jao(~jao@cpc103048-sgyl39-2-0-cust502.18-2.cable.virginm.net) (Ping timeout: 246 seconds)
2023-01-23 06:44:15 +0100merijn(~merijn@c-001-001-014.client.esciencecenter.eduvpn.nl)
2023-01-23 06:45:31 +0100FinnElija(~finn_elij@user/finn-elija/x-0085643) (Remote host closed the connection)
2023-01-23 06:46:00 +0100razetime(~Thunderbi@43.254.111.18) (Read error: Connection reset by peer)
2023-01-23 06:46:38 +0100dagit(~dagit@2001:558:6025:38:71c6:9d58:7252:8976)
2023-01-23 06:46:52 +0100FinnElija(~finn_elij@user/finn-elija/x-0085643)
2023-01-23 06:48:47 +0100johnw(~johnw@2600:1700:cf00:db0:8cfb:a8b9:b2d3:9e7)
2023-01-23 06:48:58 +0100merijn(~merijn@c-001-001-014.client.esciencecenter.eduvpn.nl) (Ping timeout: 260 seconds)
2023-01-23 06:53:46 +0100trev(~trev@user/trev)
2023-01-23 07:02:09 +0100Clinton[m](~clintonme@2001:470:69fc:105::2:31d4)
2023-01-23 07:15:57 +0100barzo(~hd@31.223.41.44)
2023-01-23 07:19:09 +0100asivitz(uid178348@id-178348.tinside.irccloud.com)
2023-01-23 07:25:08 +0100opticblast(~Thunderbi@secure-165.caltech.edu) (Ping timeout: 256 seconds)
2023-01-23 07:28:34 +0100opticblast(~Thunderbi@secure-165.caltech.edu)
2023-01-23 07:30:56 +0100bgs(~bgs@212-85-160-171.dynamic.telemach.net)
2023-01-23 07:33:42 +0100[itchyjunk](~itchyjunk@user/itchyjunk/x-7353470)
2023-01-23 08:15:06 +0100bgs(~bgs@212-85-160-171.dynamic.telemach.net) (Remote host closed the connection)
2023-01-23 08:15:15 +0100khumba(~khumba@user/khumba) ()
2023-01-23 08:26:05 +0100[itchyjunk](~itchyjunk@user/itchyjunk/x-7353470) (Remote host closed the connection)
2023-01-23 08:26:22 +0100[itchyjunk](~itchyjunk@user/itchyjunk/x-7353470)
2023-01-23 08:32:37 +0100[itchyjunk](~itchyjunk@user/itchyjunk/x-7353470) (Read error: Connection reset by peer)
2023-01-23 08:38:10 +0100kosmikus[m](~andresloe@2001:470:69fc:105::95d)
2023-01-23 08:39:47 +0100mei(~mei@user/mei) (Ping timeout: 264 seconds)
2023-01-23 08:40:05 +0100jco(~jco@90-228-194-139-no542.tbcn.telia.com)
2023-01-23 08:42:13 +0100mastarija(~mastarija@188.252.197.161)
2023-01-23 08:44:10 +0100 <mastarija> So, I have types `A = A { prefixaField :: B }` and `B = B { prefixbField :: Int }`.
2023-01-23 08:44:32 +0100 <mastarija> I've made ToJSON instances for both using `toEncoding = genericToEncoding mySettings`
2023-01-23 08:44:43 +0100merijn(~merijn@c-001-001-014.client.esciencecenter.eduvpn.nl)
2023-01-23 08:45:05 +0100 <mastarija> Where `mySettings` are just default settings with a function for modifying field names by removing prefix.
2023-01-23 08:45:34 +0100 <mastarija> When I `encode` a `B`, I get json as expected : { field : 2 }
2023-01-23 08:46:11 +0100 <mastarija> However, when i encode an `A` I get : { field : { prefixbField : 2 } }
2023-01-23 08:46:46 +0100 <mastarija> It seems like somehow, the `toEncoding = genericToEncoding mySettings` does not apply field modifier to child structures.
2023-01-23 08:47:17 +0100 <mastarija> I'd expect aeson to use that types instance instead of doing something on its own.
2023-01-23 08:47:32 +0100 <mastarija> I'm not sure if this is an error and should be reported or I'm doing something wrong.
2023-01-23 08:52:35 +0100 <mastarija> Ahh.. it would seem I have to provide the `toJSON` implementation as well...
2023-01-23 08:53:53 +0100azimut(~azimut@gateway/tor-sasl/azimut) (Ping timeout: 255 seconds)
2023-01-23 08:54:19 +0100machinedgod(~machinedg@d198-53-218-113.abhsia.telus.net)
2023-01-23 08:54:53 +0100Sgeo(~Sgeo@user/sgeo) (Read error: Connection reset by peer)
2023-01-23 08:55:08 +0100machinedgod(~machinedg@d198-53-218-113.abhsia.telus.net) (Client Quit)
2023-01-23 08:55:33 +0100machinedgod(~machinedg@d198-53-218-113.abhsia.telus.net)
2023-01-23 08:56:38 +0100takuan(~takuan@178-116-218-225.access.telenet.be)
2023-01-23 08:58:03 +0100oniko
2023-01-23 09:06:28 +0100lortabac(~lortabac@2a01:e0a:541:b8f0:188f:1e96:e3af:2697)
2023-01-23 09:07:29 +0100use-value(~Thunderbi@2a00:23c6:8a03:2f01:75c2:a71f:beaa:29bf) (Ping timeout: 246 seconds)
2023-01-23 09:07:38 +0100use-value1(~Thunderbi@2a00:23c6:8a03:2f01:44e8:662a:49b5:c27)
2023-01-23 09:08:11 +0100shriekingnoise(~shrieking@186.137.175.87) (Ping timeout: 246 seconds)
2023-01-23 09:09:55 +0100use-value1use-value
2023-01-23 09:19:05 +0100merijn(~merijn@c-001-001-014.client.esciencecenter.eduvpn.nl) (Ping timeout: 252 seconds)
2023-01-23 09:21:41 +0100CiaoSen(~Jura@p200300c9572d4e002a3a4dfffe84dbd5.dip0.t-ipconnect.de)
2023-01-23 09:24:31 +0100 <dminuoso> mastarija: My recommendation, dont use Generics for aeson instances.
2023-01-23 09:27:43 +0100 <mastarija> :)
2023-01-23 09:28:09 +0100 <mastarija> But sometimes... they are so convenient. Especially when I don't feel like working.
2023-01-23 09:28:14 +0100 <mastarija> xD
2023-01-23 09:28:22 +0100 <dminuoso> mastarija: You can use the TH helper if you want for convenience.
2023-01-23 09:28:54 +0100 <mastarija> Hm... don't know why but `TH` always rubs me the wrong way.
2023-01-23 09:29:01 +0100merijn(~merijn@c-001-001-014.client.esciencecenter.eduvpn.nl)
2023-01-23 09:30:50 +0100 <dminuoso> Multiple reasons: a) the generated code is reliably faster since you dont rely on the simplifier eliding the generic representation (which it cant always do), b) the generic instances are painfully slow, in our large project we have reduced compilation time of several minutes to just 2 seconds by switching from Generics to TH aeson instances, c) TH *can* at the very least do targeted diagnostics
2023-01-23 09:31:19 +0100 <dminuoso> And if you ever want to customize the code generate yourself, it's orders of magnitude easier to do it on TH than it is on Generics
2023-01-23 09:31:55 +0100 <[exa]> (in other news, macros ftw)
2023-01-23 09:32:46 +0100coot(~coot@213.134.171.3)
2023-01-23 09:34:11 +0100 <dminuoso> Oh and the compilation time I mentioned was *per module* of course.
2023-01-23 09:34:47 +0100 <dminuoso> It was a bit saddening to spend about 15 minutes on that project for just aeson instances, given how often the CI ran, there was a real measurable cost saving for us as a company to switch to TH. :p
2023-01-23 09:35:11 +0100 <dminuoso> If I was a blogged, I would probably have made some interesting blog article about it.
2023-01-23 09:35:13 +0100 <dminuoso> *blogger even
2023-01-23 09:35:59 +0100 <[exa]> what's so slow on generics though? is there some nondeterminism in the simplifier that chews through the representation?
2023-01-23 09:36:45 +0100 <[exa]> or is it just that the heap of intermediate generated code is too big?
2023-01-23 09:37:01 +0100 <dminuoso> No clue honestly, I just recall the simplifier mentioning literally millions of types.
2023-01-23 09:37:32 +0100 <[exa]> ok that doesn't help a lot
2023-01-23 09:37:33 +0100 <geekosaur> autogenerated generics code is really big and inefficient
2023-01-23 09:37:40 +0100hugo(znc@verdigris.lysator.liu.se) (Ping timeout: 260 seconds)
2023-01-23 09:38:20 +0100 <geekosaur> hand-written generics instances can be much more efficient, but if you're going to that trouble you might as well write the Aeson instances yourself
2023-01-23 09:38:29 +0100 <dminuoso> And thats the thing, the simplifier cant always elide the implementation - and if it cant it performs really horrid
2023-01-23 09:39:04 +0100jco(~jco@90-228-194-139-no542.tbcn.telia.com) (Ping timeout: 265 seconds)
2023-01-23 09:39:09 +0100 <dminuoso> I've talked a bit with some GHC folks about it, and their stance seems really clear: dont use generics if you care about reliable performance
2023-01-23 09:39:21 +0100 <dminuoso> Its kind of clear too, with TH you know exactly what kind of code you are getting.
2023-01-23 09:39:35 +0100 <[exa]> interesting.
2023-01-23 09:39:38 +0100 <[exa]> thanks
2023-01-23 09:39:48 +0100acidjnk_new(~acidjnk@p200300d6e715c429699c669626622ebf.dip0.t-ipconnect.de)
2023-01-23 09:40:15 +0100 <dminuoso> From a user perspective, the TH helpers are just as convenient to use, while having nothing but benefits - at the cost of breaking cross compilation.
2023-01-23 09:40:31 +0100 <dminuoso> But Im willing to bet that cross compilation is - for most people - not a necessitiy anyway
2023-01-23 09:40:40 +0100jco(~jco@90-228-194-139-no542.tbcn.telia.com)
2023-01-23 09:41:18 +0100 <dminuoso> And in principle you could get around that by expanding the spliced code manually
2023-01-23 09:44:25 +0100hugo(znc@verdigris.lysator.liu.se)
2023-01-23 09:44:41 +0100gmg(~user@user/gehmehgeh)
2023-01-23 09:50:13 +0100 <[exa]> how much does TH actually break cross-compilation if you don't touch anything that is arch-specific?
2023-01-23 09:50:48 +0100Surobaki(~surobaki@user/surobaki) (Read error: Connection reset by peer)
2023-01-23 09:52:33 +0100 <dminuoso> [exa]: As far as I understand, it breaks it completely.
2023-01-23 09:54:46 +0100 <dminuoso> So here's some of the problems"
2023-01-23 09:55:01 +0100avicenzi(~avicenzi@2a00:ca8:a1f:b004::c32)
2023-01-23 09:56:37 +0100[exa]sad
2023-01-23 09:56:48 +0100 <dminuoso> With host=AMD64 and target=ARM, you need AMD64 code for any code you intend to run from inside the TH splice
2023-01-23 09:57:49 +0100 <[exa]> ah so the arch choice is kinda enforced just by having the ability to execute code?
2023-01-23 09:57:58 +0100 <[exa]> ok that won't work. :D
2023-01-23 09:58:05 +0100 <dminuoso> Well it could be made to work of course.
2023-01-23 09:58:54 +0100 <dminuoso> GHC could just recompile the entire transitive dependency tree for the host platform, such that it is available during TH.
2023-01-23 09:59:11 +0100 <dminuoso> But that requires intricate support from say cabal too
2023-01-23 09:59:40 +0100 <[exa]> I see
2023-01-23 09:59:43 +0100 <dminuoso> Or maybe we would need multi-arch packaging, where a package already has AMD64, ARM64, etc binary code available
2023-01-23 10:00:11 +0100 <dminuoso> (but that too would require some support from cabal as well)
2023-01-23 10:00:25 +0100 <dminuoso> at least given todays users
2023-01-23 10:00:58 +0100razetime(~Thunderbi@117.193.0.153)
2023-01-23 10:01:12 +0100 <dminuoso> At any rate, GHCs can only have a single target currently.
2023-01-23 10:01:36 +0100fserucas(~fserucas@2001:818:e376:a400:fb92:70c1:dd88:c7d7)
2023-01-23 10:01:44 +0100eggplantade(~Eggplanta@2600:1700:38c5:d800:5d38:2665:17cb:f4aa) (Remote host closed the connection)
2023-01-23 10:07:25 +0100chele(~chele@user/chele)
2023-01-23 10:08:19 +0100geekosaur(~geekosaur@xmonad/geekosaur) (Killed (NickServ (GHOST command used by allbery_b)))
2023-01-23 10:08:21 +0100allbery_b(~geekosaur@xmonad/geekosaur)
2023-01-23 10:08:24 +0100allbery_bgeekosaur
2023-01-23 10:20:10 +0100nschoe(~q@141.101.51.197)
2023-01-23 10:22:43 +0100Guest75(~Guest75@178.141.138.233)
2023-01-23 10:23:02 +0100hueso_(~root@user/hueso) (Ping timeout: 246 seconds)
2023-01-23 10:25:44 +0100 <mastarija> Hm.. interesting, so there are real build performance benefits when using TH. Definitely something to consider.
2023-01-23 10:26:09 +0100 <geekosaur> compared to generics, at least
2023-01-23 10:28:26 +0100 <dminuoso> If you want to maximize build time performance, Data/Typeable are likely even faster. :p
2023-01-23 10:28:29 +0100jespada(~jespada@cpc121308-nmal25-2-0-cust15.19-2.cable.virginm.net)
2023-01-23 10:29:46 +0100 <kosmikus> depends. TH is usually worse / more pessimistic at recompilation, generics are typically worse at raw build time, especially if datatypes are large. and indeed, Data / Typeable is less likely to suffer from build-time problems than more "advanced" approaches.
2023-01-23 10:33:10 +0100mtdickens(~mtdickens@139-162-85-59.ip.linodeusercontent.com)
2023-01-23 10:33:37 +0100mtdickens(~mtdickens@139-162-85-59.ip.linodeusercontent.com) (Remote host closed the connection)
2023-01-23 10:35:34 +0100 <geekosaur> btw, I don't have quite the same understanding about ghc vs. generics that dminuoso does
2023-01-23 10:36:13 +0100 <geekosaur> there are better implementations of generics out there, possibly on hackage. but the ghc team is already overworked and can't take on maintenance of them
2023-01-23 10:36:41 +0100 <geekosaur> if someone were to take on adding and maintaining them in ghc, they'd be open to it
2023-01-23 10:37:42 +0100 <geekosaur> but as things stand, the current implementation is simple to maintain so it's going to remain the implementation unless someone takes over maintenance of a better implementation
2023-01-23 10:38:21 +0100gnalzo(~gnalzo@2a01:e0a:498:fd50:fcc6:bb5d:489a:ce8c)
2023-01-23 10:38:50 +0100 <mastarija> How would a "better" implementation work without the derive generics language extension?
2023-01-23 10:38:56 +0100 <mastarija> Custom compiler plugin?
2023-01-23 10:39:11 +0100 <geekosaur> or custom TH
2023-01-23 10:39:16 +0100 <[exa]> +1 for simpler TH
2023-01-23 10:39:31 +0100 <mastarija> nyagh
2023-01-23 10:39:35 +0100 <dminuoso> My main beef with TH is that its relatively brittle and imposes increased maintainer burden.
2023-01-23 10:40:05 +0100 <dminuoso> But luckily when we consider something like `aeson` thats not aeson-user problem, but an aeson-maintainer problem. So my recommendation to prefer TH over Generic for aeson stands
2023-01-23 10:40:07 +0100 <[exa]> could be insanely cool if the macros could be typed, right?
2023-01-23 10:40:17 +0100 <dminuoso> [exa]: we do have typed template haskell
2023-01-23 10:40:47 +0100 <[exa]> oh wow ok I missed that! can it impose e.g. generating correctly-typed functions?
2023-01-23 10:41:07 +0100 <[exa]> (like, I'm not even very aware of methods how that would work)
2023-01-23 10:41:26 +0100 <mastarija> What I hate about TH is the use of [whatever|...|], and that it splits my files into two parts whenever I use it, meaning I have to be careful where I define certain things.
2023-01-23 10:41:50 +0100 <dminuoso> mastarija: sure, but like I said for something like aeson that's an "aeson folks problem" luckily,
2023-01-23 10:42:03 +0100 <dminuoso> So long as somebody is willing to deal with its, it doesnt affect most users
2023-01-23 10:42:09 +0100 <mastarija> If I have A that uses B defined after some TH thing, then it won't work
2023-01-23 10:42:29 +0100 <mastarija> dminuoso: yes, I guess I can see that
2023-01-23 10:46:07 +0100merijn(~merijn@c-001-001-014.client.esciencecenter.eduvpn.nl) (Ping timeout: 268 seconds)
2023-01-23 10:48:37 +0100ft(~ft@p4fc2a257.dip0.t-ipconnect.de) (Quit: leaving)
2023-01-23 10:50:50 +0100kenran(~user@user/kenran)
2023-01-23 10:54:15 +0100acidjnk_new(~acidjnk@p200300d6e715c429699c669626622ebf.dip0.t-ipconnect.de) (Remote host closed the connection)
2023-01-23 10:54:37 +0100acidjnk_new(~acidjnk@p200300d6e715c429c1bce9b910063906.dip0.t-ipconnect.de)
2023-01-23 11:02:14 +0100eggplantade(~Eggplanta@2600:1700:38c5:d800:5d38:2665:17cb:f4aa)
2023-01-23 11:05:39 +0100tzh(~tzh@c-24-21-73-154.hsd1.or.comcast.net) (Quit: zzz)
2023-01-23 11:06:32 +0100eggplantade(~Eggplanta@2600:1700:38c5:d800:5d38:2665:17cb:f4aa) (Ping timeout: 255 seconds)
2023-01-23 11:06:38 +0100mcglk(~mcglk@131.191.49.120) (Read error: Connection reset by peer)
2023-01-23 11:09:00 +0100mcglk(~mcglk@131.191.49.120)
2023-01-23 11:11:14 +0100xff0x_(~xff0x@125x103x176x34.ap125.ftth.ucom.ne.jp) (Ping timeout: 256 seconds)
2023-01-23 11:12:05 +0100merijn(~merijn@c-001-001-014.client.esciencecenter.eduvpn.nl)
2023-01-23 11:18:22 +0100raehik(~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net)
2023-01-23 11:21:01 +0100econo(uid147250@user/econo) (Quit: Connection closed for inactivity)
2023-01-23 11:24:35 +0100AkechiShiro(~licht@user/akechishiro)
2023-01-23 11:32:41 +0100Typedfern(~Typedfern@60.red-83-37-32.dynamicip.rima-tde.net) (Ping timeout: 246 seconds)
2023-01-23 11:33:20 +0100 <dminuoso> Is there a nice idiom for something like `let mlist = maybe () (pure . f) in mlist (\x -> ...) maybeX <> mlist (\y -> ...) maybeY <> ...`?
2023-01-23 11:33:28 +0100Typedfern(~Typedfern@60.red-83-37-32.dynamicip.rima-tde.net)
2023-01-23 11:34:41 +0100 <dminuoso> Ah I guess I could just fmap them all and then catMaybes
2023-01-23 11:36:12 +0100 <mauke> :t maybe () (pure . ?f)
2023-01-23 11:36:13 +0100 <lambdabot> error:
2023-01-23 11:36:13 +0100 <lambdabot> • Couldn't match type ‘f0 a0’ with ‘()’
2023-01-23 11:36:13 +0100 <lambdabot> Expected type: a -> ()
2023-01-23 11:46:23 +0100merijn(~merijn@c-001-001-014.client.esciencecenter.eduvpn.nl) (Ping timeout: 246 seconds)
2023-01-23 11:55:20 +0100haritz(~hrtz@user/haritz) (Ping timeout: 260 seconds)
2023-01-23 11:57:27 +0100xff0x_(~xff0x@2405:6580:b080:900:2967:46fd:7767:4b83)
2023-01-23 12:11:01 +0100 <eldritchcookie[4> what are the best practices to internationalize a program?
2023-01-23 12:12:29 +0100haritz(~hrtz@82-69-11-11.dsl.in-addr.zen.co.uk)
2023-01-23 12:12:30 +0100haritz(~hrtz@82-69-11-11.dsl.in-addr.zen.co.uk) (Changing host)
2023-01-23 12:12:30 +0100haritz(~hrtz@user/haritz)
2023-01-23 12:14:23 +0100 <dminuoso> For i18n I would probably just register a global IORef
2023-01-23 12:14:35 +0100TheCoffeMaker(~TheCoffeM@user/thecoffemaker) (Ping timeout: 260 seconds)
2023-01-23 12:14:41 +0100 <dminuoso> It depends slightly on whether you are writing an executable or a library
2023-01-23 12:15:54 +0100 <dminuoso> Or heck, it doesnt even have to be an IORef really
2023-01-23 12:16:23 +0100 <dminuoso> You can either use simple translation functions or a map
2023-01-23 12:17:23 +0100 <eldritchcookie[4> it is a HaTeX rules manual for an ttrpg
2023-01-23 12:18:38 +0100 <mauke> heh. the answer "use a global IORef" for I18N is like when someone asks how to do multivariate calculus and you say "I would use a pencil"
2023-01-23 12:20:26 +0100jpds(~jpds@gateway/tor-sasl/jpds) (Ping timeout: 255 seconds)
2023-01-23 12:22:19 +0100TheCoffeMaker(~TheCoffeM@user/thecoffemaker)
2023-01-23 12:24:08 +0100jpds(~jpds@gateway/tor-sasl/jpds)
2023-01-23 12:28:10 +0100beteigeuze(~Thunderbi@bl14-81-220.dsl.telepac.pt)
2023-01-23 12:29:26 +0100 <eldritchcookie[4> also it is a bad suggestion the reader monad would be enough for translation
2023-01-23 12:30:17 +0100merijn(~merijn@c-001-001-014.client.esciencecenter.eduvpn.nl)
2023-01-23 12:30:47 +0100jpds(~jpds@gateway/tor-sasl/jpds) (Ping timeout: 255 seconds)
2023-01-23 12:32:52 +0100cfricke(~cfricke@user/cfricke)
2023-01-23 12:35:02 +0100merijn(~merijn@c-001-001-014.client.esciencecenter.eduvpn.nl) (Ping timeout: 246 seconds)
2023-01-23 12:37:53 +0100opticblast(~Thunderbi@secure-165.caltech.edu) (Ping timeout: 255 seconds)
2023-01-23 12:38:15 +0100kuribas(~user@ip-188-118-57-242.reverse.destiny.be)
2023-01-23 12:39:39 +0100coot(~coot@213.134.171.3) (Quit: coot)
2023-01-23 12:40:09 +0100MajorBiscuit(~MajorBisc@145.94.182.137)
2023-01-23 12:47:09 +0100tsns(~tsns@91.150.188.137)
2023-01-23 12:47:56 +0100 <tsns> fucking bastards and retards dont ever use mercury language you are too dumb for this you indian piece of shit hacker wanabes fuck you all and this piece of shit software called haskel
2023-01-23 12:48:02 +0100jpds(~jpds@gateway/tor-sasl/jpds)
2023-01-23 12:49:44 +0100ChanServ+o geekosaur
2023-01-23 12:49:51 +0100geekosaur+b *!*@91.150.188.137
2023-01-23 12:49:51 +0100tsnsgeekosaur (tsns)
2023-01-23 12:50:18 +0100geekosaur-o geekosaur
2023-01-23 12:51:49 +0100 <Jadesheit[m]> lol wtf
2023-01-23 12:54:34 +0100Shaeto(~Shaeto@94.25.234.181)
2023-01-23 12:55:50 +0100Shaeto(~Shaeto@94.25.234.181) (Client Quit)
2023-01-23 12:58:23 +0100CiaoSen(~Jura@p200300c9572d4e002a3a4dfffe84dbd5.dip0.t-ipconnect.de) (Ping timeout: 264 seconds)
2023-01-23 13:01:22 +0100 <[exa]> I'm more inclined to user mercury now tho.
2023-01-23 13:01:28 +0100jao(~jao@cpc103048-sgyl39-2-0-cust502.18-2.cable.virginm.net)
2023-01-23 13:01:55 +0100 <[exa]> (now they're in ##prolog :( )
2023-01-23 13:05:08 +0100takuan(~takuan@178-116-218-225.access.telenet.be) (Ping timeout: 256 seconds)
2023-01-23 13:05:19 +0100jpds(~jpds@gateway/tor-sasl/jpds) (Remote host closed the connection)
2023-01-23 13:05:53 +0100Shaeto(~Shaeto@94.25.234.181)
2023-01-23 13:07:51 +0100Shaeto(~Shaeto@94.25.234.181) (Client Quit)
2023-01-23 13:08:04 +0100Shaeto(~Shaeto@94.25.234.181)
2023-01-23 13:08:46 +0100Shaeto(~Shaeto@94.25.234.181) (Client Quit)
2023-01-23 13:09:19 +0100Shaeto(~Shaeto@94.25.234.181)
2023-01-23 13:09:28 +0100Shaeto(~Shaeto@94.25.234.181) (Client Quit)
2023-01-23 13:11:42 +0100Shaeto(~Shaeto@94.25.234.181)
2023-01-23 13:13:39 +0100jpds(~jpds@gateway/tor-sasl/jpds)
2023-01-23 13:14:01 +0100Shaeto(~Shaeto@94.25.234.181) (Client Quit)
2023-01-23 13:14:16 +0100Shaeto(~Shaeto@94.25.234.181)
2023-01-23 13:15:36 +0100Shaeto(~Shaeto@94.25.234.181) (Client Quit)
2023-01-23 13:15:49 +0100Shaeto(~Shaeto@94.25.234.181)
2023-01-23 13:17:25 +0100Shaeto(~Shaeto@94.25.234.181) (Client Quit)
2023-01-23 13:20:12 +0100ChanServ+o litharge
2023-01-23 13:20:13 +0100litharge-bo *!*@91.150.188.137 litharge
2023-01-23 13:21:24 +0100 <lyxia> Would it make sense for newtype I a = I a to have Coercible I Identity (it doesnt right now)?
2023-01-23 13:21:53 +0100takuan(~takuan@178-116-218-225.access.telenet.be)
2023-01-23 13:22:17 +0100Shaeto(~Shaeto@94.25.234.181)
2023-01-23 13:22:23 +0100 <lyxia> The new rule would be (forall a. Coercible (f a) (g a)) => Coercible f g
2023-01-23 13:30:10 +0100Unhammer(~Unhammer@user/unhammer) (Ping timeout: 252 seconds)
2023-01-23 13:33:19 +0100 <Axman6> is Coercible kind polymorphic?
2023-01-23 13:34:07 +0100merijn(~merijn@c-001-001-014.client.esciencecenter.eduvpn.nl)
2023-01-23 13:34:22 +0100 <dminuoso> lyxia: Maybe this is a trick question, but why wouldnt there be a `Coercible I Identity`?
2023-01-23 13:34:47 +0100Shaeto(~Shaeto@94.25.234.181) (Quit: WeeChat 3.8)
2023-01-23 13:35:11 +0100Shaeto(~Shaeto@94.25.234.181)
2023-01-23 13:36:37 +0100Shaeto(~Shaeto@94.25.234.181) (Client Quit)
2023-01-23 13:36:38 +0100 <dminuoso> Axman6: class a ~R# b => Coercible (a :: k) (b :: k)
2023-01-23 13:36:51 +0100Shaeto(~Shaeto@94.25.234.181)
2023-01-23 13:37:08 +0100 <dminuoso> But there's something really fishy here, because the ~R# constraint is not in the source code that defines Coercible https://hackage.haskell.org/package/ghc-prim-0.9.0/docs/src/GHC.Types.html#Coercible
2023-01-23 13:39:22 +0100Shaeto(~Shaeto@94.25.234.181) (Client Quit)
2023-01-23 13:39:36 +0100Shaeto(~Shaeto@94.25.234.181)
2023-01-23 13:43:42 +0100Unhammer(~Unhammer@user/unhammer)
2023-01-23 13:44:45 +0100opticblast(~Thunderbi@secure-165.caltech.edu)
2023-01-23 13:45:44 +0100use-value(~Thunderbi@2a00:23c6:8a03:2f01:44e8:662a:49b5:c27) (Quit: use-value)
2023-01-23 13:45:56 +0100jpds(~jpds@gateway/tor-sasl/jpds) (Ping timeout: 255 seconds)
2023-01-23 13:50:20 +0100jco(~jco@90-228-194-139-no542.tbcn.telia.com) (Remote host closed the connection)
2023-01-23 13:53:11 +0100n0den1te(~n0den1te@223.178.83.121)
2023-01-23 13:54:06 +0100 <Axman6> surely Corecible is full of compiler magic though - is ~R# representation equality or something?
2023-01-23 13:59:33 +0100 <dminuoso> Presumably yeah
2023-01-23 14:00:29 +0100opticblast(~Thunderbi@secure-165.caltech.edu) (Ping timeout: 256 seconds)
2023-01-23 14:00:36 +0100cfricke(~cfricke@user/cfricke) (Quit: WeeChat 3.7.1)
2023-01-23 14:03:27 +0100jpds(~jpds@gateway/tor-sasl/jpds)
2023-01-23 14:18:50 +0100troydm(~troydm@user/troydm) (Ping timeout: 260 seconds)
2023-01-23 14:19:14 +0100jpds(~jpds@gateway/tor-sasl/jpds) (Ping timeout: 255 seconds)
2023-01-23 14:20:06 +0100kenran(~user@user/kenran) (Remote host closed the connection)
2023-01-23 14:20:14 +0100emad(~emad@41.43.90.128)
2023-01-23 14:21:08 +0100 <lyxia> dminuoso: that's precisely my question :)
2023-01-23 14:23:20 +0100jpds(~jpds@gateway/tor-sasl/jpds)
2023-01-23 14:25:38 +0100TheCoffeMaker(~TheCoffeM@user/thecoffemaker) (Ping timeout: 246 seconds)
2023-01-23 14:27:47 +0100TheCoffeMaker(~TheCoffeM@user/thecoffemaker)
2023-01-23 14:28:23 +0100bitdex(~bitdex@gateway/tor-sasl/bitdex) (Quit: = "")
2023-01-23 14:31:26 +0100Unicorn_Princess(~Unicorn_P@user/Unicorn-Princess/x-3540542)
2023-01-23 14:34:24 +0100 <dminuoso> lyxia: The instance is created on-the-fly during compilation as long as they they represeentational equality.
2023-01-23 14:34:55 +0100 <dminuoso> Ahh I see what you are asking now
2023-01-23 14:38:12 +0100 <dminuoso> lyxia: I think a better audience for that question would be the ghc issue traacker
2023-01-23 14:38:25 +0100 <dminuoso> Or #ghc
2023-01-23 14:38:57 +0100tsandstr(~user@2601:18b:8100:7300::524) (Ping timeout: 255 seconds)
2023-01-23 14:39:11 +0100 <dminuoso> There appears to be a comment (borked from the phabricator import) that lightly touches it https://gitlab.haskell.org/ghc/ghc/-/issues/14733#note_148352
2023-01-23 14:41:01 +0100 <dminuoso> lyxia: I suspect this would need some internal machinery though, but that instance seems sensible for some
2023-01-23 14:41:12 +0100 <dminuoso> (Or can you even write it in haskell-land?)
2023-01-23 14:41:13 +0100azimut(~azimut@gateway/tor-sasl/azimut)
2023-01-23 14:41:14 +0100CiaoSen(~Jura@p200300c9572d4e002a3a4dfffe84dbd5.dip0.t-ipconnect.de)
2023-01-23 14:41:47 +0100mzan(~quassel@mail.asterisell.com) (https://quassel-irc.org - Chat comfortably. Anywhere.)
2023-01-23 14:43:01 +0100cfricke(~cfricke@user/cfricke)
2023-01-23 14:44:04 +0100jonathanx(~jonathan@h-178-174-176-109.A357.priv.bahnhof.se)
2023-01-23 14:50:27 +0100 <mixphix> what's the internal representation of a type former like `Identity` anyway?
2023-01-23 14:51:21 +0100 <Axman6> it's a newtype, so it is exactly the same as the type it wraps
2023-01-23 14:51:43 +0100 <mixphix> that's for `Identity a` having the same rep as `a`
2023-01-23 14:51:44 +0100 <Axman6> Identity Int is a distinct type from an Int, but at runtime looks exactly like an Int
2023-01-23 14:51:57 +0100 <mixphix> I mean specifically `Identity :: Type -> Type`
2023-01-23 14:52:27 +0100 <mixphix> wouldn't that be what lyxia is after with the instance mentioned?
2023-01-23 14:53:06 +0100 <Axman6> being able to say that I and Identity are the same basically
2023-01-23 14:54:01 +0100 <Axman6> and then I guess you could say more things about other types like transformers, Coersible f g => Coersible (StateT s f) (StateT s g)
2023-01-23 14:55:38 +0100 <mixphix> seems like we need Eq1 and Ord1 and friends to get that for type formers, so it may require a new Coercible1?
2023-01-23 15:02:32 +0100 <mixphix> (Coercible a b, Coercible a (f a), Coercible b (g b), Coercible (f a) (g b)) => Coercible1 f g ?
2023-01-23 15:03:06 +0100 <mixphix> perhaps the final superclass is redundant
2023-01-23 15:08:33 +0100thegeekinside(~thegeekin@189.180.66.244)
2023-01-23 15:11:49 +0100jumper149(~jumper149@base.felixspringer.xyz)
2023-01-23 15:13:12 +0100dsrt^(~dsrt@c-24-30-76-89.hsd1.ga.comcast.net) (Ping timeout: 256 seconds)
2023-01-23 15:17:03 +0100haritz(~hrtz@user/haritz) (Ping timeout: 260 seconds)
2023-01-23 15:21:14 +0100beteigeuze(~Thunderbi@bl14-81-220.dsl.telepac.pt) (Read error: Connection reset by peer)
2023-01-23 15:21:26 +0100beteigeuze(~Thunderbi@bl14-81-220.dsl.telepac.pt)
2023-01-23 15:22:31 +0100ddellacosta(~ddellacos@143.244.47.89)
2023-01-23 15:23:47 +0100mei(~mei@user/mei)
2023-01-23 15:27:44 +0100pavonia(~user@user/siracusa) (Quit: Bye!)
2023-01-23 15:27:57 +0100razetime(~Thunderbi@117.193.0.153) (Remote host closed the connection)
2023-01-23 15:33:47 +0100 <dminuoso> mixphix: Without the QuantifiedConstraints portion, thats not really useful
2023-01-23 15:33:55 +0100 <dminuoso> Because *that* you implicitly have already
2023-01-23 15:34:08 +0100 <dminuoso> GHC implicitly has that already in its machiner y
2023-01-23 15:35:16 +0100 <dminuoso> (It subsumes your hypothetical Coercible1)
2023-01-23 15:36:19 +0100ubert(~Thunderbi@p200300ecdf264ecb2960e53501e049b6.dip0.t-ipconnect.de)
2023-01-23 15:36:38 +0100cfricke(~cfricke@user/cfricke) (Quit: WeeChat 3.7.1)
2023-01-23 15:51:51 +0100mechap1(~mechap@user/mechap) (Ping timeout: 255 seconds)
2023-01-23 15:53:36 +0100mechap1(~mechap@user/mechap)
2023-01-23 15:55:39 +0100jao(~jao@cpc103048-sgyl39-2-0-cust502.18-2.cable.virginm.net) (Ping timeout: 260 seconds)
2023-01-23 16:03:04 +0100barzo(~hd@31.223.41.44) (Ping timeout: 256 seconds)
2023-01-23 16:04:57 +0100 <mixphix> ah, i understand better now, yes, because the newtype is telling GHC essentially (forall a. Coercible a (I a))
2023-01-23 16:06:29 +0100coot(~coot@2a02:a310:e241:1b00:ec1a:e9df:79ac:66ba)
2023-01-23 16:06:53 +0100eggplantade(~Eggplanta@2600:1700:38c5:d800:5d38:2665:17cb:f4aa)
2023-01-23 16:08:14 +0100blomberg(~default_u@212-8-250-195.hosted-by-worldstream.net)
2023-01-23 16:08:18 +0100 <blomberg> hi
2023-01-23 16:09:27 +0100 <blomberg> i=1;while i<10; f(i);end in haskell what to write
2023-01-23 16:10:32 +0100gmg(~user@user/gehmehgeh) (Remote host closed the connection)
2023-01-23 16:11:11 +0100eggplantade(~Eggplanta@2600:1700:38c5:d800:5d38:2665:17cb:f4aa) (Ping timeout: 255 seconds)
2023-01-23 16:11:43 +0100gmg(~user@user/gehmehgeh)
2023-01-23 16:13:25 +0100 <raehik> blomberg: `map f [1..9]`
2023-01-23 16:14:05 +0100 <blomberg> [..] is a range object.
2023-01-23 16:14:32 +0100 <raehik> that produces a list of results. if your function instead performs some IO action, you'll need mapM or something else
2023-01-23 16:14:51 +0100 <blomberg> but what if there is more than just a single line in a loop along with a range of i from 1 to 9
2023-01-23 16:14:52 +0100 <raehik> @[1..10]
2023-01-23 16:14:52 +0100 <lambdabot> Unknown command, try @list
2023-01-23 16:15:01 +0100Sgeo(~Sgeo@user/sgeo)
2023-01-23 16:15:05 +0100 <raehik> (how do I talk to ghci here!)
2023-01-23 16:15:17 +0100 <raehik> > [1..10]
2023-01-23 16:15:19 +0100 <lambdabot> [1,2,3,4,5,6,7,8,9,10]
2023-01-23 16:15:25 +0100 <blomberg> > x = 2; show x
2023-01-23 16:15:27 +0100 <lambdabot> <hint>:1:3: error: parse error on input ‘=’
2023-01-23 16:15:37 +0100 <blomberg> % x = 2; show x
2023-01-23 16:15:37 +0100 <yahb2> <interactive>:38:8: error: ; Parse error: module header, import declaration ; or top-level declaration expected.
2023-01-23 16:15:43 +0100 <raehik> blomberg: [1..9] is a list, not a range object (I know of no such thing in Haskell)
2023-01-23 16:15:49 +0100 <mixphix> > let x = 2 in show x
2023-01-23 16:15:50 +0100 <lambdabot> "2"
2023-01-23 16:16:45 +0100 <raehik> blomberg: your function f can be more than a single line
2023-01-23 16:17:15 +0100 <raehik> > map (\i -> i*2+1) [1..3]
2023-01-23 16:17:17 +0100 <lambdabot> [3,5,7]
2023-01-23 16:17:45 +0100 <raehik> swap in any operation on i into the first argument
2023-01-23 16:17:49 +0100 <dminuoso> blomberg: It depends a bit on what `f` is supposed to do.
2023-01-23 16:17:56 +0100 <Axman6> [x..y] is syntax sugar for the function enumFromTo x y
2023-01-23 16:18:00 +0100 <dminuoso> blomberg: but a mostly equivalemt version would be:
2023-01-23 16:18:09 +0100califax(~califax@user/califx) (Remote host closed the connection)
2023-01-23 16:18:12 +0100 <dminuoso> traverse_ f [1..10]
2023-01-23 16:18:27 +0100 <Axman6> % mapM_ print [1..10]
2023-01-23 16:18:27 +0100 <yahb2> 1 ; 2 ; 3 ; 4 ; 5 ; 6 ; 7 ; 8 ; 9 ; 10
2023-01-23 16:18:37 +0100 <Axman6> (; means new line in yahb2)
2023-01-23 16:19:10 +0100califax(~califax@user/califx)
2023-01-23 16:19:12 +0100 <Axman6> % mapM_ (\n -> print (n,n^5)) [1..10]
2023-01-23 16:19:12 +0100 <yahb2> (1,1) ; (2,32) ; (3,243) ; (4,1024) ; (5,3125) ; (6,7776) ; (7,16807) ; (8,32768) ; (9,59049) ; (10,100000)
2023-01-23 16:19:36 +0100 <blomberg> raehik: no f();other code ...
2023-01-23 16:19:43 +0100 <Axman6> blomberg: what do you actually want to do?
2023-01-23 16:20:26 +0100 <blomberg> when mapFilterFold doesn't fit how to loop
2023-01-23 16:20:35 +0100 <Axman6> what?
2023-01-23 16:21:11 +0100haritz(~hrtz@2a02:8010:65b5:0:6009:6384:e3cb:2220)
2023-01-23 16:21:12 +0100haritz(~hrtz@2a02:8010:65b5:0:6009:6384:e3cb:2220) (Changing host)
2023-01-23 16:21:12 +0100haritz(~hrtz@user/haritz)
2023-01-23 16:21:20 +0100 <blomberg> i=1;while i<10;x=3;print(x);f(i);g(x);end
2023-01-23 16:21:48 +0100 <blomberg> how to represent that without while if a loop is complex enough
2023-01-23 16:22:09 +0100 <Axman6> recursion?
2023-01-23 16:22:16 +0100 <blomberg> yes
2023-01-23 16:22:51 +0100 <Axman6> you seem to be looking for imperative answers from a functional language. based on the code you've written I would expect it to loop for ever since i never changes
2023-01-23 16:23:41 +0100 <blomberg> yes
2023-01-23 16:24:07 +0100 <geekosaur> you might do better going through a proper tutorial instead of trying to figure this out with no context
2023-01-23 16:24:08 +0100 <Axman6> well the answer is "it depends"
2023-01-23 16:24:11 +0100 <geekosaur> @where cis194
2023-01-23 16:24:11 +0100 <lambdabot> <https://github.com/byorgey/haskell-course>,<https://www.seas.upenn.edu/~cis194/spring13/lectures.html>
2023-01-23 16:24:14 +0100 <blomberg> imperative to functional conversion is what i am looking , if possible without recursion
2023-01-23 16:24:27 +0100 <Axman6> recursion is all we have, we have no loops
2023-01-23 16:24:38 +0100 <blomberg> Axman6:i mean mapFilterFold
2023-01-23 16:24:47 +0100 <Axman6> what is mapFilterFold
2023-01-23 16:25:14 +0100 <blomberg> Axman6: what would you do in such a situation
2023-01-23 16:25:37 +0100 <blomberg> mapFilterFold is a phrase equivalent word
2023-01-23 16:25:58 +0100 <blomberg> a succint phrase said in a word
2023-01-23 16:26:22 +0100 <blomberg> it's the very definition of elegant communication, don't you like it?
2023-01-23 16:26:28 +0100 <Axman6> forM_ [1..10] $ \i -> do { let x = 3; print x; f i; g x }
2023-01-23 16:27:17 +0100 <Axman6> no, I don't, because only you understand what you actually want to know and you're not explaining to us what you want. It's very poor communication
2023-01-23 16:27:59 +0100werneta(~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net) (Ping timeout: 260 seconds)
2023-01-23 16:28:22 +0100 <blomberg> is my tmux messing with my fonts or did you write forM_ underscore
2023-01-23 16:28:36 +0100 <Axman6> yes
2023-01-23 16:28:39 +0100 <Axman6> :t forM_
2023-01-23 16:28:41 +0100 <lambdabot> (Foldable t, Monad m) => t a -> (a -> m b) -> m ()
2023-01-23 16:28:49 +0100 <Axman6> :t forM_ @[]
2023-01-23 16:28:50 +0100 <lambdabot> error:
2023-01-23 16:28:50 +0100 <lambdabot> Pattern syntax in expression context: forM_@[]
2023-01-23 16:28:50 +0100 <lambdabot> Did you mean to enable TypeApplications?
2023-01-23 16:28:53 +0100 <Axman6> % :t forM_ @[]
2023-01-23 16:28:53 +0100 <yahb2> <interactive>:1:1: error: Variable not in scope: forM_
2023-01-23 16:29:00 +0100 <Axman6> urgh
2023-01-23 16:29:06 +0100 <dminuoso> % import Control.Applicative
2023-01-23 16:29:06 +0100 <yahb2> <no output>
2023-01-23 16:29:12 +0100 <dminuoso> % import Data.Foldable
2023-01-23 16:29:12 +0100 <yahb2> <no output>
2023-01-23 16:29:17 +0100 <dminuoso> % :set -XTypeApplications
2023-01-23 16:29:17 +0100 <yahb2> <no output>
2023-01-23 16:29:18 +0100 <Axman6> % :t forM_ @[]
2023-01-23 16:29:18 +0100 <yahb2> forM_ @[] :: (Foldable [], Monad m) => [a] -> (a -> m b) -> m ()
2023-01-23 16:29:38 +0100 <Axman6> heh, I love that the Foldable constraint remain
2023-01-23 16:29:38 +0100 <dminuoso> Huh, why does GHCi write `Foldable []`
2023-01-23 16:30:42 +0100 <Axman6> blomberg: forM_ is a function which takes some collection containing a's, such as a list of a's, and a function which takes an a and produces some effect, and runs that function over all the a's in the collection
2023-01-23 16:30:50 +0100paulpaul1076(~textual@95-29-5-111.broadband.corbina.ru) (Ping timeout: 268 seconds)
2023-01-23 16:31:28 +0100 <Axman6> it is in fact recursive, but that's not particularly relevant. We don't have loops because loops are just functions and we can define functions, and hence our own control flow, whenever we want
2023-01-23 16:32:58 +0100 <Axman6> > forM_ [1..4] (\i -> replicate i i)
2023-01-23 16:32:59 +0100 <lambdabot> [(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),()]
2023-01-23 16:33:04 +0100 <Axman6> > forM [1..4] (\i -> replicate i i)
2023-01-23 16:33:07 +0100 <lambdabot> [[1,2,3,4],[1,2,3,4],[1,2,3,4],[1,2,3,4],[1,2,3,4],[1,2,3,4],[1,2,3,4],[1,2,...
2023-01-23 16:33:21 +0100 <Axman6> > forM [1..2] (\i -> replicate i i)
2023-01-23 16:33:23 +0100 <lambdabot> [[1,2],[1,2]]
2023-01-23 16:33:29 +0100cheater_(~Username@user/cheater)
2023-01-23 16:33:38 +0100 <Axman6> hmm, why did I not see that coming...
2023-01-23 16:33:43 +0100 <Axman6> I should go to bed
2023-01-23 16:34:09 +0100shriekingnoise(~shrieking@186.137.175.87)
2023-01-23 16:36:02 +0100jpds(~jpds@gateway/tor-sasl/jpds) (Ping timeout: 255 seconds)
2023-01-23 16:36:04 +0100cheater(~Username@user/cheater) (Ping timeout: 252 seconds)
2023-01-23 16:36:05 +0100cheater_cheater
2023-01-23 16:37:33 +0100lortabac(~lortabac@2a01:e0a:541:b8f0:188f:1e96:e3af:2697) (Quit: WeeChat 2.8)
2023-01-23 16:39:12 +0100jpds(~jpds@gateway/tor-sasl/jpds)
2023-01-23 16:53:35 +0100califax(~califax@user/califx) (Ping timeout: 255 seconds)
2023-01-23 16:56:22 +0100troydm(~troydm@user/troydm)
2023-01-23 16:58:49 +0100califax(~califax@user/califx)
2023-01-23 16:58:54 +0100 <blomberg> Axman6: which country are you
2023-01-23 17:00:07 +0100tsns(~tsns@91.150.188.137)
2023-01-23 17:00:32 +0100 <blomberg> > forM [1..3] (\i -> replicate i)
2023-01-23 17:00:33 +0100jonathanx_(~jonathan@h-178-174-176-109.A357.priv.bahnhof.se)
2023-01-23 17:00:34 +0100 <lambdabot> error:
2023-01-23 17:00:34 +0100 <lambdabot> • No instance for (Typeable a0)
2023-01-23 17:00:34 +0100 <lambdabot> arising from a use of ‘show_M69981822229756555178’
2023-01-23 17:00:39 +0100 <blomberg> > forM [1..3] (\i -> replicate i i)
2023-01-23 17:00:41 +0100 <tsns> Okay im not trolling now. So tell me if you are interested in learning or using Mercury programming language. If yes i will stop using it.
2023-01-23 17:00:41 +0100 <lambdabot> [[1,2,3],[1,2,3],[1,2,3],[1,2,3],[1,2,3],[1,2,3]]
2023-01-23 17:01:03 +0100emad(~emad@41.43.90.128) (Quit: Leaving)
2023-01-23 17:02:10 +0100 <geekosaur> Mercury's not a bad language. Haskell exists mostly because Mercury was closed source, so PL researchers had to buy a source license
2023-01-23 17:02:34 +0100 <geekosaur> so Haskell was designed to be an open source and open specification alternative
2023-01-23 17:02:52 +0100 <tsns> geekosaur: So all Haskellers will move to Mercury in next few years right?
2023-01-23 17:03:03 +0100 <geekosaur> probably not
2023-01-23 17:03:11 +0100 <tsns> 50%
2023-01-23 17:03:13 +0100 <tsns> ?
2023-01-23 17:03:31 +0100jonathanx(~jonathan@h-178-174-176-109.A357.priv.bahnhof.se) (Ping timeout: 268 seconds)
2023-01-23 17:03:36 +0100 <geekosaur> (Mercury did open its source, about 30 years too late)
2023-01-23 17:04:31 +0100 <mauke> @where ops
2023-01-23 17:04:31 +0100 <lambdabot> byorgey Cale conal copumpkin dcoutts dibblego dolio edwardk geekosaur glguy jmcarthur johnw mniip monochrom quicksilver shachaf shapr ski
2023-01-23 17:04:44 +0100 <geekosaur> if Mercury does what you need, keep using it. others will make their own decisions
2023-01-23 17:05:18 +0100 <mauke> wow, that's some lag
2023-01-23 17:05:22 +0100 <geekosaur> yeh
2023-01-23 17:05:51 +0100 <geekosaur> bridge has been rather laggy of late, took around half an hour to relay stuff in #xmonad the other day
2023-01-23 17:06:25 +0100 <dolio> I think you're thinking of something else. Mercury is very different from Haskell.
2023-01-23 17:06:40 +0100 <mauke> Miranda
2023-01-23 17:06:41 +0100 <geekosaur> oh, sorry
2023-01-23 17:06:50 +0100geekosauris very underslept this morning
2023-01-23 17:06:52 +0100 <tsns> Haha
2023-01-23 17:07:04 +0100 <geekosaur> woke around 3
2023-01-23 17:07:05 +0100 <tsns> I could write "typical haskeller"
2023-01-23 17:07:19 +0100geekosaurhas no idea what a "typical haskeller" is
2023-01-23 17:07:33 +0100tsnscant write because ban und kick
2023-01-23 17:07:45 +0100 <mauke> so anyway, can we ban this troll?
2023-01-23 17:08:08 +0100ChanServ+o dolio
2023-01-23 17:08:08 +0100dolio+b tsns!*@*
2023-01-23 17:08:53 +0100 <geekosaur> oh, right, logic programming. dunno why anyone would compare to haskell
2023-01-23 17:09:32 +0100 <geekosaur> maybe he wanted to pick on curry instead of haskell
2023-01-23 17:09:42 +0100dolio-o dolio
2023-01-23 17:13:02 +0100 <carbolymer> is comonad.com gone?
2023-01-23 17:13:59 +0100 <dminuoso> Seems like it
2023-01-23 17:14:07 +0100 <carbolymer> oh it seems that it's mirrored on ekmett.github.io
2023-01-23 17:14:08 +0100 <carbolymer> cool
2023-01-23 17:15:05 +0100mastarija(~mastarija@188.252.197.161) (Quit: WeeChat 3.7.1)
2023-01-23 17:16:01 +0100albet70(~xxx@2400:8902::f03c:92ff:fe60:98d8) (Remote host closed the connection)
2023-01-23 17:19:50 +0100witcher(~witcher@static.74.224.203.116.clients.your-server.de) (Remote host closed the connection)
2023-01-23 17:20:21 +0100witcher(~witcher@wiredspace.de)
2023-01-23 17:20:52 +0100natto(~natto@140.238.225.67) (Quit: a.)
2023-01-23 17:21:46 +0100natto(~natto@140.238.225.67)
2023-01-23 17:22:07 +0100albet70(~xxx@2400:8902::f03c:92ff:fe60:98d8)
2023-01-23 17:23:52 +0100califax(~califax@user/califx) (Remote host closed the connection)
2023-01-23 17:25:52 +0100califax(~califax@user/califx)
2023-01-23 17:26:53 +0100 <blomberg> geekosaur: is there a math course from seas.upenn.edu as well
2023-01-23 17:27:40 +0100 <geekosaur> no idea
2023-01-23 17:28:17 +0100 <geekosaur> we know of the haskell course because its instructor is active in the haskell community
2023-01-23 17:28:43 +0100werneta(~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net)
2023-01-23 17:28:57 +0100 <geekosaur> unlikely anyone here knows whether any of the math courses are online like byorgey's course
2023-01-23 17:28:58 +0100 <blomberg> Mercury is a purely declarative logic programming language. It is related to both Prolog and Haskell https://codedocs.org/what-is/mercury-programming-language that explain why he was asking about mercury as both are Declaractive
2023-01-23 17:29:29 +0100 <geekosaur> well, yes, but it's a logic language. curry is like haskell in many ways but is also a logic language
2023-01-23 17:29:43 +0100 <jean-paul[m]> Does anyone know of a list of future Haskell-related conferences?
2023-01-23 17:30:29 +0100 <geekosaur> and apparently he popped up in ##prolog after the first time he showed up in here, so focusing on logic languages
2023-01-23 17:30:47 +0100 <geekosaur> jean-paul[m], I'd check the Discourse or Reddit
2023-01-23 17:31:49 +0100 <blomberg> geekosaur: sarcasm?
2023-01-23 17:31:56 +0100 <blomberg> math is famous
2023-01-23 17:32:07 +0100 <carbolymer> jean-paul[m]: https://wiki.haskell.org/Conferences ?
2023-01-23 17:32:12 +0100 <blomberg> how could someone be so ignorant of it's resources
2023-01-23 17:32:27 +0100 <carbolymer> jean-paul[m]: but it's not complete, e.g. there's no haskell-exchange
2023-01-23 17:32:37 +0100rekahsoft(~rekahsoft@bras-base-orllon1122w-grc-07-174-95-68-39.dsl.bell.ca)
2023-01-23 17:32:48 +0100tsns(~tsns@91.150.188.137) ()
2023-01-23 17:32:48 +0100 <jean-paul[m]> Those seem to all be past conferences
2023-01-23 17:33:06 +0100yrlnry(~yrlnry@2600:4040:738e:5400:b8c6:a4da:9f09:51fa)
2023-01-23 17:33:13 +0100 <blomberg> carbolymer: but haskell curry was a mathematician, so looks like we need math category theory and foundational math courses
2023-01-23 17:33:21 +0100 <blomberg> /resources
2023-01-23 17:33:33 +0100 <geekosaur> you need zero category theory to learn haskell
2023-01-23 17:33:35 +0100 <carbolymer> blomberg: ?
2023-01-23 17:34:17 +0100 <yrlnry> I want to use `Control.Concurrent.Async`'s `Async` type, and I have `import Control.Concurrent.Async` in my file, but GHC says `Not in scope: type constructor or class ‘Async’`. What might be wrong?
2023-01-23 17:34:23 +0100 <geekosaur> I don't know any CT but it hasn't stopped me from maintaining xmonad for the past 15ish years
2023-01-23 17:34:55 +0100 <yrlnry> (Hi Brandon)
2023-01-23 17:35:28 +0100 <carbolymer> yrlnry: paste code on pastebin
2023-01-23 17:35:38 +0100 <mauke> CT is my favorite SNES RPG
2023-01-23 17:36:04 +0100 <geekosaur> yrlnry, it looks to me like Async is a hidden type, you're supposed to use `async` or `withAsync` to construct one
2023-01-23 17:36:37 +0100 <mauke> no, it's exported
2023-01-23 17:36:45 +0100 <carbolymer> but not the constructor
2023-01-23 17:36:50 +0100 <carbolymer> hence the need for the code
2023-01-23 17:36:52 +0100 <yrlnry> I don't need to construct one, I need to declare a function that takes an `Async Result` argument.
2023-01-23 17:37:14 +0100 <yrlnry> Just a moment while I paste.
2023-01-23 17:38:06 +0100 <geekosaur> Oh, type constructor
2023-01-23 17:38:10 +0100califax(~califax@user/califx) (Remote host closed the connection)
2023-01-23 17:38:17 +0100 <geekosaur> looks like it should be there
2023-01-23 17:40:18 +0100 <yrlnry> https://paste.tomsmeding.com/d6JXcsBp
2023-01-23 17:40:53 +0100carbolymeris not seeing any imports there
2023-01-23 17:41:13 +0100 <carbolymer> ah it's at the end
2023-01-23 17:41:18 +0100 <mauke> that's not even valid code
2023-01-23 17:41:24 +0100 <mauke> how am I supposed to run this?
2023-01-23 17:41:26 +0100 <yrlnry> I can upload the entire file but i thought this would be more helpful.
2023-01-23 17:41:30 +0100 <yrlnry> I will upload the entire file.
2023-01-23 17:41:57 +0100eggplantade(~Eggplanta@104-55-37-220.lightspeed.sntcca.sbcglobal.net)
2023-01-23 17:42:51 +0100chele(~chele@user/chele) (Remote host closed the connection)
2023-01-23 17:43:18 +0100 <yrlnry> https://paste.tomsmeding.com/MpzrcAE5
2023-01-23 17:43:56 +0100ham2(~ham@user/ham) (Ping timeout: 256 seconds)
2023-01-23 17:44:03 +0100nschoe(~q@141.101.51.197) (Ping timeout: 260 seconds)
2023-01-23 17:44:24 +0100 <yrlnry> The channel's recommended paste does not have an option to select a local file for upload! The only option is to copy-paste using the cut buffer!
2023-01-23 17:44:34 +0100 <yrlnry> Did I miss something?
2023-01-23 17:44:50 +0100califax(~califax@user/califx)
2023-01-23 17:45:13 +0100 <carbolymer> probably the fact that the pastebin is open salsa, so you can create an issue about that, or even PR
2023-01-23 17:45:39 +0100 <geekosaur> I just use `xclip`
2023-01-23 17:46:08 +0100 <yrlnry> The Github page suggests using `curl`.
2023-01-23 17:46:24 +0100 <mauke> I get all kinds of errors, but nothing about Async
2023-01-23 17:47:28 +0100ham2(~ham@user/ham)
2023-01-23 17:48:04 +0100 <yrlnry> How about if I push the current state of the repo and let you run `cabal test`? Or is that silly?
2023-01-23 17:49:03 +0100bgs(~bgs@212-85-160-171.dynamic.telemach.net)
2023-01-23 17:51:35 +0100 <yrlnry> Please fetch https://github.com/mjdominus-ly/tasty/tree/demo , that's 50cc5bb0b , and in the `quickcheck` directory run `cabal test`. That's how I produce this error.
2023-01-23 17:57:26 +0100n0den1te(~n0den1te@223.178.83.121) (Quit: leaving)
2023-01-23 17:59:29 +0100use-value(~Thunderbi@2a00:23c6:8a03:2f01:44e8:662a:49b5:c27)
2023-01-23 18:00:52 +0100jao(~jao@cpc103048-sgyl39-2-0-cust502.18-2.cable.virginm.net)
2023-01-23 18:02:37 +0100telser(~quassel@user/telser)
2023-01-23 18:03:34 +0100 <mauke> got it
2023-01-23 18:04:10 +0100 <mauke> yrlnry: https://github.com/mjdominus-ly/tasty/blob/demo/core/Control/Concurrent/Async.hs#L41-L42
2023-01-23 18:04:13 +0100waleee(~waleee@2001:9b0:213:7200:cc36:a556:b1e8:b340)
2023-01-23 18:05:05 +0100 <mauke> also, for some reason :t undefined :: Async produces no output in my ghci, not even a kind error. is this a known bug in 8.8.4?
2023-01-23 18:05:45 +0100jero98772(~jero98772@2800:484:1d80:d8ce:3490:26c5:1782:da8c)
2023-01-23 18:06:04 +0100 <mauke> I got suspicious when find . -name '*.cabal' -exec grep async -- '{}' ';' produced no results in the repo
2023-01-23 18:06:10 +0100 <yrlnry> That's funny, I thought I had checked it and found that the `Async` tycon was expored.
2023-01-23 18:06:16 +0100 <mauke> so I did find . -name 'Async.hs' and here we are
2023-01-23 18:06:53 +0100califax(~califax@user/califx) (Remote host closed the connection)
2023-01-23 18:07:32 +0100 <yrlnry> Am I understanding this correctly that Tasty carries around its own version of `Control.Concurrent.Async`?
2023-01-23 18:08:11 +0100 <yrlnry> -- These are the same as in the 'async' package. We do not use
2023-01-23 18:08:12 +0100 <yrlnry> -- 'async' to avoid its dependencies.
2023-01-23 18:08:50 +0100 <yrlnry> mauke: Thanks very much
2023-01-23 18:08:54 +0100blomberg(~default_u@212-8-250-195.hosted-by-worldstream.net) (Ping timeout: 260 seconds)
2023-01-23 18:09:04 +0100 <mauke> I don't know what Tasty is, but there is a non-standard version of Control.Concurrent.Async in that repo
2023-01-23 18:09:18 +0100 <yrlnry> Yes, quite so. Thanks again.
2023-01-23 18:09:26 +0100 <mauke> which doesn't seem to match any published version that github knows about
2023-01-23 18:10:00 +0100thongpv(~thongpv87@2001:ee0:5577:f0d0:6f9:a080:d692:e79a) (Leaving)
2023-01-23 18:10:12 +0100 <mauke> I think all standard versions have exported the Async type
2023-01-23 18:10:14 +0100califax(~califax@user/califx)
2023-01-23 18:10:48 +0100califax(~califax@user/califx) (Remote host closed the connection)
2023-01-23 18:11:05 +0100 <yrlnry> Tasty is a popular test framework. Yes, the standard Control.Concurrent.Async does export the type, and that's the code I was looking at when I checked to see if it was exported. I didn't realize that Tasty was carrying around a nonstandard version of the module.
2023-01-23 18:11:21 +0100califax(~califax@user/califx)
2023-01-23 18:11:37 +0100mizlan(~mizlan@2607:f010:2e9:21:14bc:4086:1ef4:6214)
2023-01-23 18:12:10 +0100 <mauke> yeah, I was really confused for a while :-)
2023-01-23 18:12:37 +0100ncf(~n@monade.li) (Quit: Fairfarren.)
2023-01-23 18:12:46 +0100ncf(~n@monade.li)
2023-01-23 18:12:51 +0100CiaoSen(~Jura@p200300c9572d4e002a3a4dfffe84dbd5.dip0.t-ipconnect.de) (Ping timeout: 265 seconds)
2023-01-23 18:13:56 +0100 <mauke> % :t undefined :: Maybe
2023-01-23 18:13:56 +0100 <yahb2> <interactive>:1:14: error: ; • Expecting one more argument to ‘Maybe’ ; Expected a type, but ‘Maybe’ has kind ‘* -> *’ ; • In an expression type signature: Maybe ; In the expres...
2023-01-23 18:19:24 +0100tzh(~tzh@c-24-21-73-154.hsd1.wa.comcast.net)
2023-01-23 18:21:27 +0100 <mauke> smh, https://www.adena.org/news/detail/copingwithscoping doesn't even mention lexical variables
2023-01-23 18:21:47 +0100 <yrlnry> :-)
2023-01-23 18:30:42 +0100shapr(~user@68.54.166.125) (Remote host closed the connection)
2023-01-23 18:30:45 +0100econo(uid147250@user/econo)
2023-01-23 18:32:15 +0100kuribas(~user@ip-188-118-57-242.reverse.destiny.be) (Remote host closed the connection)
2023-01-23 18:36:01 +0100mikoto-chan(~mikoto-ch@2001:999:400:22bc:5dfb:b243:3fed:bd17)
2023-01-23 18:45:02 +0100califax(~califax@user/califx) (Remote host closed the connection)
2023-01-23 18:45:47 +0100MajorBiscuit(~MajorBisc@145.94.182.137) (Ping timeout: 264 seconds)
2023-01-23 18:46:27 +0100califax(~califax@user/califx)
2023-01-23 18:48:12 +0100mmhat(~mmh@p200300f1c7123ce1ee086bfffe095315.dip0.t-ipconnect.de)
2023-01-23 18:48:49 +0100mmhat(~mmh@p200300f1c7123ce1ee086bfffe095315.dip0.t-ipconnect.de) (Client Quit)
2023-01-23 19:05:26 +0100califax(~califax@user/califx) (Ping timeout: 255 seconds)
2023-01-23 19:10:42 +0100Sciencentistguy7(~sciencent@hacksoc/ordinary-member)
2023-01-23 19:10:45 +0100califax(~califax@user/califx)
2023-01-23 19:12:14 +0100Sciencentistguy(~sciencent@hacksoc/ordinary-member) (Ping timeout: 246 seconds)
2023-01-23 19:12:14 +0100Sciencentistguy7Sciencentistguy
2023-01-23 19:16:31 +0100mbuf(~Shakthi@49.204.137.190) (Quit: Leaving)
2023-01-23 19:21:23 +0100eggplantade(~Eggplanta@104-55-37-220.lightspeed.sntcca.sbcglobal.net) (Remote host closed the connection)
2023-01-23 19:23:26 +0100Shaeto(~Shaeto@94.25.234.181) (Read error: No route to host)
2023-01-23 19:24:39 +0100Shaeto(~Shaeto@94.25.234.181)
2023-01-23 19:27:26 +0100mei(~mei@user/mei) (Remote host closed the connection)
2023-01-23 19:28:35 +0100califax(~califax@user/califx) (Remote host closed the connection)
2023-01-23 19:29:49 +0100mei(~mei@user/mei)
2023-01-23 19:30:36 +0100coot(~coot@2a02:a310:e241:1b00:ec1a:e9df:79ac:66ba) (Quit: coot)
2023-01-23 19:31:02 +0100merijn(~merijn@c-001-001-014.client.esciencecenter.eduvpn.nl) (Ping timeout: 256 seconds)
2023-01-23 19:33:04 +0100califax(~califax@user/califx)
2023-01-23 19:33:12 +0100trev(~trev@user/trev) (Remote host closed the connection)
2023-01-23 19:34:10 +0100trev(~trev@user/trev)
2023-01-23 19:35:00 +0100mikoto-chan(~mikoto-ch@2001:999:400:22bc:5dfb:b243:3fed:bd17) (Ping timeout: 256 seconds)
2023-01-23 19:38:18 +0100beteigeuze(~Thunderbi@bl14-81-220.dsl.telepac.pt) (Ping timeout: 252 seconds)
2023-01-23 19:42:34 +0100beteigeuze(~Thunderbi@bl14-81-220.dsl.telepac.pt)
2023-01-23 19:46:58 +0100beteigeuze(~Thunderbi@bl14-81-220.dsl.telepac.pt) (Ping timeout: 252 seconds)
2023-01-23 19:51:15 +0100mizlan(~mizlan@2607:f010:2e9:21:14bc:4086:1ef4:6214) (Ping timeout: 255 seconds)
2023-01-23 19:56:38 +0100califax(~califax@user/califx) (Remote host closed the connection)
2023-01-23 19:57:50 +0100mei(~mei@user/mei) (Remote host closed the connection)
2023-01-23 19:58:08 +0100califax(~califax@user/califx)
2023-01-23 19:58:14 +0100cheater(~Username@user/cheater) (Read error: Connection reset by peer)
2023-01-23 19:59:06 +0100cheater(~Username@user/cheater)
2023-01-23 19:59:22 +0100merijn(~merijn@c-001-001-014.client.esciencecenter.eduvpn.nl)
2023-01-23 20:02:38 +0100eggplantade(~Eggplanta@2600:1700:38c5:d800:5d38:2665:17cb:f4aa)
2023-01-23 20:12:09 +0100califax(~califax@user/califx) (Remote host closed the connection)
2023-01-23 20:15:52 +0100califax(~califax@user/califx)
2023-01-23 20:16:04 +0100califax(~califax@user/califx) (Remote host closed the connection)
2023-01-23 20:19:37 +0100califax(~califax@user/califx)
2023-01-23 20:24:03 +0100eggplantade(~Eggplanta@2600:1700:38c5:d800:5d38:2665:17cb:f4aa) (Remote host closed the connection)
2023-01-23 20:24:33 +0100codaraxis(~codaraxis@user/codaraxis)
2023-01-23 20:28:56 +0100ralu1(~ralu@static.211.245.203.116.clients.your-server.de) (Ping timeout: 246 seconds)
2023-01-23 20:30:30 +0100 <yrlnry> I had a call to `handle (pure . mkTimeoutResultWithSeed s) ... ` where I expected the handler to be invoked, but it appeared it wasn't, because a `trace s ...` inside of `mkTimeoutResultWithSeed` wasn't printing anything.
2023-01-23 20:31:40 +0100merijn(~merijn@c-001-001-014.client.esciencecenter.eduvpn.nl) (Ping timeout: 256 seconds)
2023-01-23 20:31:51 +0100 <yrlnry> A colleague suggested replacing this with `handle (mkTimeoutResultWithSeed s)` and changing `mkTimeoutResultWithSeed` to `print s >> ...` instead. I said that wouldn't change the behavior, but I was wong.
2023-01-23 20:31:56 +0100 <yrlnry> *wrong.
2023-01-23 20:32:43 +0100 <yrlnry> I don't understand why this is different. Either way the argument to `handle` is an IO action that has the trace or print wrapped up inside it. Why would one form run the action but the other doesn't?
2023-01-23 20:33:06 +0100 <[exa]> where's the mkTimeoutResultWithSeed thingy coming from?
2023-01-23 20:33:45 +0100nschoe(~q@2a01:e0a:8e:a190:2d0f:b7a4:d564:8e95)
2023-01-23 20:34:45 +0100 <[exa]> anyway, AFAIK `trace` is basically `unsafePerformIO` and in this context I wouldn't bet anything on the reliability there. :D
2023-01-23 20:35:04 +0100 <yrlnry> It's an int that is bound farther up in the same do-block that contains the `handle` expression.
2023-01-23 20:35:06 +0100 <[exa]> spoiler: try `traceM`
2023-01-23 20:35:53 +0100Tuplanolla(~Tuplanoll@91-159-68-152.elisa-laajakaista.fi)
2023-01-23 20:36:00 +0100 <[exa]> also, do you use the "timeout result" somehow?
2023-01-23 20:36:46 +0100avicenzi(~avicenzi@2a00:ca8:a1f:b004::c32) (Ping timeout: 256 seconds)
2023-01-23 20:37:53 +0100 <yrlnry> I couldn't use `traceM` in the old code because `mkTimeoutResultWithSeed` was Int -> SomeException -> Result. With the change, it changed to Int -> SomeException -> IO Result. My question is why does it matter whether I use the old form, and give handle (pure . x) where x is SomeException -> Result, or use the new form, where I give handle (x) where x is SomeException -> IO Result?
2023-01-23 20:38:13 +0100eggplantade(~Eggplanta@2600:1700:38c5:d800:5d38:2665:17cb:f4aa)
2023-01-23 20:38:18 +0100 <yrlnry> (In the new form, it doesn't matter if I use `putStrLn` or `traceM`, but that's not a mystery.)
2023-01-23 20:39:11 +0100 <[exa]> yrlnry: I'd expect that you didn't really "trigger" the `trace` there, because of laziness you need to use/patternmatch the `s` in the external code somewhere for that to happen
2023-01-23 20:39:27 +0100 <[exa]> if that isn't the case, I blame unsafePerformIO+handle
2023-01-23 20:39:34 +0100 <yrlnry> But why would the change I made affect that?
2023-01-23 20:40:06 +0100 <[exa]> because `print` gets force-executed by IO evaluation
2023-01-23 20:40:23 +0100 <[exa]> which isn't the case with `trace`, which can hang there forever
2023-01-23 20:41:12 +0100califax(~califax@user/califx) (Remote host closed the connection)
2023-01-23 20:41:22 +0100 <[exa]> I hope I understood the problem right though. :]
2023-01-23 20:41:42 +0100 <yrlnry> Well, someone doesn't understand, but I'm not sure which of us it is.
2023-01-23 20:42:16 +0100 <yrlnry> I'll try to write up a clearer question.
2023-01-23 20:42:23 +0100 <mauke> it is an IO action that has the trace or print wrapped up inside it, but in different ways
2023-01-23 20:42:26 +0100eggplantade(~Eggplanta@2600:1700:38c5:d800:5d38:2665:17cb:f4aa) (Remote host closed the connection)
2023-01-23 20:42:49 +0100 <mauke> print produces an action that explicitly performs output when executed
2023-01-23 20:43:22 +0100 <mauke> `pure (error "whatever")` might never evaluate the argument (and hence throw the error)
2023-01-23 20:43:41 +0100 <mauke> as far as IO is concerned, pure x has no effects
2023-01-23 20:43:41 +0100ralu1(~ralu@static.211.245.203.116.clients.your-server.de)
2023-01-23 20:43:52 +0100califax(~califax@user/califx)
2023-01-23 20:43:54 +0100nschoe(~q@2a01:e0a:8e:a190:2d0f:b7a4:d564:8e95) (Quit: Switching off)
2023-01-23 20:43:57 +0100 <yrlnry> *light goes on*
2023-01-23 20:43:57 +0100 <mauke> so whether (and when) `x` "happens" depends on how you use the result
2023-01-23 20:44:26 +0100 <[exa]> yrlnry: try putting `let x = 1 : traceShowId 2` into ghci, it only prints out when you actually need the value
2023-01-23 20:44:40 +0100 <yrlnry> exa: that part I already know though.
2023-01-23 20:44:41 +0100 <[exa]> uh s/:/+/ sorry, the keys are so tiny today
2023-01-23 20:45:47 +0100 <mauke> another way of looking at it is that IO provides sequential execution, but you can still thread lazy values through it
2023-01-23 20:46:10 +0100 <mauke> and with the latter you're dealing purely with data dependencies
2023-01-23 20:48:13 +0100califax(~califax@user/califx) (Remote host closed the connection)
2023-01-23 20:51:51 +0100pavonia(~user@user/siracusa)
2023-01-23 20:52:08 +0100 <yrlnry> A colleague explains: the essential difference here is between `x <- pure (undefined $ 1 + 1)` and `x <- undefined >> pure (1+1)`.
2023-01-23 20:53:17 +0100elevenkb(~elevenkb@105.224.34.126)
2023-01-23 20:53:46 +0100mikoto-chan(~mikoto-ch@2001:999:400:22bc:5dfb:b243:3fed:bd17)
2023-01-23 20:53:56 +0100ft(~ft@p4fc2a257.dip0.t-ipconnect.de)
2023-01-23 20:56:14 +0100beteigeuze(~Thunderbi@a79-169-109-107.cpe.netcabo.pt)
2023-01-23 20:57:10 +0100 <mauke> yes, in a sense. there is also a third option: `x <- throwIO (ErrorCall "undef") >> pure (1+1)`
2023-01-23 21:00:48 +0100beteigeuze(~Thunderbi@a79-169-109-107.cpe.netcabo.pt) (Ping timeout: 252 seconds)
2023-01-23 21:02:39 +0100Shaeto(~Shaeto@94.25.234.181) (Quit: WeeChat 3.8)
2023-01-23 21:09:48 +0100 <EvanR> @src undefined
2023-01-23 21:09:48 +0100 <lambdabot> undefined = error "Prelude.undefined"
2023-01-23 21:09:53 +0100 <EvanR> @src error
2023-01-23 21:09:54 +0100 <lambdabot> error s = throw (ErrorCall s)
2023-01-23 21:10:07 +0100 <EvanR> guess that is slightly different
2023-01-23 21:11:10 +0100califax(~califax@user/califx)
2023-01-23 21:11:24 +0100elevenkb(~elevenkb@105.224.34.126) (Quit: Client closed)
2023-01-23 21:11:54 +0100 <geekosaur> same issue,m actually. `throw` is pure and only does its thing when forced
2023-01-23 21:12:07 +0100 <geekosaur> `throwIO` is in IO and does its thing when executes
2023-01-23 21:12:10 +0100 <geekosaur> *executed
2023-01-23 21:12:54 +0100 <monochrom> If you understand error, then throw is just a generalization.
2023-01-23 21:13:16 +0100 <monochrom> In particular how both are equally delayed by lazy evaluation.
2023-01-23 21:13:31 +0100bgs(~bgs@212-85-160-171.dynamic.telemach.net) (Remote host closed the connection)
2023-01-23 21:14:10 +0100ralu1(~ralu@static.211.245.203.116.clients.your-server.de) (Ping timeout: 256 seconds)
2023-01-23 21:14:42 +0100 <monochrom> Regarding "undefined >> pure (1+1)", you should also try it with Control.Monad.State.Lazy >:)
2023-01-23 21:15:42 +0100califax(~califax@user/califx) (Remote host closed the connection)
2023-01-23 21:16:17 +0100caubert(~caubert@user/caubert) (Ping timeout: 255 seconds)
2023-01-23 21:17:17 +0100califax(~califax@user/califx)
2023-01-23 21:17:35 +0100caubert(~caubert@user/caubert)
2023-01-23 21:19:10 +0100 <hololeap> I have a question about string vs text: if you're parsing a key:value document and store all the values as Text, then later you will probably parse those Texts into other types, is there any reason to store them as Text in the first place?
2023-01-23 21:19:56 +0100califax(~califax@user/califx) (Remote host closed the connection)
2023-01-23 21:20:28 +0100caubert(~caubert@user/caubert) (Read error: Connection reset by peer)
2023-01-23 21:20:31 +0100 <monochrom> Will the text be live after parsing?
2023-01-23 21:20:50 +0100yrlnry(~yrlnry@2600:4040:738e:5400:b8c6:a4da:9f09:51fa) (Quit: Leaving...)
2023-01-23 21:21:00 +0100 <hololeap> let's just say no for argument's sake (this is kind of contrived)
2023-01-23 21:21:16 +0100mei(~mei@user/mei)
2023-01-23 21:21:48 +0100 <monochrom> Are you also aware of the "copy" function and why you need it and when?
2023-01-23 21:21:52 +0100 <hololeap> and by "live" I assume you mean the Text value will get displayed somewhere before getting converted
2023-01-23 21:22:05 +0100 <hololeap> no
2023-01-23 21:22:19 +0100 <monochrom> No, I mean the same "live" as in garbage collection's "live".
2023-01-23 21:23:17 +0100califax(~califax@user/califx)
2023-01-23 21:23:20 +0100 <hololeap> I'm not sure
2023-01-23 21:23:48 +0100 <hololeap> what would the alternative be?
2023-01-23 21:23:53 +0100yrlnry(~yrlnry@2600:4040:738e:5400:b8c6:a4da:9f09:51fa)
2023-01-23 21:24:30 +0100caubert(~caubert@user/caubert)
2023-01-23 21:24:58 +0100 <monochrom> The fundamental consideration is this trade-off: Text is more compact if live, [Char] is more compact if not live.
2023-01-23 21:25:11 +0100 <yrlnry> Why does the command-line `hoogle 'Async a -> ThreadID'` produce `Algebra.NormedSpace.Maximum normFoldable :: (C a v, Foldable f) => f v -> a` ?? (I understand that `ThreadID` is misspelled, my question is why _does_ it produce this irrelevant result, not why doesn't it produce the stuff I wanted.)
2023-01-23 21:25:36 +0100 <monochrom> or rather, [Char] is more compact if streamed.
2023-01-23 21:26:27 +0100 <hololeap> oh, damn. this is getting into some unfamiliar territory for me
2023-01-23 21:26:39 +0100 <mauke> heh. hoogle is really scraping the bottom of the barrel there
2023-01-23 21:27:04 +0100 <mauke> I mean, that type signature sort of fits if you set f = Async, v = a, a = ThreadID
2023-01-23 21:27:21 +0100 <monochrom> hoogle was probably overgeneralizing to arbitrary "x y -> z" first.
2023-01-23 21:27:48 +0100 <yrlnry> Surely there are other f a -> b functions it could also have reported?
2023-01-23 21:27:51 +0100 <mauke> the instances are missing, but I doubt hoogle is aware of which classes can be sensibly instantiated with which types
2023-01-23 21:27:54 +0100 <monochrom> This is why I find hoogle misleading at my level.
2023-01-23 21:28:45 +0100 <yrlnry> Well, maybe not. Asking `hoogle 'a b -> c'` explicitly does not produce anything else.
2023-01-23 21:28:52 +0100 <mauke> hoogle doesn't know any `a b -> c` functions other than normFoldable and normFoldable1, apparently
2023-01-23 21:28:54 +0100caubert_(~caubert@user/caubert)
2023-01-23 21:29:03 +0100 <mauke> https://hoogle.haskell.org/?scope=set%3Astackage&hoogle=a%20b%20-%3E%20c
2023-01-23 21:29:10 +0100Lycurgus(~juan@user/Lycurgus)
2023-01-23 21:29:12 +0100 <hololeap> monochrom: I'll search for "haskell" "text" "copy" and see what comes up, unless you know of any really good resources that talk about the GC and what needs to be taken into consideration with it
2023-01-23 21:29:25 +0100 <monochrom> The doc of copy itself.
2023-01-23 21:29:37 +0100 <monochrom> Plus the knowledge that:
2023-01-23 21:29:47 +0100caubert(~caubert@user/caubert) (Ping timeout: 260 seconds)
2023-01-23 21:30:20 +0100caubert_caubert
2023-01-23 21:30:51 +0100 <monochrom> 1. Text is a record of (address of the whole array, length, index of the character you consider "1st character" in the array)
2023-01-23 21:31:20 +0100 <mauke> `length` or `runIdentity` have similarly-shaped types, but it's rare to have `a b -> c` where a, b, c are distinct type variables and no concrete types are involved
2023-01-23 21:31:40 +0100 <monochrom> 2. slice simply inherits that address, and plays with length and index
2023-01-23 21:31:53 +0100 <monochrom> Therefore, very obviously:
2023-01-23 21:32:11 +0100 <monochrom> A. Suppose you have a 1GB Text.
2023-01-23 21:32:41 +0100 <monochrom> B. You slice a 10-character chunk of that. You forget the original Text. Well, "forget"...
2023-01-23 21:32:53 +0100 <monochrom> Then the original 1GB Text is still live.
2023-01-23 21:33:20 +0100 <monochrom> which is clearly how most people envision how to code up a parser that inputs Text.
2023-01-23 21:34:01 +0100 <monochrom> "copy" creates a fresh address so that the original Text has a better chance of becoming dead later.
2023-01-23 21:34:33 +0100mixphix(~cigsender@74.124.58.162) (Quit: Lost terminal)
2023-01-23 21:34:54 +0100tcard(~tcard@2400:4051:5801:7500:cf17:befc:ff82:5303) (Quit: Leaving)
2023-01-23 21:35:06 +0100 <hololeap> so, if you were to do `let smallText = take 10 bigText`, every time you used smallText it would actually be performing an operation on bigText and returning the output of that?
2023-01-23 21:35:48 +0100 <mauke> is it possible to create a type that handles this situation better? like, if the program only has a 10-character slice from somewhere in the middle, could a smarter data type somehow unmap the other pages?
2023-01-23 21:36:10 +0100 <monochrom> Yes. The beauty of purity ergo sharability.
2023-01-23 21:36:39 +0100tcard(~tcard@2400:4051:5801:7500:cf17:befc:ff82:5303)
2023-01-23 21:36:50 +0100merijn(~merijn@c-001-001-014.client.esciencecenter.eduvpn.nl)
2023-01-23 21:36:52 +0100 <int-e> hololeap: "operation"... Text holds a byte array, an offset, and a length.
2023-01-23 21:36:58 +0100bontaq(~user@ool-45779fe5.dyn.optonline.net) (Ping timeout: 252 seconds)
2023-01-23 21:37:18 +0100 <int-e> hololeap: This is also true for bigText; accessing smallText is no more expensive than accessing bigText.
2023-01-23 21:38:14 +0100 <monochrom> This is also why "unsafeFreeze" and "unsafeThaw" are called "unsafe" because you can use them to break purity behind your back.
2023-01-23 21:38:41 +0100CiaoSen(~Jura@p200300c9572d4e002a3a4dfffe84dbd5.dip0.t-ipconnect.de)
2023-01-23 21:38:46 +0100 <monochrom> or rather s/purity/immutability/ to be specific.
2023-01-23 21:39:55 +0100 <hololeap> I really need to get up to speed on all this
2023-01-23 21:42:22 +0100 <hololeap> like, why doesn't the compiler know to garbage collect the 1GB text if all it ever does is get used once to find a substring, why is this important for immutability, what is sharability
2023-01-23 21:42:45 +0100 <hololeap> what is freeze and unfreeze
2023-01-23 21:42:56 +0100eggplantade(~Eggplanta@104-55-37-220.lightspeed.sntcca.sbcglobal.net)
2023-01-23 21:43:13 +0100 <hololeap> *thaw
2023-01-23 21:43:15 +0100trev(~trev@user/trev) (Remote host closed the connection)
2023-01-23 21:43:32 +0100 <monochrom> A bridge between mutable array and immutable array
2023-01-23 21:43:35 +0100 <hololeap> this sounds like some crap back when I used to hack on ruby
2023-01-23 21:44:19 +0100ub(~Thunderbi@p548c9ce5.dip0.t-ipconnect.de)
2023-01-23 21:44:21 +0100johnw(~johnw@2600:1700:cf00:db0:8cfb:a8b9:b2d3:9e7) (*.net *.split)
2023-01-23 21:44:21 +0100jinsun(~jinsun@user/jinsun) (*.net *.split)
2023-01-23 21:44:21 +0100Lord_of_Life(~Lord@user/lord-of-life/x-2819915) (*.net *.split)
2023-01-23 21:44:21 +0100Cale(~cale@cpebc4dfb3052b3-cmbc4dfb3052b0.cpe.net.cable.rogers.com) (*.net *.split)
2023-01-23 21:44:21 +0100leah2(~leah@vuxu.org) (*.net *.split)
2023-01-23 21:44:21 +0100jinsl-(~jinsl@2408:8207:255b:27c0:211:32ff:fec8:6aea) (*.net *.split)
2023-01-23 21:44:21 +0100xacktm(~xacktm@user/xacktm) (*.net *.split)
2023-01-23 21:44:22 +0100mtjm(~mutantmel@2604:a880:2:d0::208b:d001) (*.net *.split)
2023-01-23 21:44:22 +0100shachaf(~shachaf@user/shachaf) (*.net *.split)
2023-01-23 21:44:22 +0100gqplox[m](~gqploxmat@2001:470:69fc:105::2:d10d) (*.net *.split)
2023-01-23 21:44:22 +0100smichel17[m](~smichel17@2001:470:69fc:105::2d32) (*.net *.split)
2023-01-23 21:44:22 +0100jinsun_(~jinsun@user/jinsun) (*.net *.split)
2023-01-23 21:44:22 +0100peddie(~peddie@2001:470:69fc:105::25d) (*.net *.split)
2023-01-23 21:44:22 +0100tessier(~treed@98.171.210.130) (*.net *.split)
2023-01-23 21:44:22 +0100emergence(emergence@2607:5300:60:5910:dcad:beff:feef:5bc) (*.net *.split)
2023-01-23 21:44:22 +0100AWizzArd(~code@gehrels.uberspace.de) (*.net *.split)
2023-01-23 21:44:22 +0100tomboy64(~tomboy64@user/tomboy64) (*.net *.split)
2023-01-23 21:44:22 +0100berberman(~berberman@user/berberman) (*.net *.split)
2023-01-23 21:44:22 +0100ringo__(~ringo@157.230.117.128) (*.net *.split)
2023-01-23 21:44:22 +0100RMSBach(~guygastin@137.184.131.156) (*.net *.split)
2023-01-23 21:44:22 +0100amir(sid22336@user/amir) (*.net *.split)
2023-01-23 21:44:22 +0100jakalx(~jakalx@base.jakalx.net) (*.net *.split)
2023-01-23 21:44:22 +0100pjlsergeant(sid143467@id-143467.hampstead.irccloud.com) (*.net *.split)
2023-01-23 21:44:22 +0100shawwwn(sid6132@id-6132.helmsley.irccloud.com) (*.net *.split)
2023-01-23 21:44:22 +0100dragestil(~znc@user/dragestil) (*.net *.split)
2023-01-23 21:44:22 +0100astra(sid289983@user/amish) (*.net *.split)
2023-01-23 21:44:22 +0100kristjansson(sid126207@id-126207.tinside.irccloud.com) (*.net *.split)
2023-01-23 21:44:22 +0100bah(~bah@l1.tel) (*.net *.split)
2023-01-23 21:44:22 +0100dfg(~dfg@user/dfg) (*.net *.split)
2023-01-23 21:44:26 +0100shachaf_(~shachaf@li227-219.members.linode.com)
2023-01-23 21:44:26 +0100bah_(~bah@l1.tel)
2023-01-23 21:44:28 +0100shawwwn_(sid6132@id-6132.helmsley.irccloud.com)
2023-01-23 21:44:30 +0100AWizzArd(~code@gehrels.uberspace.de)
2023-01-23 21:44:31 +0100amir_(sid22336@user/amir)
2023-01-23 21:44:32 +0100jinsl(~jinsl@2408:8207:255b:27c0:211:32ff:fec8:6aea)
2023-01-23 21:44:37 +0100dfg(dfg@dfg.rocks)
2023-01-23 21:44:38 +0100tessier(~treed@98.171.210.130)
2023-01-23 21:44:38 +0100johnw(~johnw@76-234-69-149.lightspeed.frokca.sbcglobal.net)
2023-01-23 21:44:39 +0100Cale(~cale@2607:fea8:995f:b910:f535:7e00:458d:8e0c)
2023-01-23 21:44:40 +0100astra_(sid289983@user/amish)
2023-01-23 21:44:41 +0100pjlsergeant_(sid143467@id-143467.hampstead.irccloud.com)
2023-01-23 21:44:42 +0100ubert(~Thunderbi@p200300ecdf264ecb2960e53501e049b6.dip0.t-ipconnect.de) (Remote host closed the connection)
2023-01-23 21:44:43 +0100emergence(emergence@2607:5300:60:5910:dcad:beff:feef:5bc)
2023-01-23 21:44:43 +0100ububert
2023-01-23 21:44:48 +0100kristjansson_(sid126207@id-126207.tinside.irccloud.com)
2023-01-23 21:44:54 +0100dfg(dfg@dfg.rocks) (Changing host)
2023-01-23 21:44:54 +0100dfg(dfg@user/dfg)
2023-01-23 21:44:57 +0100leah2(~leah@vuxu.org)
2023-01-23 21:45:01 +0100 <geekosaur> garbage collecting only part of an array is expensive unless you do something like breaking it into manageable chunks (e.g. "carding" as used by Array)
2023-01-23 21:45:02 +0100 <hololeap> what's a good starting point to learn about all this?
2023-01-23 21:45:03 +0100amir_Guest7839
2023-01-23 21:45:05 +0100mtjm(~mutantmel@2604:a880:2:d0::208b:d001)
2023-01-23 21:45:10 +0100jinsun(~jinsun@user/jinsun)
2023-01-23 21:45:32 +0100Lord_of_Life(~Lord@user/lord-of-life/x-2819915)
2023-01-23 21:45:35 +0100tomboy64(~tomboy64@user/tomboy64)
2023-01-23 21:45:36 +0100berberman(~berberman@user/berberman)
2023-01-23 21:45:36 +0100dragestil(~znc@user/dragestil)
2023-01-23 21:45:46 +0100 <monochrom> Low-level thinking.
2023-01-23 21:46:05 +0100 <geekosaur> tracking enough information to know that only one reference to a small part of the underlying ByteArray# is cheap if only that one reference exists, extremely expensive if a thousand different ones do
2023-01-23 21:46:06 +0100ringo__(~ringo@157.230.117.128)
2023-01-23 21:46:11 +0100 <monochrom> The docs themselves.
2023-01-23 21:46:24 +0100gqplox[m](~gqploxmat@2001:470:69fc:105::2:d10d)
2023-01-23 21:46:26 +0100RMSBach(~guygastin@137.184.131.156)
2023-01-23 21:46:31 +0100 <monochrom> Seriously I never read blogs, so certainly I didn't learn any of those from blogs.
2023-01-23 21:46:56 +0100 <hololeap> if I picked up just a general book on garbage collectors, would that be misleading because it wouldn't be geared to a "pure" language like haskell?
2023-01-23 21:47:05 +0100xacktm(~xacktm@user/xacktm)
2023-01-23 21:47:31 +0100 <geekosaur> the same problem should exist on some level
2023-01-23 21:47:39 +0100eggplantade(~Eggplanta@104-55-37-220.lightspeed.sntcca.sbcglobal.net) (Ping timeout: 260 seconds)
2023-01-23 21:47:46 +0100 <monochrom> I have only read a general compiler book on general garbage collection (ie without tuning for immutable data).
2023-01-23 21:48:40 +0100 <monochrom> More generally, I have only learned and understood general CS. Then Haskell and its implementation tricks are just special cases.
2023-01-23 21:49:03 +0100 <hololeap> ok, it's fine. I've learned esoteric stuff before, I can do it again :)
2023-01-23 21:49:14 +0100peddie(~peddie@2001:470:69fc:105::25d)
2023-01-23 21:49:31 +0100 <geekosaur> this is not so esoteric, pure languages live and die by garbage collection
2023-01-23 21:49:46 +0100jinsun_(~jinsun@user/jinsun)
2023-01-23 21:49:54 +0100 <geekosaur> knowing it will explain a lot of performance and memory use behavior
2023-01-23 21:50:00 +0100smichel17[m](~smichel17@2001:470:69fc:105::2d32)
2023-01-23 21:50:28 +0100 <hololeap> but it sounds there aren't any resources that explain how all this works. I have to learn from the general case books and then start picking apart the docs/code/whitepapers
2023-01-23 21:50:46 +0100 <monochrom> In the case of Text (and ByteString, and Array, and Vector), the "hard" part is knowing the representation being (address, length, offset, more offsets...), and the principle that most library functions maximize sharing minimize copying.
2023-01-23 21:50:51 +0100 <dminuoso> 21:25:36 monochrom | or rather, [Char] is more compact if streamed.
2023-01-23 21:50:51 +0100 <hololeap> which to me makes it esoteric
2023-01-23 21:51:06 +0100 <dminuoso> monochrom: Curious, and how does Data.Text.Lazy fit into all of this? >:)
2023-01-23 21:51:12 +0100 <monochrom> Then general understanding of data structure tricks, GC, lazy evaluation fill in the rest.
2023-01-23 21:51:46 +0100 <hololeap> ok, I'll get off my high-level cloud and get my hands dirty in the low-level mud
2023-01-23 21:51:52 +0100 <hololeap> :)
2023-01-23 21:52:02 +0100 <hololeap> seems like it's time
2023-01-23 21:52:10 +0100 <monochrom> Data.Text.Lazy is going to stream at something like a 64KB granularity (or coarsity? heh)
2023-01-23 21:52:19 +0100 <geekosaur> dminuoso, it's betwixt and between, by being a lazy list of strict chunks
2023-01-23 21:52:29 +0100 <geekosaur> which can be individually garbage collected
2023-01-23 21:57:10 +0100 <monochrom> hololeap: I am certainly a fan of developing general understanding and smartness of basic/fundamental principles, then just synthesize consequences whenever I run into a special topic. I disbelieve in needing one resource per special topic.
2023-01-23 21:57:13 +0100 <dminuoso> hololeap: I guess the fundamental part about Text is that its not some magic built-in primitive that the GC has special knowledge about. As such, it obeys the GC laws as everything else, if you hold a reference it will be kept alive.
2023-01-23 21:57:33 +0100 <dminuoso> hololeap: So there isnt some deeper relationship to the garbage collector really
2023-01-23 21:58:51 +0100leah2(~leah@vuxu.org) (Quit: trotz alledem!)
2023-01-23 21:59:02 +0100leah2(~leah@vuxu.org)
2023-01-23 21:59:07 +0100 <hololeap> that's fair, monochrom, but I wasn't sure if haskell was _so_ different that general texts would just end up being misleading. but I guess it's still a language that runs on computers, so it has to have the same core science as every other language.
2023-01-23 21:59:25 +0100 <monochrom> My extreme/exaggerated example being: If you run into a library of 10 functions, do you really need 10^n tutorials for the 10^n ways of composing them? Or should you learn the fundamental principles and then synthesize what you really need?
2023-01-23 21:59:38 +0100 <monochrom> Apparently, stackoverflow users believe in the former.
2023-01-23 22:00:00 +0100 <geekosaur> stackoverflow provides perverse incentives for the former
2023-01-23 22:00:04 +0100 <monochrom> And those "XXX Cookbook" book authors and readers before them.
2023-01-23 22:00:16 +0100 <geekosaur> it's one reason I stopped using or contributing to it
2023-01-23 22:00:28 +0100 <monochrom> (Meaning, this is human nature long before even the Internet existed.)
2023-01-23 22:00:35 +0100 <dminuoso> monochrom: So we must supply `Cookbook Authoring Cookbooks` - there's clearly a demand for it.
2023-01-23 22:00:52 +0100 <monochrom> :D
2023-01-23 22:01:01 +0100 <hololeap> learning how to learn is always the hardest part
2023-01-23 22:01:31 +0100 <dminuoso> Anyway, the text sharing thing I think is a huge documentation bug.
2023-01-23 22:01:58 +0100 <dminuoso> The fact that you retain copies to original strings is really kept from the user unless you accidentally stumble over `copy :: Text -> Text` and wonder what it does.
2023-01-23 22:02:11 +0100 <geekosaur> I thought it was reasonably well documented, although that might involve an assumption that you know some GC basics
2023-01-23 22:02:23 +0100 <monochrom> I think I kind of know why the doc isn't very clear about this.
2023-01-23 22:02:32 +0100 <dminuoso> The fact that most operations are 0-copy and retain references is almost never mentioned.
2023-01-23 22:02:50 +0100 <dminuoso> I think only one non-copy text function in Data.Text mentions it
2023-01-23 22:03:02 +0100 <monochrom> In the bytestring and vector cases, if you see "take is O(1)" you can easily deduce that it does sharing, not copying.
2023-01-23 22:03:28 +0100 <monochrom> But then text has to obscure it with O(n), especially since utf-8.
2023-01-23 22:03:59 +0100 <monochrom> Now add the fact that the text doc is merely inspired by the bytestring doc.
2023-01-23 22:04:23 +0100 <monochrom> But yeah every function should say it explicitly.
2023-01-23 22:04:48 +0100 <monochrom> I kind of learned this from sampling the source code. But no one should be required to.
2023-01-23 22:09:06 +0100 <dminuoso> That problem extends to library code that uses text, because while documenting it inside text is doable, any library that directly or indirectly relies on sharing should then document that behavior as well
2023-01-23 22:10:09 +0100 <dminuoso> If you parse with aeson, do you retain references to the original string? I dont know, while I could reason about it in this particular case, for the general case I would more likely have to audit the software.
2023-01-23 22:10:21 +0100 <dminuoso> Which I would probably just do if I experience some kind of memory hog
2023-01-23 22:11:04 +0100merijn(~merijn@c-001-001-014.client.esciencecenter.eduvpn.nl) (Ping timeout: 252 seconds)
2023-01-23 22:16:13 +0100ralu1(~ralu@static.211.245.203.116.clients.your-server.de)
2023-01-23 22:22:44 +0100gurkenglas(~gurkengla@dynamic-046-114-181-040.46.114.pool.telefonica.de)
2023-01-23 22:25:00 +0100coot(~coot@2a02:a310:e241:1b00:ec1a:e9df:79ac:66ba)
2023-01-23 22:41:38 +0100Lord_of_Life_(~Lord@user/lord-of-life/x-2819915)
2023-01-23 22:42:50 +0100Lord_of_Life(~Lord@user/lord-of-life/x-2819915) (Ping timeout: 260 seconds)
2023-01-23 22:42:54 +0100Lord_of_Life_Lord_of_Life
2023-01-23 22:43:45 +0100manwithl-(~manwithlu@194.177.28.192) (Remote host closed the connection)
2023-01-23 22:45:06 +0100manwithluck(~manwithlu@194.177.28.192)
2023-01-23 22:47:03 +0100Lycurgus(~juan@user/Lycurgus) (Quit: Exeunt: personae.ai-integration.biz)
2023-01-23 22:47:17 +0100beteigeuze(~Thunderbi@a79-169-109-107.cpe.netcabo.pt)
2023-01-23 22:50:41 +0100califax(~califax@user/califx) (Remote host closed the connection)
2023-01-23 22:51:14 +0100califax(~califax@user/califx)
2023-01-23 22:57:15 +0100mizlan(~mizlan@131.179.76.206)
2023-01-23 22:58:21 +0100manwithluck(~manwithlu@194.177.28.192) (Read error: Connection reset by peer)
2023-01-23 22:59:57 +0100ralu1(~ralu@static.211.245.203.116.clients.your-server.de) (Ping timeout: 268 seconds)
2023-01-23 23:00:00 +0100jumper149(~jumper149@base.felixspringer.xyz) (Quit: WeeChat 3.7.1)
2023-01-23 23:02:04 +0100manwithluck(~manwithlu@194.177.28.192)
2023-01-23 23:02:13 +0100telser(~quassel@user/telser) (Ping timeout: 252 seconds)
2023-01-23 23:04:25 +0100telser(~quassel@user/telser)
2023-01-23 23:04:42 +0100shachaf_shachaf
2023-01-23 23:05:00 +0100Cale(~cale@2607:fea8:995f:b910:f535:7e00:458d:8e0c) (Ping timeout: 260 seconds)
2023-01-23 23:05:01 +0100oldfashionedcow(~Rahul_San@user/oldfashionedcow)
2023-01-23 23:05:10 +0100shachaf(~shachaf@li227-219.members.linode.com) (Changing host)
2023-01-23 23:05:10 +0100shachaf(~shachaf@user/shachaf)
2023-01-23 23:05:26 +0100Cale(~cale@2607:fea8:995f:b910:f535:7e00:458d:8e0c)
2023-01-23 23:11:56 +0100Cale(~cale@2607:fea8:995f:b910:f535:7e00:458d:8e0c) (Ping timeout: 255 seconds)
2023-01-23 23:20:29 +0100ralu1(~ralu@static.211.245.203.116.clients.your-server.de)
2023-01-23 23:24:15 +0100Cale(~cale@cpebc4dfb3052b3-cmbc4dfb3052b0.cpe.net.cable.rogers.com)
2023-01-23 23:33:06 +0100merijn(~merijn@c-001-001-014.client.esciencecenter.eduvpn.nl)
2023-01-23 23:44:47 +0100fserucas(~fserucas@2001:818:e376:a400:fb92:70c1:dd88:c7d7) (Ping timeout: 252 seconds)
2023-01-23 23:49:20 +0100Guest|69(~Guest|69@24.144.1.226)
2023-01-23 23:49:52 +0100coot(~coot@2a02:a310:e241:1b00:ec1a:e9df:79ac:66ba) (Quit: coot)
2023-01-23 23:50:15 +0100Guest|69(~Guest|69@24.144.1.226) (Client Quit)
2023-01-23 23:56:40 +0100mizlan(~mizlan@131.179.76.206) (Ping timeout: 252 seconds)