ChanServ changed the topic of #ocaml to: Discussions about the OCaml programming language | http://www.ocaml.org | OCaml 4.02.1 announcement at http://ocaml.org/releases/4.02.html | Public channel logs at http://irclog.whitequark.org/ocaml
rgrinberg has quit [Quit: Leaving.]
Simn has quit [Quit: Leaving]
yminsky has joined #ocaml
reem has quit [Remote host closed the connection]
reem has joined #ocaml
rgrinberg has joined #ocaml
reem has quit [Remote host closed the connection]
reem has joined #ocaml
yminsky has quit [Quit: yminsky]
ontologiae_ has quit [Ping timeout: 250 seconds]
reem has quit [Remote host closed the connection]
yminsky has joined #ocaml
yminsky has quit [Client Quit]
yminsky has joined #ocaml
AltGr has joined #ocaml
reem has joined #ocaml
reem has quit [Remote host closed the connection]
reem has joined #ocaml
ollehar1 has joined #ocaml
reem has quit [Remote host closed the connection]
madroach has quit [Ping timeout: 264 seconds]
madroach has joined #ocaml
reem has joined #ocaml
mort___ has quit [Quit: Leaving.]
segmond has quit [Ping timeout: 265 seconds]
ollehar1 has quit [Quit: ollehar1]
yminsky has quit [Quit: yminsky]
nullcat_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
yminsky has joined #ocaml
nullcat_ has joined #ocaml
segmond has joined #ocaml
lordkryss has quit [Quit: Connection closed for inactivity]
antkong has joined #ocaml
oriba has quit [Quit: oriba]
nullcat_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Intensity has joined #ocaml
antkong has quit [Ping timeout: 252 seconds]
shinnya has quit [Ping timeout: 244 seconds]
vanila has quit [Quit: Leaving]
struktured has joined #ocaml
contempt has quit [Ping timeout: 252 seconds]
yminsky has quit [Quit: yminsky]
yminsky has joined #ocaml
segmond has quit [Ping timeout: 264 seconds]
TheCommieDuck has quit [Read error: Connection reset by peer]
yminsky has quit [Client Quit]
contempt has joined #ocaml
ghostpl_ has joined #ocaml
pyon-ted-type is now known as [boxed-pyon]
ghostpl_ has quit [Ping timeout: 252 seconds]
segmond has joined #ocaml
darkf has joined #ocaml
waneck has quit [Ping timeout: 245 seconds]
keen__________75 has quit [Read error: Connection reset by peer]
BitPuffin has quit [Ping timeout: 256 seconds]
keen__________75 has joined #ocaml
reem has quit [Remote host closed the connection]
rgrinberg has quit [Read error: Connection reset by peer]
rgrinberg has joined #ocaml
reem has joined #ocaml
waneck has joined #ocaml
psy has quit [Ping timeout: 246 seconds]
manud_ has joined #ocaml
ygrek has joined #ocaml
manud has quit [Ping timeout: 264 seconds]
manud_ is now known as manud
rgrinberg has quit [Quit: Leaving.]
rgrinberg has joined #ocaml
Jefffrey has quit [Read error: No route to host]
Jefffrey has joined #ocaml
badon has quit [Ping timeout: 252 seconds]
badon_ has joined #ocaml
badon_ is now known as badon
yomimono has quit [Ping timeout: 245 seconds]
reem has quit [Remote host closed the connection]
jbrown has quit [Ping timeout: 252 seconds]
rgrinberg1 has joined #ocaml
hilquias` has quit [Ping timeout: 255 seconds]
rgrinberg has quit [Ping timeout: 256 seconds]
ghostpl_ has joined #ocaml
ghostpl_ has quit [Ping timeout: 256 seconds]
reem has joined #ocaml
rgrinberg1 has quit [Quit: Leaving.]
rgrinberg has joined #ocaml
dav__ has quit [Ping timeout: 244 seconds]
ned has joined #ocaml
ned is now known as Guest7037
ned- has quit [Ping timeout: 246 seconds]
dav has joined #ocaml
manud has quit [Quit: manud]
ygrek has quit [Ping timeout: 256 seconds]
ebzzry has quit [Remote host closed the connection]
ebzzry has joined #ocaml
Guest7037 is now known as ned
mcc has joined #ocaml
reem has quit [Remote host closed the connection]
dsheets_ has quit [Ping timeout: 252 seconds]
AlexRussia has quit [Ping timeout: 252 seconds]
Algebr has quit [Ping timeout: 240 seconds]
<mcc> hellos someone attempted to show me last week the "GADT" functionality in ocaml
<mcc> it was really interesting to me but i'm a little confused about how it works
<mcc> they showed me this seemingly magical piece of code https://gist.github.com/malk/c2a09569f20ffeb5d898#file-maybeabadidea-ml where there was a function which came "pre-matched" with a particular constructor for a tagged union -- maybeABadIdea.ml here: https://gist.github.com/malk/c2a09569f20ffeb5d898#file-maybeabadidea-ml
<mcc> usually when i am trying to understand something in ocaml, i've referred to that Real World Ocaml book, but they don't … seem? to have a bit on this feature
<mcc> i get the sense this was something that was added recently
jbrown has joined #ocaml
AltGr has left #ocaml [#ocaml]
AltGr has joined #ocaml
reem has joined #ocaml
AlexRussia has joined #ocaml
dsheets_ has joined #ocaml
<dmbaturin> mcc: http://mads-hartmann.com/ocaml/2015/01/05/gadt-ocaml.html I liked this post, it has a motivated example.
<mcc> ah, that looks great, thanks
ghostpl_ has joined #ocaml
<mcc> so... hm.
bjorkintosh has quit [Ping timeout: 245 seconds]
<mcc> algabraic data types. do the types, with sum and product, actually form an algebra?
<dmbaturin> mcc: Seems so. Bottom is the identity element.
ghostpl_ has quit [Ping timeout: 245 seconds]
rgrinberg has quit [Quit: Leaving.]
<mcc> what is bottom type in ocaml? unit?
rgrinberg has joined #ocaml
bytbox has quit [Ping timeout: 240 seconds]
<dmbaturin> I'm just starting with type theory though, so I can't be sure if things I say are correct yet. :)
<mcc> ok
<dmbaturin> mcc: No, bottom is a type with no values at all. I'm not sure one can express it in ML explicitly.
<mcc> ok
<mcc> wp says its for nonreturning functions
<mcc> so... 'a?
<dmbaturin> Maybe a type that is left abstract and not defined anywhere can count as it. But since it has no values, a sum type with bottom should be equivalent to the original type.
<mcc> ok
<dmbaturin> Well, 'a is not a type, it's a variable that may mean any concrete type.
<dmbaturin> Also, what exactly you mean by algebra? :)
hilquias` has joined #ocaml
<mcc> i mean like, is it an associative algebra, is it a ring, is it anything
<mcc> i see a set and two operations so i'm curious
<dmbaturin> ...a tuple of anything with bottom can't be created, so apparently the bottom is the identity element for product types too.
<dmbaturin> Since it has no values like the bottom and can be considered equivalent to it.
<mcc> hm ok
<dmbaturin> mcc: Field and ring people use the word "algebra" for some specific structure, but I forgot what it was.
<mcc> nod
<dmbaturin> I'm not sure if ('a, 'b) and ('b, 'a) can be considered equivalent.
<dmbaturin> But what we made up so far looks like a ring it seems.
<mcc> hm, ok
<mcc> stuff in aa is typically not commutative unless u ask for it
<mcc> commutative ring would be an abelian ring
<dmbaturin> Sum types are probably commutative though. Foo of 'a | Bar of 'b can have all the values as Bar of 'b | Foo of 'a.
hilquias` has quit [Remote host closed the connection]
<mcc> in this article. they use the syntax type a. a expr' -> a
<mcc> ok so the a is a type variable, i get that
<mcc> … what the heck is the period?
<mcc> "type a ."is that just… what you do that?
<mcc> there?
<dmbaturin> Good question. I took it as magic required in signatures when you use GADTs.
bjorkintosh has joined #ocaml
<dmbaturin> Perhaps we'll have to wait for the language lawyers to wake up. :)
bjorkintosh has quit [Ping timeout: 246 seconds]
<mcc> heh
<mcc> alas, i think i will fall asleep
<dmbaturin> Well, there's a mailing list too.
<mcc> oo
mcc has quit [Quit: battery dying sry]
rgrinberg has quit [Quit: Leaving.]
ggole has joined #ocaml
Jefffrey has quit [Remote host closed the connection]
ghostpl_ has joined #ocaml
ghostpl_ has quit [Ping timeout: 250 seconds]
rgrinberg has joined #ocaml
reem has quit [Remote host closed the connection]
reem has joined #ocaml
_pakchoi_ops has joined #ocaml
laughing-octo-sh has joined #ocaml
MercurialAlchemi has joined #ocaml
oscar_toro has quit [Quit: Lost terminal]
rgrinberg has quit [Quit: Leaving.]
_pakchoi_ops has quit [Quit: No Ping reply in 180 seconds.]
rgrinberg has joined #ocaml
_pakchoi_ops has joined #ocaml
matason has joined #ocaml
laughing-octo-sh has quit [Ping timeout: 252 seconds]
matason has quit [Ping timeout: 256 seconds]
ebzzry has quit [Remote host closed the connection]
manud has joined #ocaml
ebzzry has joined #ocaml
rgrinberg has quit [Quit: WeeChat 1.1.1]
rgrinberg has joined #ocaml
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
ebzzry has quit [Remote host closed the connection]
ebzzry has joined #ocaml
ebzzry has quit [Remote host closed the connection]
axiles has quit [Quit: Quitte]
Haudegen has quit [Ping timeout: 245 seconds]
larhat has joined #ocaml
Haudegen has joined #ocaml
matason has joined #ocaml
matason has quit [Client Quit]
Simn has joined #ocaml
bjorkintosh has joined #ocaml
reem has quit [Remote host closed the connection]
axiles has joined #ocaml
reem has joined #ocaml
ghostpl_ has joined #ocaml
MercurialAlchemi has quit [Remote host closed the connection]
MercurialAlchemi has joined #ocaml
ghostpl_ has quit [Ping timeout: 252 seconds]
manud has quit [Quit: manud]
manud has joined #ocaml
Nahra has quit [Remote host closed the connection]
reem has quit [Remote host closed the connection]
reem has joined #ocaml
rgrinberg has quit [Ping timeout: 256 seconds]
magthe has joined #ocaml
<magthe> any Archlinux users around?
<adrien_znc> just ask your question :) (I'm not one but there are several here)
zpe has joined #ocaml
reem has quit [Remote host closed the connection]
<magthe> am I supposed to be able to successfully run `opam install core utop` using ocaml from extra?
reem has joined #ocaml
<magthe> I thought I would, but didn't... first issuing `opam switch 4.02.1`, and then `opam install core utop` worked fine though, but then I have ocaml 4.02.1 installed both on the system level and locally as my user, right?
<ggole> I think that depends on how you configured/installed opam
_pakchoi_ops has quit [Ping timeout: 245 seconds]
<dmbaturin> magthe: Generally, this can work. I did use opam with the compiler from the repos, although not on arch.
maufred has quit [Remote host closed the connection]
matason has joined #ocaml
maufred has joined #ocaml
<magthe> ggole: installed it from AUR
Submarine has joined #ocaml
Submarine has joined #ocaml
<magthe> the first complaint was when compiling camlp4 -- I was told to install it system wide, so after grabbing that from extra too I got a little further
<magthe> then I got stuck on herelib
<magthe> it's not a big deal, just surprising
<whitequark> herelib? hm
ghostpl_ has joined #ocaml
reem has quit [Remote host closed the connection]
reem has joined #ocaml
dsheets_ has quit [Ping timeout: 264 seconds]
octachron has joined #ocaml
mort___ has joined #ocaml
<magthe> whitequark: yupp, the error messages were not as helpful as with camlp4, so I gave up and switched to letting opam compile ocaml too
manud has quit [Quit: manud]
manud has joined #ocaml
rgrinberg has joined #ocaml
rgrinberg has quit [Ping timeout: 250 seconds]
Kakadu has joined #ocaml
dav has quit [Ping timeout: 252 seconds]
dav has joined #ocaml
dsheets_ has joined #ocaml
ddosia has joined #ocaml
antkong_ has joined #ocaml
yomimono has joined #ocaml
manud has quit [Quit: manud]
reem has quit [Remote host closed the connection]
MercurialAlchemi has quit [Remote host closed the connection]
MercurialAlchemi has joined #ocaml
reem has joined #ocaml
Submarine has quit [Quit: Leaving]
ontologiae_ has joined #ocaml
rand000 has joined #ocaml
reem has quit [Remote host closed the connection]
reem has joined #ocaml
yomimono has quit [Ping timeout: 246 seconds]
ontologiae_ has quit [Ping timeout: 252 seconds]
reem has quit [Remote host closed the connection]
aubergines has joined #ocaml
reem has joined #ocaml
antkong_ has quit [Ping timeout: 244 seconds]
Haudegen has quit [Ping timeout: 255 seconds]
Haudegen has joined #ocaml
reem has quit [Remote host closed the connection]
MercurialAlchemi has quit [Quit: Lost terminal]
MercurialAlchemi has joined #ocaml
_andre has joined #ocaml
yomimono has joined #ocaml
rgrinberg has joined #ocaml
rgrinberg has quit [Ping timeout: 245 seconds]
<jpdeplaix> whitequark: yep, I've seen this
huza has joined #ocaml
segmond has quit [Ping timeout: 244 seconds]
Jefffrey has joined #ocaml
tane has joined #ocaml
myst has quit [Remote host closed the connection]
segmond has joined #ocaml
myst has joined #ocaml
dsheets_ has quit [Ping timeout: 252 seconds]
jao has joined #ocaml
jao has quit [Changing host]
jao has joined #ocaml
ebzzry has joined #ocaml
myst has quit [Remote host closed the connection]
myst has joined #ocaml
<magthe> I'm playing around with functors for the first time, I do get it all to work when I put all stuff, module sigs and implementation in a single .ml file, but when I try to put the sigs in a separate .mli it all breaks down... all examples I find either do like I've done, on single file, or use ocaml interactively (Real World OCaml), any pointers to examples of splitting sigs and structs of functors into separate
<magthe> files?
ebzzry has quit [Remote host closed the connection]
ebzzry has joined #ocaml
bezirg has joined #ocaml
<whitequark> can you post your existing code?
bezirg has quit [Client Quit]
bezirg has joined #ocaml
<ggole> Functors in signatures look like module Foo (Arg : ArgSig) sig ... end
<ggole> er, module Foo (Arg : ArgSig) : sig ... end
<ggole> (You can also use the functor keyword, but who does that?)
<ggole> Also, there's almost no difference between splitting things between an .ml and .mli and a struct ... end and sig ... end
<ggole> So you can test your understanding using modules in a single file easily enough
segmond has quit [Ping timeout: 256 seconds]
rgrinberg has joined #ocaml
bezirg has quit [Quit: Leaving.]
<magthe> ggole: yes, so far is all good... I *am* testing my understanding using modules in a single file... what I'd like now is to split into several files, and that's where I fail.
rgrinberg has quit [Ping timeout: 272 seconds]
<ggole> Put the sig ... end bit in the .mli and the struct ... end bit in the .ml and you should be fine
segmond has joined #ocaml
<ggole> If you run into trouble, we'll help you out - functors can be a bit head scratchy at first
<magthe> ggole: I'll make a second attempt and see how far I get
<magthe> ggole: putting the innards of a sig in a separate file is straight forward, but how do I get the `Arg` into the .ml file?
<magthe> oh, I'll put some stuff in a pastebin to show, hold on
waneck_ has joined #ocaml
waneck has quit [Read error: No route to host]
ned has quit [Ping timeout: 252 seconds]
<magthe> ggole: that's a piece of my working code
<ggole> Oh, I see what you mean
Algebr has joined #ocaml
<magthe> ggole: if I move the stuff between struct...end into a separate .ml, how do I get the info related to the sig etc (`module FuncTree (TE : TreeElement) : FT with type elt = TE.t = struct`) into it?
<magthe> ggole: am I doing it all wrong?
<ggole> No, we've been talking past each other a bit
<ggole> I thought that you were wrapping all of this in a flat module
<magthe> ggole: well, in a way that's what I'd like to do... but I don't se how I can
* magthe has poor knowledge of ocaml syntax
Jefffrey has quit [Quit: Leaving...]
<ggole> Uh, I'm not quite sure what you're asking now
<ggole> You want to know how to write a .mli for what's there?
<ggole> Or just split things up a bit?
ontologiae_ has joined #ocaml
<magthe> ggole: let's start with just splitting it up a bit... I can put `TreeElement` "as is" into treeElement.mli... the same for `FT`
<magthe> is there some way I can put `FuncTree` as a flat module into funcTree.ml?
paradoja has joined #ocaml
<ggole> Not really
<magthe> ggole: hmm, moving the innards of `TreeElement` into treeElement.mli didn't work that either... the compiler says that `TreeElement` isn't a type
<magthe> so I'm guessing the `module type ...` has to live inside another module
dsheets_ has joined #ocaml
<ggole> Yeah, when I said "the sig ... end in .mli and the struct ... end in .ml", I thought that you had module Foo : sig ... end = struct ... end and wanted to split it up
<ggole> I would put the element type and functor impl in one file
<magthe> in a single .ml?
<ggole> Yeah
<ggole> The stdlib does things that way
<magthe> oki
<ggole> It's somewhat standard to call the functor Make and the signature S, too
<ggole> Set, Map and Hashtbl all follow this pattern
<magthe> oki, I'll have a look-see
<magthe> then the implementations of the various `TreeElements` can easily go in other places... but since they are `module type ...` they can't themselves be top-level modules?
<ggole> No, implementations of the argument are just modules (and can be, and often are, top-level)
<magthe> ah, oki... I'll try
bytbox has joined #ocaml
bytbox has quit [Read error: Connection reset by peer]
bytbox has joined #ocaml
dbp has quit [Ping timeout: 265 seconds]
<magthe> ggole: ah, oki, that worked fine... and then the whole thing with `with type t = ...` isn't needed anymore... cute
jao has quit [Remote host closed the connection]
<magthe> ggole: would one usually place the instantiation of the modules (in my case `module IntTree = FuncTree (TEInt)`) where `TEInt` is defined, or where `IntTree` is used?
<ggole> You should still need the with type t = ... (although in this case I think it should be with type elt = ...)
ebzzry_ has joined #ocaml
<ggole> Instantiations of the modules go wherever the user of your tree library wants them
huza has quit [Quit: WeeChat 0.3.8]
ebzzry has quit [Ping timeout: 256 seconds]
<magthe> ggole: ah, yes the `type elt = ... ` is needed, but if I break out the various implementations of `TreeElement` I no longer need any `type t = ...` (here it really is `t`)
AltGr has left #ocaml [#ocaml]
<ggole> Oh I see. Right, that isn't needed.
bytbox has quit [Remote host closed the connection]
<magthe> ggole: is there some way of ensuring telling the compiler that I intend `TEInt` to implement the `FuncTree.TreeElement` type?
<magthe> currently it's ad-hoc (AFAIU)
<companion_cube> let _ = (module TEInt : FuncTree.TreeElement) <--- ugly hack, but should work
<magthe> companion_cube: where do I put that... in tEInt.ml?
<ggole> Pretty much, although just passing it to your functor will do the same job
<companion_cube> magthe: maybe that could be a test
<companion_cube> a kind of compile-time test, that is
<ggole> magthe: no, it needs to be outside of that module, probably in another file
<magthe> couldn't put it in tEInt.ml, that created a circular depency
<ggole> (If TEInt is nested in a file you can just stick in in there, but that doesn't sound like it is the case.)
<magthe> ggole: nope, it's not, at least not now... but it's good to know that's an option
rgrinberg has joined #ocaml
rgrinberg has quit [Ping timeout: 250 seconds]
<magthe> ggole, companion_cube: thanks for the help!
<companion_cube> no pb
<ggole> My pleasure.
<magthe> oh, BTW, I've requested #ocaml to be added to lpaste.net's list of rooms... I hope no one minds if it gets added
segmond has quit [Ping timeout: 250 seconds]
bytbox has joined #ocaml
<adrien_znc> I don't see an issue with that, quite the contrary :)
bytbox has quit [Remote host closed the connection]
arj has joined #ocaml
arj has quit [Max SendQ exceeded]
arj has joined #ocaml
arj has quit [Max SendQ exceeded]
arj has joined #ocaml
arj has quit [Max SendQ exceeded]
arj has joined #ocaml
segmond has joined #ocaml
BitPuffin has joined #ocaml
BitPuffin has quit [Remote host closed the connection]
jbrown has quit [Remote host closed the connection]
reem has joined #ocaml
ontologiae_ has quit [Ping timeout: 244 seconds]
segmond has quit [Ping timeout: 256 seconds]
<magthe> adrien_znc: my sentiment also... ocaml seemed suspiciously lacking from the list of FP languages in that list
<companion_cube> great!
reem has quit [Ping timeout: 272 seconds]
<companion_cube> maybe this could go in the topic, so that newcomers know where to paste their code
<adrien_znc> poke an op :P
* companion_cube pokes adrien_znc
<adrien_znc> I'm not an op
<companion_cube> I see that "adrien" set the topic last
<companion_cube> assume your multiple persona, or show your true op power!
<adrien_znc> different accounts
vanila has joined #ocaml
moviuro has quit [Quit: ZNC on a FreeBSD jail, from an Archlinux laptop and OpenBSD openVPN server... what else?]
<whitequark> haha
<whitequark> /tmp/ccfefYnN.o:(.data+0x1b20): undefined reference to `_glBindSampler::caml(void)'
BitPuffin has joined #ocaml
<whitequark> symbol name that accidentally looks like mangled to demangler
<rks`> :)
shinnya has joined #ocaml
segmond has joined #ocaml
<flux> ocaml strives for better c++ compatibility I see
<flux> or at least it strives to confuse c++ developers ;)
* companion_cube thinks whitequark is playing fun games such as making C++ demangler and OCaml mangler interact
<whitequark> that would be trivial to do
<whitequark> did you know the C++ mangler can serialize pretty much entire C++ expression AST?
<companion_cube> yes
<companion_cube> I retweeted your tweet ;)
segmond has quit [Ping timeout: 255 seconds]
moviuro has joined #ocaml
<ia0> what is the current state of inter-module optimization in caml?
<ia0> it looks like it does some things
<ia0> in particular it looks like it does what I always wanted "removing debug stuff from binary"
<ia0> content of debug.ml: "let debug = true (* false *)"
<ia0> content of test.ml: "open Debug;; let () = if debug then do_debug_stuff; do_normal_stuff;;"
<whitequark> there's a PR that improves it substantially
lpaste has joined #ocaml
<companion_cube> ia0: in native code, you can check what is going to be inlined with ocamlobjinfo
<ia0> compiling with ocamlopt.opt and debug set to false actually does not put do_debug_stuff in the binary
<companion_cube> ocamlobjinfo _build/debug.cmx
<ia0> nice, I'll check that
<companion_cube> if debug is inlined, there are chances that the corresponding code will be pruned
<ia0> Is it the "Approximation" section?
<ia0> it looks like the value of teh module
<ia0> yes, that's it, looks like an over-approximation
<ia0> and when the value is exact (a singleton), then you're sure it will always be that value and you can use it in optimization
<ia0> but that should be in the .cmi actually
bytbox has joined #ocaml
planetlarg has joined #ocaml
<companion_cube> oh, nice, approximation is even stronger
<companion_cube> there's also a flag "inlined" for some functions
<ia0> (nevermind about the cmi if the optimization is done at link time)
<ia0> yes I saw that too
rgrinberg has joined #ocaml
segmond has joined #ocaml
<ia0> this discovery will change a lot how I write debug code now that I now it can be easily removed
<ia0> now I have to check what happens for functions only called by debug code
contempt has quit [Ping timeout: 245 seconds]
rgrinberg has quit [Ping timeout: 246 seconds]
<ia0> they're apparently not removed
contempt has joined #ocaml
ned has joined #ocaml
ned is now known as Guest23191
segmond has quit [Ping timeout: 245 seconds]
bytbox has quit [Ping timeout: 250 seconds]
travisbrady has joined #ocaml
Guest23191 has quit [Ping timeout: 252 seconds]
bytbox has joined #ocaml
<lpaste> magthe pasted “#ocaml added to lpaste.net” at http://lpaste.net/121443
<magthe> look at that! #ocaml has been added :)
travisbrady has quit [Quit: travisbrady]
badkins has joined #ocaml
bytbox has quit [Ping timeout: 252 seconds]
jmbto has joined #ocaml
<jmbto> greetings
<ggole> o/
segmond has joined #ocaml
travisbrady has joined #ocaml
rgrinberg has joined #ocaml
xaimus has quit [Ping timeout: 272 seconds]
octachron has quit [Ping timeout: 252 seconds]
travisbrady has quit [Quit: travisbrady]
xaimus has joined #ocaml
j0sh_ has quit [Remote host closed the connection]
darkf has quit [Quit: Leaving]
psy has joined #ocaml
travisbrady has joined #ocaml
psy has quit [Max SendQ exceeded]
psy has joined #ocaml
travisbrady has quit [Client Quit]
bezirg has joined #ocaml
bezirg has quit [Client Quit]
<hcarty> companion_cube: In the success case, is https://github.com/c-cube/ocaml-containers/blob/master/src/core/CCFormat.ml#L132 ever closed?
magthe has quit [Quit: WeeChat 1.1.1]
<companion_cube> ohhh, a bug
<companion_cube> ♥
octachron has joined #ocaml
travisbrady has joined #ocaml
<flux> resource tracking :(
<flux> is there a nice reference counting library for ocaml?
<companion_cube> I'm not sure what that would look like? you mean, with manual increment and decrement?
<companion_cube> better use a finalizer
paradoja has quit [Ping timeout: 256 seconds]
<hcarty> companion_cube: I can file something formally if you'd like. I've only briefly looked at the code thought so I wasn't sure if I was missing something.
<companion_cube> that's fine, I'll fix it
ned has joined #ocaml
<hcarty> companion_cube: And hooray for discovered bugs!
<companion_cube> \o/
<companion_cube> it's not that easy to test this particular case...
ned is now known as Guest58527
<flux> companion_cube, well, something that would come with with_resource rcdfile (fun rawfile -> .. ) that would increment and decrement the reference counter
<companion_cube> but rcdfile would be an already opened file?
<flux> possibly not. I think glib has functions that return objects with refcount 0, and then they are deleted when it reaches 0 -again- :)
octachron has quit [Quit: Leaving]
<companion_cube> well, it must be very tedious to use
<hcarty> Some kind of (let%use out = open_output_file outfile in e) extension would be nice to have but I'm not sure how it could be made generic without being ugly.
<flux> I would really like that you could choose to not close the resource in the scope, though
<companion_cube> flux: but then it could be closed arbitrarily far away
<companion_cube> the only sure way is to use the GC's finalizer
<flux> companion_cube, well, you wouldn't do that ;)
<companion_cube> and the problem with that is that it can take some time before the file is closed
<hcarty> flux: Why not stick with open_resource + close_resource in that case?
<companion_cube> flux: I'd rather have uniqueness types, or something similar
<companion_cube> ^^
<flux> companion_cube, yes, but we are not going to have uniqueness types :)
<companion_cube> I know
<flux> hcarty, well, they sort of still depend on the code being structured in a way that has a nice way to put them at
<companion_cube> flux: I think that for most file uses, lexical scoping is enough
<flux> for example, with Lwt you could perhaps pass a lock to another task or you might not
<flux> well, I'll chime in the next time I'll actually miss them ;-)
<flux> companion_cube, so why didn't your code use them :-)
paradoja has joined #ocaml
<flux> well, I forgive you, you were implementing them ;-)
<flux> but nevertheles it sort of annoys that one needs to have a scoped accessor for all kinds of different resources, instead of building on the concept of 'resource' and 'scoped access'
<companion_cube> sure, but there's no way for the type system to track resources
<companion_cube> in OCaml, I mean
<ggole> You can write try_finalize easily enough though
<companion_cube> unless you miserably fail like I did there
<ggole> Ideally you would only write it once and use it N times for whatever resources you need
<def`> I made an experiment with implicits
travisbrady has quit [Quit: travisbrady]
<companion_cube> def`: to deal with resources?
<def`> you don't need the type system to track ressources
travisbrady has joined #ocaml
<ggole> I remember that modula made it possible to GC file descriptors (at least, their analogue of fds)
<def`> (I mean, that would be better but that's out of scope)
WraithM has joined #ocaml
cateches has joined #ocaml
<ggole> rimshot
<cateches> I hope this isn't a flamewar topic, but do most people use async or lwt?
<whitequark> lwt
<cateches> whitequark so do most people not use janestreet core? what's the alternative? batteries?
bitbckt has quit [Quit: ZNC - http://znc.in]
<companion_cube> ggole: you can do it in OCaml, with finalizers
<ggole> Finalizers may never run before you exhaust the available fds
<companion_cube> cateches: the world is divided in 5 categories: 1/ people who don't use OCaml 2/ people who use Core 3/ people who use batteries 4/ people who use bare stdlib 5/ people who use stdlib+some bizarre extension of stdlib
<companion_cube> ggole: well, that's the best a GC can guarantee, I think
<haesbaert> are lwts preemptive ? I'm guessing not
<MercurialAlchemi> companion_cube: what about people who use containers?
<companion_cube> MercurialAlchemi: 5/ :p
<companion_cube> def`: looks pretty cool
<MercurialAlchemi> companion_cube: pff :)
<ggole> You can have a wrapper that runs a GC and closes unreachable fds when the fds run out
<Algebr> For imperative code, what a good way to get a else if, just do a match?
<cateches> companion_cube: so I just kinda have to pick a camp for a project and deal with it
<ggole> (Or more likely, well before then.)
jao has joined #ocaml
jao has quit [Changing host]
jao has joined #ocaml
<ggole> Algebr: if you want else if, use else if?
<companion_cube> cateches: well, yes
<companion_cube> you can start with bare stdlib and then switch to batteries or 5/ easily, though
<whitequark> haesbaert: neither lwt nor async
<haesbaert> ah ok, that makes sense
<Algebr> ggole: I mean an actual else if rather than a nested if condition
<cateches> okay
<ggole> What's the difference?
<Algebr> just looks nicer.
<ggole> O_o
<ggole> Wait, are you indenting the second bit?
cateches has quit [Quit: Page closed]
<Algebr> doing whatever ocp-indent does
<ggole> It should indent it just like an "actual else if" (whatever that might be)
<ggole> Ifs do get pretty ugly when you start needing blocks, but that's not really related
<Algebr> but there isn't an actual C like else if or python elif in the actual ocaml lanuage right
rgrinberg has quit [Quit: WeeChat 1.1.1]
<ggole> You just type else if and keep going
<ggole> if foo then bar else if baz then quux else zonk
rgrinberg has joined #ocaml
segmond has quit [Ping timeout: 272 seconds]
<ggole> Rather like C.
<whitequark> there isn't an "else if" in the C grammar, I think
bitbckt has joined #ocaml
<ggole> It's else <statement>
<Algebr> ha, I just checked as well
<ggole> elif rubs me the wrong way for some reason
lordkryss has joined #ocaml
<ggole> (But not as much as reverse keywords, blech.)
bytbox has joined #ocaml
<Algebr> what are reverse keywords?
<ggole> When a construct is terminated with the keyword it begins with, reversed
<ggole> if ... fi, case ... esac, etc
bytbox has quit [Remote host closed the connection]
<Algebr> oh, yea, those are annoying
segmond has joined #ocaml
psy has quit [Read error: No route to host]
destrius has quit [Ping timeout: 272 seconds]
destrius has joined #ocaml
<struktured> ggole: the only thing worse than xml tags is that
slash^ has joined #ocaml
travisbrady has quit [Quit: travisbrady]
struktured has quit [Ping timeout: 250 seconds]
rgrinberg has quit [Ping timeout: 264 seconds]
rgrinberg has joined #ocaml
ontologiae_ has joined #ocaml
badkins has quit [Read error: Connection reset by peer]
ontologiae_ has quit [Ping timeout: 246 seconds]
struktured has joined #ocaml
ned- has joined #ocaml
Guest58527 has quit [Ping timeout: 250 seconds]
bytbox has joined #ocaml
axiles has quit [Quit: Quitte]
struktured has quit [Ping timeout: 264 seconds]
swgillespie has joined #ocaml
bytbox has quit [Remote host closed the connection]
MercurialAlchemi has quit [Remote host closed the connection]
dbp has joined #ocaml
MercurialAlchemi has joined #ocaml
ned has joined #ocaml
ned is now known as Guest45468
ned- has quit [Ping timeout: 244 seconds]
ontologiae_ has joined #ocaml
JuggleTux has joined #ocaml
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
larhat has quit [Quit: Leaving.]
Guest45468 has quit [Ping timeout: 250 seconds]
jwatzman|work has joined #ocaml
planetlarg has quit [Quit: Ex-Chat]
bytbox has joined #ocaml
mort___ has quit [Ping timeout: 250 seconds]
paradoja has quit [Ping timeout: 256 seconds]
travisbrady has joined #ocaml
martintrojer has quit [Max SendQ exceeded]
martintrojer has joined #ocaml
matthewhill has joined #ocaml
<Algebr> Is there a way in Lwt to say grab a handle on whatever event I'm currently on? Like Lwt.current_event () or somethign like that
martintrojer has quit [Max SendQ exceeded]
martintrojer has joined #ocaml
matason has quit [Ping timeout: 252 seconds]
Submarine has joined #ocaml
Submarine has joined #ocaml
travisbrady has quit [Quit: travisbrady]
segmond has quit [Ping timeout: 252 seconds]
<Algebr> Is it really the case that arguments to methods can't be type variables?
<mbac> methods?
<Algebr> I was writing a method and got this error, type 'c -> unit where 'c is unbound
arj has quit [Quit: Leaving.]
<rgrinberg> Algebr: so you're defining a class?
<Algebr> I'm subclassing something and adding a method
MrScout has joined #ocaml
ontologiae_ has quit [Ping timeout: 252 seconds]
<rgrinberg> it's true that classes need explicit type parameters
MrScout has quit [Remote host closed the connection]
<companion_cube> o/ rgrinberg
<Algebr> why is this
MrScout has joined #ocaml
matthewhill has quit [Quit: Be back later ...]
aubergines has quit [Remote host closed the connection]
<rgrinberg> companion_cube: too bad it's too painful to functorize over this map :/ I'm sure core users would prefer their own data structure
<companion_cube> what do you mean?
<rgrinberg> I mean in the context of opium. Users are likely to want to Univ_map over CCMixmap
<rgrinberg> it doesn't matter though
<rgrinberg> you can't please everyone :D
<ggole> Type variables need to be bound somewhere...
<ggole> Although you can universally quantify methods if you need that.
segmond has joined #ocaml
<companion_cube> yeah, sure :D
<companion_cube> althoug maybe, some time, there might be a version of opium using containers ;)
badkins has joined #ocaml
<rgrinberg> companion_cube: seems like that's the way it would be :D
axiles has joined #ocaml
<rgrinberg> although I better not get complaints from core users that containers is bloated
matthewhill has joined #ocaml
<rgrinberg> companion_cube: is it possible to have a CCMixmap that is parameterized over the map impl. that it uses?
<rgrinberg> companion_cube: /this is not a feature request/ just curious
<whitequark> lol
<rgrinberg> ;)
Anarchos has joined #ocaml
matthewhill has quit [Client Quit]
bytbox has quit [Ping timeout: 244 seconds]
<Algebr> I have something I worked on and what to show it off on like /r/ocaml but it has some corner cases
yomimono has quit [Ping timeout: 252 seconds]
dsheets_ has quit [Ping timeout: 255 seconds]
oriba has joined #ocaml
mort___ has joined #ocaml
q66 has quit [Ping timeout: 264 seconds]
travisbrady has joined #ocaml
rand000 has quit [Ping timeout: 244 seconds]
<ggole> Show it off and ask for feedback
q66 has joined #ocaml
mort___ has quit [Quit: Leaving.]
Haudegen has quit [Ping timeout: 244 seconds]
16WAACCNJ has joined #ocaml
laughing-octo-sh has joined #ocaml
Haudegen has joined #ocaml
<companion_cube> rgrinberg: I suppose so, it would just require a higher-order functor
<companion_cube> module Make(X : ORD)(M : functor (X:ORD) -> MAP with type key=X.t) : MIXMAP with type key = X.t and ....
orbitz has quit [Remote host closed the connection]
ned has joined #ocaml
ghostpl_ has quit [Remote host closed the connection]
ned is now known as Guest53396
q66_ has joined #ocaml
<Algebr> How is it that ocamldebug has a polymorphic print function but regular ocaml can't?
<Algebr> because of the extra stuff added by -g?
larhat has joined #ocaml
<companion_cube> yes, it's magic
rand000 has joined #ocaml
pyx has joined #ocaml
pyx has quit [Client Quit]
q66 has quit [Quit: Leaving]
matason has joined #ocaml
Guest53396 has quit [Ping timeout: 264 seconds]
AnxiousGarlic has joined #ocaml
AnxiousGarlic has left #ocaml [#ocaml]
q66_ has quit [Changing host]
q66_ has joined #ocaml
q66_ is now known as q66
laughing-octo-sh has quit [Ping timeout: 246 seconds]
kakadu_ has joined #ocaml
<whitequark> Algebr: toplevel also has it.
<whitequark> they use the same information
laughing-octo-sh has joined #ocaml
<ggole> It's sketchy and incomplete, too
<whitequark> um, is it?
<whitequark> as far as I understand it gives you the precise typing environment
mort___ has joined #ocaml
<ggole> module M : sig val f : unit -> unit end = struct type t = A | B exception E of t let f () = raise (E A) end
<ggole> Then M.f ()
<whitequark> um, how is that related?
<whitequark> you could as well build without -g
<whitequark> since exceptions don't carry typing information
<ggole> That's the "polymorphic print" we are discussing, isn't it?
bytbox has joined #ocaml
<ggole> And there are other (uncommon) situations in which the type environment doesn't tell you how to print a value properly
<Algebr> the standard library's Array module is kind of lacking compared to list, like where is filter?
ghostpl_ has joined #ocaml
ghostpl_ has quit [Remote host closed the connection]
ghostpl_ has joined #ocaml
<companion_cube> Algebr: filter isn't trivial to implement with Array
<companion_cube> you can't know the size in advance
<Algebr> yea, was looking at batterie's implementation thinking I could just copy and paste it, not trivial..
<companion_cube> you can use Array.to_list and Array.of_list
<Algebr> yea, I was thinking that but I'm wondering that the overhead of that is
<companion_cube> filter built on top of filter_map
<ggole> You can filter in place easily enough
<companion_cube> ggole: with a resizable array, yeah
<companion_cube> otherwise you'd need to return the new length?
<Algebr> hmm, I can fold too
<ggole> It leaves junk at the end
<ggole> So yeah, return the point
<ggole> Array is certainly a bit sparse
manud has joined #ocaml
<Drup> Algebr: a reason not to use <insert a stdlib extension here> ?
segmond has quit [Ping timeout: 255 seconds]
<Algebr> I'd rather not have dependencies
bytbox has quit [Ping timeout: 246 seconds]
ontologiae_ has joined #ocaml
Guest53396 has joined #ocaml
ptc has joined #ocaml
ptc is now known as Guest24093
<whitequark> ggole: actually, I think you could print a value properly.
<whitequark> you have all the data you need. M.E and M is in your environment
reem has joined #ocaml
<Drup> Algebr: abandon that mindset, it's useless and actively harmful.
<Drup> I can understand why you would want small dependencies
<Drup> but no dependency is stupid most of the time and will lead you to reimplement yet another half assed stdlib extension inside your app
<ggole> whitequark: doesn't the environment only give you the signature of M, which doesn't contain the problematic constructor?
<whitequark> oh.
<whitequark> haven't noticed that.
mort___ has quit [Quit: Leaving.]
<ggole> If it's exposed it should print fine.
<whitequark> but it will be present in debug info, however.
<whitequark> assuming you go crawl the environment from where it was raised :)
<ggole> It does seem like this should be possible
<whitequark> and since toplevel now has debug info as well, that would also work in toplevel
<Algebr> Drup: damn, throwing it down, but you're right.
<ggole> There are some genuinely impossible cases but there's actually sane handling for that
<whitequark> like which?
<ggole> Eg type t = A : 'a -> t;; A 1
<Drup> Algebr: don't worry, I had this discussion with several other people before you to sharpen my arguments.
<ggole> Instead of just guessing and printing an int (yuck) it gives you <poly>, which is at least honest
<whitequark> well, I don't think that's a problem
<whitequark> exception printing is inconsistent with semantics
<whitequark> this is consistent
<whitequark> you aren't entitled to get information you can't in any way retrieve from within the language
<ousado> are you talking about runtime type information?
<whitequark> you can't get "1" from "A 1" above in any way
<whitequark> ever
<whitequark> you can only get an (<opaque> : existential)
<ggole> Yeah, agreed
<whitequark> whereas you can of course match on M.E in /some/ context
Guest24093 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<ggole> Hmm, do open types have the same issue?
<whitequark> yes
<whitequark> exceptions are open types
<whitequark> with funky syntax.
WraithM has quit [Quit: leaving]
<whitequark> type x += Hi;; raise (Obj.magic Hi);; Exception: Hi. #
<ggole> Ah, it prints it <extension>
<ggole> That's a bit nicer
<def`> what do you mean by exception printing is inconsistent with semantics?
<whitequark> see ggole's example above
segmond has joined #ocaml
<whitequark> ggole: I think that's less useful
<ggole> module M : sig type t = .. val f : unit -> t end = struct type t = .. type t += A let f () = A end
<def`> ah yes
<def`> I missed the example. Yeah…
dsheets_ has joined #ocaml
<ggole> whitequark: less useful? Because exceptions are somewhat likely to be unexpectedly seen at the toplevel where you would very much want the info?
<whitequark> exactly
<ggole> Yeah, I'm inclined to agree
BitPuffin has quit [Ping timeout: 255 seconds]
<Algebr> this is not legal correct (fun (foo, (bar, baz)) as t -> ...)
<ggole> Moar parens
<ggole> (fun ((foo, (bar, baz)) as t) -> ...)
<Algebr> lispml
<companion_cube> https://github.com/ocaml/ocaml/pull/147 interesting anyway
<ggole> (I can't remember if you need the ones around the outermost tuple or not...)
<Drup> companion_cube: lol
<def`> (I think you don't :)
<Drup> companion_cube: "Maybe in that case we could also have an Option module in the stdlib" and you just showed in one sentence why this will not be in the stdlib.
_andre has quit [Quit: leaving]
tane has quit [Quit: Verlassend]
<companion_cube> well, if we get a Result module with combinators, we can have an Option module
<companion_cube> what I'm actually defending is: just the type in the stdlib, and in a library
<whitequark> the people who say "stdlib should stay a support module for compiler" should just shut up, they're directly harmful to the community
bytbox has joined #ocaml
<companion_cube> whitequark: sadly some of those people are the compiler maintainers
<rgrinberg> whitequark: you might not like haskell but they have a pretty good governance model for "base"
<companion_cube> Drup: really, no one ever proposed an Option module?
<whitequark> companion_cube: no incentive for inria to care about community, i suppose
<companion_cube> pretty much yeah
<Drup> companion_cube: on the contrary, re-read the sentence
<companion_cube> I mean, they care about Coq
<rgrinberg> too bad the whole ocaml-platform effort thing died
<companion_cube> I re-read, and saw no change
<Drup> ok, two many negations in one sentence
<Drup> too*
<Drup> this is *not* the reason.
<companion_cube> what's the reason then? (and for what? :D)
<Drup> because the Core team said the stdlib should be small and refuse to add anything in it.
<Drup> except things that can't be outside the compiler
<Drup> (Bytes, for example)
<companion_cube> oh, I see
<companion_cube> too many negations indeed
<Drup> yeah
<rgrinberg> Drup: can't they make an exception for type definitions
Anarchos has quit [Quit: Vision[0.9.7-H-20140108]: i've been blurred!]
<Drup> rgrinberg: I don't know, I'm not the core team
<companion_cube> if they accept to put just a type definition, fine, but the compatibility lib will also have to contain only the type
<Drup> it's actually worse
<Drup> the compatibility lib is not usable if the type is in pervasive
<Drup> because it's globally opened
<Drup> really, putting it in the stdlib is only a way to say "we agreed on it"
<companion_cube> I didn't check, did yminsky put it in Pervasives? awww
<Drup> of course he did :p
<Drup> I mean, that's the most sensible place to put it, if you don't consider other things
<Drup> and if we agreed on it, we don't need it in the stdlib.
<companion_cube> no, that's not the most sensible place to put it
<companion_cube> Pervasives is too big already
<companion_cube> it should be almost empty
<companion_cube> and contain aliases, not definitions
<rgrinberg> companion_cube: you sound like a core user :D
<companion_cube> how so? Core promotes the use of open everywhere
<companion_cube> I don't like open
<companion_cube> even when it's implicit
<rgrinberg> I mean that core's equivalent to pervasives, `Std` is basicall a collcetion of aliases
<Drup> rgrinberg: no, it's not
<Drup> Std contains lots of values
<Drup> it's enormous
<companion_cube> I'm not against Std shadowing (==), though, it's a nice trick ^^
<companion_cube> otoh batteries' BatPervasives is *terrible*
Anarchos has joined #ocaml
<Drup> please, compare the .mli if you want to compare something
BitPuffin has joined #ocaml
<ggole> val dump : 'a -> string ಠ_ಠ
<Drup> yeah
<Drup> and the Enum functions
<companion_cube> ggole: yeah :/
bytbox has quit [Remote host closed the connection]
Anarchos has quit [Quit: Vision[0.9.7-H-20140108]: i've been blurred!]
<companion_cube> I'm not sure Result will work, but until then I'll keep poly variants :>
AlexRussia has quit [Ping timeout: 265 seconds]
<ggole> Guh, it's late
ggole has quit []
olauzon has joined #ocaml
slash^ has quit [Read error: Connection reset by peer]
reem has quit [Remote host closed the connection]
reem has joined #ocaml
Submarine has quit [Quit: Leaving]
Submarine has joined #ocaml
bytbox has joined #ocaml
segmond has quit [Ping timeout: 245 seconds]
16WAACCNJ has quit [Ping timeout: 256 seconds]
laughing-octo-sh has quit [Ping timeout: 255 seconds]
Guest53396 is now known as ned
segmond has joined #ocaml
avsm has joined #ocaml
claudiuc has joined #ocaml
avsm has quit [Quit: Leaving.]
larhat has quit [Quit: Leaving.]
reem has quit [Remote host closed the connection]
ptc has joined #ocaml
travisbrady has quit [Quit: travisbrady]
ptc is now known as Guest93907
travisbrady has joined #ocaml
travisbrady has quit [Client Quit]
reem has joined #ocaml
matason has quit [Ping timeout: 256 seconds]
ghostpl_ has quit [Remote host closed the connection]
Anarchos has joined #ocaml
Haudegen has quit [Ping timeout: 256 seconds]
Haudegen has joined #ocaml
rgrinberg has quit [Ping timeout: 246 seconds]
reem has quit [Remote host closed the connection]
kakadu_ has quit [Remote host closed the connection]
manud has quit [Quit: manud]
segmond has quit [Ping timeout: 250 seconds]
travisbrady has joined #ocaml
rgrinberg has joined #ocaml
rand000 has quit [Quit: leaving]
zpe has quit [Remote host closed the connection]
Anarchos has quit [Quit: Vision[0.9.7-H-20140108]: i've been blurred!]
segmond has joined #ocaml
Anarchos has joined #ocaml
nullcat has joined #ocaml
badkins has quit []
reem has joined #ocaml
Anarchos has quit [Quit: Vision[0.9.7-H-20140108]: i've been blurred!]
MercurialAlchemi has quit [Ping timeout: 252 seconds]
jbrown has joined #ocaml
<nullcat> https://github.com/ocaml/ocaml/pull/147 why the polymorphic example compiles without error?
AlexRussia has joined #ocaml
Guest93907 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
vivien_ has joined #ocaml
psnively has joined #ocaml
<psnively> Hi everyone! Is anyone else having OPAM error out trying to upgrade stuff from Jane Street?
<psnively> etc.
<flux> nullcat, because the type [> `Ok (_ list) | `Error _] matches that case..
<flux> you can always just do this: match `foo with `foo | `bar -> () and it works
<flux> but you cannot do: match (`foo : [`foo]) with `foo | `bar -> ()
<vivien_> Hello, I am trying to compile something from debian stable to windows, thanks to the "opam-windows-repository". I can't get i686-w64-mingw32-ocamlbuild working : it says it can't find dllunix.so. Did I miss something ? I have a dllunix.dll in ~/.opam/4.00.1/i686-and-so-on/lib/ocaml/stublibs
Anarchos has joined #ocaml
<flux> nullcat, ah, and I see now what you understand. well, that [> ..] type is compatible with presult I suppose is the core of the issue :)
<BitPuffin> SML has things like Word32 etc, does ocaml have anything like that, or do ya have to put up with integer
<flux> actually I said wrong about the type. in any case, the type of 'f' is inferred to be val f : [< `Error of 'a | `OK | `Ok of 'b list ] -> int = <fun>
<nullcat> flux: yeah that's what i mean. Just wondering why compiler cannot see the error of the third matching case in the poly example, which is (`Ok | `Error) ... since there is no "`Ok"
<whitequark> BitPuffin: int32
<nullcat> flux: i see
<BitPuffin> whitequark: that's signed though
mort___ has joined #ocaml
<nullcat> flux: totally makes sense now
<BitPuffin> word32 is unsigned
<nullcat> thanks!
<companion_cube> I think there's a library for unsigned ints
<whitequark> opam install uint
reem has quit [Remote host closed the connection]
<BitPuffin> looks like that interfaces with C
<nullcat> psnively: my async already upgrades to that version, and I can use 'wget' to get that tar.gz file on my machine
<nullcat> psnively: did you run "$ opam update"?
<whitequark> BitPuffin: well, so does int32
<whitequark> oh, hi psnively
<psnively> nullcat: Yeah. It’s very weird. opam update says I need to opam upgrade, but when I do, I get errors, just on the Jane Street stuff. But curl works.
<psnively> Hi whitequark!
TheLemonMan has joined #ocaml
<flux> psnively, ..are you using the external resolver?
<psnively> “External resolver?"
<flux> aspcud
<psnively> Beats me.
<psnively> How would I tell? :-)
<flux> so I guess that's a no :)
<flux> do you have aspcud installed?
<psnively> Doubtful.
<flux> well, then you are not using it :)
<flux> opam's internal resolver seems a bit simple, I actually wonder if it's in fact buggy
<BitPuffin> whitequark: would be nice to have something that doesn't depend on an external compiler :o
<psnively> That does seem to simplify things… at least as far as answering your question goes.
<whitequark> BitPuffin: ocaml depends on an external compiler
<flux> but aspcud has resolved those issues 100% for the opam install/upgrade cases I have seen here.. ;-)
<whitequark> I mean, building C extensions just reuses the same machinery ocamlc -custom and, to a degree, ocamlopt use
<BitPuffin> whitequark: it does? for pure ocaml?
segmond has quit [Ping timeout: 240 seconds]
<whitequark> sure
<BitPuffin> I guess it probably uses an external assembler
<BitPuffin> but it's not like it compiles to C
<whitequark> it invokes a C compiler
<BitPuffin> to assemble?
<whitequark> yes
<BitPuffin> hm
<psnively> flux: OK. How do I install aspcud and tell OPAM to use it?
<whitequark> assemble and link, because it doesn't really know linker flags
<flux> psnively, what operating system do you have?
<BitPuffin> whitequark: interesting, would be cool if someone wrote an assembler in ocaml :P
<flux> I suppose it would be great to have aspcud as an opam package, even if it's not in ocaml
<psnively> flux: Mac OS X Yosemite, 10.10.2.
<BitPuffin> (and linker)
<whitequark> BitPuffin: god why
<BitPuffin> moar self host
<psnively> BitPuffin: They did. It’s called LLVM. ;-)
<whitequark> indeed
<vanila> i thought LLVM was C++
<whitequark> though LLD has no ocaml bindings and can't quite self-host
<BitPuffin> psnively: err, it's written in cpp?
<psnively> BitPuffin: Well, OK, technically it’s just OCaml bindings to LLVM...
<flux> psnively, dunno then. find sources and install it the old way :)
<psnively> BitPuffin: Picky, picky.
<whitequark> psnively: brew install aspcud
<psnively> flux: LOL OK, thanks.
<BitPuffin> psnively: xD
<whitequark> no need to build from source
<psnively> whitequark: I avoid Homebrew and MacPorts like the bubonic plague, but thanks.
<flux> psnively, opam also supports some cloud solver
<flux> psnively, haven't used it but apparently it works fine
<whitequark> that seems shortsighted
<psnively> whitequark: So I’m told. :-D
<flux> http://sourceforge.net/projects/potassco/files/aspcud/1.9.0/ - lookie, a pre-built macos build
travisbrady has quit [Quit: travisbrady]
ptc has joined #ocaml
ptc is now known as Guest54001
vivien_ has quit [Quit: Konversation terminated!]
jao has quit [Ping timeout: 240 seconds]
<TheLemonMan> I'm having some problems getting core to install with opam
<TheLemonMan> here's the error it spews http://ix.io/gGd
<whitequark> opam install camlp4
<whitequark> and try again
dav_ has joined #ocaml
dav_ has quit [Changing host]
dav_ has joined #ocaml
<companion_cube> it might be the system switch?
<whitequark> companion_cube: still works
jwatzman|work has quit [Quit: jwatzman|work]
<whitequark> ... hm, or maybe not
<whitequark> still worth a try
<TheLemonMan> whitequark, I already have installed it using my distro packages
<Leonidas> let's just hope your distro is not called "Arch"
<companion_cube> whitequark: I has trouble with camlp4+system, a long time ago
dav has quit [Ping timeout: 255 seconds]
<TheLemonMan> Leonidas, bingo!
<whitequark> wow, 10 sep
<Leonidas> for some reason, they are sitting on it for 5 months now.
segmond has joined #ocaml
<companion_cube> sad
segmond has quit [Max SendQ exceeded]
mort___ has quit [Quit: Leaving.]
segmond has joined #ocaml
Simn has quit [Quit: Leaving]
<Leonidas> I'd recommend against using system ocaml on arch
<Drup> Algebr: opam it!
<TheLemonMan> Leonidas, `opam install camlp4` doesn't seem to like my system ocaml too
<Leonidas> TheLemonMan: opam compiler 4.02.1
<Leonidas> s/compiler/switch/
<Algebr> Drup: I'm not sure about how to write the opam file correctly and I'm kind of fried lol
<TheLemonMan> sigh
segmond has quit [Ping timeout: 244 seconds]
<Drup> Algebr: it's easy, if you do "opam pin add lambda-invaders /path/to/source"
<Algebr> i did
<Drup> it will auto-generate one, propose you to modify it and then save it in the directory
<Algebr> it is pinned via github and whatnot, I guess I just needed to write the install target in the makefile
<Drup> then you can use opam-publish to publish
<Drup> ah, yes, you need an install target.
<Algebr> oh, opam-publish, I missed that part.
<Drup> opam-publish is just for the main opam repo
<Drup> but you should push the opam file in the repository
<TheLemonMan> also, while the compiler is compiling, do you recommend to use Core or Batteries ?
<Algebr> Drup: will do
<Algebr> Drup: I also finished a front-end coding challenge using ocsigen and I wanted to publish it as well but can't on via NDA.
rgrinberg has quit [Ping timeout: 272 seconds]
<Drup> Oh.
<Drup> nice
<companion_cube> TheLemonMan: you can start with the bare stdlib, then you'll see what you miss from richer libraries
<Drup> Algebr: the flock of invaders just exited the screen by the right
<whitequark> wha
<Algebr> yea, cause you probably hit the first column.
<TheLemonMan> companion_cube, RWO examples use the Core, hence the question
Anarchos has quit [Quit: Vision[0.9.7-H-20140108]: i've been blurred!]
<Leonidas> TheLemonMan: then use Core if you use the RWO examples
<companion_cube> right
<Leonidas> (just keep in mind that Core rewrites much of your Stdlib if you open it)
<Drup> Algebr: "Fatal error: exception Invalid_argument("Option.get")" now :D
<Leonidas> (so look at the Core docs not the Stdlib docs for help)
<Algebr> yea, I'm absuing Option.get
<Algebr> heh
<Drup> bad !
<companion_cube> oh wow, you can do this with lambda-term? neat
<Drup> of course you can :D
<Algebr> heh, I don't think it was intended for pseudo-games, but there it is.
<Drup> you manipulate an array of UChar, you can do pretty much whatever you want
<Drup> a matrix*
<Algebr> yea, I was looking for an alien symbol for unicode
<Drup> there is one
<tokenrove> i hacked up a little game in ocaml with tsdl for #1gam on the weekend, which i'd love to get some code review on, but i still need to take a pass at cleaning it and its libraries up.
<Drup> bah, don't clean
<Drup> publish it first, clean after
<Drup> the good old "let me just clean it before publishing" is equivalent to procrastination, just more perverse because it seems justified :D
<tokenrove> ok, with that caveat, it's available here: https://github.com/tokenrove/zookicker
<tokenrove> you are right, of course
<tokenrove> but i am in the middle of finishing a deliverable on actual work and would like to come back to it and give it one more pass.
segmond has joined #ocaml
<Algebr> haha, nice !
<companion_cube> aww, I expected at least a screenshot, tokenrove ^^
ontologiae_ has quit [Ping timeout: 244 seconds]
<Drup> Algebr: not handler by my monospace font, though
<Drup> handled*
<tokenrove> companion_cube: good point. (there's a screenshot on the linked blog post, near the bottom, but i'll add one to the readme. i was holding out hope that i would get the presentation layer implemented.)
<Drup> tokenrove: oh, but it is published, just not anounced, that's fine :p
<companion_cube> oh, neat
<tokenrove> i was hoping to make board's interface parameterized by a presentation module to avoid having board deal with sdl at all. i still need to figure that out.
<tokenrove> anyway, despite it being a weekend hack i would appreciate any feedback on the code, places to improve things, and any expressions of interest in the tsdl-image and tsdl-mixer libraries being fleshed out
<Algebr> Drup: are you on debian?
<Drup> Algebr: nope
<Drup> Algebr: "foo |> (function ...." is pretty much the same as "match foo with ..." but with more parens and an additional operator :p
<Algebr> ahh, oops.
olauzon has quit [Quit: olauzon]
<Drup> considering the operation you do, I think rockets should not be an array.
<Algebr> what instead?
<Drup> a list
<Algebr> yea, I was worried that lists would be slow
<Algebr> although to be fair I didn't try lists at all
<Drup> well,
<Drup> you are copying the array constantly
<Drup> you are *consing* on an array
<TheLemonMan> "Error: Unbound module Core" eww
oriba has quit [Quit: oriba]
travisbrady has joined #ocaml
psnively has quit [Quit: psnively]
<Drup> Algebr: " (* 0 is down, 1 is left, 2 is right *)"
<Algebr> ahh, yep, I see
<Drup> A sum type might be appropriate :D
<Algebr> yea, I did initially
<Algebr> but yea, need to change that
<Drup> (I like the fact there is somewhere "if !go_down = 3"
<Algebr> the single equal sign for equality threw me off occasionally
<Algebr> Drup: one thing that was annoying was tons of | None -> (). Is there something better than that, or is that just nature of imperative code?
<Drup> Option.iter
<apache2> is there a way to make the compiler complain about == ?
<apache2> I very rarely use == in ocaml, but I often end up typing it by accident
<whitequark> let (==) = "no"
<whitequark> well, that won't really show in an error message
<apache2> whitequark: ah, heh :D that works, I guess, but that wouldn't be project-wide, would it?
<whitequark> let (==) = `The_fuck_are_you_doing
<Algebr> lol
<whitequark> apache2: no. look at the -open flag
<apache2> thanks
reem has joined #ocaml
reem has quit [Ping timeout: 265 seconds]
<Drup> Algebr: I wonder if there is a way to have the terminal fire multiple events at once correctly, and remove the auto-repeat period
<Algebr> Drup: that would be really nice
<Algebr> |> is defined as let (|>) f x = x f , right?
badkins has joined #ocaml
<Drup> yes
segmond has quit [Ping timeout: 246 seconds]
hiptobecubic has joined #ocaml
<hiptobecubic> Is 'thinkocaml' a decent book?
<hiptobecubic> it seems like it isn't
<hiptobecubic> but i could be wrong