2025/01/16

Newest at the top

2025-01-16 06:19:36 +0100 <mauke> then the rest boils down to tree conversion, not json parsing
2025-01-16 06:19:22 +0100 <mauke> Square: I mean, you could use aeson to decode to Value
2025-01-16 06:13:25 +0100merijn(~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 248 seconds)
2025-01-16 06:08:50 +0100merijn(~merijn@128-137-045-062.dynamic.caiway.nl) merijn
2025-01-16 06:08:31 +0100j1n37(~j1n37@user/j1n37) j1n37
2025-01-16 06:05:58 +0100 <jackdk> Is it fair to characterise the problem as "I want to provide a set of keys, whether or not the keys are optional, and the types of their expected value, and get a JSON deserialiser for an object with those keys"?
2025-01-16 06:05:22 +0100j1n37(~j1n37@user/j1n37) (Read error: Connection reset by peer)
2025-01-16 06:04:28 +0100 <jackdk> I'm sorry, I still don't really understand what I'm looking at. Is `Wrap a` meant to be a sum type? Is the universe of keys meant to be finite?
2025-01-16 06:01:29 +0100CaptainSlog(~user@67.237.174.60) (Quit: ERC 5.5.0.29.1 (IRC client for GNU Emacs 29.4))
2025-01-16 05:57:56 +0100merijn(~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 252 seconds)
2025-01-16 05:57:33 +0100CaptainSlog(~user@67.237.174.60)
2025-01-16 05:51:09 +0100sp1ff(~user@c-67-160-173-55.hsd1.wa.comcast.net) sp1ff
2025-01-16 05:49:08 +0100merijn(~merijn@128-137-045-062.dynamic.caiway.nl) merijn
2025-01-16 05:37:45 +0100merijn(~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 244 seconds)
2025-01-16 05:31:05 +0100merijn(~merijn@128-137-045-062.dynamic.caiway.nl) merijn
2025-01-16 05:28:37 +0100peterbecich(~Thunderbi@syn-047-229-123-186.res.spectrum.com) peterbecich
2025-01-16 05:23:40 +0100Guest20(~Guest71@2800:a4:10ef:7400:35a0:bf8a:5772:25a7) (Ping timeout: 240 seconds)
2025-01-16 05:20:10 +0100merijn(~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 252 seconds)
2025-01-16 05:18:11 +0100bitdex(~bitdex@gateway/tor-sasl/bitdex) bitdex
2025-01-16 05:17:07 +0100m5zs7k(aquares@web10.mydevil.net) m5zs7k
2025-01-16 05:15:40 +0100merijn(~merijn@128-137-045-062.dynamic.caiway.nl) merijn
2025-01-16 05:14:23 +0100 <Square> I guess the parser would use a "Output Box" where box would be the sumtype housing the listing of type I mentioned in the paste. That "Box" would need existential quantifican (+ Typeable) as the enums would be arbitrary.
2025-01-16 05:12:21 +0100m5zs7k(aquares@web10.mydevil.net) (Ping timeout: 276 seconds)
2025-01-16 05:12:12 +0100 <Square> So I redifined my idea a bit, so ignore types mentioned in posts before the paste.
2025-01-16 05:10:23 +0100housemate(~housemate@146.70.66.228) (Quit: Nothing to see here. I wasn't there. I take IRC seriously. I do not work for any body DIRECTLY although I do represent BOT NET.)
2025-01-16 05:10:06 +0100 <Square> jackdk, Hope this makes sense https://paste.tomsmeding.com/dCXlspBC
2025-01-16 05:05:24 +0100jzargo(~jzargo@user/jzargo) jzargo
2025-01-16 05:04:45 +0100merijn(~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 252 seconds)
2025-01-16 05:00:16 +0100merijn(~merijn@128-137-045-062.dynamic.caiway.nl) merijn
2025-01-16 04:57:28 +0100 <Square> i will! Realized I needed to think a bit to write something comprehensive.
2025-01-16 04:49:33 +0100merijn(~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 265 seconds)
2025-01-16 04:48:27 +0100 <jackdk> Thanks. Please mention me when it's ready so I get a beep
2025-01-16 04:48:06 +0100 <Square> ok, ill do that
2025-01-16 04:47:57 +0100 <Square> Say i want to deserialize a 'Map SomeKey Box'. 'data Box = forall a. Box a'.
2025-01-16 04:47:40 +0100 <jackdk> If this is going to be a long explanation, you might want to use a pastebin
2025-01-16 04:47:12 +0100 <Square> ops
2025-01-16 04:47:11 +0100 <Square> Say i want to deserialize a Map SomeKey
2025-01-16 04:46:39 +0100 <Square> ok
2025-01-16 04:46:15 +0100 <jackdk> Can we jump to the concrete? What type are you trying to deserialise into and is the context defined anywhere (even perhaps outside of Haskell, like an API doc?)
2025-01-16 04:46:08 +0100 <Square> quantified*
2025-01-16 04:46:01 +0100 <Square> existentially qualified wrapper type*
2025-01-16 04:45:33 +0100 <Square> jackdk, Hmm possibly. But I forgot to say that above mentioned types will be shuved into a existential type
2025-01-16 04:45:08 +0100 <jackdk> merijn: your client is blinking in and out of this channel again
2025-01-16 04:44:52 +0100merijn(~merijn@128-137-045-062.dynamic.caiway.nl) merijn
2025-01-16 04:42:36 +0100 <jackdk> Is the universe of possible contexts small enough to be represented by a family of newtypes?
2025-01-16 04:41:23 +0100 <Square> jackdk, info about how fields should be deserialized. Like the presence of '"value":12' could get all sorts of type wrappings. 'Int', 'Maybe Int', 'SomeType (Maybe Int)'
2025-01-16 04:38:38 +0100 <jackdk> Square: what sort of data is carried by the context?
2025-01-16 04:38:10 +0100Guest71(~Guest71@2800:a4:10ef:7400:35a0:bf8a:5772:25a7) (Ping timeout: 240 seconds)
2025-01-16 04:37:34 +0100 <Square> I will be neading to create a JSON (de)serializer for a type that will require a context during the deserialization step. Aiui aeson doesn't support this. Sure I could roll my own with with some parser combinators, but I wonder if anyone sees a simpler approach?
2025-01-16 04:37:33 +0100Guest20(~Guest71@2800:a4:10ef:7400:35a0:bf8a:5772:25a7)