adrien changed the topic of #ocaml to: Discussions about the OCaml programming language | http://www.ocaml.org | OCaml 4.07.1 release notes: https://caml.inria.fr/pub/distrib/ocaml-4.07/notes/Changes | Try OCaml in your browser: http://try.ocamlpro.com | Public channel logs at http://irclog.whitequark.org/ocaml | Due to ongoing spam, you must register your nickname to talk on the channel
carlosdagos has joined #ocaml
Haudegen has quit [Remote host closed the connection]
orbifx has joined #ocaml
yawaramin has quit [Remote host closed the connection]
yawaramin has joined #ocaml
ziyourenxiang has joined #ocaml
themsay has joined #ocaml
dsp has quit [Remote host closed the connection]
orbifx has quit [Ping timeout: 268 seconds]
recj has joined #ocaml
themsay has quit [Ping timeout: 268 seconds]
jao has quit [Remote host closed the connection]
jao has joined #ocaml
Spetznaz_ has quit [Ping timeout: 240 seconds]
silver has quit [Read error: Connection reset by peer]
kvda has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jimt is now known as Jim7J1AJH
mfp has quit [Ping timeout: 246 seconds]
ostera has joined #ocaml
ygrek has quit [Ping timeout: 250 seconds]
kvda has joined #ocaml
ostera has quit [Ping timeout: 250 seconds]
yomimono has quit [Ping timeout: 268 seconds]
yawaramin has quit [Remote host closed the connection]
Jim7J1AJH is now known as jimt
yawaramin has joined #ocaml
yomimono has joined #ocaml
tormen has joined #ocaml
yomimono has quit [Client Quit]
tormen_ has quit [Ping timeout: 240 seconds]
yomimono has joined #ocaml
marvin2 has quit [Ping timeout: 250 seconds]
recj has quit [Ping timeout: 240 seconds]
nullifidian__ has joined #ocaml
nullifidian_ has quit [Read error: Connection reset by peer]
loli has joined #ocaml
recj has joined #ocaml
gravicappa has joined #ocaml
pierpal has quit [Quit: Poof]
pierpal has joined #ocaml
iovec has joined #ocaml
opt9_ has joined #ocaml
opt9_ has quit [Client Quit]
opt9 has joined #ocaml
yawaramin has quit [Remote host closed the connection]
opt9 has quit [Quit: leaving]
opt9 has joined #ocaml
yawaramin has joined #ocaml
yawaramin has quit [Ping timeout: 268 seconds]
steenuil has quit [Remote host closed the connection]
Haudegen has joined #ocaml
pierpal has quit [Read error: Connection reset by peer]
marvin2 has joined #ocaml
companion_cube has quit [Remote host closed the connection]
ocabot has quit [Remote host closed the connection]
themsay has joined #ocaml
Asmadeus has quit [Ping timeout: 252 seconds]
adrien has quit [Ping timeout: 245 seconds]
Asmadeus has joined #ocaml
al-damiri has quit [Quit: Connection closed for inactivity]
carlosdagos has quit [Quit: Connection closed for inactivity]
bartholin has joined #ocaml
pierpal has joined #ocaml
adrien has joined #ocaml
notzmv has quit [Ping timeout: 268 seconds]
bartholin has quit [Remote host closed the connection]
jaar has joined #ocaml
leah2 has quit [Ping timeout: 260 seconds]
mfp has joined #ocaml
jaar_ has joined #ocaml
jaar_ has quit [Remote host closed the connection]
jaar has quit [Remote host closed the connection]
ziyourenxiang has quit [Ping timeout: 258 seconds]
asymptotically has joined #ocaml
klntsky has quit [Ping timeout: 256 seconds]
klntsky has joined #ocaml
zolk3ri has joined #ocaml
Haudegen has quit [Remote host closed the connection]
Asmadeus has quit [Remote host closed the connection]
Asmadeus has joined #ocaml
leah2 has joined #ocaml
jbrown has quit [Remote host closed the connection]
jbrown has joined #ocaml
ziyourenxiang has joined #ocaml
silver has joined #ocaml
ostera has joined #ocaml
Haudegen has joined #ocaml
ostera has quit [Ping timeout: 258 seconds]
ostera has joined #ocaml
ostera has quit [Ping timeout: 250 seconds]
ostera has joined #ocaml
pierpal has quit [Quit: Poof]
pierpal has joined #ocaml
adrianbrink has joined #ocaml
<adrianbrink> hey
al-damiri has joined #ocaml
ostera has quit [Ping timeout: 240 seconds]
ostera has joined #ocaml
<octachron> May I suggest to ask your question directly rather than in a link? `type a. ... ` is the combined notation for an universally quantified locally abstract type `a`. This notation is mostly useful in recursive functions over GADTs.
<adrianbrink> @octachron Thank you. What does GADT stand for? I've also seen the same notation with `type kind kind2.` and also with `(type kind)`. What does the last one mean?
<octachron> Generalized Algebraic DataTypes: http://caml.inria.fr/pub/docs/manual-ocaml/extn.html#sec252
jbrown has quit [Ping timeout: 252 seconds]
<adrianbrink> For example here:
<adrianbrink> ```let make (type kind)
<adrianbrink> (Manager_result.MCase res_case : kind Manager_result.case) =
<adrianbrink> ``
<octachron> `type kind kind2 . ...` introduces two types `kind` and `kind2` that are universally quantified and locally abstract
<octachron> `(type kind)` introduces a locally abstract type `kind` (note the lack of universal quantification in this case).
<octachron> Locally abstract types are often needed with GADTs because pattern matching can only refine (add equations) to abstract types.
<octachron> Similarly, the universal quantification is required when defining polymorphically recursive functions.
<adrianbrink> Thank you very much. This is very helpful
pierpal has quit [Read error: Connection reset by peer]
<adrianbrink> Another question which I hard for me to google anywhere.
<adrianbrink> ```
<adrianbrink> type t = private
<adrianbrink> | Implicit of Signature.Public_key_hash.t
<adrianbrink> | Originated of Contract_hash.t
<adrianbrink> ```
<adrianbrink> What does private mean in this case (it's in an .mli file) and does it matter for a variant whether the first case has a pipe or not?
<octachron> `private` means that the variant constructed cannot be constructed by hand. One would need to use one of the constructor function provided somewhere else in the module.
<octachron> However, it is possible to destruct value of type `t`, i.e. you can peek at the value representation but not construct it directly
ostera has quit [Ping timeout: 268 seconds]
<octachron> Having a pipe or not on the first variant is a stylistic choice.
bartholin has joined #ocaml
<adrianbrink> Ah, perfect :-)
jbrown has joined #ocaml
<adrianbrink> I'm trying to understand some source code right now and I have come across this:
<adrianbrink> ```
<adrianbrink> type 'kind operation_metadata = {
<adrianbrink> (** Result of applying a {!Operation.t}. Follows the same structure. *)
<adrianbrink> contents: 'kind contents_result_list ;
<adrianbrink> }
<adrianbrink> and packed_operation_metadata =
<adrianbrink> | Operation_metadata : 'kind operation_metadata -> packed_operation_metadata
<adrianbrink> | No_operation_metadata : packed_operation_metadata
<adrianbrink> ```
<adrianbrink> Does `'kind operation_metadata -> packed_operation_metadata` mean that it is a function? Also is `packed_operation_metadata` a varaint and how is it possible that if it can reference itself?
<octachron> There are GADTs definitions
decentpenguin has joined #ocaml
ostera has joined #ocaml
pierpal has joined #ocaml
ostera has quit [Ping timeout: 258 seconds]
ostera has joined #ocaml
<adrianbrink> If anyone else would like more reading material this blog post is great: https://mads-hartmann.com/ocaml/2015/01/05/gadt-ocaml.html
asymptotically has quit [Ping timeout: 256 seconds]
pierpal has quit [Ping timeout: 240 seconds]
pierpal has joined #ocaml
asymptotically has joined #ocaml
pierpal has quit [Ping timeout: 246 seconds]
<zozozo> I have a samll problem with dune: even when using the linkall flag and specifying a purely side-effecting module in the (modules (..)) field of an executable stanza, it appear dune doesn't link the purely side-effecting module, :/
ocabot has joined #ocaml
companion_cube has joined #ocaml
mengu has joined #ocaml
spew has joined #ocaml
yawaramin has joined #ocaml
yawaramin has quit [Ping timeout: 250 seconds]
ollehar has joined #ocaml
tane has joined #ocaml
FreeBirdLjj 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
powerbit has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 246 seconds]
FreeBirdLjj has joined #ocaml
ollehar has quit [Ping timeout: 258 seconds]
FreeBirdLjj has quit [Remote host closed the connection]
JimmyRcom has joined #ocaml
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 244 seconds]
FreeBirdLjj has joined #ocaml
ostera has joined #ocaml
ostera has quit [Ping timeout: 268 seconds]
themsay has joined #ocaml
recj has joined #ocaml
waleee has joined #ocaml
jbrown has joined #ocaml
waleee has quit [Ping timeout: 272 seconds]
Serpent7776 has joined #ocaml
ygrek has joined #ocaml
Haudegen has joined #ocaml
steenuil has joined #ocaml
ostera has joined #ocaml
ostera has quit [Ping timeout: 258 seconds]
ostera has joined #ocaml
<cemerick> I'm giving js_of_ocaml a try, and wondering what I should be expecting in terms of output size? The most basic `print_endline "foo"` produces 11K of javascript, which is a little surprising?
recj has quit [Ping timeout: 250 seconds]
ostera has quit [Ping timeout: 245 seconds]
<cemerick> fwiw, I'm using dune at the moment, `--profile=release`, and setting `--opt=3` in the JSOO flags
FreeBirdLjj has quit [Remote host closed the connection]
recj has joined #ocaml
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 268 seconds]
ostera has joined #ocaml
ostera has quit [Ping timeout: 268 seconds]
recj has quit [Ping timeout: 258 seconds]
recj has joined #ocaml
Serpent7776 has quit [Read error: Connection reset by peer]
Serpent7776 has joined #ocaml
ostera has joined #ocaml
ostera has quit [Ping timeout: 244 seconds]
ostera has joined #ocaml
<steenuil> I think I've seen a few people mention that you should run it through uglifyjs or the closure compiler because it doesn't do much dead code elimination
<cemerick> steenuil: odd given that it claims that it does so explicitly ¯\_(ツ)_/¯ I'll see what the diff ends up being.
<spew> what's the deal with bucklescript?
ostera has quit [Ping timeout: 246 seconds]
<steenuil> I might be wrong about that
<cemerick> spew: the deal, with regard to what?
<cemerick> I actually started with bucklescript, but not having access to opam isn't great
Denommus has joined #ocaml
gareppa has joined #ocaml
yomimono_ has joined #ocaml
recj has quit [Ping timeout: 272 seconds]
recj has joined #ocaml
r3s1stanc3 has joined #ocaml
kakadu_ has joined #ocaml
recj has quit [Ping timeout: 250 seconds]
recj has joined #ocaml
recj has quit [Ping timeout: 268 seconds]
recj has joined #ocaml
jmiven has joined #ocaml
Spetznaz_ has joined #ocaml
recj has quit [Ping timeout: 240 seconds]
zolk3ri has joined #ocaml
recj has joined #ocaml
timeless has joined #ocaml
<timeless> anyone know offhand how to install cryptokit using brew (macOS)?
<companion_cube> install opam, then `opam install cryptokit`? 😇
<timeless> you left off `opam init` 😜
<companion_cube> right, right
* timeless is trying to patch random ocaml w/o really speaking ocaml
<timeless> it isn't going too badly
zolk3ri has quit [Quit: Lost terminal]
<timeless> ok, so, it's 'installed', but i apparently didn't add it to my path which means i didn't do myself any favors
<companion_cube> eval `opam env`
<timeless> yeah
* timeless installs `num`
<companion_cube> what's the random OCaml you're trying to patch?
<timeless> sks-keyserver
<timeless> great, it doesn't actually like me even before i try to patch it
<timeless> so, i guess i should downgrade my ocaml
* timeless tries opam switch create 4.05.0
<companion_cube> oh boy, this seems old
<companion_cube> if it doesn't use safe-string… -_-
recj has quit [Remote host closed the connection]
recj has joined #ocaml
Haudegen has quit [Remote host closed the connection]
ostera has joined #ocaml
gareppa has quit [Quit: Leaving]
<timeless> >> Fatal error: OCaml and preprocessor have incompatible versions
* timeless sighs
<timeless> clearly i'm not going to like this adventure
<timeless> is the idea that i only want to use `opam` and not brew for pretty much everything?
<companion_cube> definitely, yes
ostera has quit [Ping timeout: 268 seconds]
<companion_cube> but porting old rotten OCaml to a modern version might not be the easiest, I'm afraid
<timeless> since it isn't my code, i'd rather downgrade my ocaml env to match their expectations
<companion_cube> (this compilation error you pasted above is related to the split between strings and bytes introduced a few versions ago)
<timeless> upgrading their requirements is a breaking change
<timeless> my goal is not to break them, just make my life suck a bit ess
<timeless> s/ess$/less/
<companion_cube> so, this thing is not maintained anymore, yet you depend on it? :s
<timeless> s/you/the debian&ubuntu world/
<timeless> pretty much
<companion_cube> ugh.
<timeless> 🤯
<timeless> 🐪
<companion_cube> the combination of these emojis is uncanny
kvda has joined #ocaml
<timeless> thank you
* timeless presumes `opam` is more or less a `cpan` relative conceptually
<timeless> so, what version of ocaml do i want to switch to if i want to build this thing?
<timeless> latest failure using The OCaml toplevel, version 4.05.0
Serpent7776 has quit [Quit: leaving]
orbifx has joined #ocaml
Haudegen has joined #ocaml
ostera has joined #ocaml
<steenuil> I've actually managed to compile some old (17+ years) OCaml with fairly minimal changes using dune
<steenuil> ...granted, I had to turn off about 20 warnings and disable safe-string
<Armael> wow, nice :)
<Armael> what code was that?
ostera has quit [Ping timeout: 258 seconds]
<steenuil> an implementation of xlib I had to dig out from the archive
yomimono_ has quit [Ping timeout: 268 seconds]
themsay has quit [Ping timeout: 258 seconds]
yomimono has joined #ocaml
tane has quit [Quit: Leaving]
ygrek has quit [Ping timeout: 258 seconds]
yawaramin has joined #ocaml
<orbifx> is it ok to pattern match Set.empty?
<Drup> orbifx: well, you can't, so I guess the answer is no.
<orbifx> Drup: do I want to know why, or is it too complicated before bed time? :P
<Drup> You can only match against data constructors, `Set.empty` is not a constructor.
<orbifx> Ah ok
<orbifx> guards should work, right?
<orbifx> | x, y when x = Set.emtpy ?
<Drup> yes
<orbifx> cool thanks Drup
kvda has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
kvda has joined #ocaml
<orbifx> One last one for the night, Set.map doesn't allow mapping from one type of set to another; is the best way for conversions to use Set.fold?
recj has quit [Read error: Connection reset by peer]
<Drup> yes
recj has joined #ocaml
<orbifx> I guess it's not correct to expect a one to one mapping between sets, right?
<orbifx> thanks again Drup
yawaramin has quit [Remote host closed the connection]
yawaramin has joined #ocaml
kakadu_ has quit [Remote host closed the connection]
Haudegen has quit [Remote host closed the connection]
pierpal has joined #ocaml
Denommus has left #ocaml ["ERC Version 5.3 (IRC client for Emacs)"]
caente has joined #ocaml
orbifx has quit [Ping timeout: 258 seconds]
kvda has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
carlosdagos has joined #ocaml
ostera has joined #ocaml
ostera has quit [Ping timeout: 246 seconds]
ziyourenxiang has joined #ocaml
nst^ has joined #ocaml