Logs: liberachat/#haskell
| 2021-07-21 00:34:25 | <aegon> | dsal: I want to store it in record in a ReaderT so I need to give a type for it somewheres |
| 2021-07-21 00:35:40 | <aegon> | I want to have access to an Env within route of my app so I can interact with google storage, I think one way for this is to store the Google Env in a record in a ReaderT but this level of type work is over my head, maybe the way this is formed precludes that? |
| 2021-07-21 00:36:50 | × | Guest4 quits (~Guest4@50.47.115.102) (Quit: Client closed) |
| 2021-07-21 00:37:17 | <Cajun> | h98: that does seem accurate, but that makes me wonder why it isnt caught by a syntax checker of some kind and results in the GHC panic. ill submit the bug report if it appears it hasnt been submitted already |
| 2021-07-21 00:37:47 | <dsal> | aegon: You don't necessarily want to store that env. I'm trying to see what the equivalent in gogol is of some of the stuff I'm doing in amazonka |
| 2021-07-21 00:38:02 | <geekosaur> | just for grins and giggles: does it change if you rename the type? |
| 2021-07-21 00:38:38 | <geekosaur> | that is, (a :: Num b => b) |
| 2021-07-21 00:38:53 | <h98> | https://gitlab.haskell.org/ghc/ghc/-/issues/18714 might be relevant |
| 2021-07-21 00:39:35 | <aegon> | dsal: hmm, i thought i'd want to not create and tear down loggers / envs everytime i uplaod or download something from gcs but maybe it's lighterweight than i thought? |
| 2021-07-21 00:39:35 | <Cajun> | that doesnt do much of anything it appears geekosaur but nice idea lol |
| 2021-07-21 00:39:48 | <Cajun> | h98: it does appear to be relevant, thanks! |
| 2021-07-21 00:40:02 | <aegon> | dsal: thats for sure doing an env lookup and a disk read at the least but maybe Gogol caches that somewhere internal with an IORef |
| 2021-07-21 00:40:18 | <dsal> | aegon: yeah. In amazonka, there's an AWST you can use. I don't quite know where that is. But your type signature looks a bit weird there. Have you tried removing it and asking it what the type is? |
| 2021-07-21 00:40:21 | × | Lord_of_Life quits (~Lord@user/lord-of-life/x-2819915) (Ping timeout: 265 seconds) |
| 2021-07-21 00:40:49 | <aegon> | dsal: yeah, with it removed GHC gives up, I thought maybe i was missing a language pragma so sprinkled some in :P |
| 2021-07-21 00:41:33 | <aegon> | gettin ga pastebin of the error |
| 2021-07-21 00:41:34 | → | allbery_b joins (~geekosaur@xmonad/geekosaur) |
| 2021-07-21 00:41:34 | × | geekosaur quits (~geekosaur@xmonad/geekosaur) (Killed (NickServ (GHOST command used by allbery_b))) |
| 2021-07-21 00:41:37 | allbery_b | is now known as geekosaur |
| 2021-07-21 00:42:00 | × | adinf quits (~adinfinit@2600:6c40:653f:5f00:a650:d8d7:fe0b:8c1f) (Ping timeout: 255 seconds) |
| 2021-07-21 00:43:31 | <aegon> | dsal: here is the one https://dpaste.com/F98EU49GW |
| 2021-07-21 00:44:44 | → | Lord_of_Life joins (~Lord@user/lord-of-life/x-2819915) |
| 2021-07-21 00:45:29 | <dsal> | Oh, well for the first, you probably just need the correct constraints. newEnv is `newEnv :: (MonadIO m, MonadCatch m, AllowScopes s) => m (Env s)` |
| 2021-07-21 00:45:37 | <dsal> | Your function is basically the same as that. |
| 2021-07-21 00:46:08 | <dsal> | I should write some code against gogol. I thought I had somewhere, but I guess not. |
| 2021-07-21 00:47:35 | <aegon> | dsal: hmm, but then when i get the Env s and i want to store that in a record, i need to provide the s type and i don't know how to tell the compiler what that is |
| 2021-07-21 00:48:22 | <geekosaur> | isn't the error message giving that to you? |
| 2021-07-21 00:48:45 | × | hiruji quits (~hiruji@user/hiruji) (Ping timeout: 255 seconds) |
| 2021-07-21 00:50:07 | <aegon> | geekosaur: i must be missing a language extension? i tried plugging that into it before an ghc didn't know how to parse '["thing"]' as part of the Env type signature |
| 2021-07-21 00:50:21 | <aegon> | it said somethign about a Kind mismatch |
| 2021-07-21 00:51:01 | × | Deide quits (~Deide@user/deide) (Quit: Seeee yaaaa) |
| 2021-07-21 00:51:48 | <geekosaur> | maybe provide that code and error? this is starting to sound like an xy problem |
| 2021-07-21 00:51:59 | × | lbseale quits (~lbseale@user/ep1ctetus) (Quit: Leaving) |
| 2021-07-21 00:52:45 | <dsal> | This code uses some fancy features and has a lot of bugs open begging for it to be updated and/or offering help to maintain it. :( |
| 2021-07-21 00:54:56 | <aegon> | working on getting a paste for that, I'm pretty unfamiliar with these extensions so it takes a bit to reorganize stuff and get back to the previous state |
| 2021-07-21 00:55:06 | → | pesada joins (~agua@2804:18:4a:c35:1:0:3be5:8cb2) |
| 2021-07-21 00:55:16 | → | adinf joins (~adinfinit@2600:6c40:653f:5f00:a650:d8d7:fe0b:8c1f) |
| 2021-07-21 00:55:57 | <geekosaur> | anyway kind mismatch is not usually a missing extension but some other problem |
| 2021-07-21 00:56:08 | <dsal> | DataKinds isn't too confusing, but it is leading to some monstrous types: type FilesCopyResource = "drive" :> ("v3" :> ("files" :> (Capture "fileId" Text :> ("copy" :> (QueryParam "ocrLanguage" Text :> (QueryParam "keepRevisionForever" Bool :> (QueryParam "supportsAllDrives" Bool :> (QueryParam "ignoreDefaultVisibility" Bool :> (QueryParam "supportsTeamDrives" Bool :> (QueryParam "alt" AltJSON :> (ReqBody '[JSON] File :> Post '[JSON] |
| 2021-07-21 00:56:08 | <dsal> | File))))))))))) |
| 2021-07-21 00:56:58 | <geekosaur> | the type there admittedly wouldn't have matched kinds *, so maybe you're missing PolyKinds |
| 2021-07-21 00:57:40 | × | agua quits (~agua@2804:18:4f:bc57:1:0:3808:8f6a) (Ping timeout: 246 seconds) |
| 2021-07-21 00:57:45 | × | oxide quits (~lambda@user/oxide) (Read error: Connection reset by peer) |
| 2021-07-21 00:58:36 | <aegon> | ooo, i got it down to a warning, i was screwing up the s part of the type by adding an extra ' at the end |
| 2021-07-21 00:58:43 | <aegon> | what extension or feature is the '["string"] |
| 2021-07-21 00:59:24 | <geekosaur> | that's a type-level list of Symbols |
| 2021-07-21 00:59:29 | <h98> | aegon https://stackoverflow.com/questions/54020335/what-is-and-in-haskell |
| 2021-07-21 01:00:57 | <aegon> | h98 reading that |
| 2021-07-21 01:01:09 | <aegon> | in the meanwhile here is the version with just a warning https://dpaste.com/6N2WZ3YVG |
| 2021-07-21 01:03:20 | <dsal> | That's a handy warning. |
| 2021-07-21 01:05:03 | <aegon> | yeah i fixed it, I need to read up on MonadCatch, so I need to do this init within a non IO monad, it doesn't work when I remove the constraint MonadCatch but the example i see is doing this in raw IO |
| 2021-07-21 01:05:35 | <dsal> | If you need to use this, you need to use it from something with a `MonadCatch` constraint. |
| 2021-07-21 01:06:07 | <aegon> | ooooh, the example is untyped and is eventually going through Google.Network.runGoogle |
| 2021-07-21 01:07:31 | × | chris_ quits (~chris@81.96.113.213) (Remote host closed the connection) |
| 2021-07-21 01:10:50 | <aegon> | and, IO is an instance of MonadCatch |
| 2021-07-21 01:13:22 | → | chris_ joins (~chris@81.96.113.213) |
| 2021-07-21 01:13:34 | <dsal> | Yeah, IO has a lot of instances. |
| 2021-07-21 01:14:44 | × | jao quits (~jao@cpc103048-sgyl39-2-0-cust502.18-2.cable.virginm.net) (Ping timeout: 258 seconds) |
| 2021-07-21 01:15:21 | <aegon> | sorry for all the questions, I've read about transformers a lot, this is the first time trying to do something real with them and its quite different than reading, I'm still getting working on some intuition, i got the type down |
| 2021-07-21 01:15:45 | <aegon> | so if i'm understanding this correct theres a type definitions somewhere in google that uses that string as one of its representations |
| 2021-07-21 01:16:43 | <dsal> | This isn't transformers, this is DataKinds. |
| 2021-07-21 01:16:44 | <aegon> | or is '[] doing something special with the Symol definition that converts any sequence of strings into a matchable type parameter |
| 2021-07-21 01:16:50 | → | shapr joins (~user@pool-100-36-247-68.washdc.fios.verizon.net) |
| 2021-07-21 01:18:39 | <dsal> | Symbol is for type literals: https://hackage.haskell.org/package/base-4.15.0.0/docs/GHC-TypeLits.html#t:Symbol |
| 2021-07-21 01:18:44 | → | olive_ joins (~olive_@117.222.71.166) |
| 2021-07-21 01:19:31 | → | oxide joins (~lambda@user/oxide) |
| 2021-07-21 01:19:43 | × | smichel17 quits (~smichel17@c-73-68-217-18.hsd1.ma.comcast.net) (Quit: smichel17) |
| 2021-07-21 01:20:05 | <aegon> | reading up on DataKinds / TypeLits |
| 2021-07-21 01:20:12 | <dsal> | Argh, these types require pastebins just to talk about |
| 2021-07-21 01:20:58 | × | xff0x_ quits (~xff0x@2001:1a81:52d5:1300:581a:587e:cc8c:4deb) (Ping timeout: 240 seconds) |
| 2021-07-21 01:20:59 | → | jao joins (~jao@cpc103048-sgyl39-2-0-cust502.18-2.cable.virginm.net) |
| 2021-07-21 01:21:24 | <justsomeguy> | That's one advantage of other kinds of chat platforms, like the fp discord or matrix. |
| 2021-07-21 01:21:45 | <justsomeguy> | (You can have an in-line text document, which can easily be hidden or expanded.) |
| 2021-07-21 01:22:50 | <dsal> | Heh. It's more of damning a type definition that's so long it requires that kind of feature to even look at. |
| 2021-07-21 01:22:56 | → | xff0x_ joins (~xff0x@2001:1a81:530d:8900:36a5:b6bb:ee85:bc72) |
| 2021-07-21 01:22:56 | <dsal> | aegon: https://github.com/brendanhay/gogol/blob/develop/gogol-storage/gen/Network/Google/Resource/Storage/Objects/Get.hs#L206 <-- you can see how this is used here. |
| 2021-07-21 01:23:35 | <dsal> | The scope string is part of the type such that you get compile-time safety preventing you from calling a modification function with a read scope. |
| 2021-07-21 01:24:40 | → | doyougnu joins (~user@c-73-25-202-122.hsd1.or.comcast.net) |
| 2021-07-21 01:26:11 | <monochrom> | Is that type-level URL meme |
| 2021-07-21 01:27:15 | dsal | creates type shortener service |
| 2021-07-21 01:27:34 | <dsal> | e.g.: https://github.com/brendanhay/gogol/blob/develop/gogol-storage/gen/Network/Google/Resource/Storage/Objects/Insert.hs#L55-L102 |
| 2021-07-21 01:27:40 | <monochrom> | hee hee |
| 2021-07-21 01:28:28 | <dsal> | I think the indentation is probably quite misleading. |
| 2021-07-21 01:28:29 | <h98> | should've run the URLs through bit.ly first to make the types shorter |
| 2021-07-21 01:29:13 | <dsal> | echo type | gzip -9vc | gzip -9vc |
| 2021-07-21 01:29:30 | × | waleee quits (~waleee@2001:9b0:216:8200:d457:9189:7843:1dbd) (Ping timeout: 256 seconds) |
| 2021-07-21 01:32:24 | × | Lord_of_Life quits (~Lord@user/lord-of-life/x-2819915) (Ping timeout: 268 seconds) |
| 2021-07-21 01:33:28 | × | eight quits (~eight@user/eight) (Quit: leaving) |
| 2021-07-21 01:33:52 | → | Lord_of_Life joins (~Lord@user/lord-of-life/x-2819915) |
| 2021-07-21 01:34:00 | → | myShoggoth joins (~myShoggot@97-120-70-214.ptld.qwest.net) |
| 2021-07-21 01:39:04 | → | merijn joins (~merijn@83-160-49-249.ip.xs4all.nl) |
| 2021-07-21 01:42:14 | × | geekosaur quits (~geekosaur@xmonad/geekosaur) (Remote host closed the connection) |
| 2021-07-21 01:43:47 | × | doyougnu quits (~user@c-73-25-202-122.hsd1.or.comcast.net) (Remote host closed the connection) |
| 2021-07-21 01:43:55 | <aegon> | dsal: are you the author of gogol? |
| 2021-07-21 01:45:08 | → | geekosaur joins (~geekosaur@xmonad/geekosaur) |
| 2021-07-21 01:49:04 | <dsal> | aegon: noooo. |
| 2021-07-21 01:49:11 | <dsal> | That dude seems busy |
| 2021-07-21 01:49:59 | × | jmorris quits (uid433911@id-433911.stonehaven.irccloud.com) (Quit: Connection closed for inactivity) |
| 2021-07-21 01:50:18 | × | MQ-17J quits (~MQ-17J@d14-69-206-129.try.wideopenwest.com) (Ping timeout: 252 seconds) |
| 2021-07-21 01:50:27 | → | MQ-17J joins (~MQ-17J@d14-69-206-129.try.wideopenwest.com) |
All times are in UTC.