Logs: liberachat/#haskell
| 2021-08-22 17:51:11 | → | wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) |
| 2021-08-22 17:51:11 | × | wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Changing host) |
| 2021-08-22 17:51:11 | → | wroathe joins (~wroathe@user/wroathe) |
| 2021-08-22 17:57:13 | → | bontaq joins (~user@ool-18e47f8d.dyn.optonline.net) |
| 2021-08-22 17:59:03 | → | vysn joins (~vysn@user/vysn) |
| 2021-08-22 17:59:18 | → | jumper149 joins (~jumper149@80.240.31.34) |
| 2021-08-22 18:02:34 | → | pbrisbin joins (~patrick@174-081-116-011.res.spectrum.com) |
| 2021-08-22 18:05:14 | × | fef quits (~thedawn@user/thedawn) (Remote host closed the connection) |
| 2021-08-22 18:06:03 | → | hololeap joins (~hololeap@user/hololeap) |
| 2021-08-22 18:06:45 | → | gustik joins (~gustik@2a01:c844:2410:9020:63ab:4bb6:83d2:e11b) |
| 2021-08-22 18:08:31 | → | pavonia joins (~user@user/siracusa) |
| 2021-08-22 18:10:54 | × | kuribas quits (~user@ptr-25vy0iac19m0oa3eqv7.18120a2.ip6.access.telenet.be) (Remote host closed the connection) |
| 2021-08-22 18:13:21 | → | Guest5329 joins (~chris@81.96.113.213) |
| 2021-08-22 18:14:34 | × | azeem quits (~azeem@dynamic-adsl-94-34-33-6.clienti.tiscali.it) (Ping timeout: 250 seconds) |
| 2021-08-22 18:15:17 | → | lavaman joins (~lavaman@98.38.249.169) |
| 2021-08-22 18:15:41 | → | azeem joins (~azeem@176.200.223.33) |
| 2021-08-22 18:19:59 | → | oxide joins (~lambda@user/oxide) |
| 2021-08-22 18:24:40 | × | azeem quits (~azeem@176.200.223.33) (Ping timeout: 240 seconds) |
| 2021-08-22 18:25:17 | → | azeem joins (~azeem@176.200.223.33) |
| 2021-08-22 18:29:44 | × | azeem quits (~azeem@176.200.223.33) (Ping timeout: 250 seconds) |
| 2021-08-22 18:30:58 | → | fresheyeball joins (~fresheyeb@c-71-237-105-37.hsd1.co.comcast.net) |
| 2021-08-22 18:31:28 | <fresheyeball> | I am trying to impliment an instance of Show for an existenial type |
| 2021-08-22 18:31:33 | <fresheyeball> | I feel lost |
| 2021-08-22 18:32:23 | <c_wraith> | You probably can't. |
| 2021-08-22 18:32:41 | <fresheyeball> | I got Eq and Ord already |
| 2021-08-22 18:32:44 | <fresheyeball> | why not Show? |
| 2021-08-22 18:32:48 | → | azeem joins (~azeem@176.200.223.33) |
| 2021-08-22 18:33:13 | <c_wraith> | what's the type? |
| 2021-08-22 18:33:33 | <fresheyeball> | data Page = PEcho | PLogin |
| 2021-08-22 18:33:58 | <c_wraith> | that's not existential |
| 2021-08-22 18:34:10 | <fresheyeball> | data PageView = forall (p :: Page). (Eq (PageModel p), Typeable p, DemotePage p) => PageView (Proxy p) (PageModel p) |
| 2021-08-22 18:35:07 | <fresheyeball> | I figured it out |
| 2021-08-22 18:35:16 | <fresheyeball> | I didn't know I could just make show, and not showsPrec |
| 2021-08-22 18:35:21 | <fresheyeball> | showsPrec is hard |
| 2021-08-22 18:35:26 | <fresheyeball> | I thought I had to make showsPrec |
| 2021-08-22 18:35:37 | <c_wraith> | showsPrec isn't any harder than show... |
| 2021-08-22 18:35:38 | → | Pickchea joins (~private@user/pickchea) |
| 2021-08-22 18:35:52 | <fresheyeball> | It is to me |
| 2021-08-22 18:35:55 | <sm> | tis |
| 2021-08-22 18:35:58 | <fresheyeball> | I don't understand it |
| 2021-08-22 18:36:06 | <fresheyeball> | ShowS? Int for precidence? |
| 2021-08-22 18:36:13 | <c_wraith> | I mean... ok, you need to write more code. But it's identical complexity at the type level. |
| 2021-08-22 18:36:25 | <fresheyeball> | sure ok |
| 2021-08-22 18:36:30 | <fresheyeball> | that makes sense |
| 2021-08-22 18:36:37 | <fresheyeball> | ok, now I need to do Generic |
| 2021-08-22 18:36:39 | <fresheyeball> | FEAR |
| 2021-08-22 18:36:48 | <sm> | I'll tell that one to new users from now on |
| 2021-08-22 18:37:12 | <c_wraith> | I've written showsPrec by hand. It really isn't hard. It breaks down into a few common patterns |
| 2021-08-22 18:37:20 | <sm> | to my wife, in fact |
| 2021-08-22 18:37:33 | <c_wraith> | the docs are nice enough to illustrate all those patterns for you, in fact. |
| 2021-08-22 18:38:43 | <c_wraith> | and Prelude even exports a bunch of weird functions that are useless most of the time, but really convenient for writing showsPrec instances |
| 2021-08-22 18:39:32 | <c_wraith> | :t showParen -- like this |
| 2021-08-22 18:39:33 | <lambdabot> | Bool -> ShowS -> ShowS |
| 2021-08-22 18:39:42 | × | raehik quits (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net) (Ping timeout: 250 seconds) |
| 2021-08-22 18:39:45 | → | hexfive joins (~eric@50.35.83.177) |
| 2021-08-22 18:39:50 | sm | . o O "what do you mean you don't understand ? it's identical complexity at the type level !" "Oh, of course! How silly of me, thanks for making everything clear" |
| 2021-08-22 18:40:32 | <c_wraith> | hey, when the complaint is "I can't figure out how to do X with an existential, but I can figure out Y", pointing out that the existential is irrelevant for the difference matters. |
| 2021-08-22 18:40:58 | → | raehik joins (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net) |
| 2021-08-22 18:41:02 | <fresheyeball> | c_wraith: fair enough, it was a bad question |
| 2021-08-22 18:41:18 | <fresheyeball> | any examples of hand written Generic instances? |
| 2021-08-22 18:41:37 | <c_wraith> | I don't know if anyone has ever hand-written a Generic instance. |
| 2021-08-22 18:41:56 | <fresheyeball> | is there a way to get a Generic instances for my data type? |
| 2021-08-22 18:42:16 | <c_wraith> | ... ok, that's certainly an exaggeration. I'm sure it was done by hand for comparison during the development of the DeriveGeneric extension. |
| 2021-08-22 18:42:22 | <sm> | c_wraith: no criticism implied, I'm just joking around (and backing up fresheyeball's perception, in human terms showsPrec is way harder than show) |
| 2021-08-22 18:42:43 | <fresheyeball> | right, the existential part was really not part of the question though |
| 2021-08-22 18:42:50 | <fresheyeball> | it was more why I can't derive it |
| 2021-08-22 18:43:39 | × | hexfive quits (~eric@50.35.83.177) (Client Quit) |
| 2021-08-22 18:43:45 | <fresheyeball> | And why I can't derive Generic either |
| 2021-08-22 18:45:26 | <c_wraith> | my general experience is that when something is hard to get to work in Haskell, it's also hard to use. |
| 2021-08-22 18:45:50 | <fresheyeball> | c_wraith: maybe so, but I really want the safety and ergonimics this will provide to the code |
| 2021-08-22 18:45:54 | <c_wraith> | the type system issues don't go away |
| 2021-08-22 18:46:10 | <c_wraith> | I question the ergonomics. |
| 2021-08-22 18:46:25 | <c_wraith> | I expect it will be as hard to use everywhere as it is to implement |
| 2021-08-22 18:46:27 | <fresheyeball> | If I can get his, I have dependantly typed routes, which will let me write code in terms of the actual model without a ton of hand mapping between run time ADTs |
| 2021-08-22 18:46:47 | × | xff0x quits (~xff0x@2001:1a81:52ba:f800:b837:8a9e:e00a:9d36) (Ping timeout: 258 seconds) |
| 2021-08-22 18:47:26 | → | dschrempf joins (~dominik@2a01-036d-0118-46d4-2358-1c2a-8fb3-e278.pool6.digikabel.hu) |
| 2021-08-22 18:47:42 | → | xff0x joins (~xff0x@2001:1a81:52ba:f800:f347:6f1f:6209:b9ad) |
| 2021-08-22 18:47:56 | × | pbrisbin quits (~patrick@174-081-116-011.res.spectrum.com) (Ping timeout: 250 seconds) |
| 2021-08-22 18:48:07 | <glguy> | fresheyeball, There's some research what it means to extend GHC.Generics to handle existential quantification, but the stuff you need isn't in base |
| 2021-08-22 18:48:26 | <fresheyeball> | glguy: that's fine |
| 2021-08-22 18:48:30 | <fresheyeball> | I just need to figure this out |
| 2021-08-22 18:48:34 | <glguy> | and everything that works with generics would need to be updated to use the new stuff |
| 2021-08-22 18:48:42 | <fresheyeball> | all the types that are existentialized in are Generic |
| 2021-08-22 18:48:48 | <fresheyeball> | and the only other thing in this type is a Proxy |
| 2021-08-22 18:48:52 | <fresheyeball> | so it should be possible |
| 2021-08-22 18:49:07 | <glguy> | it's not something Generics currently supports |
| 2021-08-22 18:49:23 | <fresheyeball> | glguy: are you saying it's currently impossible while logically possible? |
| 2021-08-22 18:49:45 | <glguy> | someone could perhaps make a thing that wasn't GHC.Generics but was similar and then it might work |
| 2021-08-22 18:49:49 | <glguy> | but it doesn't work in GHC.Generics |
| 2021-08-22 18:50:00 | <fresheyeball> | so... yes? |
| 2021-08-22 18:50:10 | <glguy> | so no you can't make a Generic instance |
| 2021-08-22 18:50:14 | → | segfaultfizzbuzz joins (~segfaultf@157-131-253-1.fiber.dynamic.sonic.net) |
| 2021-08-22 18:50:16 | <glguy> | but you could invent a whole new generics system |
| 2021-08-22 18:50:19 | <fresheyeball> | ok |
| 2021-08-22 18:50:35 | <fresheyeball> | so that makes sense because type Rep would need the existenail variable |
| 2021-08-22 18:51:15 | <fresheyeball> | well lame |
| 2021-08-22 18:51:30 | <fresheyeball> | hmm, I can get around this |
| 2021-08-22 18:51:39 | <fresheyeball> | because I think I am only using Generic for Aeson |
| 2021-08-22 18:51:43 | → | timCF joins (~timCF@m91-129-108-244.cust.tele2.ee) |
| 2021-08-22 18:52:07 | <glguy> | You could perhaps use Generics on your underlying PageModel type and then use a not-generics thing to wrap that up for PageView |
All times are in UTC.