companion_cube changed the topic of #ocaml to: Discussions about the OCaml programming language | http://www.ocaml.org | OCaml 4.11 release notes: https://caml.inria.fr/pub/distrib/ocaml-4.11/notes/Changes | Try OCaml in your browser: http://try.ocamlpro.com | Public channel logs at http://irclog.whitequark.org/ocaml
reynir has quit [Ping timeout: 256 seconds]
reynir has joined #ocaml
rock64 has quit [Ping timeout: 260 seconds]
rock64 has joined #ocaml
snowpanda has joined #ocaml
rock64 has quit [Ping timeout: 240 seconds]
rock64 has joined #ocaml
laokz has joined #ocaml
nullcone has quit [Quit: Connection closed for inactivity]
reynir has quit [Ping timeout: 240 seconds]
reynir has joined #ocaml
<d_bot_> <darrenldl> cloveistaken: a student im mentoring has had good experience with cornell's book
reynir has quit [Ping timeout: 240 seconds]
ggole has joined #ocaml
reynir has joined #ocaml
waleee-cl has quit [Quit: Connection closed for inactivity]
reynir has quit [Ping timeout: 240 seconds]
bartholin has quit [Quit: Leaving]
tianon has quit [Ping timeout: 265 seconds]
tianon has joined #ocaml
reynir has joined #ocaml
<laokz> yes. as a very new beginner, i'v got a step-by-step understanding with its help. and i propose ocaml.org gives a link to that: https://www.cs.cornell.edu/courses/cs3110/2020sp/textbook/
<laokz> s/yes/yes also/
laokz has quit [Ping timeout: 246 seconds]
narimiran has joined #ocaml
mfp has quit [Ping timeout: 260 seconds]
mbuf has joined #ocaml
nullcone has joined #ocaml
osa1 has joined #ocaml
reynir has quit [Ping timeout: 265 seconds]
reynir has joined #ocaml
sgnb` has quit [Remote host closed the connection]
laokz has joined #ocaml
narimiran has quit [Ping timeout: 256 seconds]
narimiran has joined #ocaml
decentpenguin has quit [Read error: Connection reset by peer]
decentpenguin has joined #ocaml
Haudegen has joined #ocaml
snowpanda has quit [Quit: Leaving...]
laokz has quit [Ping timeout: 240 seconds]
mbuf has quit [Ping timeout: 246 seconds]
<vsiles> now that ocaml supports configure script in a nicer way, what would be the canonical way to create an opam switch with custom CFLAGS/LDFLAGS ? just set them in the env prior to the `opam init`/`switch create` or should I tweak some opam file too ?
reynir has quit [Remote host closed the connection]
reynir has joined #ocaml
olle has joined #ocaml
hnOsmium0001 has quit [Quit: Connection closed for inactivity]
reynir has quit [Ping timeout: 246 seconds]
dhil has joined #ocaml
reynir has joined #ocaml
mbuf has joined #ocaml
reynir has quit [Ping timeout: 272 seconds]
reynir has joined #ocaml
reynir has quit [Ping timeout: 246 seconds]
reynir has joined #ocaml
reynir has quit [Ping timeout: 240 seconds]
reynir has joined #ocaml
<vsiles> also, is there a simple way to create an opam switch based on ocaml:trunk ?
mfp has joined #ocaml
<d_bot_> <EduardoRFS> anyone knows why ocaml doesn't have a way to extend records?
<d_bot_> <EduardoRFS>
<d_bot_> <EduardoRFS> ```ocaml
<d_bot_> <EduardoRFS> type x = {x: int;}
<d_bot_> <EduardoRFS> type y = {x;y: int;}
<d_bot_> <EduardoRFS> ```
<d_bot_> <EduardoRFS> like this, it even works with the current memory model
<d_bot_> <EduardoRFS> it seems simple for inference, just use the most broad version
<theblatte> vsiles: 4.12.0+trunk?
<vsiles> theblatte: I'll try to get a date of its last update ! Thanks
reynir has quit [Ping timeout: 260 seconds]
reynir has joined #ocaml
<def> EduardoRFS: it does not seem simple for inference, I don't see how one can make that principle.
waleee-cl has joined #ocaml
laokz has joined #ocaml
reynir has quit [Ping timeout: 256 seconds]
proletkultura has joined #ocaml
<d_bot_> <EduardoRFS> it's subtyping, `y` isn't `{x: int; y: int}` it's `{x; y: int}` so you just follow the pointer while you can combine, if you're doing `fun v -> v.x` and you have both defined in the same environment, it goes `y -> x`
<d_bot_> <EduardoRFS> so
<d_bot_> <EduardoRFS> ```ocaml
<d_bot_> <EduardoRFS> type x = {x: int}
<d_bot_> <EduardoRFS> type y = {x; y: int}
<d_bot_> <EduardoRFS> (* they're not the same *)
<d_bot_> <EduardoRFS> type x = {x: int}
<d_bot_> <EduardoRFS> type y = {x: int; y: int}
<d_bot_> <EduardoRFS> ```
reynir has joined #ocaml
<theblatte> subtyping requires type annotations in OCaml though
<d_bot_> <EduardoRFS> btw even without row polymorphism, it would still be useful, it would be almost a sugar where the only difference is on type inference
<d_bot_> <ostera> @EduardoRFS is there anything preventing you to do this at the syntax level to see how useful it actually is for your use-case?
<d_bot_> <ostera>
<d_bot_> <ostera> I can imagine wanting to fit a `y` back into an `x` and dropping fields, but doing that means at least asking "which x" if there's many
<d_bot_> <ostera> (btw, is this for react prop composition?)
<d_bot_> <EduardoRFS> nope I can implement that, but it seems like a language decision choice
<d_bot_> <EduardoRFS> nah it's not, I just want subtyping to model some Java code without using the object system
<d_bot_> <EduardoRFS> it's one of the cases where I don't need lazy binding but I want subtyping
<d_bot_> <ggole> Just because something is possible doesn't mean it should be added
<d_bot_> <ostera> I'd start with a ppx and see how far that takes you -- if all you really need is to inline the records together, that should'nt be too hard to hack together
Haudegen has quit [Quit: Bin weg.]
<vsiles> theblatte: looks like I need to have a first switch+compiler set to be able to add a new repo (needed for trunk) so I'm stuck :p But I'll continue digging in this direction
reynir has quit [Ping timeout: 240 seconds]
reynir has joined #ocaml
<cloveistaken> I have a question. When I define a type at the top level, e.g: type Foo = { a : int; b : int }, I can then initialize a value using let k = { a = 1; b = 2 };;
<cloveistaken> But now I put the type into a Module M, with type Foo being in M
<cloveistaken> How can I initialize a value now ?
<vsiles> inside the module or outside ?
<theblatte> let k = { M.a = 1; b = 2 }?
<vsiles> I prefer let k = M.{ a = 1; B = 2} :p
<d_bot_> <ostera> you can also do local opens like `let k = M.{ a= 1; b = 2}`
<d_bot_> <ostera> or `let open M in { a= 1; b = 2 }`
<theblatte> also you're bluffing, you cannot define a type called Foo :p
<cloveistaken> Ahh
<cloveistaken> foo
<cloveistaken> I was struggling debugging at this thing before, capitalize vs not
<cloveistaken> Anyway thanks I'll try the local open
<theblatte> local open is slightly evil, the least invasive way is the one I gave
<cloveistaken> Why only M.a but not M.b as well ?
<cloveistaken> For your way
<vsiles> ocaml gets that b will be M.b
<vsiles> because of the first one
<cloveistaken> By the same logic, if I do k = M.{a = 1; b = 2}, then everything in the same scope as k would have M open ?
<cloveistaken> Hence the { M.a = 1 } way is better ?
<vsiles> not in the same scope as k
<theblatte> everything inside the {} has M open, hence my claim (but I'll freely admit it generally doesn't matter)
<vsiles> only he {}
<vsiles> theblatte: I'm not sure I see a difference between M.{ ... } and { M.x = ...; ... }
<vsiles> isn't it the same
<vsiles> ?
<cloveistaken> Then shouldn't 2 methods the same ?
<theblatte> let foo () = () in M.{a = foo ()} will call M.foo, not the locally-bound foo
<theblatte> (if M has a foo value)
<cloveistaken> Spooky
<cloveistaken> Looks like hidden unexpected behaviors in the making
<ggole> M.{x = ..} is the same as let open M in {x = ..}, which is not the same as {M.x = ..}
<theblatte> cloveistaken: exactly, although I have yet to see a concrete instance where that's a problem, to be honest :)
<ggole> To simply qualify the field names you should use the latter, which is a shame because it is a bit uglier
<vsiles> fair enough, thanks for the example
laokz has quit [Ping timeout: 246 seconds]
mbuf has quit [Quit: Leaving]
osa1 has quit [Ping timeout: 256 seconds]
Haudegen has joined #ocaml
<vsiles> if anyone is familiar with Core_kernel.Byte_units: is Byte_units.of_bytes_float_exn (float_of_int i) the same of Byte_units.of_bytes_int i ?
dhil has quit [Ping timeout: 240 seconds]
reynir has quit [Remote host closed the connection]
reynir has joined #ocaml
<d_bot_> <Ulugbek> `ocamllsp` users on vscode:
<d_bot_> <Ulugbek> it seems like I need to restart the language server (or reopen the file) more often these days for the file changes to take effect (otherwise, the squiggly red underlining doesn't disappear). Has anyone noticed something like that?
FreeBirdLjj has joined #ocaml
reynir has quit [Ping timeout: 246 seconds]
reynir has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
sonologico has quit [Read error: Connection reset by peer]
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
dckc has quit [Ping timeout: 272 seconds]
dhil has joined #ocaml
dckc has joined #ocaml
osa1 has joined #ocaml
Anarchos has joined #ocaml
laokz has joined #ocaml
muskan has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
muskan has quit [Remote host closed the connection]
FreeBirdLjj has quit [Ping timeout: 260 seconds]
hnOsmium0001 has joined #ocaml
FreeBirdLjj has joined #ocaml
Anarchos has quit [Quit: Vision[0.10.3]: i've been blurred!]
FreeBirdLjj has quit [Ping timeout: 240 seconds]
spew has joined #ocaml
mmohammadi98129 has joined #ocaml
laokz has quit [Quit: Leaving]
mmohammadi98129 has quit [Quit: I quit (╯°□°)╯︵ ┻━┻]
mmohammadi9812 has joined #ocaml
Haudegen has quit [Quit: Bin weg.]
olle has quit [Ping timeout: 240 seconds]
cantstanya has quit [Ping timeout: 240 seconds]
Tuplanolla has joined #ocaml
Jesin has quit [Quit: Leaving]
gareppa has joined #ocaml
Haudegen has joined #ocaml
vicfred has quit [Quit: Leaving]
Jesin has joined #ocaml
tane has joined #ocaml
TC01 has quit [Ping timeout: 260 seconds]
TC01 has joined #ocaml
gareppa has quit [Quit: Leaving]
vicfred has joined #ocaml
jnavila has joined #ocaml
amiloradovsky has joined #ocaml
bartholin has joined #ocaml
mmohammadi9812 has quit [Ping timeout: 246 seconds]
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 260 seconds]
sonologico has joined #ocaml
dhil has quit [Ping timeout: 258 seconds]
dhil has joined #ocaml
narimiran has quit [Ping timeout: 240 seconds]
osa1 has quit [Ping timeout: 264 seconds]
remexre has quit [Ping timeout: 240 seconds]
remexre has joined #ocaml
jnavila has quit [Quit: Konversation terminated!]
Yagotzirck has joined #ocaml
raver has quit [Quit: Gateway shutdown]
ggole has quit [Quit: Leaving]
_whitelogger has joined #ocaml
Haudegen has quit [Quit: No Ping reply in 180 seconds.]
Haudegen has joined #ocaml
tane has quit [Quit: Leaving]
Yagotzirck has quit [Quit: Leaving]
reynir has quit [Ping timeout: 256 seconds]
reynir has joined #ocaml
dhil has quit [Ping timeout: 265 seconds]
Tuplanolla has quit [Quit: Leaving.]
rock64 has quit [Ping timeout: 240 seconds]
Haudegen has quit [Ping timeout: 246 seconds]
sagax has quit [Read error: Connection reset by peer]
rock64 has joined #ocaml
amiloradovsky has quit [Ping timeout: 240 seconds]
troydm has quit [Ping timeout: 272 seconds]
troydm has joined #ocaml