companion_cube changed the topic of #ocaml to: Discussion about the OCaml programming language | http://www.ocaml.org | OCaml 5.0 released(!!1!): https://ocaml.org/releases/5.0.0.html | Try OCaml in your browser: https://try.ocamlpro.com | Public channel logs at https://libera.irclog.whitequark.org/ocaml/
pie_ has quit []
pie_ has joined #ocaml
TakinOver has quit [Ping timeout: 240 seconds]
spip has quit [Quit: Konversation terminated!]
wingsorc has quit [Ping timeout: 252 seconds]
chrisz has quit [Ping timeout: 240 seconds]
chrisz has joined #ocaml
<discocaml> <rgrinberg> there's a pure ocaml solver the "0install solver" I believe
wilfred has joined #ocaml
<companion_cube> yes, but it's really not great (or wasn't, years ago)
<discocaml> <rgrinberg> what's wrong with it?
<companion_cube> It's a sat solver implemented with objects :). There are better ways. That said if it does the job...
<companion_cube> I don't think it'd be enough for opam which needs more than sat though
czy has joined #ocaml
<discocaml> <rgrinberg> yeah, there are some features it doesn't support but at least it's fast apparently
Serpent7776 has joined #ocaml
wilfred has quit [Quit: Connection closed for inactivity]
TakinOver has joined #ocaml
bartholin has joined #ocaml
Haudegen has joined #ocaml
azimut has joined #ocaml
Tuplanolla has joined #ocaml
alexherbo2 has joined #ocaml
alexherbo2 has quit [Remote host closed the connection]
alexherbo2 has joined #ocaml
alexherbo2 has quit [Remote host closed the connection]
alexherbo2 has joined #ocaml
spip has joined #ocaml
Serpent7776 has quit [Quit: leaving]
<discocaml> <AradArbel10> I'm slightly concerned about copying data structures. my situation is some structured data, built mostly of nested `list`s and recursive ADTs, everything immutable. if I take one node of this tree-like thing and assign it into another node, would ocaml do a deep copy?
<discocaml> <AradArbel10> how can I check if this kind of sharing takes place? and if it doesn't, how can I make it happen (maybe some `ref` shenanigans, despite not needing mutability...)
<discocaml> <AradArbel10> I'm slightly concerned about copying data structures. my situation is some structured data, built mostly of nested `list`s and recursive ADTs, everything immutable. if I take one node of this tree-like thing and construct a new node containing it, would ocaml do a deep copy?
<discocaml> <AradArbel10> how can I check if this kind of sharing takes place? and if it doesn't, how can I make it happen (maybe some `ref` shenanigans, despite not needing mutability...)
<discocaml> <octachron> Ocaml never does deep copy by itself.
<discocaml> <octachron> A value is either an integer or an immutable pointer towards a GC-owned piece of memory.
<discocaml> <AradArbel10> ah nice, so I think I'm good
wingsorc has joined #ocaml
alexherbo2 has quit [Remote host closed the connection]
alexherbo2 has joined #ocaml
nore_ has joined #ocaml
pippijn_ has joined #ocaml
masterbu1lder has joined #ocaml
pie__ has joined #ocaml
wagle_ has joined #ocaml
Johann_ has joined #ocaml
nore has quit [Ping timeout: 320 seconds]
pie_ has quit [Ping timeout: 305 seconds]
Johann has quit [Ping timeout: 305 seconds]
masterbuilder has quit [Ping timeout: 305 seconds]
wagle has quit [Ping timeout: 305 seconds]
micro has quit [Ping timeout: 305 seconds]
pippijn has quit [Ping timeout: 305 seconds]
micro has joined #ocaml
noonien has quit [Quit: The Lounge - https://thelounge.chat]
noonien has joined #ocaml
anpad has quit [Ping timeout: 252 seconds]
anpad has joined #ocaml
alexherbo2 has quit [Remote host closed the connection]
anpad has quit [Read error: Connection reset by peer]
xd1le has quit [Quit: xd1le]
anpad has joined #ocaml
alexherbo2 has joined #ocaml
chrisz has quit [Ping timeout: 246 seconds]
chrisz has joined #ocaml
Stumpfenstiel has joined #ocaml
Absalom has joined #ocaml
noddy has quit [Quit: WeeChat 3.8]
noddy has joined #ocaml
azimut has quit [Ping timeout: 240 seconds]
Haudegen has quit [Quit: No Ping reply in 180 seconds.]
Haudegen has joined #ocaml
alexherbo2 has quit [Remote host closed the connection]
alexherbo2 has joined #ocaml
wingsorc has quit [Quit: Leaving]
olle has joined #ocaml
azimut has joined #ocaml
count3rmeasure has joined #ocaml
<discocaml> <ec> Is there a popular/standard-ish monadic transformers library that _isn't_ dependent on `core_kernel`? I see `mnd` … and `monadlib`, but it doesn't look very active, and also depends on `batteries` …
<discocaml> <nsmmrs> Containers has functions like Option.map/bind and their infix operator equivalents.
count3rmeasure has quit [Ping timeout: 246 seconds]
<discocaml> <darrenldl> finally finished restructuring a nottui mess into a component tree structure. definitely should have pinged the frontend dev friend earlier.
olle has quit [Ping timeout: 250 seconds]
xd1le has joined #ocaml
<discocaml> <mbacarella> suppose I have a suite of libraries that I want all contained under a top-level module called Swiss with the option to install any of the library suite later. like someone can opam install swiss-foo and swiss-bar and the result there will be they can access the code via Swiss.Foo and Swiss.Bar. is the way to do this through the dune selection system where if the library Swiss_foo exists it'll bind it to Swiss.Foo and if it doesn't exist it'
alexherbo2 has quit [Remote host closed the connection]
alexherbo2 has joined #ocaml
alexherbo2 has quit [Remote host closed the connection]
alexherbo2 has joined #ocaml
<discocaml> <mbacarella> I guess also list swiss-foo and swiss-bar as optional dependencies of swiss in opam so that it rebuilds swiss after you install swiss-foo?
<discocaml> <mbacarella> suppose I have a suite of libraries that I want all contained under a top-level module called Swiss with the option to install any of the library suite later. like someone can opam install swiss-foo and swiss-bar and the result there will be they can access the code via Swiss.Foo and Swiss.Bar. is the way to do this through the dune selection system where if the library Swiss_foo exists it'll bind it to Swiss.Foo and if it doesn't exist it'
gwizon has joined #ocaml
micro has quit [*.net *.split]
micro has joined #ocaml
gwizon has quit [Quit: Lost terminal]
Fardale has quit [Quit: WeeChat 3.0]
<companion_cube> @darrenldl is the code still using nottui?
gwizon has joined #ocaml
Fardale has joined #ocaml
alexherbo2 has quit [Remote host closed the connection]
alexherbo2 has joined #ocaml
gwizon has quit [Quit: leaving]
alexherbo2 has quit [Remote host closed the connection]
count3rmeasure has joined #ocaml
amk has quit [Ping timeout: 240 seconds]
alexherbo2 has joined #ocaml
amk has joined #ocaml
bartholin has quit [Quit: Leaving]
olle has joined #ocaml
<discocaml> <masterbuilder> is there a way to make `assert` print the failing assertion?
<discocaml> <NULL> You mean having an exception which carries a string?
<discocaml> <masterbuilder> No, like, Assertion failed: lhs =/= rhs, printing the actual values that were compared, I mean, I guess they might not be printable in all cases
<discocaml> <masterbuilder> it's nice to know why the assertion failed
<discocaml> <masterbuilder> there isn't really a good way to write a function that can do that for all types yourself as far as I can tell
<discocaml> <NULL> Yeah, that would need a universal printer, which OCaml doesn't have
<discocaml> <masterbuilder> so is there any workaround?
wilfred has joined #ocaml
<discocaml> <NULL> Also, assert takes a bool, so it wouldn't know what to print
<discocaml> <masterbuilder> yes fair point, but you get the idea
olle has left #ocaml [#ocaml]
<discocaml> <NULL> Construct your own exception and build a string with the info you need
<discocaml> <masterbuilder> hmm, alright
azimut has quit [Ping timeout: 240 seconds]
Haudegen has quit [Quit: No Ping reply in 180 seconds.]
Haudegen has joined #ocaml
wagle_ is now known as wagle
<companion_cube> But assert tells you the file and line, doesn't it?
<discocaml> <masterbuilder> Yes, but if it's not a statically determinable assertion and it depends on runtime conditions and it's checked a bunch of times before failing then knowing where the assert is located in the code is not particularly insightful
<discocaml> <masterbuilder> exceptions are probably better for that, I just placed some quick and dirty asserts here and there
<companion_cube> Ah, right
<discocaml> <RegularSpatula> Are you already using Janestreet libs? If so you can use ppx_assert
<discocaml> <RegularSpatula> It will print inputs on failures, tho you can’t turn them off with noassert option
<companion_cube> I don't use any jst lib, if I'm debugging that kind of stuff I add a log statement in the assert
h0rror has quit [Ping timeout: 252 seconds]
<companion_cube> `assert (let ok =... in if not ok then log; ok)`
h0rror has joined #ocaml
Stumpfenstiel has quit [Remote host closed the connection]
count3rmeasur3 has joined #ocaml
count3rmeasure has quit [Ping timeout: 248 seconds]
count3rmeasur3 has quit [Ping timeout: 246 seconds]
mal`` has quit [Quit: Leaving]