Logs: liberachat/#haskell
| 2021-08-15 16:18:21 | × | kritzefitz quits (~kritzefit@picard.host.weltraumschlangen.de) (Quit: ZNC 1.8.2+deb2+b1 - https://znc.in) |
| 2021-08-15 16:18:29 | → | raehik joins (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net) |
| 2021-08-15 16:18:59 | × | wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Ping timeout: 268 seconds) |
| 2021-08-15 16:19:00 | → | kritzefitz joins (~kritzefit@picard.host.weltraumschlangen.de) |
| 2021-08-15 16:21:47 | × | geekosaur quits (~geekosaur@xmonad/geekosaur) (Killed (NickServ (GHOST command used by allbery_b))) |
| 2021-08-15 16:21:48 | → | allbery_b joins (~geekosaur@xmonad/geekosaur) |
| 2021-08-15 16:21:51 | allbery_b | is now known as geekosaur |
| 2021-08-15 16:22:31 | <fvr> | hoknamahn: create a Haskell function to call your function, look at mallocBytes in base |
| 2021-08-15 16:22:33 | <tomsmeding> | hoknamahn: think about what your code would look like in C, but without using & -- instead, you allocate some memory using malloc/free. Then convert all the malloc/free pairs in your hypothetical implementation to haskell's alloca |
| 2021-08-15 16:26:59 | × | burnsidesLlama quits (~burnsides@dhcp168-012.wadham.ox.ac.uk) (Remote host closed the connection) |
| 2021-08-15 16:28:11 | → | Pickchea joins (~private@user/pickchea) |
| 2021-08-15 16:30:47 | <hoknamahn> | tomsmeding: thanks, i think i see what you mean. |
| 2021-08-15 16:32:34 | × | acidjnk_new quits (~acidjnk@p200300d0c72b9503f052fac21b551e32.dip0.t-ipconnect.de) (Ping timeout: 272 seconds) |
| 2021-08-15 16:32:40 | × | bitdex_ quits (~bitdex@gateway/tor-sasl/bitdex) (Remote host closed the connection) |
| 2021-08-15 16:33:05 | → | haowenl joins (~Thunderbi@066-215-230-039.res.spectrum.com) |
| 2021-08-15 16:33:30 | → | bitdex_ joins (~bitdex@gateway/tor-sasl/bitdex) |
| 2021-08-15 16:33:31 | × | haowenl quits (~Thunderbi@066-215-230-039.res.spectrum.com) (Client Quit) |
| 2021-08-15 16:34:15 | → | wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) |
| 2021-08-15 16:38:16 | → | eggplantade joins (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) |
| 2021-08-15 16:39:20 | × | wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Ping timeout: 268 seconds) |
| 2021-08-15 16:42:41 | × | eggplantade quits (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Ping timeout: 248 seconds) |
| 2021-08-15 16:45:15 | → | merijn joins (~merijn@83-160-49-249.ip.xs4all.nl) |
| 2021-08-15 16:48:14 | → | kuribas joins (~user@ptr-25vy0iaezbxroyr1ffb.18120a2.ip6.access.telenet.be) |
| 2021-08-15 16:52:36 | → | eggplantade joins (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) |
| 2021-08-15 16:54:09 | × | Pickchea quits (~private@user/pickchea) (Ping timeout: 268 seconds) |
| 2021-08-15 16:56:16 | × | Xnuk quits (~xnuk@vultr.xnu.kr) (Quit: ZNC - https://znc.in) |
| 2021-08-15 16:56:24 | → | gehmehgeh joins (~user@user/gehmehgeh) |
| 2021-08-15 16:56:32 | → | Xnuk joins (~xnuk@vultr.xnu.kr) |
| 2021-08-15 16:57:54 | → | euandreh joins (~euandreh@2804:14c:33:9fe5:8577:297f:c78a:d1b2) |
| 2021-08-15 17:01:10 | → | burnsidesLlama joins (~burnsides@dhcp168-012.wadham.ox.ac.uk) |
| 2021-08-15 17:03:23 | × | jespada quits (~jespada@90.254.247.46) (Ping timeout: 268 seconds) |
| 2021-08-15 17:03:51 | → | shapr joins (~user@pool-108-28-144-11.washdc.fios.verizon.net) |
| 2021-08-15 17:04:38 | × | pretty_dumm_guy quits (trottel@gateway/vpn/protonvpn/prettydummguy/x-88029655) (Ping timeout: 268 seconds) |
| 2021-08-15 17:05:48 | → | jespada joins (~jespada@90.254.247.46) |
| 2021-08-15 17:06:15 | → | tripoli joins (~tripoli@69.233.98.238) |
| 2021-08-15 17:06:59 | × | pgib quits (~textual@173.38.117.66) (Ping timeout: 258 seconds) |
| 2021-08-15 17:07:05 | × | burnsidesLlama quits (~burnsides@dhcp168-012.wadham.ox.ac.uk) (Ping timeout: 268 seconds) |
| 2021-08-15 17:07:34 | → | __monty__ joins (~toonn@user/toonn) |
| 2021-08-15 17:07:44 | × | robertm quits (robertm@rojoma.com) (Quit: WeeChat 2.3) |
| 2021-08-15 17:09:44 | → | robertm joins (robertm@rojoma.com) |
| 2021-08-15 17:11:35 | → | haowenl joins (~Thunderbi@066-215-230-039.res.spectrum.com) |
| 2021-08-15 17:12:20 | × | haowenl quits (~Thunderbi@066-215-230-039.res.spectrum.com) (Client Quit) |
| 2021-08-15 17:16:16 | × | waleee quits (~waleee@2001:9b0:216:8200:d457:9189:7843:1dbd) (Ping timeout: 272 seconds) |
| 2021-08-15 17:17:11 | → | waleee joins (~waleee@2001:9b0:216:8200:d457:9189:7843:1dbd) |
| 2021-08-15 17:19:14 | × | merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 252 seconds) |
| 2021-08-15 17:22:30 | → | vysn joins (~vysn@user/vysn) |
| 2021-08-15 17:23:35 | → | jumper149 joins (~jumper149@80.240.31.34) |
| 2021-08-15 17:25:00 | → | pfurla joins (~pfurla@ool-3f8fcb0f.dyn.optonline.net) |
| 2021-08-15 17:27:09 | → | burnsidesLlama joins (~burnsides@dhcp168-012.wadham.ox.ac.uk) |
| 2021-08-15 17:28:33 | × | pfurla_ quits (~pfurla@ool-3f8fcb0f.dyn.optonline.net) (Ping timeout: 248 seconds) |
| 2021-08-15 17:30:20 | <energizer> | anybody know what "structural function types" refers to? |
| 2021-08-15 17:30:59 | × | burnsidesLlama quits (~burnsides@dhcp168-012.wadham.ox.ac.uk) (Remote host closed the connection) |
| 2021-08-15 17:31:14 | → | burnsidesLlama joins (~burnsides@dhcp168-012.wadham.ox.ac.uk) |
| 2021-08-15 17:32:47 | → | roboguy_ joins (~roboguy_@2605:a601:afe7:9f00:789f:7a:b395:5977) |
| 2021-08-15 17:33:17 | × | burnsidesLlama quits (~burnsides@dhcp168-012.wadham.ox.ac.uk) (Remote host closed the connection) |
| 2021-08-15 17:33:46 | → | Sgeo joins (~Sgeo@user/sgeo) |
| 2021-08-15 17:33:48 | → | burnsidesLlama joins (~burnsides@dhcp168-012.wadham.ox.ac.uk) |
| 2021-08-15 17:36:46 | → | o1lo01ol1o joins (~o1lo01ol1@31.22.129.100) |
| 2021-08-15 17:37:16 | × | vysn quits (~vysn@user/vysn) (Quit: WeeChat 3.2) |
| 2021-08-15 17:37:38 | → | vysn joins (~vysn@user/vysn) |
| 2021-08-15 17:38:02 | × | burnsidesLlama quits (~burnsides@dhcp168-012.wadham.ox.ac.uk) (Ping timeout: 245 seconds) |
| 2021-08-15 17:40:56 | <hololeap> | energizer: context? |
| 2021-08-15 17:41:11 | <energizer> | hololeap: https://github.com/thautwarm/HigherKindedPolymorphisms.jl |
| 2021-08-15 17:41:21 | × | o1lo01ol1o quits (~o1lo01ol1@31.22.129.100) (Ping timeout: 248 seconds) |
| 2021-08-15 17:42:48 | <hololeap> | *shrugs* some julia thing? |
| 2021-08-15 17:45:14 | → | Pickchea joins (~private@user/pickchea) |
| 2021-08-15 17:45:28 | × | roboguy_ quits (~roboguy_@2605:a601:afe7:9f00:789f:7a:b395:5977) () |
| 2021-08-15 17:45:56 | <cdsmith> | Hmm, in C++ I can write a template that can be instantiated with any type, but works differently if the argument type is showable. Any hack to do the same for a polymorphic method in Haskell? Is that something a rewrite rule could do? |
| 2021-08-15 17:47:35 | <opqdonut> | rewrite rules are meant to be used for semantics-preserving optimizations, so no |
| 2021-08-15 17:47:39 | × | vysn quits (~vysn@user/vysn) (Quit: WeeChat 3.2) |
| 2021-08-15 17:47:55 | <cdsmith> | I'm not so concerned with what they are meant for. I'm being evil here... |
| 2021-08-15 17:48:02 | → | vysn joins (~vysn@user/vysn) |
| 2021-08-15 17:48:43 | <opqdonut> | I wonder if you could do something like use OverlappingInstances and have a something like `instance MyThing a where stringify x = "<unshowable>"; instance Show a => MyThing a where stringify x = show x` |
| 2021-08-15 17:49:02 | <opqdonut> | probably not since those instances are equal in terms of instance resolution, the class contexts don't get used at that point... |
| 2021-08-15 17:49:06 | <cdsmith> | This is an "optimization" in spirit... it's just an optimization for the programmer by seeing better test failure messages. |
| 2021-08-15 17:49:25 | <cdsmith> | Yeah, I don't think the class approach works. |
| 2021-08-15 17:50:17 | <hololeap> | wouldn't it work if you swapped the order of those two instances? |
| 2021-08-15 17:50:19 | <opqdonut> | a google search leads me here via stackoverflow: https://github.com/mikeizbicki/ifcxt |
| 2021-08-15 17:50:42 | <opqdonut> | so a ConstraintKinds trick |
| 2021-08-15 17:54:37 | × | dcompoze quits (~dcompoze@cpc97624-walt24-2-0-cust75.13-2.cable.virginm.net) (Quit: Weechat 3.2) |
| 2021-08-15 17:55:31 | → | jao joins (jao@gateway/vpn/protonvpn/jao) |
| 2021-08-15 18:01:43 | <tomsmeding> | right, so make an instance (IfCtx (Show a)) for all 'a' that have a Show instance |
| 2021-08-15 18:01:51 | <tomsmeding> | that's... verbose |
| 2021-08-15 18:02:22 | <tomsmeding> | you don't even need ConstraintKinds to apply this trick |
| 2021-08-15 18:02:38 | → | tzh joins (~tzh@c-24-21-73-154.hsd1.or.comcast.net) |
| 2021-08-15 18:03:17 | <tomsmeding> | opqdonut's MyThing could work just fine; indeed, if you enumerate all showable types and make an OVERLAPS instance for all of them, and then add an OVERLAPPABLE default one that does the non-Show thing, then it would work fine |
| 2021-08-15 18:03:30 | → | Neuromancer joins (~Neuromanc@user/neuromancer) |
| 2021-08-15 18:04:03 | <tomsmeding> | cdsmith: can the method you're talking about be a template haskell splice itself? |
| 2021-08-15 18:04:33 | <opqdonut> | yeah that's a good idea |
| 2021-08-15 18:04:36 | <tomsmeding> | if so, then I believe you can do this with TH by querying in-scope instances at usage site |
| 2021-08-15 18:04:40 | <opqdonut> | yeah |
| 2021-08-15 18:05:28 | <opqdonut> | that might work differently in polymorphic contexts though |
| 2021-08-15 18:05:40 | <tomsmeding> | true |
| 2021-08-15 18:06:00 | <tomsmeding> | but, like, in polymorphic contexts where will you magick up a type class dictionary from at runtime |
| 2021-08-15 18:06:31 | <tomsmeding> | someone has asked about this before, and then and now I immediatealy think of Typeable |
| 2021-08-15 18:06:54 | <tomsmeding> | but I believe the executable doesn't have any embedded information of the classes that a particular Typeable type implements |
| 2021-08-15 18:10:05 | <tomsmeding> | oooooh, make a list of known (Show a, Typeable a) types using templatehaskell, and embed a list in the application containing a list of Thingy, where data Thingy = forall a. (Show a, Typeable a) => Thingy (TypeRep a) |
| 2021-08-15 18:10:08 | × | markpythonicbitc quits (~markpytho@50.228.44.6) (Quit: My MacBook has gone to sleep. ZZZzzz…) |
| 2021-08-15 18:10:17 | <tomsmeding> | where that TypeRep comes from Type.Reflection, not Data.Typeable |
| 2021-08-15 18:10:19 | <hololeap> | there's also the solution of making a Showable newtype and then: instance {-# OVERLAPPING #-} Show a => MyThing (Showable a) |
All times are in UTC.