<pmetzger>
which was very nice of him under the circumstances.
<steenuil>
oh, that's cool.
exarkun has quit [Ping timeout: 248 seconds]
jimmyrcom_ has quit [Ping timeout: 240 seconds]
jimmyrcom_ has joined #ocaml
silver_ has joined #ocaml
silver has quit [Ping timeout: 276 seconds]
pmetzger has quit []
caltelt_ has quit [Ping timeout: 260 seconds]
silver_ has quit [Read error: Connection reset by peer]
mfp has quit [Ping timeout: 240 seconds]
hdon has quit [Ping timeout: 240 seconds]
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Read error: Connection timed out]
FreeBirdLjj has joined #ocaml
hdon has joined #ocaml
hdon has quit [Ping timeout: 268 seconds]
tormen has joined #ocaml
tormen_ has quit [Ping timeout: 240 seconds]
moolc has joined #ocaml
jao has quit [Ping timeout: 268 seconds]
arthur_rainbow has quit [Quit: Leaving.]
arthur_rainbow has joined #ocaml
arthur_rainbow has quit [Changing host]
arthur_rainbow has joined #ocaml
_habnabit has quit [Remote host closed the connection]
_habnabit has joined #ocaml
Fare has joined #ocaml
pierpa has quit [Quit: Page closed]
Fare has quit [Ping timeout: 248 seconds]
pierpal has quit [Ping timeout: 264 seconds]
arthur_rainbow has quit [Ping timeout: 264 seconds]
al-damiri has quit [Quit: Connection closed for inactivity]
Fare has joined #ocaml
arthur_rainbow has joined #ocaml
ziyourenxiang has joined #ocaml
pierpal has joined #ocaml
Fare has quit [Ping timeout: 248 seconds]
pierpal has quit [Client Quit]
pierpal has joined #ocaml
ziyourenxiang has quit [Quit: Leaving]
pierpal has quit [Ping timeout: 264 seconds]
pierpal has joined #ocaml
pierpal has quit [Read error: Connection reset by peer]
pierpal has joined #ocaml
ziyourenxiang has joined #ocaml
ygrek has quit [Ping timeout: 240 seconds]
Fare has joined #ocaml
Fare has quit [Ping timeout: 240 seconds]
pierpal has quit [Read error: Connection reset by peer]
Fare has joined #ocaml
kalio has quit [Ping timeout: 248 seconds]
pierpal has joined #ocaml
jack5638 has quit [Ping timeout: 260 seconds]
jack5638 has joined #ocaml
jack5638 has quit [Ping timeout: 260 seconds]
jack5638 has joined #ocaml
SegFaultAX has quit [Ping timeout: 255 seconds]
SegFaultAX has joined #ocaml
pierpal has quit [Ping timeout: 248 seconds]
FreeBirdLjj has quit [Remote host closed the connection]
moolc has quit [Quit: ERC (IRC client for Emacs 27.0.50)]
muelleme has joined #ocaml
sz0 has quit [Quit: Connection closed for inactivity]
jack5638 has quit [Ping timeout: 260 seconds]
jack5638 has joined #ocaml
pierpal has joined #ocaml
muelleme has quit [Ping timeout: 240 seconds]
kalio has joined #ocaml
pierpal has quit [Read error: Connection reset by peer]
jbrown has quit [Ping timeout: 240 seconds]
jimmyrcom_ has quit [Ping timeout: 264 seconds]
FreeBirdLjj has joined #ocaml
<discord1>
<loxs> Can I specify that a function's parameter can be only one particular variant, instead of any of this variant type?
<discord1>
<loxs> ah, sorry, I already had a type for the contents of this variant, so I'll just unpack and use that
kakadu has joined #ocaml
argent_smith has joined #ocaml
zolk3ri has joined #ocaml
RalfJ has quit [Remote host closed the connection]
RalfJ has joined #ocaml
Haudegen has joined #ocaml
orbifx has joined #ocaml
Fare has quit [Ping timeout: 248 seconds]
moolc has joined #ocaml
arthur_rainbow has quit [Ping timeout: 264 seconds]
mfp has joined #ocaml
jnavila has joined #ocaml
kakadu has quit [Ping timeout: 240 seconds]
kakadu_ has joined #ocaml
arthur_rainbow has joined #ocaml
demonimin has quit [Ping timeout: 260 seconds]
pierpal has joined #ocaml
pierpal has quit [Ping timeout: 260 seconds]
jnavila has quit [Ping timeout: 240 seconds]
silver has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
pierpal has joined #ocaml
kakadu_ has quit [Ping timeout: 240 seconds]
kakadu has joined #ocaml
malina has quit [Ping timeout: 260 seconds]
orbifx has quit [Ping timeout: 268 seconds]
<discord1>
<loxs> What's the equivalence of #require "zarith";; for my jbuilder project? Jbuilder refuses to allow me to open Zarith, but if I do jbuilder utop ./lib/ and then require zarith, it works.
<steenuil>
did you add zarith to the libraries option in the jbuild file?
<discord1>
<loxs> yeah
<steenuil>
then I dunno
<discord1>
<loxs> hm, actually I was able to do directly open Q... which is a bit ugly, because now whoever reads my code won't know that this is Zarith.Q
demonimin has joined #ocaml
<Drup>
zarith is not wrapped, yes
<discord1>
<loxs> I wrapped it my module like module Zarith = struct module Q = Q end - how bad is this?
<Drup>
I think it's a bit pointless, but it's your code
<discord1>
<loxs> hm, yeah, the compiler still knows the types and merlin too... so it shouldn't be too bad for the reader
<remix2000[m]>
Hello! Is there something like list, but that doesn't allow duplicate elements?
<Drup>
remix2000[m]: a set ? :p
<remix2000[m]>
Drup, set would be okay, but it also requires type to be ordered…
<Drup>
remix2000[m]: hashsets then
<remix2000[m]>
Drup, what are those hashsets?
<Drup>
remix2000[m]: just use an hashtable as a set
<Drup>
type set = (elt, unit) Hashtbl.t, or something like that
moolc has quit [Ping timeout: 248 seconds]
moolc has joined #ocaml
<remix2000[m]>
Drup, thank you, it works. But what if I want to prevent storing the same variant twice, no matter what it holds? So that there couldn't be both `A 13` and `A 42` in one set?
malina has joined #ocaml
<discord1>
<ncthbrt> remix2000: How big are you expecting the set to be?
<Drup>
remix2000[m]: then you make a function for variants to integer that maps all classes for which you want something unique to the same integer, and you store a map indexed by that integer
<Drup>
(or, said in another way: you provide your own hash function)
<remix2000[m]>
Drup, a bit hacky, but it should work. Thanks!
dhil has joined #ocaml
jnavila has joined #ocaml
pierpal has quit [Ping timeout: 268 seconds]
jnavila has quit [Remote host closed the connection]
fred_ has joined #ocaml
fred_ is now known as Guest49605
<Guest49605>
Bonjour à tous, débutant sous "caml", connaissez vous des sites pour débutant ou de la docs en français svp. Merci à tous
Guest49605 has quit [Quit: Page closed]
kakadu has quit [Remote host closed the connection]
<octachron>
Guest49605, #ocaml-fr pour les questions en français
<moolc>
octachron: elle a déjà quitté
demonimin has quit [Ping timeout: 264 seconds]
demonimin has joined #ocaml
demonimin has joined #ocaml
demonimin has quit [Ping timeout: 240 seconds]
arthur_rainbow has left #ocaml [#ocaml]
demonimin has joined #ocaml
moolc has left #ocaml ["ERC (IRC client for Emacs 27.0.50)"]
pierpal has joined #ocaml
demonimin has quit [Ping timeout: 268 seconds]
orbifx has joined #ocaml
demonimin has joined #ocaml
demonimin has joined #ocaml
FreeBirdLjj has joined #ocaml
sh0t has joined #ocaml
RouvenAssouly[m] has joined #ocaml
dhil has quit [Ping timeout: 256 seconds]
dhil has joined #ocaml
govg has joined #ocaml
moei has quit [Quit: Leaving...]
Bronsa has joined #ocaml
mk9 has joined #ocaml
jimmyrcom_ has joined #ocaml
kalio has quit [Ping timeout: 248 seconds]
Fare has joined #ocaml
jimmyrcom_ has quit [Ping timeout: 240 seconds]
demonimin has quit [Ping timeout: 240 seconds]
malina has quit [Read error: Connection reset by peer]
demonimin has joined #ocaml
demonimin has quit [Ping timeout: 260 seconds]
pierpal has quit [Read error: Connection reset by peer]
Haudegen has quit [Read error: Connection reset by peer]
pierpal has joined #ocaml
malina has joined #ocaml
Bronsa has quit [Ping timeout: 240 seconds]
malina has quit [Client Quit]
pierpal has quit [Quit: Poof]
pierpal has joined #ocaml
jbrown has joined #ocaml
dhil has quit [Ping timeout: 265 seconds]
pmetzger has joined #ocaml
jimmyrcom_ has joined #ocaml
tarptaeya has joined #ocaml
muelleme has joined #ocaml
letoh has quit [Ping timeout: 240 seconds]
sh0t has quit [Ping timeout: 260 seconds]
pierpal has quit [Ping timeout: 240 seconds]
ziyourenxiang has quit [Ping timeout: 268 seconds]
orbifx has quit [Quit: WeeChat 2.0.1]
mk9 has quit [Quit: mk9]
webshinra has quit [Ping timeout: 256 seconds]
FreeBirdLjj has quit [Remote host closed the connection]
rwmjones has quit [Ping timeout: 248 seconds]
rwmjones has joined #ocaml
FreeBirdLjj has joined #ocaml
mehdib has quit [Read error: Connection reset by peer]
mehdib has joined #ocaml
ctrlsbstr has joined #ocaml
tarptaeya has quit [Quit: Konversation terminated!]
michbad_ has joined #ocaml
michbad_ has quit [Remote host closed the connection]
michbad_ has joined #ocaml
michbad_ has quit [Remote host closed the connection]
orbifx has joined #ocaml
muelleme has quit [Ping timeout: 240 seconds]
letoh has joined #ocaml
pierpal has joined #ocaml
moei has joined #ocaml
<discord1>
<loxs> Can I parametrize a file level module? I really hate having MyModule.MyModule just for the sake of parametrization?
<discord1>
<loxs> and having to write all of my code indented one level
Haudegen has joined #ocaml
<octachron>
loxs, you cannot. And it is generally useful to have the signature of the functor result at the same level than the functor
<octachron>
i.e. "module type S = ... module Make(...): S with type = ... = ..."
<pmetzger>
BTW, octachron, I'm curious where the "S" convention came from. Do you know? the "type t" stuff is obvious (t for type.)
<discord1>
<loxs> I see, thanks
<pmetzger>
is it just because S is a letter near t?
<octachron>
pmetzger, from signature?
<pmetzger>
Ah, s for signature would make sense!
<octachron>
and it is idiomatic to have fully capitalized identifiant for module type
<pmetzger>
That part I get. I thought it was more than idiomatic, though, isn't it now enforced by the compiler?
<pmetzger>
(I was under the impression it hadn't always been enforced though.)
<octachron>
Not really, personally I dislike to have so many capitals in a single word and tend to go in the other direction, e.g. "module type s = sig type t end"
<octachron>
rather than "module STACK = sig ... end"
<Drup>
pmetzger: only for modules, not for module types
<octachron>
module type STACK*
<pmetzger>
I should read the manual again. The last time I read it I didn't understand as much of the language. Sadly much of it requires that you know what it means to get maximum benefit.
<pmetzger>
(though that's true of most programming languages.)
<octachron>
pmetzger, this is true of most domains. I would be very interested in the ability to fully understand Friedrich Nietzsche in a single reading.
<Drup>
One could hope that the ocaml manual would be a bit more accessible than Nietzsche
<pmetzger>
Indeed. And I think many domains are straightforward to understand quite quickly. For example, although I'm not good at chopping onions for lack of practice, the idea of what is required is not deep. :)
<octachron>
Drup, the density of flowery metaphors by paragraph is certainly far lower in the manual; at the very least
<pmetzger>
BTW, is there a file of what the changes in 4.07 will be somewhere in the repository?
<Drup>
pmetzger: CHANGES.md
<pmetzger>
Thank you.
<pmetzger>
hrm. oddly, though the file is in markdown, it is just named "Changes" without an extension.
<discord1>
<loxs> So is it idiomatic to have all my parametrized modules in the same file (same parametric abstraction) then have MyModule.Top which does all the parametrization for these modules, so that users can just do open MyModule.Top (Param) and have access to them all?
TheLemonMan has joined #ocaml
<Drup>
I wouldn't say that's "idiomatic"
<Drup>
but it's not a bad idea
<pmetzger>
Hrm. 4.07 will have empty variants. I suppose one can't really pattern match on those. :)
<discord1>
<loxs> thanks
<Drup>
pmetzger `match foo with | _ -> .`
jao has joined #ocaml
<pmetzger>
ah, yes. the wildcard will always work.
<pmetzger>
It hadn't occurred to me. Then again, I'm not sure what one would do with an empty variant.
<pmetzger>
Though it is nice for consistency I suppose.
<Drup>
no, the ` -> . ` means that the match is impossible
<Drup>
it's a special syntax
<Drup>
and the typechecker will verify that the case is indeed impossible
<pmetzger>
I wonder where the "_" pattern idiom originated. It is in many functional languages with pattern matching.
<pmetzger>
I don't mean the idea of it, I mean the actual _. ML I suppose?
<octachron>
pmetzger, they can be quite useful combined with GADTs
<pmetzger>
octachron: I believe you, though I have yet to venture much into GADT land. I really should play with them at some point. They seem like a very powerful tool.
ctrlsbstr has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<pmetzger>
If I didn't really have a handle on what was meant by value constructor or, more importantly, existential types, it would be hard to parse.
<pmetzger>
It's appropriate for a reference manual but "someday" there should be an intro section for people who find terms like "existential type" puzzling.
<Fare>
any jbuilder / ppx expert around?
<pmetzger>
Fare: Still having the trouble you were having the other day?
<pmetzger>
Fare: You really should bring it up on discuss.ocaml.org
<Fare>
My coding partner sent a mail on the mailing-list already
<Fare>
and I'm reading various documents, that each provides useful but incomplete information.
kalio has joined #ocaml
<pmetzger>
Try discuss. It is nice. People have answered my questions every time.
<Fare>
I also have questions such as: what should a lens do when it depends on invalid assumptions, such as "the 7th element" of a list of length 5? Just ignore the thing and drop the element when setting, return a default when getting? Raise an exception? Raise an exception when getting but not setting?
<Fare>
It looks like the ocaml ecosystem is in transition from a variety of unsatisfying build systems to dune which claims to be better?
<pmetzger>
Fare: discuss is good for long form questions. Or maybe the caml mailing list. IRC is too casual, and too few people are on it at any given time.
ctrlsbstr has joined #ocaml
<pmetzger>
Fare: I still don't understand Dune completely so I'm not sure if it is the ultimate solution or not.
<Drup>
I don't necessarely agree, but iirc, the mailing question was so open-ended that nobody is going to answer :)
pierpal has quit [Ping timeout: 248 seconds]
<Drup>
Fare: `invalid_arg` is usually well suited for these cases
pierpal has joined #ocaml
<octachron>
Fare, the general answer will be to have a look at documentation and examples of omp (ocaml-migrate-parsetree)
<Fare>
octachron, thanks!
sh0t has joined #ocaml
kakadu has joined #ocaml
sillyotter has joined #ocaml
pierpal has quit [Quit: Poof]
sillyotter has quit [Client Quit]
pierpal has joined #ocaml
ctrlsbstr has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<discord1>
<mars0i> Anybody know what the step is to install a sexp printer in utop for Jane Street sexps? ocaml # #require "ppx_sexp_conv";; # open Sexplib.Std;; # type foo = {a : int} [@@deriving sexp];; type foo = { a : int; } val foo_of_sexp : Sexplib0.Sexp.t -> foo = <fun> val sexp_of_foo : foo -> Sexplib0.Sexp.t = <fun> # sexp_of_foo {a=42};; - : Sexplib0.Sexp.t = Ppx_sexp_conv_lib.Sexp.List [Ppx_sexp_conv_lib.Sexp.List [Ppx_sexp_conv_lib.Sexp.Atom "a";
<discord1>
Ppx_sexp_conv_lib.Sexp.Atom "42"]]
<discord1>
<mars0i> i.e. so it will print as (a 42) or something like that?
Fare has quit [Ping timeout: 240 seconds]
pierpal has quit [Read error: Connection reset by peer]
pierpal has joined #ocaml
pierpal has quit [Client Quit]
<discord1>
<Perry> I don't know offhand, but as "Real World OCaml" deals with sexp stuff a lot, and uses utop for all examples, it might mention it.
pierpal has joined #ocaml
orbifx has quit [Ping timeout: 240 seconds]
sh0t has quit [Ping timeout: 264 seconds]
pierpal has quit [Ping timeout: 260 seconds]
<discord1>
<loxs> Does anyone know what's the proper jbuilder stanza to prevent Missing primitives provided by +nat.js I try things like this but I can't seem to make it work: (js_of_ocaml (( flags +nat)))
<discord1>
<mars0i> @Perry, yes, you're right. I should have looked there.
TheLemonMan has quit [Quit: "It's now safe to turn off your computer."]
<Drup>
pmetzger[m]: reguarding gadt's manual/tutorial .... You could say it's also an artefact of how both new and advanced gadts are. I think it's one of these things where we just don't know how to explain it in simple enough terms.
sh0t has joined #ocaml
<discord1>
<loxs> Thanks, copy` finally made it work like this: (js_of_ocaml (( flags (+nat.js))))
Anitha has joined #ocaml
webshinra has quit [Remote host closed the connection]
ctrlsbstr has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
troydm has quit [Quit: What is Hope? That all of your wishes and all of your dreams come true? To turn back time because things were not supposed to happen like that (C) Rau Le Creuset]
argent_smith has quit [Quit: Leaving.]
jnavila has quit [Ping timeout: 240 seconds]
ia0 has quit [Remote host closed the connection]
sz0 has joined #ocaml
gtrak has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
gtrak has quit [Ping timeout: 256 seconds]
jao has quit [Disconnected by services]
jao has joined #ocaml
hdon has joined #ocaml
webshinra has quit [Quit: Leaving]
webshinra has joined #ocaml
<exarkun>
I see that ocaml only runs code in a single OS thread at a time but it does seem to run multiple OS threads. Is that right? Is there a compiler configuration to limit it to a single OS thread?
<mrvn>
exarkun: ocaml runs one thread with ocaml at a time but other threads can exist and run external code.
<mrvn>
Anything using threads has to specify -threads as compiler argument.
<mrvn>
(so no, you can't limit it. If the source uses threads then it has to use threads. Otherwise it won't)
orbifx has joined #ocaml
averell has quit [Quit: .]
jbrown has quit [Ping timeout: 265 seconds]
Fare has joined #ocaml
hdon has quit [Ping timeout: 268 seconds]
kakadu has quit [Ping timeout: 276 seconds]
pierpa has joined #ocaml
Haudegen has quit [Remote host closed the connection]
ziyourenxiang has joined #ocaml
ziyourenxiang has joined #ocaml
ziyourenxiang has quit [Changing host]
silver has quit [Read error: Connection reset by peer]