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