00:29
humasect has joined #ocaml
00:32
humasect has quit [Client Quit]
01:00
myrkraverk has joined #ocaml
01:02
myrkraverk_ has quit [Ping timeout: 244 seconds]
01:44
myrkraverk_ has joined #ocaml
01:46
myrkraverk has quit [Ping timeout: 252 seconds]
02:34
myrkraverk has joined #ocaml
02:37
myrkraverk_ has quit [Ping timeout: 252 seconds]
02:45
myrkraverk_ has joined #ocaml
02:47
inline has quit [Quit: Leaving]
02:48
wbooze has joined #ocaml
02:48
myrkraverk has quit [Ping timeout: 276 seconds]
02:53
<
discocaml >
<ape_logic> is there a way to use either of the ppx json derivers to support objects that can contain a few variations of structure ?
02:53
<
discocaml >
<ape_logic> for example ,
02:53
<
discocaml >
<ape_logic> `"foo": { "type": "baz", "baz": "bar" }` or `"foo": { "type": "feh", "ding": "dong" }`
02:53
<
discocaml >
<ape_logic> the actual data is a nested structure that contains named k/v which can each be of a few types, depending on one of its sub keys
02:54
<
discocaml >
<ape_logic> (so "foo" is the name of the entry, and the entries are part of a top level object)
02:55
<
discocaml >
<ape_logic> it seems like they'll only really work for static structures, and while my natural inclination is to represent these in ocaml with variants, the derivers have funny ideas about how those are represented, and even moreso around what an assoc list looks like in json ..
03:02
<
discocaml >
<yawaramin> would probably need a few manual transformations to set it up the way you want it
03:11
<
discocaml >
<yawaramin> eg using `ppx_deriving_yojson`: ```ocaml
03:11
<
discocaml >
<yawaramin> type foo = Baz of { baz : string } | Feh of { ding : string }
03:11
<
discocaml >
<yawaramin>
03:11
<
discocaml >
<yawaramin> type foo' = { typ : string [@key "type"]; baz : (string [@default ""]); ding : (string [@default ""]) } [@@deriving to_yojson]
03:11
<
discocaml >
<yawaramin>
03:11
<
discocaml >
<yawaramin> let foo_to_yojson = function
03:11
<
discocaml >
<yawaramin> | Baz { baz } -> foo'_to_yojson { typ = "baz"; baz; ding = "" }
03:11
<
discocaml >
<yawaramin> | Feh { ding } -> foo'_to_yojson { typ = "feh"; baz = ""; ding }
03:11
<
discocaml >
<yawaramin> ```
03:11
<
discocaml >
<yawaramin> trying it: ```
03:11
<
discocaml >
<yawaramin> # Yojson.Safe.to_string (foo_to_yojson (Baz {baz = "bar"}));;
03:11
<
discocaml >
<yawaramin> - : string = "{\"type\":\"baz\",\"baz\":\"bar\"}"
03:11
<
discocaml >
<yawaramin> # Yojson.Safe.to_string (foo_to_yojson (Feh {ding = "dong"}));;
03:11
<
discocaml >
<yawaramin> - : string = "{\"type\":\"feh\",\"ding\":\"dong\"}"
03:11
<
discocaml >
<yawaramin> ```
03:15
<
discocaml >
<ape_logic> that's kind of similar to where I was at, but what about making yojson understand the object containing them? ie.
03:15
<
discocaml >
<ape_logic> ```json
03:15
<
discocaml >
<ape_logic> {
03:15
<
discocaml >
<ape_logic> "things": {
03:15
<
discocaml >
<ape_logic> "this": { "type": "baz", "baz": "bar" },
03:16
<
discocaml >
<ape_logic> "that": { "type": "feh", "ding": "dong"}
03:16
<
discocaml >
<ape_logic> }
03:16
<
discocaml >
<ape_logic> }
03:16
<
discocaml >
<ape_logic> ```
03:16
<
discocaml >
<ape_logic> I try to tell it this is a `(string * foo) list` but it wants one of those to look something like `things: [ { ..some.object.data.. }, ]`
03:16
<
discocaml >
<ape_logic> that's kind of similar to where I was at, but what about making yojson understand the object containing them? ie.
03:16
<
discocaml >
<ape_logic> ```json
03:16
<
discocaml >
<ape_logic> {
03:16
<
discocaml >
<ape_logic> "things": {
03:16
<
discocaml >
<ape_logic> "this": { "type": "baz", "baz": "bar" },
03:16
<
discocaml >
<ape_logic> "that": { "type": "feh", "ding": "dong"}
03:16
<
discocaml >
<ape_logic> }
03:16
<
discocaml >
<ape_logic> }
03:16
<
discocaml >
<ape_logic> ```
03:16
<
discocaml >
<ape_logic> I try to tell it `things` is a `(string * foo) list` but it wants one of those to look something like `things: [ { ..some.object.data.. }, ]`
03:16
<
discocaml >
<ape_logic> that's kind of similar to where I was at, but what about making yojson understand the object containing them? ie.
03:16
<
discocaml >
<ape_logic> ```json
03:16
<
discocaml >
<ape_logic> {
03:16
<
discocaml >
<ape_logic> "things": {
03:16
<
discocaml >
<ape_logic> "this": { "type": "baz", "baz": "bar" },
03:16
<
discocaml >
<ape_logic> "that": { "type": "feh", "ding": "dong"}
03:16
<
discocaml >
<ape_logic> }
03:16
<
discocaml >
<ape_logic> }
03:16
<
discocaml >
<ape_logic> ```
03:16
<
discocaml >
<ape_logic> I try to tell it `things` is a `(string * foo) list` but it wants one of those to look something like `"things": [ { ..object data.. } ]`
03:16
<
discocaml >
<ape_logic> (judging by how it outputs a dummy object of it)
03:17
<
discocaml >
<yawaramin> once you've defined the `foo_to_yojson` (eg) nested converter, Yojson will automatically use that (because of its name) in the top-level converter
03:17
<
discocaml >
<yawaramin> to convert a nested `foo` object
03:27
hsw has quit [Remote host closed the connection]
03:27
hsw has joined #ocaml
03:47
troydm has joined #ocaml
03:53
hsw has quit [Remote host closed the connection]
03:54
nirvdrum741 has joined #ocaml
03:55
hsw has joined #ocaml
04:21
deavmi has quit [Quit: Livin' in Afrika]
04:26
deavmi has joined #ocaml
04:39
m5zs7k_ has joined #ocaml
04:39
m5zs7k has quit [Read error: Connection reset by peer]
04:41
za3k has quit [Remote host closed the connection]
04:41
za3k has joined #ocaml
04:42
grobe0ba has quit [Ping timeout: 248 seconds]
04:42
tomku has quit [Ping timeout: 268 seconds]
04:43
germ has quit [Ping timeout: 276 seconds]
04:44
tomku has joined #ocaml
04:47
germ has joined #ocaml
04:47
m5zs7k_ is now known as m5zs7k
04:54
wbooze_ has joined #ocaml
04:56
nirvdrum741 has quit [Read error: Connection reset by peer]
04:57
wbooze has quit [Ping timeout: 252 seconds]
04:57
nirvdrum741 has joined #ocaml
05:04
nirvdrum7414 has joined #ocaml
05:06
nirvdrum741 has quit [Ping timeout: 252 seconds]
05:06
nirvdrum7414 is now known as nirvdrum741
05:11
nirvdrum7416 has joined #ocaml
05:11
nirvdrum741 has quit [Read error: Connection reset by peer]
05:11
nirvdrum7416 is now known as nirvdrum741
05:30
<
discocaml >
<ape_logic> it seems no matter what I do, I get this:
05:30
<
discocaml >
<ape_logic> ```
05:30
<
discocaml >
<ape_logic> {
05:30
<
discocaml >
<ape_logic> "nodes": [
05:30
<
discocaml >
<ape_logic> [
05:30
<
discocaml >
<ape_logic> "test",
05:30
<
discocaml >
<ape_logic> {
05:30
<
discocaml >
<ape_logic> "inputs": [],
05:30
<
discocaml >
<ape_logic> "locked": {
05:30
<
discocaml >
<ape_logic> "lastModified": 0,
05:30
<
discocaml >
<ape_logic> "narHash": "",
05:30
<
discocaml >
<ape_logic> "path": "",
05:30
<
discocaml >
<ape_logic> "type": ""
05:30
<
discocaml >
<ape_logic> },
05:30
<
discocaml >
<ape_logic> "original": { "path": "", "type": "" }
05:30
<
discocaml >
<ape_logic> }
05:30
<
discocaml >
<ape_logic> ]
05:30
<
discocaml >
<ape_logic> ],
05:30
<
discocaml >
<ape_logic> "root": "root",
05:30
<
discocaml >
<ape_logic> "version": 7
05:30
<
discocaml >
<ape_logic> }
05:30
<
discocaml >
<ape_logic> ```
05:30
<
discocaml >
<ape_logic> where `nodes` array should obviously be an assoc.. all the documentation I can find suggests this should be outputting (and imbibing) an object here
05:48
<
discocaml >
<ape_logic> ah, ppx_yojson_conv only supports custom routines under the default names / doesn't allow per field [@to_yojson]
06:10
sailorTheCat has joined #ocaml
06:41
hsw has quit [Remote host closed the connection]
06:41
hsw has joined #ocaml
06:51
grobe0ba has joined #ocaml
06:52
Serpent7776 has joined #ocaml
07:30
bartholin has joined #ocaml
07:34
za3k has joined #ocaml
07:55
Haudegen has joined #ocaml
08:24
myrkraverk has joined #ocaml
08:25
Everything has joined #ocaml
08:27
myrkraverk_ has quit [Ping timeout: 252 seconds]
08:30
bartholin has quit [Quit: Leaving]
08:33
keyboard has quit [Remote host closed the connection]
09:28
hsw has quit [Remote host closed the connection]
09:29
hsw has joined #ocaml
09:57
zor has joined #ocaml
10:00
chiselfuse has quit [*.net *.split]
10:07
toastal has left #ocaml [#ocaml]
10:10
funkatronixxx has joined #ocaml
10:10
funkatronixxx has quit [Remote host closed the connection]
10:32
humasect has joined #ocaml
10:51
itszor has joined #ocaml
10:55
zor has quit [Ping timeout: 272 seconds]
11:29
humasect has quit [Remote host closed the connection]
11:47
myrkraverk_ has joined #ocaml
11:50
myrkraverk has quit [Ping timeout: 252 seconds]
11:51
myrkraverk_ has quit [Read error: Connection reset by peer]
11:52
myrkraverk_ has joined #ocaml
11:52
toastal has joined #ocaml
11:53
myrkraverk__ has joined #ocaml
11:57
myrkraverk_ has quit [Ping timeout: 276 seconds]
12:16
Haudegen has quit [Quit: Bin weg.]
12:25
chiselfuse has joined #ocaml
12:41
humasect has joined #ocaml
12:52
toastal has left #ocaml [#ocaml]
13:03
polykernel has quit [Ping timeout: 265 seconds]
13:05
polykernel has joined #ocaml
13:11
Serpent7776 has quit [Ping timeout: 248 seconds]
13:12
myrkraverk has joined #ocaml
13:13
Serpent7776 has joined #ocaml
13:15
myrkraverk__ has quit [Ping timeout: 276 seconds]
13:23
Haudegen has joined #ocaml
13:30
myrkraverk_ has joined #ocaml
13:33
myrkraverk has quit [Ping timeout: 252 seconds]
13:40
humasect has quit [Remote host closed the connection]
13:50
myrkraverk has joined #ocaml
13:53
myrkraverk_ has quit [Ping timeout: 276 seconds]
13:58
Tuplanolla has joined #ocaml
13:58
humasect has joined #ocaml
14:01
<
discocaml >
<yawaramin> yeah i used ppx_deriving_yojson
14:17
trillion_exabyte has quit [Ping timeout: 248 seconds]
14:19
myrkraverk_ has joined #ocaml
14:19
trillion_exabyte has joined #ocaml
14:22
myrkraverk has quit [Ping timeout: 248 seconds]
14:48
wbooze_ is now known as wbooze
15:03
myrkraverk has joined #ocaml
15:06
myrkraverk_ has quit [Ping timeout: 248 seconds]
15:09
toastal has joined #ocaml
15:30
myrkraverk_ has joined #ocaml
15:33
myrkraverk has quit [Ping timeout: 248 seconds]
15:43
toastal has left #ocaml [#ocaml]
15:44
myrkraverk has joined #ocaml
15:44
toastal has joined #ocaml
15:47
myrkraverk_ has quit [Ping timeout: 252 seconds]
15:47
Haudegen has quit [Quit: Bin weg.]
16:05
myrkraverk_ has joined #ocaml
16:07
humasect has quit [Remote host closed the connection]
16:08
myrkraverk has quit [Ping timeout: 252 seconds]
16:24
myrkraverk has joined #ocaml
16:24
humasect has joined #ocaml
16:27
myrkraverk_ has quit [Ping timeout: 248 seconds]
16:43
Haudegen has joined #ocaml
17:37
humasect has quit [Remote host closed the connection]
17:50
Serpent7776 has quit [Ping timeout: 252 seconds]
18:14
bartholin has joined #ocaml
18:17
euphores has quit [Quit: Leaving.]
18:22
humasect has joined #ocaml
18:23
euphores has joined #ocaml
19:55
toastal has left #ocaml [#ocaml]
20:00
Serpent7776 has joined #ocaml
20:25
humasect has quit [Remote host closed the connection]
20:33
<
discocaml >
<leostera> we have supervisors in riot!
20:43
<
discocaml >
<shalokshalom> nice!
20:43
<
discocaml >
<shalokshalom> are there any plans to implement fault tolerance, and how far do you think you can go with the scheduling?
20:57
Everything has quit [Quit: leaving]
21:02
<
discocaml >
<yawaramin> doesn't fault tolerance basically boil down to having supervisors in an actor system?
21:07
Serpent7776 has quit [Ping timeout: 265 seconds]
21:13
Frostillicus has quit [Ping timeout: 276 seconds]
21:40
bartholin has quit [Quit: Leaving]
21:42
Mister_Magister_ has joined #ocaml
21:43
Mister_Magister has quit [Ping timeout: 276 seconds]
21:45
Mister_Magister_ is now known as Mister_Magister
22:00
myrkraverk_ has joined #ocaml
22:03
myrkraverk has quit [Ping timeout: 252 seconds]
22:12
Frostillicus has joined #ocaml
22:19
Frostillicus has quit [Ping timeout: 252 seconds]
22:52
Mister_Magister_ has joined #ocaml
22:52
Mister_Magister has quit [Ping timeout: 248 seconds]
22:56
Mister_Magister_ is now known as Mister_Magister
23:13
humasect has joined #ocaml
23:14
humasect has quit [Remote host closed the connection]
23:16
Mister_Magister_ has joined #ocaml
23:17
Mister_Magister has quit [Ping timeout: 276 seconds]
23:18
humasect has joined #ocaml
23:18
Mister_Magister_ is now known as Mister_Magister
23:21
humasect has quit [Remote host closed the connection]
23:24
Mister_Magister_ has joined #ocaml
23:24
Mister_Magister has quit [Ping timeout: 248 seconds]
23:26
humasect has joined #ocaml
23:26
Mister_Magister_ is now known as Mister_Magister
23:27
humasect has quit [Remote host closed the connection]
23:28
humasect has joined #ocaml
23:28
Haudegen has quit [Quit: Bin weg.]
23:31
Tuplanolla has quit [Ping timeout: 272 seconds]
23:44
humasect has quit [Read error: Connection reset by peer]
23:44
humasect has joined #ocaml
23:46
Frostillicus has joined #ocaml
23:50
humasect has quit [Remote host closed the connection]
23:53
Frostillicus has quit [Ping timeout: 252 seconds]