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
jimmyrcom has joined #ocaml
spew has quit [Read error: Connection reset by peer]
sillyotter has joined #ocaml
ahf has quit [Quit: Bye.]
sillyotter has quit [Quit: WeeChat 1.9.1]
sh0t has quit [Remote host closed the connection]
infinity0 has quit [Ping timeout: 256 seconds]
infinity0 has joined #ocaml
FreeBirdLjj has joined #ocaml
ziyourenxiang has quit [Ping timeout: 240 seconds]
ahf_ is now known as ahf
jao has quit [Ping timeout: 256 seconds]
al-damiri has quit [Quit: Connection closed for inactivity]
FreeBirdLjj has quit [Remote host closed the connection]
dtornabene has joined #ocaml
am55 has quit [Quit: am55]
kbit has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
zolk3ri has quit [Remote host closed the connection]
kbit has joined #ocaml
isd has quit [Quit: Leaving.]
spew has joined #ocaml
spew has quit [Read error: Connection reset by peer]
mfp has quit [Ping timeout: 252 seconds]
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 240 seconds]
maattdd_ has joined #ocaml
FreeBirdLjj has joined #ocaml
maattdd_ has quit [Ping timeout: 240 seconds]
FreeBirdLjj has quit [Ping timeout: 256 seconds]
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 252 seconds]
govg has joined #ocaml
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 256 seconds]
kbit has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
kbit has joined #ocaml
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 240 seconds]
FreeBirdLjj has joined #ocaml
SiGe has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 240 seconds]
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 276 seconds]
mbuf has joined #ocaml
pd2000 has joined #ocaml
pd2000 has quit [Ping timeout: 256 seconds]
kbit has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
kbit has joined #ocaml
gtrak has quit [Ping timeout: 256 seconds]
gtrak has joined #ocaml
dtornabene_ has joined #ocaml
dtornabene has quit [Ping timeout: 268 seconds]
dtornabene_ has quit [Remote host closed the connection]
dtornabene_ has joined #ocaml
dtornabene_ has quit [Read error: Connection reset by peer]
dtornabene has joined #ocaml
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 268 seconds]
dtornabene has quit [Remote host closed the connection]
dtornabene has joined #ocaml
SiGe has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 260 seconds]
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 240 seconds]
MercurialAlchemi has joined #ocaml
pierpa has quit [Quit: Page closed]
<_xvilka_> hi
<_xvilka_> what is the best way to define enum in OCaml? I am writing a wrapper for C library and want to use nice errors representations inside like "match errno with | Error_success -> ...", but Error_success is 0 for example
<_xvilka_> how to define C-like enumeration in OCaml?
<ousado> _xvilka_: that looks like it might help you to decide: https://www.linux-nantes.org/~fmonnier/OCaml/ocaml-wrapping-c.html#ref_enums
<_xvilka_> ousado: oh, it uses C stubs, I am using Ctypes library
kbit has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<ousado> doesn't really matter in this case, does it
kbit has joined #ocaml
<_xvilka_> ousado: it does matter, since I need to be sure that Error_success is 0, not some any other value
<ousado> ocamls internal representation doesn't change with the mechanism you use to interface with C
<_xvilka_> or you mean wrap it with OCaml function converting from integer to my custom type every time?
<ousado> a flat ADT is just that - an integer
<ousado> starting at 0
<ousado> so yeah, for representing C enums in ocaml, I'd absolutely use ADTs
<ousado> for certain enums, that don't start at 0 or skip values, etc. you'll need some minimal processing, of course
<ousado> and in some cases, when the actual values are used in computations like bit fiddling or whatever, that should have equivalent semantics on the ocaml side, you maybe want to use something else
<_xvilka_> I see
<_xvilka_> thank you
pierpa has joined #ocaml
FreeBirdLjj has joined #ocaml
pd2000 has joined #ocaml
<_xvilka_> ok, but how to convert the integer to that variant type?
Haudegen has joined #ocaml
<_xvilka_> without gigantic pattern matching, just converting the value directly
FreeBirdLjj has quit [Ping timeout: 256 seconds]
pd2000 has quit [Ping timeout: 256 seconds]
FreeBirdLjj has joined #ocaml
<ousado> _xvilka_: you mean from the C-side to the ocaml side?
<Armael> _xvilka_: I assume you are not using Cstubs_struct
FreeBirdLjj has quit [Ping timeout: 240 seconds]
<Armael> In that case you have to either write by hand conversions functions between your variant type and int
<Armael> Or you can use ppx_deriving enum to generate these conversion functions
dakk has joined #ocaml
<ousado> and deriving, yes..
FreeBirdLjj has joined #ocaml
cbot has quit [Quit: Leaving]
mk9 has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 265 seconds]
<ousado> .. and still, you could just use the appropriate integer type for the enum in ctypes itself, and then use the knowledge that the internal representation of flat ADTs is exactly that of integers in ocaml
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 252 seconds]
mk9 has quit [Quit: mk9]
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 276 seconds]
<_xvilka_> Armael: thx
<_xvilka_> ousado: yeah, have a function returning errno as an integer, want to provide a nice error names in a wrapper
<_xvilka_> Armael: deriving enum is exactly what I need
pd2000 has joined #ocaml
mk9 has joined #ocaml
gentauro has quit [Ping timeout: 256 seconds]
gentauro has joined #ocaml
argent_smith has joined #ocaml
mk9 has quit [Quit: mk9]
tarptaeya has joined #ocaml
FreeBirdLjj has joined #ocaml
tsani has quit [Ping timeout: 260 seconds]
FreeBirdLjj has quit [Ping timeout: 256 seconds]
tsani has joined #ocaml
<Armael> ousado: this is if you use cstubs_struct
<rgr[m]> Is there a way to apply a functor to a signature to get another signature in an .mlI?
<Armael> Drup: ^ :D
<rgr[m]> E.g. something like module type of Make(X)
<rgr[m]> But without actually having X defined as well
<Armael> I was wondering the same thing yesterday
<rgr[m]> Drup: halp
<Armael> the answer is you can't, I think
<Armael> at least, how would that work if X appears in the return signature of Make?
<rgr[m]> ah, but my X wouldn't introduce any new types. E.g. it would be something like X with type t = string or w/e
<rgr[m]> But yeah, that does sound suspicious
<rgr[m]> Leonidas: nice you're taking over zmq?
gentauro has quit [Ping timeout: 256 seconds]
kbit has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<ousado> Armael: hmm?
FreeBirdLjj has joined #ocaml
johnelse has joined #ocaml
<ousado> what are you referring to with 'this' in that sentence?
tane_ has joined #ocaml
kbit has joined #ocaml
tane_ is now known as tane
<ousado> I still don't know what you're referring to :) anyway - the internal representation of flat ADTs is exactly the same as unboxed ocaml integers, that's true for at least native, bytecode and js_of_ocaml, not sure about bucklescript, but I'd be surprised if it was different there, as they pay attention to not break Obj.magic and friends
FreeBirdLjj has quit [Ping timeout: 248 seconds]
gentauro has joined #ocaml
<Armael> there are differents setups when writing bindings with ctypes
<Armael> the function that is added in this PR is only available when doing stub generation for structure definition bindings, aka Cstubs_struct https://github.com/ocamllabs/ocaml-ctypes/tree/master/examples/cstubs_structs
<Armael> in that case, there's a setup in several steps where ctypes generates C and ML code to check statically that the bindings descriptions of the structure match the reality, and automatically compute the offsets and alignments
FreeBirdLjj has joined #ocaml
<Armael> if you're using a more dynamic setup (eg by simply dynlinking the C library), this is not possible and you cannot use Cstubs_struct.enum -- you have to write conversions function by hand
<ousado> be that as it may - we're talking about flat ADTs here
<Armael> and if you mess up these functions (or if the definitions of the library change behind your back) then your bindings will crash
<Armael> yes.
<Armael> you can replace "struct" by "enum" in my explanation above
<ousado> nope
<Armael> what
<Armael> *shrug*
<ousado> enums are integers
FreeBirdLjj has quit [Ping timeout: 252 seconds]
<Armael> ...yes
<ousado> .. yes, and if you know how to get an int from C to ocaml, using ctypes, or whatever other mechanism, helper, etc. under the sun, that's all you need to translate into a flat ocaml ADT
pd2000 has quit [Read error: Connection reset by peer]
pd2000 has joined #ocaml
<Leonidas> rgr[m]: Well, I am working at the company, so sort-of. But I'll add you and hcarty anyway :-)
AltGr has joined #ocaml
pd2000 has quit [Ping timeout: 240 seconds]
FreeBirdLjj has joined #ocaml
<Leonidas> rgr[m]: I very much appreciate your help on it and we'd like to make this project as open as possible
FreeBirdLjj has quit [Ping timeout: 240 seconds]
ziyourenxiang has joined #ocaml
dtornabene has quit [Remote host closed the connection]
pd2000 has joined #ocaml
FreeBirdLjj has joined #ocaml
ygrek has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 260 seconds]
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 276 seconds]
jao has joined #ocaml
zpe has quit [Remote host closed the connection]
jao has quit [Ping timeout: 276 seconds]
FreeBirdLjj has joined #ocaml
zpe has joined #ocaml
kakadu has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 268 seconds]
<Leonidas> in the light of changes on opam2, how would one specify version constraints on a package?
<Leonidas> s/package/compiler/
<Leonidas> is available: [ ocaml-version >= "4.03" ] still the way to go?
<octachron> since compiler are package in opam2, you should specify the dependency as a normal package dependendency
FreeBirdLjj has joined #ocaml
<Leonidas> octachron: I assume since my opam file is 1.2 format, it gets automatically translated into a normal depencency by opam2. Is this correct?
<octachron> I think so
FreeBirdLjj has quit [Ping timeout: 255 seconds]
zpe has quit [Remote host closed the connection]
<Leonidas> rgr[m]: you should have received an invite
Haudegen has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 256 seconds]
pd2000 has quit [Ping timeout: 256 seconds]
pd2000 has joined #ocaml
mfp has joined #ocaml
barcabuona has quit [Ping timeout: 260 seconds]
AltGr has left #ocaml [#ocaml]
FreeBirdLjj has joined #ocaml
<rgr[m]> Leonidas: I did. Thanks.
FreeBirdLjj has quit [Ping timeout: 268 seconds]
pd2000 has quit [Ping timeout: 265 seconds]
pd2000 has joined #ocaml
am55 has joined #ocaml
FreeBirdLjj has joined #ocaml
spew has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 248 seconds]
FreeBirdLjj has joined #ocaml
shinnya has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 252 seconds]
zpe has joined #ocaml
zolk3ri has joined #ocaml
pd2000 has quit [Ping timeout: 276 seconds]
pd2000 has joined #ocaml
p_d has joined #ocaml
pd2000 has quit [Ping timeout: 256 seconds]
FreeBirdLjj has joined #ocaml
AltGr has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 260 seconds]
snhmib has joined #ocaml
pd_2000 has joined #ocaml
_andre has joined #ocaml
p_d has quit [Ping timeout: 260 seconds]
snhmib has quit [Ping timeout: 240 seconds]
snhmib has joined #ocaml
FreeBirdLjj has joined #ocaml
snhmib has quit [Ping timeout: 252 seconds]
FreeBirdLjj has quit [Ping timeout: 256 seconds]
shinnya has quit [Ping timeout: 256 seconds]
gtrak has quit [Ping timeout: 240 seconds]
snhmib has joined #ocaml
<Leonidas> rgr[m]: thanks for your PR :) Having both Lwt and Async bindings in there would be fantastic.
baboum has joined #ocaml
snhmib has quit [Quit: WeeChat 1.6]
johnelse has quit [Ping timeout: 260 seconds]
FreeBirdLjj has joined #ocaml
TarVanimelde has joined #ocaml
buyfn has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 256 seconds]
<remix2000> reynir: Some packages fail to compile. :'( https://gist.github.com/remi6397/06092870f915ba555e6bcea0666651ae
<zozozo> octachron: about ocaml as a normal package, does that mean that one should put "ocaml" as a dependency even if there is no version requirement, or does opam still suppose every package depends on the compiler ?
<remix2000> reynir: I also want to clarify that I am not gildor, and I'm not french ("programmation").
<rgr[m]> Leonidas: Yeah, OCaml is a perfect language for using zmq btw. Fast, type safe, native :P
TarVanimelde has quit [Quit: TarVanimelde]
pd_2000 has quit [Ping timeout: 240 seconds]
p_d has joined #ocaml
<dmbaturin> zozozo: You only need to specify it the version matters.
spew has quit [Read error: Connection reset by peer]
<Leonidas> rgr[m]: Yesterday I looked at running OCaml on AWS Lambda and to do that one has to implement gobs (Rob Pike's answer to Googles Protocol Buffers) and Go rpc :( Wish they used something different, literally *anything* would've been better.
<octachron> zozozo, I think that, theoretically, it would be nicer to add ocaml as dependency for people using switch with no compiler installed
<rgr[m]> companion_cube: I hope you've given up on nanomsg btw
<dmbaturin> In the big picture, considering that some platforms still have ocaml 3.x in their default repos, and some people are just using older versions, it's probably a good idea to figure out the oldest version your code actually will compile with. :)
<rgr[m]> Leonidas: Hmm. why is that? I actually ran OCaml on Lambda before and don't remember any of that being necessary.
sveit has quit [Ping timeout: 256 seconds]
<dmbaturin> Hhm... Are there already any tools to automate ocaml version compatibility checks?
<rgr[m]> That was almost a couple of years ago however. I think i might have been one of the first users of OCaml on lambda
<zozozo> dmbaturin: sure, I was just thinking theoretically, ^^
<rgr[m]> PR's to opam-repository should build on all version of OCaml one claims to support
<zozozo> dmbaturin: for automated version compatibility check, there's always opam's CI, :p
<dmbaturin> rgr[m]: Yes, I meant more like static analysis tools that could tell it without compiling. I wonder if I should attempt to make one.
<Leonidas> rgr[m]: you can run it using a nodejs shim or apex/up but I'd like to do it "properly", without depending on various crutches
<rgr[m]> I actually disagree with spending time on figuring this stuff out. The burden of supporting old versions should go on the users of such versions.
<dmbaturin> Sound like a fun sort of project.
FreeBirdLjj has joined #ocaml
<rgr[m]> Leonidas: yes, i had a node shim
<dmbaturin> Leonidas: Quite surprising since Rob Pike is at google.
ahf has quit [Remote host closed the connection]
<dmbaturin> Well, it's even more surprising that he did that NIH thing at google, than that amazon chose to use it.
<Leonidas> dmbaturin: not really since he seems to think people at google are dumb ;-)
sveit has joined #ocaml
<dmbaturin> Their acceptance of Go makes me think he may be right. ;)
<dmbaturin> Right for the wrong reasons, so to speak.
<Leonidas> rgr[m]: the other possibility would be jsoo via node, also an option :)
<rgr[m]> grpc is another thing we sorely lack in OCaml :P
<Leonidas> remix2000: looks like your (or gildors) is too new
<Leonidas> yes, lets have more ways to do slight pointless variations on msgpack!
FreeBirdLjj has quit [Ping timeout: 240 seconds]
ahf has joined #ocaml
sh0t has joined #ocaml
johnelse has joined #ocaml
<dmbaturin> rgr[m]: Well, I've been on both sides. As a packager, I really want build scripts (or documentation) to tell about missing dependencies rather than make me decipher compilation errors. As a developer I hate doing that, but I want to save people frustration when building it.
mbuf has quit [Quit: Leaving]
<rgr[m]> That would be nice, but I'm not advocating for shitty error messages. Just for people to favor strict constraints and recent versions
<rgr[m]> Since I see a lot of maintainer effort being thrown into the void supporting things like 4.01.0.
<dmbaturin> Oh, I'm not talking about _supporting 4.01.0, just about specifying correctly that it will not build with anything older than 4.02 (or whatever else).
FreeBirdLjj has joined #ocaml
<rgr[m]> Leonidas: well grpc lets you define a schema using protobufs, so it ends up being much easier to do multi language rpc with it in practice.
<rgr[m]> msgpack seems more of a binary json replacement to me
gpietro has joined #ocaml
sh0t has quit [Read error: Connection reset by peer]
FreeBirdLjj has quit [Ping timeout: 256 seconds]
ygrek has quit [Ping timeout: 240 seconds]
pierpa has quit [Ping timeout: 260 seconds]
p_d has quit [Ping timeout: 240 seconds]
dhil has joined #ocaml
am55 has quit [Quit: am55]
baboum has quit [Ping timeout: 256 seconds]
baboum has joined #ocaml
trochdewei has joined #ocaml
<zolk3ri> /2/2
<zolk3ri> ffs
<Drup> rgr[m]: "module F (struct module type S = ... end) = struct module type T = ... end"
<Drup> You can write a functor that takes a module containing a signature and return a module containing a signature
<Drup> that's the only way you can write functors on signatures
Onemorenickname has joined #ocaml
jimt has quit [Quit: leaving]
jimt has joined #ocaml
gpietro has quit [Ping timeout: 256 seconds]
baboum has quit [Ping timeout: 256 seconds]
buyfn has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
gentauro has quit [Ping timeout: 240 seconds]
gentauro has joined #ocaml
baboum has joined #ocaml
orbitz_ has quit [Quit: Reconnecting]
orbitz has joined #ocaml
<companion_cube> rgr[m]: yeah… I still have legacy toy code that uses it, but don't expect no maintenance
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 248 seconds]
<Leonidas> rgr[m]: but from what I read gobs is basically like binary JSON aka msgpack
baboum has quit [Ping timeout: 265 seconds]
<companion_cube> rgr[m]: also I use zmq for jupyter stuff
gtrak has joined #ocaml
gtrak has quit [Ping timeout: 248 seconds]
kbit has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
kbit has joined #ocaml
gtrak has joined #ocaml
<Leonidas> iocaml was using zmq too
<companion_cube> well I'm deriving from it
<companion_cube> it's "jupyter-kernel" on opam, and it uses lwt-zmq instead of threads ;)
<companion_cube> (but it doesn't have ocaml as a kernel, it's just the library for writing kernels)
<Drup> the zoo of libraries for these notebooks is a bit confusing, tbh
dhil has quit [Ping timeout: 252 seconds]
<companion_cube> well iocaml should rely on jupyter-kernel, in the future, ideally
gpietro has joined #ocaml
gpietro has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
sh0t has joined #ocaml
<Leonidas> rgr[m]: looks like sexp_opaque is not in v0.9
<rgr[m]> Leonidas: yeah, that's pesky. Oh well, we might as well just stick to 4.04 for async-zmq
<rgr[m]> zmq-async I mean
<rgr[m]> I don't think there's an issue for zmq and zmq-async supporting different minimum ocaml versions, right?
<Leonidas> rgr[m]: I'm a bit confused because it did exist in Core 11x., since RWO even mentions it.
<Leonidas> rgr[m]: apart from being a bit unexpected, not really.
<Leonidas> rgr[m]: could you add a note in the readme that async-support is only in 4.04 and up?
<rgr[m]> Leonidas: it's not enough to just add it to the opam file?
<Leonidas> rgr[m]: We discussed this already, so I would do the same https://github.com/issuu/ocaml-zmq/pull/46#discussion_r172473622
<Leonidas> since there is nothing about zmq-async specifically which requires 4.04+ language features
cross has joined #ocaml
<rgr[m]> Leonidas: I'll update the README more thoroughly after hcarty submits his lwt bindings.
<rgr[m]> We'll describe the sub libraries then
<Leonidas> rgr[m]: sgtm
<Leonidas> rgr[m]: is there some kind of roadmap to that? I'm wondering whether it would make sense to make a release before that.
<rgr[m]> I'd expect it to be in the upcoming few days
<companion_cube> I'm surprised some people ask for >= 4.04
<companion_cube> 4.03, I can understand, but 4.04 ?
<Leonidas> 4.04.1 even
<alicemaz> does base... remove polymorphic equality operator? seems to redefine = from a -> a -> bool to int -> int -> bool
p_d has joined #ocaml
<alicemaz> ahh ok, ty
Jesin has joined #ocaml
pd_2000 has joined #ocaml
p_d has quit [Ping timeout: 256 seconds]
zolk3ri has quit [Ping timeout: 240 seconds]
<Leonidas> I am not quite sure why it ises Int.(=) though, that seems a bit arbitrary?
<octachron> Int seems like a good choice amongst predefined types
<Leonidas> octachron: It could also return `Probably_you_dont_want_polymorphic_equality, as Jane Street does in Async with Printf.printf
cmk_zzz_ has quit [Ping timeout: 276 seconds]
<flux[m]> and have a good operator go to waste.. ?-)
<Leonidas> Int.(1 = 1)?
<flux[m]> I don't think it's a bad idea to make a choice. obviously 1 = 1 is much more succinct way to express the same thing, and of non-polymorphic values we compare in ocaml, I think integers are highly represented
<flux[m]> ie. string, float, char and bool-comparisons are all probably less common, at least that's my feeling
MercurialAlchemi has quit [Ping timeout: 260 seconds]
<Leonidas> I match on ints instead :p
<Leonidas> btw, what does the [m] mean? Is it the MirageOS clan? :)
<alicemaz> I found a blog post explaining their reasoning and can sorta agree with it
<Armael> the matrix clan, I believe
<flux[m]> matrix. I'm using the matrix-irc bridge for this account.
<Leonidas> alicemaz: can you send the link?
pitastrudl has quit [Remote host closed the connection]
p_d has joined #ocaml
<flux[m]> ..with 13 other forefronting people here!
pd_2000 has quit [Ping timeout: 268 seconds]
<alicemaz> since = just recursively descends a data structure it generates the wrong result on things not uniquely represented by their data structures, eg sets, and since this is implemented with compiler magic there isn't much to be done about it
<jpdeplaix> Leonidas: int is the most used type when polymorphic comparaisons/operators are involved
<flux[m]> I think it would have been a nice alternative approach to add the ability to hook (=) from ocaml as well (as it is possible to do from C)
<flux[m]> but I guess there was general dislike for magic like that ;)
<Leonidas> alicemaz: oh, I am not denying the fact that polymorphic equality is bad, I just find the choice of Int.(=) to be promoted to (=) a bit… arbitrary
<flux[m]> and you never (statically) know wheren you find a non-compareable value
<alicemaz> I think polymorphic compare is good, but I come from haskell, so :P
<Leonidas> haskell has Eq though
<companion_cube> which makes a huge difference
<Leonidas> modular implicit (=) will solve all our problems!
cmk_zzz has joined #ocaml
<alicemaz> I am very much hoping for modular implicits (as are many I gather, I started on ocaml like two days ago but have already noticed "where are my typeclasses" is a bit of a meme)
<jpdeplaix> yes but in the meantime… :/
<Leonidas> hmm, github now promotes adding CONTRIBUTING.md and Codes of Conduct to repositories. Hmm.
<companion_cube> in the meantime, let's all follow jpdeplaix on the monomorphic path
<jpdeplaix> !! :)
<Leonidas> the hope for modular implicits is the thing that makes me get out of bed in the morning
<Armael> good, you'll be able to get out of bed for still quite some time then
<jpdeplaix> :D
<companion_cube> :D
<Leonidas> :D
pd_2000 has joined #ocaml
pitastrudl has joined #ocaml
zolk3ri has joined #ocaml
p_d has quit [Ping timeout: 268 seconds]
al-damiri has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
pd_2000 has quit [Quit: There's nothing dirtier than a giant ball of oil]
AltGr has left #ocaml [#ocaml]
AltGr has joined #ocaml
dhil has joined #ocaml
FreeBirdLjj has joined #ocaml
zolk3ri has quit [Remote host closed the connection]
zolk3ri has joined #ocaml
AltGr has left #ocaml [#ocaml]
vodkaInferno has quit [Read error: Connection reset by peer]
vodkaInferno has joined #ocaml
gentauro has quit [Ping timeout: 260 seconds]
AltGr has joined #ocaml
Jesin has quit [Quit: Leaving]
dxtr has quit [Changing host]
dxtr has joined #ocaml
zlsyx has joined #ocaml
gentauro has joined #ocaml
johnelse has quit [Ping timeout: 240 seconds]
jimmyrcom has quit [Ping timeout: 260 seconds]
baboum has joined #ocaml
bruce_r has joined #ocaml
p_d has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
ziyourenxiang has quit [Ping timeout: 245 seconds]
FreeBirdLjj has quit [Ping timeout: 240 seconds]
dakk has quit [Remote host closed the connection]
spew has joined #ocaml
<spew> what's the preferred style for a match expression on the rhs of a pattern match?
<Armael> it's highly recommended to wrap it with begin .. end
<spew> I've been doing "Foo foo -> (match some_fn foo with ...)" but I was thinking about switching to begin/end
<Armael> yeah begin end is a bit nicer I think
p_d has quit [Quit: Friends help you move. Real friends help you move bodies.]
<companion_cube> it's more visible
<spew> I agree, thanks
bruce_r has quit [Ping timeout: 240 seconds]
syamaoka has quit [Ping timeout: 268 seconds]
AltGr has left #ocaml [#ocaml]
isd has joined #ocaml
bruce_r has joined #ocaml
jnavila has joined #ocaml
baboum has quit [Quit: WeeChat 2.0.1]
zpe has quit [Remote host closed the connection]
zpe has joined #ocaml
elfring has joined #ocaml
jnavila has quit [Ping timeout: 240 seconds]
jnavila has joined #ocaml
SegFaultAX has joined #ocaml
johnelse has joined #ocaml
kakadu has quit [Quit: Konversation terminated!]
jnavila has quit [Ping timeout: 265 seconds]
jnavila has joined #ocaml
johnelse has quit [Read error: Connection reset by peer]
andreas_ has joined #ocaml
johnelse has joined #ocaml
jnavila has quit [Ping timeout: 240 seconds]
dhil has quit [Ping timeout: 240 seconds]
kbit has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<Leonidas> I hate it and avoid begin/end, but I'm the minority
<Leonidas> begin/end is nice for calculations though: begin 1 + begin 3 + 5 end * 4 end.
<Leonidas> usually I try to unnest so I don't have nested matches :/
jnavila has joined #ocaml
kbit has joined #ocaml
leah2 has quit [Ping timeout: 265 seconds]
trochdewei has quit [Remote host closed the connection]
isd has quit [Quit: Leaving.]
<Armael> Leonidas: what
<Armael> >begin 1 + begin 3 + 5 end * 4 end
mankyKitty has quit [Read error: Connection reset by peer]
<spew> Leonidas: it's like you use begin/end and () exactly the opposite of how they are intended
mankyKitty has joined #ocaml
cbarrett has quit [Ping timeout: 240 seconds]
<Leonidas> the bit about arithmethics was a bit trolling to point out how subjective it all is.
cbarrett has joined #ocaml
<bruce_r> I like to use begin/end as a signal/reminder that something imperative is going on
<Leonidas> bruce_r: come to think of it, yeah, I could subscribe to the practice
<bruce_r> A lof of people do let () = a () in let () = b () in c (). I don't like it, I feel like it tries to hide the side effects. I like better `begin a(); b (); c ()`
<bruce_r> ...end
<Leonidas> but for that you don't need begin and end to begin with
<bruce_r> right, say that code was in a pattern matching branch of some sort
<bruce_r> for example
<bruce_r> or some place where you need it...
cbot has joined #ocaml
barcabuona has joined #ocaml
viry has joined #ocaml
viry has left #ocaml ["WeeChat 1.6"]
Onemorenickname_ has joined #ocaml
Onemorenickname has quit [Ping timeout: 248 seconds]
kakadu has joined #ocaml
leah2 has joined #ocaml
isd has joined #ocaml
silenc3r has joined #ocaml
isd has quit [Ping timeout: 240 seconds]
tvlt has joined #ocaml
<tvlt> Hello
ln5 has joined #ocaml
isd has joined #ocaml
tvlt has quit [Quit: Page closed]
SiGe has joined #ocaml
<SiGe> Hey guys. Is it possible to make the build process provide some sort of backtrace of why there is a type error? I.e., where is the origin of the caller, etc. I am following the Kaleidoscope tutorial (LLVM) and passed the wrong number of arguments to one of the functions but was getting an error in a totally different part of the code.
am55 has joined #ocaml
barcabuona has quit [Quit: WeeChat 2.0.1]
<ln5> i'm trying to |topkg build| a program which is a verbatim copy of the client example in https://github.com/avsm/ocaml-cohttp but fail at what seems to be teh linking stage: "Error: No implementations provided for the following modules" listing Cohttp_lwt_unix__, Cohttp_lwt__ and Cohttp__
<ln5> note the double underscores
<SiGe> Just to be more clear, here's the code and the error: https://gist.github.com/anonymous/d378c2c1afe0576f5c5c4e93b24ffcd7
<SiGe> I somehow wanted to trace back to line 31 - but the error was too cryptic for me to do that.
<Leonidas> SiGe: not really. What I find often useful is to constrain the types of functions, so whenever the type inference disagrees with me we can sort it out behind the shed directly.
<SiGe> Leonidas: Ah, that makes a lot of sense. Just to rephrase add the signature of each function, correct?
<Leonidas> SiGe: Exactly!
<SiGe> Thanks!
<Leonidas> HTH :)
baboum has joined #ocaml
<octachron> ln5, can you check your version of jbuilder?
gentauro has quit [Ping timeout: 240 seconds]
gentauro has joined #ocaml
isd has quit [Ping timeout: 255 seconds]
jnavila has quit [Ping timeout: 256 seconds]
SiGe has quit [Remote host closed the connection]
andreas_ has quit [Quit: Connection closed for inactivity]
<ln5> octachron: is jbuilder involved? i thought topkg invoked ocmalbuild. i do have jbuilder installed though, version 1.0+beta18.
<octachron> ln5, there is a bug with beta18, that makes it forget to install some modules
<ln5> ah oh! my dependencies, i see.
<ln5> this makes sense
<octachron> you should pin to beta17: "opam pin add jbuilder 1.0+beta17"
<octachron> and then reinstall cohttp
<ln5> yay. not linking yet but at least the error is moving!
bruce_r has quit [Ping timeout: 240 seconds]
Onemorenickname has joined #ocaml
<octachron> ln5, if you are using unix modules, you probably need cohttp.unix as a dependency
<ln5> i've got package(cohttp cohttp-lwt-unix) in _tags and opam
Onemorenickname_ has quit [Ping timeout: 268 seconds]
<ln5> compiling (and linking) the server example code from the same page succeeds without errors now at least. the client part is probably my bad.
<ln5> how would i've debugged this properly? what do i have now that i didn't when installing cohttp using beta18?
jnavila has joined #ocaml
tane has quit [Quit: Leaving]
jnavila has quit [Remote host closed the connection]
Jesin has joined #ocaml
<ln5> octachron: thank you for your very timely and helpful response. i was even more at loss than usual this time.
<octachron> ln5, basically, the Cohttp__ module is an interface-only module, jbuilder's beta18 stopped to install the implementation file corresponding to this interface, because it was not needed when using jbuilder but this impacted other build systems that did not use the same compiler flags by default
_andre has quit [Quit: leaving]
tarptaeya has quit [Quit: Leaving]
elfring has quit [Quit: Konversation terminated!]
silenc3r has quit [Quit: Leaving]
zpe has quit [Ping timeout: 268 seconds]
bruce_r has joined #ocaml
govg has quit [Ping timeout: 268 seconds]
am55 has quit [Quit: am55]
richi235 has quit [Quit: No Ping reply in 180 seconds.]
richi235 has joined #ocaml
Jesin has quit [Quit: Leaving]
am55 has joined #ocaml
Jesin has joined #ocaml
<ln5> octachron: thanks
Jesin has quit [Quit: Leaving]
Jesin has joined #ocaml
orbifx has joined #ocaml
navaja has joined #ocaml
<nicoo> octachron: Thanks, I tried helping ln5 but that got me stumped for a while
navaja has quit [Ping timeout: 260 seconds]
argent_smith has quit [Quit: Leaving.]
shinnya has joined #ocaml
gtrak has quit [Ping timeout: 240 seconds]
jao has joined #ocaml
baboum has quit [Quit: WeeChat 2.0.1]
kbit has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
kbit has joined #ocaml
kakadu has quit [Remote host closed the connection]
zolk3ri has quit [Remote host closed the connection]
am55 has quit [Quit: am55]
jimt_ has joined #ocaml
jimt has quit [Ping timeout: 268 seconds]