adrien changed the topic of #ocaml to: Discussions about the OCaml programming language | http://www.ocaml.org | OCaml 4.06.0 release notes: https://caml.inria.fr/pub/distrib/ocaml-4.06/notes/Changes | Try OCaml in your browser: http://try.ocamlpro.com | Public channel logs at http://irclog.whitequark.org/ocaml
spew has joined #ocaml
<domanic> pierpa: I don't even know what to search for. what is () called?
al-damiri has quit [Quit: Connection closed for inactivity]
<domanic> pierpa: the tutorial I am looking at is on ocaml.org ... is there a better starting place?
ziyourenxiang has quit [Ping timeout: 260 seconds]
spew has quit [Read error: Connection reset by peer]
infinity0_ has joined #ocaml
infinity0_ has quit [Changing host]
infinity0 has quit [Killed (hitchcock.freenode.net (Nickname regained by services))]
infinity0 has joined #ocaml
sveit has quit [Quit: Bye]
mfp has quit [Ping timeout: 276 seconds]
malina has joined #ocaml
opios has joined #ocaml
opios has quit [Changing host]
opios has joined #ocaml
<Drup> domanic: () is the only value of type "unit", it's often used as argument for functions that do not need any input
<pierpa> domanic: () is a tuple of arity zero, the only value f type unit, one uses it when there are no more significative values, and Drup preceded me!
<pierpa> in the tutorial at ocaml.org, in http://ocaml.org/learn/tutorials/basics.html @ para "Basic Types" () is mentioned. Agreed, it does not say a lot there...
Haudegen has quit [Remote host closed the connection]
sveit has joined #ocaml
silver_ has joined #ocaml
silver has quit [Ping timeout: 248 seconds]
sveit has quit [Quit: Bye]
<domanic> Drup: thanks
sveit has joined #ocaml
<domanic> Drup: pierpa ... hmm is my understanding correct: that you use () when there are ~named arguments to mark that they have all been given?
<Drup> yes, it's also used for that
<Enjolras> can also be used to mark side effect : let fresh_counter () = let counter = ref 0 in fun () -> incr counter; !counter
<domanic> Question: if ocaml has type inheritance... why does it need mli files? (basically seem like c's .h files?)
<Enjolras> .mli files have several benefits : make incremental recompilation faster, and parallel compilation easier
<Enjolras> more importantly, they force you to restrict api and code dependency between independant modules
<Enjolras> and they are a good place to document the code
<Enjolras> and they are a way to hide internal implementation details by restricting the types exported
<Enjolras> think you can have module UserId : sig type t val parse : string -> (t, parse_error) result ... end = struct type t = string let parse = ... end
<Enjolras> user of the module cannot see it's a string and are forced to use the parse function to create a value which will check syntax
<Enjolras> so you know by construction if you have a UserId.t that it was checked for validity
<Enjolras> it's just an example
<Enjolras> (also i suspect you meant type inference ?)
<domanic> Enjolras: yes, thanks, I did mean inference
domanic has quit [Ping timeout: 240 seconds]
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 248 seconds]
piazzt has left #ocaml ["User left"]
malina has quit [Ping timeout: 268 seconds]
bartholin has quit [Ping timeout: 256 seconds]
hdon has quit [Ping timeout: 256 seconds]
bartholin has joined #ocaml
gtrak has quit [Ping timeout: 264 seconds]
isd1 has quit [Ping timeout: 248 seconds]
gtrak has joined #ocaml
silver_ has quit [Read error: Connection reset by peer]
tormen_ has joined #ocaml
tormen has quit [Ping timeout: 264 seconds]
jjmeyer0 has quit [Ping timeout: 276 seconds]
mmmmmmmmmmmm[m] has joined #ocaml
wagle has quit [Read error: Connection reset by peer]
wagle has joined #ocaml
wagle has quit [Remote host closed the connection]
wagle has joined #ocaml
jao has joined #ocaml
jimmyrcom has quit [Ping timeout: 264 seconds]
wagle has quit [Remote host closed the connection]
wagle has joined #ocaml
jao has quit [Ping timeout: 260 seconds]
mbuf has joined #ocaml
letoh has quit [Ping timeout: 268 seconds]
pierpa has quit [Quit: Page closed]
nicoo has quit [Remote host closed the connection]
nicoo has joined #ocaml
pierpal has joined #ocaml
pierpal has quit [Ping timeout: 256 seconds]
<flux[m]> I think it happens so that new OCaml users don't use .mli-files but old ones do..
unyu has quit [Quit: Reboot.]
wklm has joined #ocaml
jnavila has joined #ocaml
jnavila has quit [Remote host closed the connection]
muelleme has joined #ocaml
djellemah_ has quit [Quit: Leaving]
muelleme has quit [Ping timeout: 256 seconds]
pierpal has joined #ocaml
zpe has quit [Remote host closed the connection]
zolk3ri has joined #ocaml
malina has joined #ocaml
malina has quit [Remote host closed the connection]
wklm has quit [Ping timeout: 240 seconds]
pierpal has quit [Read error: Connection reset by peer]
wklm has joined #ocaml
<steenuil> I like .mli files much more than cluttering files with pubs or publics or
<steenuil> they give you a nice overview of the public API of a module without having to see the gory details
AltGr has joined #ocaml
zolk3ri has quit [Remote host closed the connection]
pierpal has joined #ocaml
pierpal has quit [Client Quit]
pierpal has joined #ocaml
zpe has joined #ocaml
zpe has quit [Read error: Connection reset by peer]
zpe has joined #ocaml
pierpal has quit [Read error: Connection reset by peer]
wklm has quit [Ping timeout: 264 seconds]
wklm has joined #ocaml
wklm has left #ocaml [#ocaml]
hdon has joined #ocaml
pierpal has joined #ocaml
ygrek has joined #ocaml
dakk has joined #ocaml
baroud has joined #ocaml
Guest74553 has joined #ocaml
johnelse is now known as johnel_away
johnel_away is now known as johnelse
pierpal has quit [Ping timeout: 248 seconds]
mfp has joined #ocaml
<rgr[m]> flux: yup.. I very much recall my early self
<rgr[m]> A user's opinion on mli files is a very good proxy for their experience in OCaml
baroud has quit [Remote host closed the connection]
<rgr[m]> What does $ ocamlc -config | grep system say on a windows machine?
<Leonidas> I only do mli files for library code :p
<Leonidas> often I have small modules then I throw in a small sig or module type, but that's it
argent_smith has joined #ocaml
<flux[m]> mli files are a good starting point for a project. you get to compile your code with a tentative interface that's still easy to modify.
<flux[m]> and then just insert meat!
Guest74553 is now known as Haudegen
baroud has joined #ocaml
<mrvn> I do mli files for library code by editing "ocamlc -i" output
<mrvn> rgr[m]: I think mli files suck. The info should be in the ml file directly and use less duplication.
<mrvn> rgr[m]: what does that make me?
<rgr[m]> mrvn: it's only a proxy :P there are exceptions
<rgr[m]> but it's good taht you still write them for the rest of us
<mrvn> rgr[m]: I would like to just write: 'let private foo x y = x + y let public_foo = foo' and then the cmi file will have just "val public_foo : int -> int -> int" without needing an mli file.
<mrvn> similar for types but there "private" is already used so it's hard to come up with something.
<rgr[m]> so you never want to write any type signaures?
<mrvn> rgr[m]: you can write them and libraries should.
<mrvn> let (public_foo : int -> int -> int) = foo
<steenuil> that puts a lot of noise in the implementation imo
<rgr[m]> That style is something fairly similar to is done in java. Can't say I like it more...
<rgr[m]> But with great tooling it does work
<mrvn> yeah. Somethimes that looks real ugly. I'm not happy with it either.
<mrvn> But look at the overhead you have to write for a private type in a module at the moment. Or recursive modules. Or a large variant type. Too much duplication between the type and the implementation.
<rgr[m]> Duplication isn't great, but it's pretty benign b/c at least the compiler guarantees it will never go out of sync.
<rgr[m]> So while I don't love it, it's not a huge issue
<mrvn> You can cheat by putting everything in a submodule and then including the type of that.
<rgr[m]> Yup. There are workarounds when it becomes unbearable. E.g. like duplicate module type declarations
<steenuil> honestly I find it pretty hard to look at a module and understand its interface in languages like TypeScript, which work as you described
<mrvn> steenuil: then look at a generated mli file.
<steenuil> some languages don't have those
<steenuil> and a generated mli file might be much harder to read than a hand-written one
<mrvn> Ocamls generated api docs look pretty readable to me.
<mrvn> Usually I look at those and the ml files and ignore the mli completly.
webshinra has quit [Quit: Leaving]
<flux[m]> I usually ignore generated api docs and look the mli directly :)
ygrek has quit [Ping timeout: 260 seconds]
dakk has quit [Ping timeout: 264 seconds]
<zozozo> A great point of mlis as doc is that you are not constrianed by the dependencies of your functions: i.e. in the .ml a certain order is necessary because of implementation dependencies while in the mli you can re-order things to be clearer from a doc perspective
* bartholin puts dark shades on.
<bartholin> I let ocamlbuild generate .mli for me, and then I don't touch them.
* bartholin flies away.
baroud has quit [Ping timeout: 240 seconds]
inr_ has joined #ocaml
inr has quit [Ping timeout: 240 seconds]
ziyourenxiang has joined #ocaml
elfring has joined #ocaml
pierpal has joined #ocaml
tiksin[m] has joined #ocaml
malina has joined #ocaml
kakadu has joined #ocaml
hdon has quit [Ping timeout: 248 seconds]
Bronsa has joined #ocaml
baroud has joined #ocaml
hdon has joined #ocaml
pierpal has quit [Ping timeout: 264 seconds]
<rgr[m]> bartholin: you need to fly away because you're still using ocamlbuild :P
jjmeyer0 has joined #ocaml
nullifidian has quit [Remote host closed the connection]
<Drup> bartholin: it means you don't document your library
<Drup> bad bartholin!
Haudegen has quit [Read error: Connection reset by peer]
<Leonidas> https://github.com/mirage/alcotest/blob/4e99315b5ea105044fa7e0b894971961cdb38a20/src/alcotest.ml#L554 what does the (type a) mean? That syntax is quite confusing to me
steenuil has quit [Remote host closed the connection]
<Drup> Leonidas: it introduce a new rigid type variables "a" that can't be unified with any thing else
<Drup> you can think of it as "∀a"
<Leonidas> Drup: So the only difference between having 'a there is that the a leaks out and is basically a fresh type that cannot be used by anybody else?
<Drup> no, the a doesn't leak, it's replaced by a normal type variable once that function is typechecked
<Drup> the difference is that it forces the "a" to stay a abstract in the body of the function
<Leonidas> hmm, but 'a is also abstract, the body does not know what the 'a will be when called?
<Leonidas> What is its name? Maybe I can read the docs instead of asking facepalm-inducing questions :-)
<octachron> Leonidas, 'a is unification type variable: let x: 'a = 0 is perfectly valid
<octachron> (type a) is a locally abstract type variable
<octachron> they are described in the extension part of the manual for now
<Leonidas> Where all cool new things go :D
<Leonidas> thanks, these things are impossible to google for
<octachron> (( and there are also universally quantified type variable let f:'a. 'a -> 'a = fun x -> x ))
nullifidian has joined #ocaml
letoh has joined #ocaml
_andre has joined #ocaml
mbuf has quit [Quit: Leaving]
jao has joined #ocaml
ygrek has joined #ocaml
hdon has quit [Ping timeout: 248 seconds]
baroud has quit [Remote host closed the connection]
baroud has joined #ocaml
Haudegen has joined #ocaml
nullifidian has quit [Remote host closed the connection]
baroud` has joined #ocaml
baroud has quit [Ping timeout: 256 seconds]
lopex has quit []
lopex has joined #ocaml
jao has quit [Ping timeout: 240 seconds]
JSharp has quit []
JSharp has joined #ocaml
nullifidian has joined #ocaml
grandy______ has quit []
grandy______ has joined #ocaml
nullifidian has quit [Remote host closed the connection]
gtrak has quit [Ping timeout: 248 seconds]
krelix has joined #ocaml
stephe has quit []
stephe has joined #ocaml
nullifidian has joined #ocaml
zmt01 has joined #ocaml
zmt00 has quit [Ping timeout: 240 seconds]
sh0t has joined #ocaml
nullifidian has quit [Remote host closed the connection]
gtrak has joined #ocaml
tarptaeya has joined #ocaml
jimmyrcom has joined #ocaml
nullifidian has joined #ocaml
steenuil has joined #ocaml
cross has quit [Ping timeout: 264 seconds]
sh0t has quit [Ping timeout: 240 seconds]
caw_______ has quit []
caw_______ has joined #ocaml
nullifidian has quit [Remote host closed the connection]
shinnya has joined #ocaml
nullifidian has joined #ocaml
al-damiri has joined #ocaml
rjungemann has quit []
rjungemann has joined #ocaml
zolk3ri has joined #ocaml
Bronsa has quit [Remote host closed the connection]
hdon has joined #ocaml
hdon has quit [Ping timeout: 264 seconds]
cross has joined #ocaml
ygrek has quit [Ping timeout: 240 seconds]
hdon has joined #ocaml
hdon has quit [Ping timeout: 260 seconds]
sh0t has joined #ocaml
Haudegen has quit [Remote host closed the connection]
baroud` has quit [Remote host closed the connection]
Haudegen has joined #ocaml
zlsyx has joined #ocaml
sgnb has joined #ocaml
shinnya has quit [Ping timeout: 248 seconds]
nullifidian has quit [Remote host closed the connection]
BitPuffin has joined #ocaml
JeanMax has joined #ocaml
hdon has joined #ocaml
jao has joined #ocaml
sgnb has quit [Remote host closed the connection]
AltGr has left #ocaml [#ocaml]
JeanMax has quit [Remote host closed the connection]
hdon has quit [Ping timeout: 248 seconds]
muelleme has joined #ocaml
nullifidian has joined #ocaml
FreeBirdLjj has joined #ocaml
pierpal has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
pierpal has quit [Client Quit]
pierpal has joined #ocaml
pierpal has quit [Read error: Connection reset by peer]
pierpal has joined #ocaml
cow-orker has quit [Ping timeout: 260 seconds]
pierpal has quit [Read error: Connection reset by peer]
cow-orker has joined #ocaml
pierpal has joined #ocaml
Bronsa has joined #ocaml
pierpal has quit [Read error: Connection reset by peer]
pierpal has joined #ocaml
hdon has joined #ocaml
Haudegen has quit [Read error: Connection reset by peer]
Guest17193 has quit [Quit: Page closed]
zlsyx has quit [Ping timeout: 256 seconds]
zpe has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
krelix has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ziyourenxiang has quit [Ping timeout: 268 seconds]
jao has quit [Ping timeout: 246 seconds]
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
pierpal has quit [Read error: Connection reset by peer]
pierpal has joined #ocaml
pierpal has quit [Read error: Connection reset by peer]
pierpal has joined #ocaml
jnavila has joined #ocaml
krelix has joined #ocaml
krelix has quit [Max SendQ exceeded]
FreeBirdLjj has quit [Remote host closed the connection]
jnavila has quit [Ping timeout: 240 seconds]
nullifidian has quit [Remote host closed the connection]
Haudegen has joined #ocaml
zlsyx has joined #ocaml
pierpal has quit [Ping timeout: 240 seconds]
Haudegen has quit [Ping timeout: 256 seconds]
Haudegen has joined #ocaml
pierpal has joined #ocaml
malina has quit [Quit: Throwing apples of Montserrat]
malina has joined #ocaml
pierpal has quit [Ping timeout: 264 seconds]
kakadu has quit [Quit: Konversation terminated!]
jnavila has joined #ocaml
gareppa has joined #ocaml
pierpal has joined #ocaml
zmt01 has quit [Quit: Leaving]
zmt00 has joined #ocaml
gareppa has quit [Quit: Leaving]
sh0t has quit [Remote host closed the connection]
sh0t has joined #ocaml
pierpal has quit [Ping timeout: 264 seconds]
jack5638 has quit [Ping timeout: 240 seconds]
kakadu has joined #ocaml
pierpal has joined #ocaml
jack5638 has joined #ocaml
Haudegen has quit [Remote host closed the connection]
<tizoc> what is the correct way of reporting errors when using ppx_driver? I'm using Location.raise_error but the output I get is Location.Error(_) (without the message being displayed)
<tizoc> Location.raise_errorf*
pierpal has quit [Remote host closed the connection]
Haudegen has joined #ocaml
bairui_ has joined #ocaml
bairui has quit [Ping timeout: 240 seconds]
nullifidian has joined #ocaml
zolk3ri has quit [Quit: Lost terminal]
malina has quit [Quit: Throwing apples of Montserrat]
malina has joined #ocaml
malina has quit [Client Quit]
silenc3r has joined #ocaml
Jesin has joined #ocaml
elfring has quit [Quit: Konversation terminated!]
argent_smith has quit [Quit: Leaving.]
silenc3r has quit [Quit: Leaving]
gtrak has quit [Ping timeout: 240 seconds]
jnavila has quit [Remote host closed the connection]
letoh has quit [Ping timeout: 260 seconds]
spew has joined #ocaml
_andre has quit [Quit: leaving]
tarptaeya has quit [Quit: Konversation terminated!]
Jesin has quit [Quit: Leaving]
isd has joined #ocaml
zlsyx has quit [Remote host closed the connection]
pierpal has joined #ocaml
spew has quit [Ping timeout: 264 seconds]
pierpa has joined #ocaml
spew has joined #ocaml
gtrak has joined #ocaml
zpe has joined #ocaml
zpe has quit [Remote host closed the connection]
gtrak has quit [Ping timeout: 240 seconds]
gtrak has joined #ocaml
muelleme has quit [Ping timeout: 260 seconds]
rwmjones has quit [Ping timeout: 264 seconds]
sh0t has quit [Remote host closed the connection]
stux|RC-- has joined #ocaml
Bronsa has quit [Ping timeout: 240 seconds]
stux|RC has quit [Ping timeout: 255 seconds]
shinnya has joined #ocaml
gtrak has quit [Ping timeout: 260 seconds]
kakadu has quit [Remote host closed the connection]
unyu has joined #ocaml
domanic has joined #ocaml
muelleme has joined #ocaml
Haudegen has quit [Remote host closed the connection]
spew has quit [Read error: Connection reset by peer]
domanic has quit [Ping timeout: 256 seconds]
isd has quit [Ping timeout: 264 seconds]
domanic has joined #ocaml
bairui_ is now known as bairui