<discocaml>
<deech> File "src_ext/base64/src/dune", line 5, characters 12-17:
<discocaml>
<deech> 5 | (libraries bytes))
<discocaml>
<deech> ^^^^^
<discocaml>
<deech> Error: Library "bytes" not found.
<discocaml>
<deech> ```
<discocaml>
<deech> The `bytes` repo (https://github.com/chambart/ocaml-bytes) says it's only needed for `<= 4.0.2` but my version is `5.1.0+dev1-2022-06-09` which I compiled from HEAD today so why is there a dependency on it?
<discocaml>
<octachron> The dependency is a mistake: all version of OCaml supported by dune (≥4.03) have a `Bytes` module, thus it is never useful to have `(libraries bytes)` stanza in a dune file.
masterbuilder has quit [Ping timeout: 255 seconds]
masterbuilder has joined #ocaml
masterbuilder has quit [Ping timeout: 248 seconds]
def has joined #ocaml
def has left #ocaml [#ocaml]
masterbuilder has joined #ocaml
Everything has joined #ocaml
mbuf has quit [Quit: Leaving]
gentauro has quit [Ping timeout: 246 seconds]
kakadu has quit [Remote host closed the connection]
gentauro has joined #ocaml
Haudegen has quit [Quit: Bin weg.]
azimut has joined #ocaml
John_Ivan__ has joined #ocaml
John_Ivan_ has quit [Ping timeout: 256 seconds]
Everything has quit [Quit: leaving]
azimut_ has joined #ocaml
azimut has quit [Ping timeout: 255 seconds]
Haudegen has joined #ocaml
bartholin has joined #ocaml
Serpent7776 has joined #ocaml
Serpent7776 has quit [Ping timeout: 246 seconds]
jumpnbrownweasel has quit [Remote host closed the connection]
jumpnbrownweasel has joined #ocaml
waleee has joined #ocaml
trev has quit [Remote host closed the connection]
Stumpfenstiel has joined #ocaml
bartholin has quit [Quit: Leaving]
<discocaml>
<Swerve> Say I make a graph like so:
<discocaml>
<Swerve> ```ocaml
<discocaml>
<Swerve> type graph = {
<discocaml>
<Swerve> value : int;
<discocaml>
<Swerve> children : graph list;
<discocaml>
<Swerve> }
<discocaml>
<Swerve> ```
<discocaml>
<Swerve> From what I can tell, if I instantiate this type, I end up with a graph whose nodes contain copies of all the subgraphs its children create, like so:
<discocaml>
<Swerve> ```ocaml
<discocaml>
<Swerve> let a = {value=0; children=[];}
<discocaml>
<Swerve> let b = {value=1; children=[a];}
<discocaml>
<Swerve> let c = {value=2; children=[a;b]}
<discocaml>
<Swerve> ```
<discocaml>
<Swerve> The problem here is that c contains a and b, but b contains a copy of a, so c contains two copies of a, etc. This makes the space requirements for this structure balloon wildly. I've tried changing the type of graph to be a reference, with children being a graph ref list. But this doesn't seem to change anything.
<discocaml>
<Swerve> How can I fix this?
<discocaml>
<Swerve> Say I make a graph like so:
<discocaml>
<Swerve> ```ocaml
<discocaml>
<Swerve> type graph = {
<discocaml>
<Swerve> value : int;
<discocaml>
<Swerve> children : graph list;
<discocaml>
<Swerve> }
<discocaml>
<Swerve> ```
<discocaml>
<Swerve> From what I can tell, if I instantiate this type like so, I end up with a graph whose nodes contain copies of all the subgraphs its children create, like so:
<discocaml>
<Swerve> ```ocaml
<discocaml>
<Swerve> let a = {value=0; children=[];}
<discocaml>
<Swerve> let b = {value=1; children=[a];}
<discocaml>
<Swerve> let c = {value=2; children=[a;b]}
<discocaml>
<Swerve> ```
<discocaml>
<Swerve> The problem here is that c contains a and b, but b contains a copy of a, so c contains two copies of a, etc. This makes the space requirements for this structure balloon wildly. I've tried changing the type of graph to be a reference, with children being a graph ref list. But this doesn't seem to change anything.
<discocaml>
<Swerve> How can I fix this?
<discocaml>
<Swerve> Say I make a graph like so:
<discocaml>
<Swerve> ```ocaml
<discocaml>
<Swerve> type graph = {
<discocaml>
<Swerve> value : int;
<discocaml>
<Swerve> children : graph list;
<discocaml>
<Swerve> }
<discocaml>
<Swerve> ```
<discocaml>
<Swerve> From what I can tell, if I instantiate this type like so, I end up with a graph whose nodes contain copies of all the subgraphs its children create:
<discocaml>
<Swerve> ```ocaml
<discocaml>
<Swerve> let a = {value=0; children=[];}
<discocaml>
<Swerve> let b = {value=1; children=[a];}
<discocaml>
<Swerve> let c = {value=2; children=[a;b]}
<discocaml>
<Swerve> ```
<discocaml>
<Swerve> The problem here is that c contains a and b, but b contains a copy of a, so c contains two copies of a, etc. This makes the space requirements for this structure balloon wildly. I've tried changing the type of graph to be a reference, with children being a graph ref list. But this doesn't seem to change anything.
<discocaml>
<Swerve> How can I fix this?
<discocaml>
<Swerve> Say I make a graph like so:
<discocaml>
<Swerve> ```ocaml
<discocaml>
<Swerve> type graph = {
<discocaml>
<Swerve> value : int;
<discocaml>
<Swerve> children : graph list;
<discocaml>
<Swerve> }
<discocaml>
<Swerve> ```
<discocaml>
<Swerve> From what I can tell, if I instantiate this type like so, I end up with a graph whose nodes contain copies of all the subgraphs its children create:
<discocaml>
<Swerve> ```ocaml
<discocaml>
<Swerve> let a = {value=0; children=[];}
<discocaml>
<Swerve> let b = {value=1; children=[a];}
<discocaml>
<Swerve> let c = {value=2; children=[a;b]}
<discocaml>
<Swerve> ```
<discocaml>
<Swerve> The problem here is that c contains a and b, but b contains a copy of a, so c contains two copies of a, etc. This makes the space requirements for this structure balloon wildly. I've tried changing the type of graph to be a reference, with children being a graph ref list. But this doesn't seem to change anything.
<discocaml>
<Swerve> Am I understanding the behavior correctly? and how can I fix this?
<discocaml>
<KW78> there is no copy, everything is shared
<discocaml>
<Swerve> So c simply contains pointers to a and b?
<discocaml>
<KW78> aka persistent data structure
<discocaml>
<KW78> in this case yes, although this is an implementation detail. Ocaml has a uniform data representation. basically everything beside integers are wrapped in boxes and pointed too.
<discocaml>
<KW78> (integers have a special representation to distinguish them from pointers)
<discocaml>
<Swerve> Okay, thanks a ton!
szkl has joined #ocaml
wingsorc has joined #ocaml
olle has quit [Ping timeout: 265 seconds]
spip has quit [Quit: Konversation terminated!]
<discocaml>
<anmonteiro> it's immutable but not persistent
<discocaml>
<anmonteiro> it's immutable but not persistent, right?
spip has joined #ocaml
Tuplanolla has joined #ocaml
bgs has quit [Remote host closed the connection]
Haudegen has quit [Quit: No Ping reply in 180 seconds.]
Haudegen has joined #ocaml
Stumpfenstiel has quit [Ping timeout: 255 seconds]
szkl has quit [Quit: Connection closed for inactivity]
haesbaert has quit [Remote host closed the connection]