adrien changed the topic of #ocaml to: Discussions about the OCaml programming language | http://www.ocaml.org | OCaml 4.09 release notes: https://caml.inria.fr/pub/distrib/ocaml-4.09/notes/Changes | Try OCaml in your browser: http://try.ocamlpro.com | Public channel logs at http://irclog.whitequark.org/ocaml
kleisli has quit [Remote host closed the connection]
kleisli has joined #ocaml
yomimono has quit [Ping timeout: 256 seconds]
rosterok has quit [Quit: Connection closed for inactivity]
isd has joined #ocaml
kleisli has quit [Remote host closed the connection]
kleisli has joined #ocaml
<isd> Hey All, I'm experimenting with writing jsoo bindings for the javascript promise APIs using gen_js_api. I'm hitting an error and I'm stumped. Here's the code, command and error in the comments: https://pastebin.com/NjUcuGHP
<isd> Any ideas?
<isd> passing that file to the `ocaml` command gives me an error about a missing Ojs module, but it parses fine.
andreas303 has quit [Remote host closed the connection]
jaar has quit [Ping timeout: 246 seconds]
andreas303 has joined #ocaml
<isd> Hm, seems it doesn't like the type variables. Can gen_js_api not handle polymorphism?
yomimono has joined #ocaml
<isd> Thanks for rubber-ducking for me everyone :P
amiloradovsky has quit [Ping timeout: 240 seconds]
ygrek has quit [Ping timeout: 256 seconds]
sz0 has quit [Quit: Connection closed for inactivity]
isd has left #ocaml ["User left"]
TakinOver has quit [Remote host closed the connection]
KeyJoo has quit [Quit: KeyJoo]
cartwright has quit [Write error: Connection reset by peer]
andreas303 has quit [Write error: Connection reset by peer]
andreas303 has joined #ocaml
cartwright has joined #ocaml
rwmjones has quit [Quit: ZNC - 1.6.0 - http://znc.in]
rwmjones has joined #ocaml
narimiran has joined #ocaml
amiloradovsky has joined #ocaml
kleisli has quit [Remote host closed the connection]
kleisli has joined #ocaml
chripell has joined #ocaml
Haudegen has joined #ocaml
mbuf has joined #ocaml
kleisli has quit [Remote host closed the connection]
kleisli has joined #ocaml
kindaro has joined #ocaml
cheater has joined #ocaml
<cheater> hi
<cheater> can someone recommend some quick start docs on ocaml? i'm a heavy haskell user and have used ocaml for some time a few years ago, and i'll be working on a large code base that uses ocaml now.
<kindaro> cheater:  Hi, I am in a similar situation as you. I can throw some links at you.
<kindaro> Like, have you read this? http://blog.ezyang.com/2010/10/ocaml-for-haskellers/
<kindaro> Though the most important resource for me is the Jane Street's documentation for their Core prelude alternative.
<kindaro> For example, they define infix monadic composition for many things, although it is found in a somewhat obscure submodule.
<kindaro> They also redefine some things in a surprizing way, for example equality is monomorphic int by default and you have to open Poly to get the usual polymorphic equality.
kindaro has left #ocaml [#ocaml]
jaar has joined #ocaml
kindaro has joined #ocaml
<kindaro> Also note the book Real https://dev.realworldocaml.org/toc.html
<kindaro> …the book Real World Ocaml is available: https://dev.realworldocaml.org/toc.html
<kindaro> But I find that it is way too long, seeing how Ocaml is not much more than strict Haskell without type classes.
cartwright has quit [Remote host closed the connection]
cartwright has joined #ocaml
<_xvilka_> hi, if you see your own package in this list - please update it to the dune or just update the opam file accordingly: https://github.com/ocaml/opam-repository/issues/15943
<cheater> i've read this back in the day
<cheater> i'm mostly interested in what tooling to use to install ocaml and packages etc
kleisli has quit [Remote host closed the connection]
kleisli has joined #ocaml
|jbrown| has quit [Ping timeout: 250 seconds]
|jbrown| has joined #ocaml
<Leonidas> opam
wingsorc has joined #ocaml
chripell has quit [Remote host closed the connection]
chripell has joined #ocaml
<kindaro> cheater:  This article seems to describe the workflow, and it is reasonably recent: https://medium.com/@bobbypriambodo/starting-an-ocaml-app-project-using-dune-d4f74e291de8
<kindaro> Or should I say _a_ workflow… Anyway, Dune seems to be universally accepted, even some very old projects such as Coq are migrating to it.
orbifx has joined #ocaml
<kindaro> I have a question about Set best practices. I am working on a project based on Core, and I have some non-trivial types polymorphic in several variables. These types have lists inside, and I want to replace some of the lists by sets. I am looking at two options: either to use Core's polymorphic sets _(which I have no idea how to work with yet)_ or monomorphize the types to `int` and use int maps to
<kindaro> translate the results of computations to the types I actually want. What should I do? Polymorphism is of course by far more comfortable, but, not knowing Ocaml very well, I am afraid that types will become too complicated and the type system will fail me.
<Leonidas> kindaro: You can also create your own Set type, so you don't need to deal with polymorphic sets
sz0 has joined #ocaml
<Leonidas> I would not change type to its if you don't need to, since that will make the types less specific
<kindaro> Leonidas: Do you think it will be feasible to deal with sets and keep everything polymorphic?
kindaro has quit [Remote host closed the connection]
chripell has quit [Quit: Leaving]
chripell has joined #ocaml
ggole has joined #ocaml
tane has joined #ocaml
Anarchos has joined #ocaml
orbifx has quit [Ping timeout: 256 seconds]
dborisog has joined #ocaml
mfp has joined #ocaml
chripell has quit [Quit: Leaving]
orbifx has joined #ocaml
chripell has joined #ocaml
_whitelogger has joined #ocaml
Leonidas has joined #ocaml
leah2 has joined #ocaml
farn has joined #ocaml
Manis[m] has joined #ocaml
prsafont[m] has joined #ocaml
Haudegen has quit [Quit: Bin weg.]
Anarchos has quit [Quit: Vision[0.10.3]: i've been blurred!]
chripell has quit [Remote host closed the connection]
chripell has joined #ocaml
dckc has quit [Ping timeout: 272 seconds]
dckc has joined #ocaml
kindaro has joined #ocaml
<kindaro> How do I define and use Unicode strings? I understand the basic `char` is actually a byte?
<tane> kindaro, you can have a look at the opam package repository, there are various libraries to deal with unicode
<octachron> You just use strings. The interpretation of the data within the strings is your own responsability.
ygrek has joined #ocaml
<kindaro> I don't want it to be mine. What I need is, rather, a sequence of items that happen to be Unicode symbols.
<kindaro> tane:  I gather that there are several third party solutions, but I am not sure which to pick, and what is the general paradigm.
<tane> kindaro, I guess it depends on your use case
<tane> I've successfully used https://opam.ocaml.org/packages/uutf/ in the past to interpret a string as a sequence of unicode code points
<kindaro> I want to have a type that holds a Unicode symbol. A list of such type would be good for me.
<tane> then try your luck with uutf
<Drup> kindaro: `Uchar.t` from the stdlib.
bglm[m] has left #ocaml ["Kicked by @appservice-irc:matrix.org : Idle for 30+ days"]
<Drup> there are several packages that defines ropes and stuff, along with functions to manipulate unicode chars and encodings
kleisli has quit [Remote host closed the connection]
<kindaro> I understand that Ocaml does not have Unicode string literals — so how do I define strings? _(Say, for testing.)_
kleisli has joined #ocaml
ygrek has quit [Remote host closed the connection]
ygrek has joined #ocaml
porchetta has quit [Ping timeout: 265 seconds]
Haudegen has joined #ocaml
<kindaro> I have a code path that should never be visited. What should I put there so that it gives a descriptive run time error?
<kindaro> Like Obj.magic "impossible error", but better.
<companion_cube> kindaro: "aéö" works, in utf8
<ggole> assert false is reasonable for 'impossible' paths
porchetta has joined #ocaml
<Drup> kindaro: I wonder how you came up with the idea of doing `Obj.magic "impossible error" :D
<Drup> (instead of, you know, raisin an exception)
<ggole> It's only descriptive in that you get a source location, I guess.
<Drup> ggole: you don't even get that :D
<Drup> you only get memory corruption and sadness
<ggole> I meant for assert false
<kindaro> However assert false does not have any string associated with it.
<kindaro> Otherwise I suppose it is good.
<Drup> `invalid_arg` works as well.
<kindaro> What is `invalid_arg`?
<ggole> You could use failwith "a bad thing happened" or failwith ("a bad thing happened at " ^ __LOC__)
<ggole> invalid_arg is supposed to be used when you find that some input is not in the allowed range of values
<companion_cube> ^
<companion_cube> `assert false` is the "it's impossible to reach here"
<companion_cube> it gives you a location and everything
Jesin has quit [Quit: Leaving]
muskan has joined #ocaml
Exagone313 has quit [Quit: see ya!]
sonologico has joined #ocaml
valtr has quit [Ping timeout: 260 seconds]
_tjr_ has quit [Ping timeout: 256 seconds]
zfnmxt has quit [Ping timeout: 260 seconds]
bacam has quit [Ping timeout: 240 seconds]
Jesin has joined #ocaml
DanielRichman has quit [Ping timeout: 268 seconds]
Exagone313 has joined #ocaml
eagleflo has quit [Ping timeout: 260 seconds]
rom1504 has quit [Ping timeout: 256 seconds]
eagleflo has joined #ocaml
adrien has quit [Ping timeout: 256 seconds]
pippijn has quit [Ping timeout: 256 seconds]
keep-learning[m] has quit [Ping timeout: 240 seconds]
aspiwack[m] has quit [Ping timeout: 240 seconds]
bacam has joined #ocaml
_tjr_ has joined #ocaml
valtr has joined #ocaml
rks` has quit [Ping timeout: 246 seconds]
aspiwack[m] has joined #ocaml
<zozozo> basically, any exception will give you a location (assuming you don't have a catch-all somewhere)
pippijn has joined #ocaml
<zozozo> if you really want a dirty solution without an exception, you could also force a segfault by dereferencing Obj.magic 0
<Drup> why
keep-learning[m] has joined #ocaml
<zozozo> because you can !
<zozozo> I remember some people/organisation (but don't remember which one) used to force segfault with some magic number/bytes to identify these kinds of failures in ocaml code
<companion_cube> wtf wtf wtf
<zozozo> maybe I'm just desensitized after having debugged too much very low-level code emitted by the compiler
<zozozo> the past few weeks I've ready more assembly code than ocaml code, :p
sonologico has quit [Remote host closed the connection]
bacam has quit [Ping timeout: 246 seconds]
DanielRichman has joined #ocaml
DanielRichman has quit [Ping timeout: 260 seconds]
adrien has joined #ocaml
zfnmxt has joined #ocaml
rks` has joined #ocaml
chripell_ has joined #ocaml
bacam has joined #ocaml
chripell has quit [Read error: Connection reset by peer]
keep-learning[m] has quit [*.net *.split]
flux1 has quit [*.net *.split]
copy` has quit [*.net *.split]
jeroud has quit [*.net *.split]
lopex has quit [*.net *.split]
dash has quit [*.net *.split]
ehirdoy has quit [*.net *.split]
haskell_enthusia has quit [*.net *.split]
jeroud has joined #ocaml
keep-learning[m] has joined #ocaml
flux1 has joined #ocaml
lopex has joined #ocaml
copy` has joined #ocaml
dash has joined #ocaml
ehirdoy has joined #ocaml
haskell_enthusia has joined #ocaml
DanielRichman has joined #ocaml
flux1 has quit [Max SendQ exceeded]
Manis[m] has quit [Ping timeout: 240 seconds]
keep-learning[m] has quit [Ping timeout: 240 seconds]
dash has quit [Ping timeout: 240 seconds]
karan has quit [Ping timeout: 246 seconds]
callcc[m] has quit [Ping timeout: 246 seconds]
aecepoglu[m] has quit [Ping timeout: 246 seconds]
lnxw37d4 has quit [Ping timeout: 246 seconds]
aspiwack[m] has quit [Ping timeout: 256 seconds]
prsafont[m] has quit [Ping timeout: 256 seconds]
labor[m] has quit [Ping timeout: 256 seconds]
copy` has quit [Ping timeout: 240 seconds]
pablo[m] has quit [Ping timeout: 256 seconds]
sepp2k has quit [Ping timeout: 260 seconds]
dl3br[m] has quit [Ping timeout: 260 seconds]
zwindl[m] has quit [Ping timeout: 260 seconds]
cgenie[m] has quit [Ping timeout: 260 seconds]
jimt[m] has quit [Ping timeout: 260 seconds]
peddie has quit [Ping timeout: 260 seconds]
rom1504 has joined #ocaml
_tjr_ has quit [Changing host]
_tjr_ has joined #ocaml
Haudegen has quit [Quit: Bin weg.]
amiloradovsky has quit [Ping timeout: 252 seconds]
TheLemonMan has joined #ocaml
sonologico has joined #ocaml
<Drup> zozozo: please seek help
haskell_enthusia has quit [Ping timeout: 240 seconds]
keep-learning[m] has joined #ocaml
haskell_enthusia has joined #ocaml
sonologico__ has joined #ocaml
sonologico has quit [Ping timeout: 246 seconds]
aecepoglu[m] has joined #ocaml
labor[m] has joined #ocaml
peddie has joined #ocaml
aspiwack[m] has joined #ocaml
lnxw37d4 has joined #ocaml
copy` has joined #ocaml
dash has joined #ocaml
prsafont[m] has joined #ocaml
pablo[m] has joined #ocaml
flux1 has joined #ocaml
Manis[m] has joined #ocaml
zwindl[m] has joined #ocaml
jimt[m] has joined #ocaml
cgenie[m] has joined #ocaml
callcc[m] has joined #ocaml
dl3br[m] has joined #ocaml
sepp2k has joined #ocaml
karan has joined #ocaml
thizanne has joined #ocaml
amiloradovsky has joined #ocaml
thizanne has quit [Client Quit]
thizanne has joined #ocaml
chripell_ has quit [Ping timeout: 264 seconds]
Anarchos has joined #ocaml
Haudegen has joined #ocaml
gareppa has joined #ocaml
<Anarchos> last revision of dune an d opam on github do not seem compatible
gareppa has quit [Quit: Leaving]
sonologico__ has quit [Remote host closed the connection]
sonologico__ has joined #ocaml
kleisli has quit [Remote host closed the connection]
kleisli has joined #ocaml
kindaro has quit [Ping timeout: 246 seconds]
Serpent7776 has quit [Read error: Connection reset by peer]
Serpent7776 has joined #ocaml
Serpent7776 has quit [Read error: Connection reset by peer]
Serpent7776 has joined #ocaml
sonologico__ has quit [Remote host closed the connection]
sonologico__ has joined #ocaml
Anarchos has quit [Ping timeout: 260 seconds]
gareppa has joined #ocaml
gareppa has quit [Quit: Leaving]
sonologico___ has joined #ocaml
sonologico___ has quit [Client Quit]
sonologico__ has quit [Ping timeout: 272 seconds]
orbifx has quit [Ping timeout: 260 seconds]
dborisog has quit [Ping timeout: 250 seconds]
porchetta has quit [Quit: WeeChat 2.7.1]
porchetta has joined #ocaml
porchetta has quit [Client Quit]
orbifx has joined #ocaml
porchetta has joined #ocaml
vicfred_ has joined #ocaml
vicfred has quit [Ping timeout: 264 seconds]
vicfred_ has quit [Quit: Leaving]
vicfred has joined #ocaml
muskan has quit [Ping timeout: 240 seconds]
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 240 seconds]
narimiran has quit [Ping timeout: 265 seconds]
Hrundi_V_Bakshi has joined #ocaml
Hrundi_V_Bakshi_ has joined #ocaml
KeyJoo has joined #ocaml
ggole has quit [Quit: Leaving]
ohama has quit [Ping timeout: 260 seconds]
muskan has joined #ocaml
andreas303 has quit [Remote host closed the connection]
pablo[m] has quit [Quit: Idle for 30+ days]
andreas303 has joined #ocaml
Serpent7776 has quit [Read error: Connection reset by peer]
Serpent7776 has joined #ocaml
dl3br[m] has left #ocaml ["Kicked by @appservice-irc:matrix.org : Idle for 30+ days"]
karan has quit [Quit: Idle for 30+ days]
sepp2k has left #ocaml ["Kicked by @appservice-irc:matrix.org : Idle for 30+ days"]
callcc[m] has quit [Quit: Idle for 30+ days]
Hrundi_V_Bakshi has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
TakinOver has joined #ocaml
tane has quit [Quit: Leaving]
wingsorc has quit [Quit: Leaving]
littleli_ has joined #ocaml
TheLemonMan has quit [Quit: "It's now safe to turn off your computer."]
orbifx has quit [Quit: orbifx]
Jesin has quit [Quit: Leaving]
Hrundi_V_Bakshi_ has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
Jesin has joined #ocaml
Haudegen has quit [Ping timeout: 260 seconds]
jaar has quit [Ping timeout: 246 seconds]