Logs: liberachat/#haskell
| 2021-08-22 18:52:30 | <fresheyeball> | glguy: I don't understand that |
| 2021-08-22 18:52:43 | ← | segfaultfizzbuzz parts (~segfaultf@157-131-253-1.fiber.dynamic.sonic.net) (Leaving) |
| 2021-08-22 18:52:44 | <fresheyeball> | you mean get ToJSON from the underly Generic? |
| 2021-08-22 18:52:58 | <fresheyeball> | and then use that instance in my hand written instance? |
| 2021-08-22 18:53:06 | <glguy> | There's no reason to store a Proxy in the datatype, anyway |
| 2021-08-22 18:53:29 | <glguy> | the whole datatype really is just the PageModel |
| 2021-08-22 18:53:32 | → | abrantesasf joins (~abrantesa@2804:14d:b086:4b3c:2e56:dcff:fedb:62f) |
| 2021-08-22 18:53:33 | <fresheyeball> | I don't see how to get even Eq without it |
| 2021-08-22 18:54:01 | <glguy> | Storing the proxy in the datatype, that first field with type (Proxy p), doesn't help implement Eq |
| 2021-08-22 18:54:04 | <fresheyeball> | http://ix.io/3wGy |
| 2021-08-22 18:54:09 | <fresheyeball> | if you want to see what I have in full |
| 2021-08-22 18:54:23 | <fresheyeball> | I am using it with typeable to get Eq |
| 2021-08-22 18:55:25 | <timCF> | Hello! I'm looking for a some soft of "standard" function `Int -> Rational -> Text` which takes amount of symbols to render aftrer dot as first argument. Ideally I want this function to work without convertions to Float/Double and corresponding rounding errors. I came up with this, but not sure it's optimal solution |
| 2021-08-22 18:55:30 | <timCF> | https://github.com/tkachuk-labs/rentier/blob/8089b849d431b8eaa6aa793894c624d473bd4b04/src/Rentier/Rational.hs#L18-L31 |
| 2021-08-22 18:55:47 | <fresheyeball> | timCF: convert to Fixed first |
| 2021-08-22 18:55:48 | <glguy> | fresheyeball, You can always just make a new "Proxy" value when you need it; storing it on the constructor doesn't do anything extra |
| 2021-08-22 18:55:57 | <fresheyeball> | then just use Show |
| 2021-08-22 18:56:46 | <fresheyeball> | glguy: I don't see how to do it |
| 2021-08-22 18:56:59 | <fresheyeball> | how do I bring p into scope without to Proxy? |
| 2021-08-22 18:57:11 | <timCF> | fresheyeball: thanks! |
| 2021-08-22 18:57:47 | <glguy> | fresheyeball, one moment, your file was missing all the language extensions |
| 2021-08-22 18:57:59 | <fresheyeball> | glguy: yeah it's in the cabal file |
| 2021-08-22 18:58:09 | <glguy> | yeah, this is why that's not as good as putting them in the file |
| 2021-08-22 18:58:23 | <fresheyeball> | glguy: I get really sick of adding them |
| 2021-08-22 18:58:44 | <glguy> | fortunately making new files isn't the most common part of making things |
| 2021-08-22 18:59:14 | <fresheyeball> | glguy: I understand the critique, but I am doing it this way and I am not changing it |
| 2021-08-22 18:59:29 | <glguy> | that fine, it just means your file doesn't load. I'll stop |
| 2021-08-22 19:00:57 | <fresheyeball> | glguy: I got it |
| 2021-08-22 19:01:08 | <fresheyeball> | I can do (x :: PageModel p) and avoid the Proxy |
| 2021-08-22 19:01:21 | <shachaf> | -fglasgow-exts for life |
| 2021-08-22 19:01:26 | → | merijn joins (~merijn@83-160-49-249.ip.xs4all.nl) |
| 2021-08-22 19:01:43 | <shachaf> | I heard they were adding something like glasgow-exts back to GHC? |
| 2021-08-22 19:02:24 | <fresheyeball> | Oop nope |
| 2021-08-22 19:02:28 | <fresheyeball> | I do need the Proxy |
| 2021-08-22 19:02:33 | <fresheyeball> | otherwise I can't get instances into scope |
| 2021-08-22 19:05:44 | <glguy> | no, pattern matching on the PageView constructor brings instances into scope, not the Proxy |
| 2021-08-22 19:06:34 | <janus> | shachaf: is it GHC2021 that is like glasgow-exts? |
| 2021-08-22 19:06:50 | <glguy> | If you ever need a proxy you can recover it like: toProxy :: f p -> Proxy p; toProxy _ = Proxy |
| 2021-08-22 19:06:54 | <shachaf> | Oh, that sounds right. |
| 2021-08-22 19:10:00 | <janus> | GHC2021+GADTs+OverloadedStrings+DerivingStrategies 4 lyfe :P |
| 2021-08-22 19:11:14 | × | Guest5329 quits (~chris@81.96.113.213) (Remote host closed the connection) |
| 2021-08-22 19:11:42 | × | azeem quits (~azeem@176.200.223.33) (Ping timeout: 258 seconds) |
| 2021-08-22 19:11:46 | × | dschrempf quits (~dominik@2a01-036d-0118-46d4-2358-1c2a-8fb3-e278.pool6.digikabel.hu) (Ping timeout: 250 seconds) |
| 2021-08-22 19:11:57 | <janus> | hmm what if they had done multiple levels og GHC2021? :P hahaha you could have GHC2021SevenVotes, GHC2021SixVotes :P then, if like me, you think ghc2021 is a bit too conserative, you'd have the option |
| 2021-08-22 19:11:58 | <shachaf> | Glaswegian Algebraic Data Types isn't part of GHC2021? |
| 2021-08-22 19:12:23 | <janus> | shachaf: they are not ;) the one i mentioned are at 7 votes, they'd need 8 votes to be included |
| 2021-08-22 19:13:17 | <janus> | in effect, i guess it would be like a two-staged voting system |
| 2021-08-22 19:13:23 | → | azeem joins (~azeem@176.200.223.33) |
| 2021-08-22 19:13:34 | <janus> | then, you could probe haskell and see which level of ghc2021 people would commonly choose |
| 2021-08-22 19:13:44 | <janus> | i think GHC2021SevenVotes would be more popular than GHC2021EightVotes |
| 2021-08-22 19:14:06 | <janus> | s/haskell/hackage/ (sorry) |
| 2021-08-22 19:14:23 | → | burnsidesLlama joins (~burnsides@dhcp168-023.wadham.ox.ac.uk) |
| 2021-08-22 19:15:28 | × | hendursa1 quits (~weechat@user/hendursaga) (Quit: hendursa1) |
| 2021-08-22 19:15:39 | → | Sgeo joins (~Sgeo@user/sgeo) |
| 2021-08-22 19:15:55 | → | hendursaga joins (~weechat@user/hendursaga) |
| 2021-08-22 19:17:58 | × | burnsidesLlama quits (~burnsides@dhcp168-023.wadham.ox.ac.uk) (Remote host closed the connection) |
| 2021-08-22 19:18:42 | → | burnsidesLlama joins (~burnsides@dhcp168-023.wadham.ox.ac.uk) |
| 2021-08-22 19:19:58 | × | azeem quits (~azeem@176.200.223.33) (Ping timeout: 252 seconds) |
| 2021-08-22 19:21:52 | × | burnsidesLlama quits (~burnsides@dhcp168-023.wadham.ox.ac.uk) (Remote host closed the connection) |
| 2021-08-22 19:22:30 | <fresheyeball> | ok so ToJSON was easy |
| 2021-08-22 19:22:34 | <fresheyeball> | but FromJSON is hard |
| 2021-08-22 19:23:19 | → | neo joins (~neo3@cpe-292712.ip.primehome.com) |
| 2021-08-22 19:24:34 | <c_wraith> | I'd expect FromJSON to actually be impossible |
| 2021-08-22 19:24:48 | <fresheyeball> | c_wraith: I did this before with singletons |
| 2021-08-22 19:24:56 | <fresheyeball> | but I don't want to pull in singletons just for this |
| 2021-08-22 19:25:06 | <fresheyeball> | basically I demote Page and encode that into the json |
| 2021-08-22 19:25:18 | <fresheyeball> | then I decode Page, and need to convert it to a Proxy of itself |
| 2021-08-22 19:25:37 | → | pretty_dumm_guy joins (trottel@gateway/vpn/protonvpn/prettydummguy/x-88029655) |
| 2021-08-22 19:26:07 | <janus> | hmmm i wonder if it even makes sense to have a discussion around GHC2021SevenVotes or if is it just plain politically infeasible |
| 2021-08-22 19:26:09 | <c_wraith> | your options are all various forms of "a table". The only question is whether you manage that table yourself or try to throw it into instances of some class to make the compiler do it |
| 2021-08-22 19:28:07 | × | mei quits (~mei@user/mei) (Quit: mei) |
| 2021-08-22 19:31:10 | × | oxide quits (~lambda@user/oxide) (Ping timeout: 240 seconds) |
| 2021-08-22 19:34:26 | <fresheyeball> | c_wraith: I got it! |
| 2021-08-22 19:35:02 | <fresheyeball> | http://ix.io/3wGF |
| 2021-08-22 19:35:29 | × | merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 248 seconds) |
| 2021-08-22 19:41:29 | → | chris joins (~chris@81.96.113.213) |
| 2021-08-22 19:41:32 | chris | is now known as Guest934 |
| 2021-08-22 19:42:59 | → | Lord_of_Life_ joins (~Lord@user/lord-of-life/x-2819915) |
| 2021-08-22 19:43:24 | × | Lord_of_Life quits (~Lord@user/lord-of-life/x-2819915) (Ping timeout: 250 seconds) |
| 2021-08-22 19:44:16 | Lord_of_Life_ | is now known as Lord_of_Life |
| 2021-08-22 19:45:40 | × | Guest934 quits (~chris@81.96.113.213) (Ping timeout: 240 seconds) |
| 2021-08-22 19:47:44 | × | alx741 quits (~alx741@181.196.68.120) (Ping timeout: 250 seconds) |
| 2021-08-22 19:48:36 | × | _xor quits (~xor@74.215.232.67) (Read error: Connection reset by peer) |
| 2021-08-22 19:49:12 | → | _xor joins (~xor@74.215.232.67) |
| 2021-08-22 19:51:01 | → | azeem joins (~azeem@176.200.243.28) |
| 2021-08-22 19:53:59 | × | _xor quits (~xor@74.215.232.67) (Read error: Connection reset by peer) |
| 2021-08-22 19:54:24 | → | _xor joins (~xor@74.215.232.67) |
| 2021-08-22 19:57:44 | × | _ht quits (~quassel@82-169-194-8.biz.kpn.net) (Remote host closed the connection) |
| 2021-08-22 19:58:16 | → | burnsidesLlama joins (~burnsides@dhcp168-023.wadham.ox.ac.uk) |
| 2021-08-22 20:00:09 | × | zaquest quits (~notzaques@5.128.210.178) (Quit: Leaving) |
| 2021-08-22 20:00:47 | → | alx741 joins (~alx741@181.196.68.94) |
| 2021-08-22 20:01:13 | → | zaquest joins (~notzaques@5.128.210.178) |
| 2021-08-22 20:02:41 | × | burnsidesLlama quits (~burnsides@dhcp168-023.wadham.ox.ac.uk) (Ping timeout: 248 seconds) |
| 2021-08-22 20:05:04 | × | juhp quits (~juhp@128.106.188.220) (Ping timeout: 250 seconds) |
| 2021-08-22 20:07:48 | × | azeem quits (~azeem@176.200.243.28) (Ping timeout: 268 seconds) |
| 2021-08-22 20:08:04 | → | juhp joins (~juhp@128.106.188.220) |
| 2021-08-22 20:09:05 | × | eggplantade quits (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Ping timeout: 248 seconds) |
| 2021-08-22 20:09:40 | × | [Kalisto] quits (~nico@user/kalisto/x-8968079) (Ping timeout: 268 seconds) |
| 2021-08-22 20:11:21 | → | eggplantade joins (~Eggplanta@2600:1700:bef1:5e10:fc6b:7277:c769:1dab) |
| 2021-08-22 20:12:58 | → | o1lo01ol1o joins (~o1lo01ol1@5.181.115.89.rev.vodafone.pt) |
All times are in UTC.