spew has quit [Quit: Connection closed for inactivity]
z3n3 has joined #ocaml
breitenj- has joined #ocaml
zekt83 has quit [Read error: Connection reset by peer]
zekt83 has joined #ocaml
breitenj has quit [Ping timeout: 252 seconds]
mahmudov has quit [Remote host closed the connection]
z3n3 has quit [Ping timeout: 272 seconds]
z3n3 has joined #ocaml
smazga has quit [Quit: leaving]
kleisli has joined #ocaml
olle has quit [Ping timeout: 240 seconds]
kleisli has quit [Ping timeout: 260 seconds]
olle has joined #ocaml
z3n3 has quit [Ping timeout: 252 seconds]
sarna has quit [Quit: bye]
sarna has joined #ocaml
Haudegen has quit [Quit: Bin weg.]
kleisli has joined #ocaml
kvik has quit [Ping timeout: 260 seconds]
kvik has joined #ocaml
kvik has quit [Ping timeout: 260 seconds]
kvik has joined #ocaml
mfp has quit [Ping timeout: 265 seconds]
johnelse has quit [Ping timeout: 248 seconds]
johnelse has joined #ocaml
johnelse is now known as Guest48418
kvik has quit [Ping timeout: 260 seconds]
JeanMax` has quit [Ping timeout: 250 seconds]
JeanMax` has joined #ocaml
swistak35 has quit [Ping timeout: 250 seconds]
lyxia has quit [Ping timeout: 250 seconds]
lyxia has joined #ocaml
swistak35 has joined #ocaml
theglass has quit [Remote host closed the connection]
theglass has joined #ocaml
theglass has quit [Changing host]
theglass has joined #ocaml
vicfred has quit [Remote host closed the connection]
vicfred has joined #ocaml
kvik has joined #ocaml
mbuf has joined #ocaml
tormen has joined #ocaml
tormen_ has quit [Ping timeout: 260 seconds]
Haudegen has joined #ocaml
g0d_shatter has joined #ocaml
g0d_shatter has quit [Quit: Leaving]
spew has joined #ocaml
dborisog has joined #ocaml
jim7j1ajh has quit [Ping timeout: 268 seconds]
dckc has quit [Ping timeout: 260 seconds]
jim7j1ajh has joined #ocaml
dckc has joined #ocaml
monad_cat has quit [Read error: Connection reset by peer]
monad_cat has joined #ocaml
Adso_of_Jelq has quit [Read error: Connection reset by peer]
Adso_of_Jelq has joined #ocaml
dckc has quit [Ping timeout: 260 seconds]
dckc has joined #ocaml
narimiran has joined #ocaml
gravicappa has joined #ocaml
kakadu_ has joined #ocaml
kakadu has quit [Ping timeout: 240 seconds]
vicfred has quit [Quit: Leaving]
fantasticsid has joined #ocaml
fantasticsid has quit [Read error: Connection reset by peer]
fantasticsid has joined #ocaml
fantasticsid has quit [Ping timeout: 260 seconds]
jao has quit [Ping timeout: 265 seconds]
fantasticsid has joined #ocaml
<dborisog>
Is there a function in OCaml that lists all/major patterns for a given type? I think this function will be useful to juniors and mids having fragmented understanding of algeabraic data types. The compiler sometimes reports about incompleteness of a pattern matching providing an example of missing pattern; therefore, the possible-pattern-generative capabilities are supported by the compiler.
picolino_ has joined #ocaml
fantasticsid has quit [Read error: Connection reset by peer]
Geekingfrog_ has joined #ocaml
kakadu_ has quit [*.net *.split]
dborisog has quit [*.net *.split]
ec has quit [*.net *.split]
crowley95 has quit [*.net *.split]
picolino has quit [*.net *.split]
Drup has quit [*.net *.split]
Madars has quit [*.net *.split]
rixed has quit [*.net *.split]
vsiles has quit [*.net *.split]
cthuluh has quit [*.net *.split]
mrd has quit [*.net *.split]
Geekingfrog has quit [*.net *.split]
freusque has quit [*.net *.split]
Ekho has quit [*.net *.split]
maskt has quit [*.net *.split]
zv has quit [*.net *.split]
DanielRichman has quit [*.net *.split]
rntz2 has quit [*.net *.split]
fantasticsid has joined #ocaml
pepesza has quit [Ping timeout: 268 seconds]
Ekho- has joined #ocaml
pepesza has joined #ocaml
fantasticsid has quit [Ping timeout: 260 seconds]
fantasticsid has joined #ocaml
ggole has joined #ocaml
fantasticsid has quit [Quit: ERC (IRC client for Emacs 27.0.50)]
kakadu_ has joined #ocaml
ec has joined #ocaml
crowley95 has joined #ocaml
vsiles has joined #ocaml
rixed has joined #ocaml
Drup has joined #ocaml
freusque has joined #ocaml
mrd has joined #ocaml
DanielRichman has joined #ocaml
zv has joined #ocaml
rntz2 has joined #ocaml
dborisog has joined #ocaml
Madars has joined #ocaml
cthuluh has joined #ocaml
maskt has joined #ocaml
Serpent7776 has joined #ocaml
SrPx has quit [Ping timeout: 240 seconds]
swistak35 has quit [Ping timeout: 240 seconds]
mpu has quit [Ping timeout: 268 seconds]
mpu has joined #ocaml
SrPx has joined #ocaml
swistak35 has joined #ocaml
kakadu has joined #ocaml
<Fardale>
dborisog: merlin provide this kind of function with MerlinDestruct command
<dborisog>
Fardale: indeed. Thank you!
ollehar has joined #ocaml
spew has quit [Quit: Connection closed for inactivity]
z3n3 has joined #ocaml
KeyJoo has joined #ocaml
free_beard has joined #ocaml
<sarna>
hi, can I somehow assure that a function won't mutate the innards of my record?
<octachron_>
If your record is immutable.
<sarna>
yeah, but what if I have an Array in a field? when I pass that struct somewhere, I can't be sure the Array will stay the same
<octachron_>
Indeed.
<ggole>
In some circumstances you can make the field a private type, although that can be quite restrictive
<sarna>
:^(
* sarna
goes back to the C# age of making copies of everything
<def`>
an array is inherently mutable, if you don't want it to be mutated you should not expose an array.
<def`>
for instant an opaque alias to an array type that only has get, length and maybe to_array functions.
<ggole>
Then you get to reimplement all the non-mutating Array functions (that you happen to need).
<def`>
at least you need to copy paste the array.mli signature and restrict the interface.
<def`>
(I played with a "type (-'w, +'r) bi_array" that can express immutability via sub-typing)
<sarna>
I don't like it, but I can't think of any sane way of providing me what I would like, lol
<def`>
that seems fine to me.
Geekingfrog_ is now known as Geekingfrog
<Fardale>
sarna: in containers, CCVector can be made read only
<sarna>
Fardale: frick, I'm tempted to use containers again
<sarna>
they seem so nice in comparison to core
<sarna>
I said it many times and I will say it again - core's docs are one of the worst docs I've ever seen for a library
bartholin has quit [Quit: Leaving]
kleisli has quit [Ping timeout: 268 seconds]
mfp has joined #ocaml
oni-on-ion has quit [Remote host closed the connection]
oni-on-ion has joined #ocaml
mbuf has quit [Quit: Leaving]
z3n3 has quit [Ping timeout: 248 seconds]
sagitt has joined #ocaml
sagitt has quit [Quit: WeeChat 2.7]
z3n3 has joined #ocaml
dhil has joined #ocaml
Haudegen has quit [Quit: No Ping reply in 180 seconds.]
z3n3 has quit [Quit: WeeChat 2.7]
z3n3 has joined #ocaml
Haudegen has joined #ocaml
root has joined #ocaml
Nahra has joined #ocaml
root is now known as Guest42099
Guest42099 is now known as z3n9
z3n3 has quit [Quit: WeeChat 2.7]
z3n9 has quit [Client Quit]
z3n3 has joined #ocaml
Guest48418 is now known as johnelse
johnelse has quit [Quit: leaving]
johnel has joined #ocaml
andreas303 has quit [Remote host closed the connection]
andreas303 has joined #ocaml
z3n3 has quit [Quit: WeeChat 2.7]
z3n3 has joined #ocaml
free_beard has quit [Remote host closed the connection]
apaul1729 has quit [Remote host closed the connection]
jnavila has quit [Ping timeout: 272 seconds]
TheLemonMan has joined #ocaml
tsuyoshi has joined #ocaml
mahmudov has joined #ocaml
narimiran has quit [Ping timeout: 258 seconds]
gravicappa has quit [Ping timeout: 265 seconds]
TheLemonMan has quit [Quit: "It's now safe to turn off your computer."]
Nahra has quit [Quit: leaving]
oni-on-ion has quit [Read error: Connection reset by peer]
oni-on-ion has joined #ocaml
Jenz has joined #ocaml
<Jenz>
Help! I've been playing (learning, that is) with OCaml as of recently; having a lot of fun. But now I realize there's something quite fundamental I'm missing, I don't understand why this (extremely simple) program doesn't compile: https://paste.sr.ht/~jenz/aa8b58414a3f2409a67b62d97ffcf0211ed5789b
wingsorc_ has joined #ocaml
<lyxia>
Jenz: the field probably needs to be qualified: r.R.a
<oni-on-ion>
because 'r.a' is not in scope? try R.a
<Jenz>
lyxia, oni-on-ion: thanks, but that doesn't work, resulting in "Unbound record field R.a"
<oni-on-ion>
ah because you have a signature. try the record in there ?
<Jenz>
In where? The module?
<thizanne>
Jenz: applying your signature (the module type) to your module makes that, outside your module, everything that isn't part of the signature is hidden
<thizanne>
in particular, you hide the fact that your type t is a record with some field .a
<thizanne>
so if you want to access it, an idea would be to add to the signature a function like get : 'a t -> 'a
<Jenz>
thizanne: And there is no way, to keep the abstract type signature, and still access the record field directly?
<thizanne>
no
<thizanne>
(to be complete, you can cheat the type system and code like it's C, but that's not really part of the language anymore)
<Jenz>
Huh, ok, thanks; thizanne
<Jenz>
Every single imperative approach to any problem I've seen in OCaml has been downright ugly
<thizanne>
Jenz: note that it's on purpose: this allows you to force the user to access this 'a value with the function get that you provide
<Jenz>
Yes, I could just drop the module type signature
<thizanne>
so that when you change the implementation of the module (for instance by defining type 'a t = Foo of 'a), you just have to redefine get
<thizanne>
and everything in the code that uses the module can stay the same
<Jenz>
I guess that is the idiomatic way. Modules; are to me--coming from the OOP world-- simply unfamiliar