Logs: freenode/#haskell
| 2020-11-16 14:08:09 | × | Jajik quits (xchlup2@gateway/shell/fi.muni.cz/x-dpprselxanrtxlgk) (Quit: Ping timeout (120 seconds)) |
| 2020-11-16 14:08:22 | → | Jajik joins (xchlup2@gateway/shell/fi.muni.cz/x-jfxvsfpdsqpqvolb) |
| 2020-11-16 14:09:05 | → | acarrico joins (~acarrico@dhcp-68-142-39-249.greenmountainaccess.net) |
| 2020-11-16 14:09:22 | → | mmfood joins (~mmfood@81-232-132-159-no64.tbcn.telia.com) |
| 2020-11-16 14:11:11 | → | wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) |
| 2020-11-16 14:11:39 | × | cinimod_ quits (uid93893@gateway/web/irccloud.com/x-jjuixteopossqepf) () |
| 2020-11-16 14:11:53 | → | cinimod_ joins (uid93893@gateway/web/irccloud.com/x-wrzxrzpvqphwukyg) |
| 2020-11-16 14:13:30 | × | Kaivo quits (~Kaivo@104-200-86-99.mc.derytele.com) (Quit: WeeChat 2.9) |
| 2020-11-16 14:13:40 | → | xsperry joins (~as@unaffiliated/xsperry) |
| 2020-11-16 14:15:50 | × | wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Ping timeout: 260 seconds) |
| 2020-11-16 14:19:18 | → | machinedgod joins (~machinedg@24.105.81.50) |
| 2020-11-16 14:19:43 | × | Martinsos quits (~user@cpe-188-129-116-164.dynamic.amis.hr) (Ping timeout: 260 seconds) |
| 2020-11-16 14:19:59 | × | Tario quits (~Tario@201.192.165.173) (Read error: Connection reset by peer) |
| 2020-11-16 14:25:26 | <kuribas> | How do I model some subtype relation with classes? For example A contains some B, B contains some C, then I want a function that gives me all C in A. |
| 2020-11-16 14:25:40 | → | p-core joins (~Thunderbi@2001:718:1e03:5128:2ab7:7f35:48a1:8515) |
| 2020-11-16 14:25:55 | <kuribas> | like "allChildren someA @C" |
| 2020-11-16 14:26:15 | <kuribas> | I could do this with overlapping type-classes, but they aren't recommended? |
| 2020-11-16 14:26:36 | <merijn> | kuribas: tbh, what your asking also sounds "not recommended" :p |
| 2020-11-16 14:27:07 | <kuribas> | merijn: so you would model every combination of subsets? |
| 2020-11-16 14:27:30 | <merijn> | You're going to have to get a lot more specific about what that even means :) |
| 2020-11-16 14:27:46 | × | gxt quits (~gxt@gateway/tor-sasl/gxt) (Remote host closed the connection) |
| 2020-11-16 14:28:51 | → | Stanley00 joins (~stanley00@unaffiliated/stanley00) |
| 2020-11-16 14:28:58 | <kuribas> | well in lisp we have (select :park :sensor-box), and it would return all sensor-boxes in a park. |
| 2020-11-16 14:29:06 | → | gxt joins (~gxt@gateway/tor-sasl/gxt) |
| 2020-11-16 14:29:08 | <geekosaur> | ti sounded more like generics than classes to me |
| 2020-11-16 14:30:33 | → | knupfer joins (~Thunderbi@dynamic-046-114-148-109.46.114.pool.telefonica.de) |
| 2020-11-16 14:31:05 | <kuribas> | merijn: or you would explicitly compose them? |
| 2020-11-16 14:31:32 | <kuribas> | like parkInverters >>> inverterSensorBoxes |
| 2020-11-16 14:31:38 | × | jchia quits (~jchia@58.32.36.109) (*.net *.split) |
| 2020-11-16 14:31:38 | × | TMA quits (tma@twin.jikos.cz) (*.net *.split) |
| 2020-11-16 14:31:38 | × | jdt quits (~jdt@208.85.233.130) (*.net *.split) |
| 2020-11-16 14:31:38 | × | adamCS quits (~adamCS@ec2-34-207-160-255.compute-1.amazonaws.com) (*.net *.split) |
| 2020-11-16 14:31:38 | × | Ranhir quits (~Ranhir@157.97.53.139) (*.net *.split) |
| 2020-11-16 14:31:38 | × | qz quits (~quetzal@li272-85.members.linode.com) (*.net *.split) |
| 2020-11-16 14:31:38 | × | [exa] quits (exa@unaffiliated/exa/x-5381537) (*.net *.split) |
| 2020-11-16 14:31:38 | × | ring0` quits (~ringo@unaffiliated/ring0/x-8667941) (*.net *.split) |
| 2020-11-16 14:31:38 | × | kqr quits (~kqr@vps.xkqr.org) (*.net *.split) |
| 2020-11-16 14:31:49 | → | [exa] joins (exa@srv3.blesmrt.net) |
| 2020-11-16 14:31:54 | → | qz joins (~quetzal@li272-85.members.linode.com) |
| 2020-11-16 14:31:54 | → | jdt joins (~jdt@208.85.233.130) |
| 2020-11-16 14:31:59 | → | adamCS joins (~adamCS@ec2-34-207-160-255.compute-1.amazonaws.com) |
| 2020-11-16 14:32:03 | → | TMA joins (tma@twin.jikos.cz) |
| 2020-11-16 14:32:05 | → | Ranhir joins (~Ranhir@157.97.53.139) |
| 2020-11-16 14:32:12 | <merijn> | kuribas: Are you maybe (accidentally) trying to reinvent the cursor stuff from xml-conduit? |
| 2020-11-16 14:32:18 | → | ring0` joins (~ringo@unaffiliated/ring0/x-8667941) |
| 2020-11-16 14:32:18 | → | kqr joins (~kqr@vps.xkqr.org) |
| 2020-11-16 14:32:43 | → | jchia joins (~jchia@45.32.62.73) |
| 2020-11-16 14:33:11 | <kuribas> | well, I have a containment relation. |
| 2020-11-16 14:33:22 | <merijn> | kuribas: https://hackage.haskell.org/package/xml-conduit-1.8.0.1/docs/Text-XML-Cursor.html |
| 2020-11-16 14:33:26 | × | Stanley00 quits (~stanley00@unaffiliated/stanley00) (Ping timeout: 272 seconds) |
| 2020-11-16 14:33:46 | <merijn> | This handles exactly queries like "all XML tags with property Y starting from node X" style queries |
| 2020-11-16 14:33:56 | <merijn> | Which sounds similar to what you're doing? |
| 2020-11-16 14:34:04 | <kuribas> | merijn: yeah |
| 2020-11-16 14:34:11 | <kuribas> | merijn: but this goes to the DB |
| 2020-11-16 14:35:06 | → | renzhi joins (~renzhi@2607:fa49:655f:e600::28da) |
| 2020-11-16 14:35:31 | <kuribas> | merijn: another example is a class relationship. Let's say I have a "attribute" type. (Attribute class tp), meaning I can extract a value of "tp" from an object of type "Object class" |
| 2020-11-16 14:35:54 | <kuribas> | So "get :: Object class -> Attribute class tp -> m tp" |
| 2020-11-16 14:36:08 | <kuribas> | But class has superclasses. |
| 2020-11-16 14:36:32 | × | christo quits (~chris@81.96.113.213) (Remote host closed the connection) |
| 2020-11-16 14:37:03 | <kuribas> | so I want "get :: SuperClassOf class2 class1 => Object class1 -> Attribute class2 tp -> m tp" |
| 2020-11-16 14:37:16 | <kuribas> | but then that only works if I use overlapping instances. |
| 2020-11-16 14:37:29 | <merijn> | I would personally never contemplate going this route |
| 2020-11-16 14:37:31 | <kuribas> | to get the transitive closure of superclasses. |
| 2020-11-16 14:37:38 | <kuribas> | merijn: which route would you go then. |
| 2020-11-16 14:37:40 | <merijn> | This'll all end in tears |
| 2020-11-16 14:37:58 | <kuribas> | tell me which route well end in happiness |
| 2020-11-16 14:38:07 | <merijn> | I don't really know what I *would* do, because I've never attempted this |
| 2020-11-16 14:38:34 | × | cgfuh quits (~cgfuh@181.167.191.58) (Quit: WeeChat 2.9) |
| 2020-11-16 14:38:40 | → | elfets joins (~elfets@ip-37-201-23-96.hsi13.unitymediagroup.de) |
| 2020-11-16 14:38:47 | <merijn> | kuribas: I would probably try and encode the accesors as a GADT and then just have transformers that can map them to their containing objects |
| 2020-11-16 14:38:47 | → | Chi1thangoo joins (~Chi1thang@87.112.60.168) |
| 2020-11-16 14:38:50 | <kuribas> | of course I could invent a "fancy haskell" solution, using type level lists, etc... |
| 2020-11-16 14:39:20 | <merijn> | Any sort of "inheritance" style design with typeclasses always ends in cryptic errors, overlapping/incoherent instance nightmares, etc. |
| 2020-11-16 14:39:49 | → | cgfuh joins (~cgfuh@181.167.191.58) |
| 2020-11-16 14:40:45 | × | nbloomf quits (~nbloomf@2600:1700:ad14:3020:8491:5fed:8d7f:daad) (Quit: My MacBook has gone to sleep. ZZZzzz…) |
| 2020-11-16 14:41:24 | <kuribas> | merijn: I could make a custom type error |
| 2020-11-16 14:41:40 | <merijn> | If "Attribute class tp" was a datatype with just the explicit function to make the appropriate lookup you can then define a Category and Profunctor instance and then generalising is just contramap the class type to the more general type |
| 2020-11-16 14:41:46 | → | Tario joins (~Tario@201.192.165.173) |
| 2020-11-16 14:42:02 | × | toorevitimirp quits (~tooreviti@117.182.180.118) (Ping timeout: 264 seconds) |
| 2020-11-16 14:42:08 | <tomjaguarpaw> | Can I get access to RTS statistics at run time? I would like to see if it really is garbage collection that is causing my strange performance. |
| 2020-11-16 14:42:14 | <merijn> | tomjaguarpaw: Yes |
| 2020-11-16 14:42:23 | <tomjaguarpaw> | Where do I look for those? |
| 2020-11-16 14:42:29 | <merijn> | tomjaguarpaw: Somewhere in the GHC.* modules in base |
| 2020-11-16 14:42:51 | <kuribas> | merijn: you mean explicit subtyping? |
| 2020-11-16 14:43:05 | × | geekosaur quits (82659a09@host154-009.vpn.uakron.edu) (Remote host closed the connection) |
| 2020-11-16 14:43:12 | <merijn> | I mean "forgetting the term subtyping entirely" |
| 2020-11-16 14:43:39 | <kuribas> | like: asClass :: IsSubClass a b => Attribute a tp -> Attribute b tp |
| 2020-11-16 14:43:53 | <kuribas> | merijn: the model is already subtyped, I cannot change that. |
| 2020-11-16 14:44:03 | <tomjaguarpaw> | Hmm GHC.Stats, I guess |
| 2020-11-16 14:44:10 | <merijn> | Except, if Attribute is a datatype and has a profunctor instance then you don't even need IsSubClass or anything |
| 2020-11-16 14:44:16 | <merijn> | You just need a function "a -> b" |
| 2020-11-16 14:45:02 | <kuribas> | merijn: but class is just a phantom type to ensure you don't send an attribute to the wrong object. |
| 2020-11-16 14:45:30 | <kuribas> | merijn: so a function a -> b is impossible. |
| 2020-11-16 14:46:03 | <kuribas> | a and b are uninhabited |
| 2020-11-16 14:46:05 | → | christo joins (~chris@81.96.113.213) |
| 2020-11-16 14:47:34 | × | jchia quits (~jchia@45.32.62.73) (Remote host closed the connection) |
| 2020-11-16 14:47:36 | → | heatsink joins (~heatsink@107-136-5-69.lightspeed.sntcca.sbcglobal.net) |
| 2020-11-16 14:47:56 | → | jchia joins (~jchia@45.32.62.73) |
| 2020-11-16 14:48:09 | × | Sanchayan quits (~Sanchayan@171.61.102.109) (Quit: leaving) |
| 2020-11-16 14:48:12 | <merijn> | So, that just means you can't use profunctor. You can define a Convertible type with phantom attributes (probably as GADT or data family?) and then have "Convert a b -> Attribute a tp -> Attribute b tp" or something? |
All times are in UTC.