adrien changed the topic of #ocaml to: Discussions about the OCaml programming language | http://www.ocaml.org | OCaml MOOC http://1149.fr/ocaml-mooc | OCaml 4.02.3 announced http://ocaml.org/releases/4.02.html | Try OCaml in your browser: http://try.ocamlpro.com | Public channel logs at http://irclog.whitequark.org/ocaml
Kakadu has quit [Remote host closed the connection]
ceryo has joined #ocaml
ceryo has quit [Client Quit]
teknozulu has joined #ocaml
shinnya has joined #ocaml
johnf has joined #ocaml
ryanartecona has quit [Ping timeout: 264 seconds]
jonludlam has quit [Ping timeout: 250 seconds]
rand has quit [Quit: leaving]
nullcatxxx_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
jonludlam has joined #ocaml
BitPuffin|osx has joined #ocaml
madroach has quit [Ping timeout: 260 seconds]
sepp2k has quit [Quit: Leaving.]
madroach has joined #ocaml
ontologiae has joined #ocaml
jonludlam has quit [Ping timeout: 272 seconds]
raphaelss has joined #ocaml
huza has joined #ocaml
ril is now known as ril[away]
ril[away] is now known as ril
ontologiae has quit [Ping timeout: 240 seconds]
jwatzman|work has quit [Quit: jwatzman|work]
damason has quit [Ping timeout: 240 seconds]
damason has joined #ocaml
raphaelss has quit [Quit: Leaving]
ontologiae has joined #ocaml
brkdrk has joined #ocaml
<brkdrk> I have two identical 4.01.0 opam installs both having the base-bytes package installed and starting from identical, clean builds, one of them but not the other fails with "Error: Unbound module Bytes"... I compared _tags and myocamlbuild.ml and they are identical. any ideas?
higgs has joined #ocaml
Riviera has joined #ocaml
<brkdrk> ^^^ never mind, adding a BuildDepends: bytes to _oasis solved the issue
jeffmo has quit [Ping timeout: 246 seconds]
ollehar has quit [Ping timeout: 252 seconds]
ontologiae has quit [Ping timeout: 260 seconds]
teknozulu has quit [Ping timeout: 246 seconds]
yegods has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
ygrek has joined #ocaml
ygrek_ has quit [Ping timeout: 240 seconds]
adit has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
damason_afk has joined #ocaml
damason has quit [Ping timeout: 272 seconds]
moei has joined #ocaml
nullcatxxx_ has joined #ocaml
johnf has quit [Read error: Connection reset by peer]
^elyse^ has quit [Quit: Leaving...]
damason_afk has quit [Ping timeout: 240 seconds]
damason has joined #ocaml
pierpa` has joined #ocaml
shinnya has quit [Ping timeout: 260 seconds]
ril has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
ril has joined #ocaml
ril has quit [Client Quit]
sgnb` has quit [Ping timeout: 240 seconds]
nullcatxxx_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
huza has quit [Ping timeout: 260 seconds]
higgs has quit [Ping timeout: 272 seconds]
ygrek_ has joined #ocaml
BitPuffin|osx has quit [Ping timeout: 244 seconds]
Algebr has joined #ocaml
ygrek has quit [Ping timeout: 260 seconds]
<Algebr> I'm trying to dump the AST of some code with ppx_tools but confused why this counts as a syntax error: ocamlfind ppx_tools/dumpast -t "type foo = A | B" -t says that its " -t for type expressions""
nullcatxxx_ has joined #ocaml
<Algebr> I'm trying to create the AST fragment needed to create type foo = A | B and use ppx_tools, etc.
teknozulu has joined #ocaml
larhat2 has joined #ocaml
higgs has joined #ocaml
larhat1 has quit [Ping timeout: 276 seconds]
Guest68832 has quit [Ping timeout: 260 seconds]
trix has joined #ocaml
trix is now known as Guest56329
ril has joined #ocaml
teknozulu has quit [Ping timeout: 246 seconds]
ril has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
ncthom91 has joined #ocaml
teknozulu has joined #ocaml
ril has joined #ocaml
tmtwd has joined #ocaml
igoroliveira has quit [Quit: Connection closed for inactivity]
Bahman has joined #ocaml
teknozulu has quit [Ping timeout: 250 seconds]
ril is now known as ril[away]
larhat has quit [Read error: Connection reset by peer]
larhat has joined #ocaml
ril[away] is now known as ril
ril has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
ygrek_ has quit [Ping timeout: 250 seconds]
teknozulu has joined #ocaml
<brkdrk> Algebr: A|B is a type definition, not a type expression, see http://caml.inria.fr/pub/docs/manual-ocaml/types.html
ncthom91 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
higgs has quit [Remote host closed the connection]
Algebr has quit [Ping timeout: 240 seconds]
darkf has joined #ocaml
ril has joined #ocaml
zaquest has quit [Ping timeout: 255 seconds]
zaquest has joined #ocaml
psy has joined #ocaml
psy has quit [Max SendQ exceeded]
psy has joined #ocaml
voldial has joined #ocaml
<voldial> Anyone use musl? I'm having a hard time getting ocaml to compile with ocmalopt (so unison is happy): https://bugs.gentoo.org/show_bug.cgi?id=566006
ril has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
psy has quit [Quit: Leaving]
mac10688 has quit [Ping timeout: 252 seconds]
nuuit has quit [Ping timeout: 252 seconds]
MercurialAlchemi has joined #ocaml
zaquest_ has joined #ocaml
zaquest has quit [Ping timeout: 246 seconds]
kushal has joined #ocaml
nullcatxxx_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
tmtwd has quit [Ping timeout: 250 seconds]
nullcatxxx_ has joined #ocaml
<flux> adrien, and I suppose in addition to that it's also GPL-incompatible?
<adrien> yup
<adrien> it has its own license
<flux> so rlwrap it is. I should try it some day if it works decently with it. I would expect so.
ygrek_ has joined #ocaml
segmond has quit [Ping timeout: 240 seconds]
cyraxjoe has quit [Remote host closed the connection]
cyraxjoe has joined #ocaml
cyraxjoe has quit [Read error: Connection reset by peer]
cyraxjoe has joined #ocaml
srcerer_ has joined #ocaml
srcerer has quit [Ping timeout: 272 seconds]
coody has quit [Quit: Connection closed for inactivity]
Algebr has joined #ocaml
teknozulu has quit [Ping timeout: 244 seconds]
raphaelss has joined #ocaml
Mercuria1Alchemi has joined #ocaml
segmond has joined #ocaml
nullcatxxx_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
nullcatxxx_ has joined #ocaml
damason has quit [Ping timeout: 255 seconds]
nullcatxxx_ has quit [Client Quit]
Haudegen has quit [Ping timeout: 272 seconds]
zaquest_ is now known as zaquest
orbifx has quit [Ping timeout: 264 seconds]
Haudegen has joined #ocaml
jeffmo has joined #ocaml
jeffmo has quit [Client Quit]
djellemah_ has joined #ocaml
djellemah__ has joined #ocaml
djellemah has quit [Ping timeout: 264 seconds]
djellemah_ has quit [Ping timeout: 265 seconds]
sh0t has joined #ocaml
sgnb has joined #ocaml
zpe has joined #ocaml
pkrnj has quit [Quit: Textual IRC Client: www.textualapp.com]
badon has quit [Ping timeout: 246 seconds]
pierpa` has quit [Ping timeout: 272 seconds]
badon has joined #ocaml
darkf has quit [Ping timeout: 246 seconds]
darkf has joined #ocaml
sh0t has quit [Ping timeout: 240 seconds]
larhat has quit [Quit: Leaving.]
_andre has joined #ocaml
yegods has joined #ocaml
yegods has quit [Remote host closed the connection]
yegods has joined #ocaml
jonludlam has joined #ocaml
jonludlam has quit [Read error: Connection reset by peer]
Kakadu has joined #ocaml
mort___ has joined #ocaml
contempt has quit [Ping timeout: 244 seconds]
contempt has joined #ocaml
Simn has joined #ocaml
python476 has joined #ocaml
moei has quit [Quit: Leaving...]
vbmithr has quit [Read error: Connection reset by peer]
ia0 has quit [Ping timeout: 260 seconds]
voldial has quit [Quit: WeeChat 1.2-dev]
ia0 has joined #ocaml
def`_ is now known as def`
ygrek_ has quit [Ping timeout: 250 seconds]
yegods has quit []
ia0 has quit [Read error: Connection reset by peer]
yegods has joined #ocaml
iosys has quit [Quit: Leaving]
iosys has joined #ocaml
huza has joined #ocaml
Bahman has quit [Read error: Connection timed out]
Bahman has joined #ocaml
kushal has quit [Ping timeout: 260 seconds]
Bahman has quit [Read error: Connection reset by peer]
Bahman has joined #ocaml
ousado_ has quit [Ping timeout: 250 seconds]
raphaelsss has joined #ocaml
huza has quit [Quit: WeeChat 0.3.8]
raphaelss has quit [Ping timeout: 272 seconds]
zpe has quit [Remote host closed the connection]
mfp has quit [Remote host closed the connection]
sepp2k has joined #ocaml
ontologiae has joined #ocaml
Algebr has quit [Ping timeout: 246 seconds]
Bahman has quit [Quit: Ave atque vale]
yegods has quit [Read error: Connection reset by peer]
yegods has joined #ocaml
sz0 has joined #ocaml
ia0 has joined #ocaml
kushal has joined #ocaml
Haudegen has quit [Ping timeout: 244 seconds]
raphaelssss has joined #ocaml
raphaelsss has quit [Ping timeout: 255 seconds]
BitPuffin has joined #ocaml
Haudegen has joined #ocaml
ontologiae has quit [Ping timeout: 260 seconds]
ontologiae has joined #ocaml
mfp_ has joined #ocaml
ontologiae has quit [Ping timeout: 260 seconds]
tvaalen has quit [Ping timeout: 250 seconds]
Beluki has joined #ocaml
mfp_ is now known as mfp
ddosia has joined #ocaml
dsheets has joined #ocaml
tvaalen has joined #ocaml
djellemah__ is now known as djellemah
badon_ has joined #ocaml
badon has quit [Disconnected by services]
badon_ is now known as badon
fedjo has joined #ocaml
fedjo has left #ocaml [#ocaml]
ceryo has joined #ocaml
ncthom91 has joined #ocaml
ncthom91 has quit [Client Quit]
ontologiae has joined #ocaml
ontologiae has quit [Ping timeout: 240 seconds]
yegods has quit [Remote host closed the connection]
octachron has joined #ocaml
FreeBird_ has joined #ocaml
fedjo has joined #ocaml
fedjo has left #ocaml [#ocaml]
FreeBirdLjj has quit [Ping timeout: 240 seconds]
yegods has joined #ocaml
FreeBird_ has quit [Ping timeout: 252 seconds]
^elyse^ has joined #ocaml
^elyse^ has quit [Client Quit]
<Leonidas> https://github.com/antirez/linenoise maybe this? but it's not compatible to the readline API I believe
shinnya has joined #ocaml
<flux> well there is libedit, I think it's compatible
<Leonidas> 22:57 < adrien> (that said there's libedit but contrary to what you might read it definitely differs from readline in some places)
<flux> oh :-)
<edwin> we used linenoise in a C application, works well for basic line editing
<Drup> there is also ledit
<Drup> which is rlwrap in OCaml
<Leonidas> I believe I have tried it but rlwrap worked better.
<Leonidas> not 100% sure, though.
<Drup> probably, I don't use either
<flux> I switched from ledit to rlwrap as well
tmtwd has joined #ocaml
<flux> and actually rlwrap is still my to-go ocaml wrapper, for some reason I haven't quite learned to type 'utop' instead of 'rlwrap ocaml' ;-)
mort___1 has joined #ocaml
<Enjolras_> the recent gasche's poston reddit made me switch to utop
mort___ has quit [Ping timeout: 246 seconds]
<Enjolras_> and... it's actually cool :)
<Leonidas> it is
Mercuria1Alchemi has quit [Ping timeout: 255 seconds]
mal`` has quit [Ping timeout: 240 seconds]
cschneid has quit [Ping timeout: 240 seconds]
n1ftyn8_ has quit [Ping timeout: 240 seconds]
n1ftyn8_ has joined #ocaml
cschneid has joined #ocaml
mal`` has joined #ocaml
tmtwd has quit [Ping timeout: 264 seconds]
tg` has quit [Quit: Reconnecting]
ontologiae has joined #ocaml
tg has joined #ocaml
ril has joined #ocaml
igoroliveira has joined #ocaml
enamex has joined #ocaml
mort___1 has quit [Quit: Leaving.]
ontologiae has quit [Ping timeout: 240 seconds]
zpe has joined #ocaml
Guest38 has joined #ocaml
Guest38 has quit [Read error: Connection reset by peer]
mort___ has joined #ocaml
keg29 has joined #ocaml
<keg29> Hi, has anyone ever encountered an error of the form “unknown C primitive ‘ml_z_of_string_base’” I’m using ocaml version 4.02.3, installed today with opam, have done opam install zarith successfully, running on Ubuntu 14.04 ?
ontologiae has joined #ocaml
psy_ has joined #ocaml
martintrojer has quit [Max SendQ exceeded]
martintrojer has joined #ocaml
slash^ has joined #ocaml
<zozozo> keg29: is gmp installed on your machine ?
octachron has quit [Quit: Leaving]
ril has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<keg29> Yes
ncthom91 has joined #ocaml
<keg29> zozozo: GMP 5. something is installed
zpe has quit [Remote host closed the connection]
<zozozo> hm.. try reinstalling zarith maybe ?
<keg29> Have done that; tried a fresh install on a virtual machine running a clean ubuntu with 15.10, apt_get gmp_dev; opam install zarith; and then tried to build a library using zarith, and got the same message
<dexterph> I'm having some issues with ocaml-curses, I install it with `opam install curses' yet I cannot open it in utop (I can open other modules like 'core' and others I've installed with opam)
<dexterph> I've even tried downloading the source and installing it with `make install'. After this. I can 'open Curses' with utop if I'm in the same directory but in any other directory I get 'unbound module Curses'
<Kakadu> #require "curses" ?
<Drup> keg29: "opam depext zarith"
<dexterph> Kakadu: #require "curses" works
<Drup> if that's not enough, no idea, sorry
<Kakadu> dexterph: Let me guess, you were following real world ocaml recently?
<dexterph> okay and then I can open it
<dexterph> Kakadu: not recently, just want to try writing some curses in ocaml
<Kakadu> I think that some code which allows you to open Core have appeared in the ~/.ocamlinit somehow
nicoo_ has joined #ocaml
<dexterph> yeah, but why can't it find curses?
<dexterph> oh okay, i see now
nicoo has quit [Ping timeout: 272 seconds]
nicoo_ is now known as nicoo
Bahman has joined #ocaml
ril has joined #ocaml
enamex has quit [Ping timeout: 255 seconds]
enamex has joined #ocaml
octachron has joined #ocaml
nullcatxxx_ has joined #ocaml
aphprentice has joined #ocaml
ontologiae has quit [Ping timeout: 246 seconds]
Enjolras_ is now known as trebuh_
trebuh_ is now known as Enjolras
ollehar has joined #ocaml
jwatzman|work has joined #ocaml
mort___ has quit [Ping timeout: 246 seconds]
<ollehar> did I already ask about compiler support for xss-prevention?
<ollehar> tainted strings can be used to prevent sql injection. maybe something similar can be used for xss? like include in the type system if the variable has been escaped.
<ollehar> but then again, would you escape it _from_ or _to_ the database?
jwatzman2 has joined #ocaml
Simn has quit [Ping timeout: 252 seconds]
jwatzman2 has quit [Client Quit]
jwatzman|work has quit [Ping timeout: 246 seconds]
jwatzman2 has joined #ocaml
jwatzman2 is now known as jwatzman|work
jwatzman|work has quit [Changing host]
jwatzman|work has joined #ocaml
demonimin has joined #ocaml
nullcatxxx_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Algebr has joined #ocaml
srcerer_ is now known as srcerer
nullcatxxx_ has joined #ocaml
keg29 has left #ocaml [#ocaml]
cyraxjoe has quit [Ping timeout: 272 seconds]
ontologiae has joined #ocaml
Haudegen has quit [Ping timeout: 240 seconds]
shinnya has quit [Ping timeout: 260 seconds]
Algebr` has joined #ocaml
ontologiae has quit [Quit: WeeChat 1.2]
Algebr has quit [Ping timeout: 246 seconds]
segmond has quit [Ping timeout: 246 seconds]
Kakadu has quit [Quit: Page closed]
Haudegen has joined #ocaml
Simn has joined #ocaml
<j0sh> do AST location values affect compiling? or are they just informative?
<octachron> they are just informative?
<j0sh> i've got some ppx that generates the exact same parse tree, the only difference is in the location information, but the compiler complains that a function is undefined when i'm inserting it via an antiquotation
<j0sh> the post processed source with -dsource looks identical
<octachron> function name/pattern name are not part of the location information. So I don't see how the error could come from here.
<j0sh> yeah, i managed to make the location names match, so the only difference now is that one compiles and the other doesn't. bizarre
<j0sh> is there something other than the parse tree i can look at?
<j0sh> it seems to not be recognizing an anti-quoted function in the environment but if i hard-code the function call in the quotation, it works fine
<octachron> Have you tried the rewriter in ppx_tools?
<j0sh> yeah, output seems the same as -dsource
<j0sh> looks fine
cyraxjoe has joined #ocaml
<octachron> and the output that you obtain with -dsource/rewriter compiles?
dsheets has quit [Ping timeout: 240 seconds]
<j0sh> after removing the "Error: Unbound value..." line from the output, yes, the -dsource output compiles as-is
<j0sh> with the exact same command line
larhat has joined #ocaml
<octachron> then I have no idea how this is happening
ygrek_ has joined #ocaml
Denommus has quit [Quit: rebooting]
<j0sh> i think i figured it out. looks like we can't invoke a function that's inside of a module, but if i do a local opens then call the function without qualifying by the module name, it seems to work
<j0sh> i think i remember now that idents like "Module.AnotherModule.foo" isn't a valid identifier on its own... the parts need to be deconstructed a bit more
<j0sh> would have been nice if the parse tree would show some indication of this rather than grouping the whole path under the same ident. ah well
ollehar has quit [Ping timeout: 252 seconds]
jwatzman2 has joined #ocaml
jwatzman|work has quit [Disconnected by services]
jwatzman2 is now known as jwatzman|work
jwatzman|work has quit [Changing host]
jwatzman|work has joined #ocaml
<octachron> josh, you are right Module.f is not a valid identifier, it should be Ldot( Lident Module, Lident f). I did not think of that.
<octachron> and since there is no way to construct such value "Module.name" in the compiler, the error is hard to spot
darkf has quit [Quit: Leaving]
nullcatxxx_ has quit [Ping timeout: 246 seconds]
<j0sh> octachron: ah yeah, thanks. definitely tricky to spot, this had me scratching my head for a while
zpe has joined #ocaml
yegods has quit [Remote host closed the connection]
jeffmo has joined #ocaml
orbifx has joined #ocaml
yegods has joined #ocaml
^elyse^ has joined #ocaml
contempt has quit [Ping timeout: 260 seconds]
contempt has joined #ocaml
Kakadu has joined #ocaml
zpe has quit [Remote host closed the connection]
yegods has quit [Remote host closed the connection]
Bahman has quit [Quit: Ave atque vale]
BitPuffin has quit [Ping timeout: 265 seconds]
kushal has quit [Quit: Leaving]
sh0t has joined #ocaml
pkrnj has joined #ocaml
sh0t has quit [Remote host closed the connection]
sh0t has joined #ocaml
yegods has joined #ocaml
slash^ has quit [Read error: Connection reset by peer]
yegods has quit [Remote host closed the connection]
^elyse^ has quit [Quit: Leaving]
ollehar has joined #ocaml
yegods has joined #ocaml
orbifx2 has joined #ocaml
raphaelssss has quit [Quit: Leaving]
orbifx3 has joined #ocaml
^elyse^ has joined #ocaml
moei has joined #ocaml
orbifx has quit [Ping timeout: 240 seconds]
Kakadu has quit [Remote host closed the connection]
orbifx2 has quit [Ping timeout: 246 seconds]
Kakadu has joined #ocaml
_andre has quit [Quit: leaving]
nuuit has joined #ocaml
ncthom91 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
yegods has quit [Remote host closed the connection]
Beluki has quit [Quit: Beluki]
Haudegen has quit [Ping timeout: 244 seconds]
shinnya has joined #ocaml
lewis1711 has joined #ocaml
enquora has joined #ocaml
Haudegen has joined #ocaml
raphaelss has joined #ocaml
enquora has quit [Client Quit]
<lewis1711> let's say you have a bunch of union types. let like "let pet = Dog | Cat | Horse ...". All is well and good with your program. then you realise "I need to associate some data with these animals". what approach do you take? say you need to associate each animal with their scientific name. do you make like a function "let scientific_name_of_animal = function ..." ? do you make each member a record? do you make them keys in a map? what
<lewis1711> do you do?
<companion_cube> wow, that depends!
<companion_cube> if the information is the same for each animal, for isntance:
<companion_cube> type animal = { info: info; kind: animal_kind } and animal_kind = Dog | Cat | Horse
<companion_cube> this kind of stuff
<companion_cube> if the information is different for each animal, then I'd use parameters
<companion_cube> type animal = Dog of dog_info | Cat of cat_info | Horse of ....
<lewis1711> the information is the same, meaning of the same data type?
<lewis1711> ahh I see
<reynir> let cat_transformer animal = { animal with animal_kind = Cat }
<reynir> :v
yegods has joined #ocaml
johnf has joined #ocaml
ygrek_ has quit [Ping timeout: 240 seconds]
<Leonidas> j0sh: your apply snippet does not require GADTs at all
<Leonidas> I misunderstood you when you mentioned apply
<Leonidas> j0sh: your code can be shortened to let apply f x = f x which has exactly the same signature and is basically the flipped version of (|>)
ceryo has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
rwmjones has quit [Quit: ZNC - 1.6.0 - http://znc.in]
<^elyse^> let apply = (@@)
rwmjones has joined #ocaml
<Leonidas> ah, yes, exactly.
<Leonidas> I wonder if a true lisp-like apply is even possible in OCaml
<groovy2shoes> currying makes that difficult
ddosia has quit [Quit: Connection closed for inactivity]
<Leonidas> Can't even figure out how the signature would look like… ('a -> 'b -> … -> 'y -> 'z) -> ('a * 'b * … * 'y) -> 'z
<groovy2shoes> the thing that lisp has that makes it easier (in addition to the non-currying) is heterogenous lists
kevinch has joined #ocaml
<Leonidas> basically uncurryN
MercurialAlchemi has quit [Ping timeout: 260 seconds]
ncthom91 has joined #ocaml
havarnov has joined #ocaml
rwmjones has quit [Ping timeout: 250 seconds]
yegods has quit [Remote host closed the connection]
<havarnov> hi, quick question: why doesn't Int.of_string has the type (string -> int option) and instead throughs an error?
Algebr`` has joined #ocaml
orbifx has joined #ocaml
nullcatxxx_ has joined #ocaml
<havarnov> *throws
<companion_cube> short answer: it was written a long time ago, when the style was more toward imperative
<companion_cube> oh wait, in Core?
nullcatxxx_ has quit [Client Quit]
Algebr` has quit [Ping timeout: 240 seconds]
<companion_cube> ah, so Int32
<companion_cube> in the stdlib
<companion_cube> well the stdlib tends to use exceptions, for the reason I mentioned above
kevinch has quit [Quit: Computer has gone to sleep.]
<octachron> Leonidas, it is kind of possible to use GADT to have this kind of apply ( a_1 -> ... a_n ) -> (a_1, .., a_n) t -> 'z works but it is not pretty
<companion_cube> yeah, it's what Format does basically
<companion_cube> octachron: I'm sorry for your PR
<havarnov> companion_cube: ok, thanks. is it common to wrap them up in a function so you dont have to use try ... with everywhere? Or is try ... with as good as option?
<companion_cube> sometimes options are nicer, but in general try...with is ok
<havarnov> IMHO option is better because it forces the user of the function to handle the error
<companion_cube> I'm sorry, I can't give a more precise answer
<havarnov> while the try...with can blow up at runtime..
<octachron> companion_cube, thanks. The lack of information has been a little bit frustrating
<companion_cube> yeah, I agree — I'm sad this is reverted, it was a good idea
<flux> what was?
<companion_cube> overloading indexing operators, mostly .{} and .{}<-
<Drup> octachron: I agree with you, it's quite frustating
<lewis1711> exceptions would be nicer if they were checked. one of the things jave did right IMO
orbifx3 has quit [Quit: AtomicIRC: The nuclear option.]
<companion_cube> amen to that
yegods has joined #ocaml
rwmjones has joined #ocaml
<lewis1711> I like options when they're going to be "caught" (dealt with?) one layer up
<lewis1711> but I feel like exceptions scale better when its buried way down in there
<orbifx> any bindings, wrappers or generally alternative ways to handle unix/linux passwords?
ygrek has joined #ocaml
<edwin> it would be good to know what exception can escape a function, at least for documentation purposes
<orbifx> there is pwd.h for C.
<companion_cube> we need a fracking effect system
<companion_cube> but it's never going to be implemented, it would break too many things
raphaelss has quit [Ping timeout: 250 seconds]
<Leonidas> octachron: hmm, Format seems go go in that general direction.
<Leonidas> I found some "solution" for Haskell but they use typeclasses
<orbifx> for anyone looking for an answer to my question opasswd
<octachron> Leonidas, a short example https://gist.github.com/Octachron/6bbfb9a744a908ef2777
mac10688 has joined #ocaml
moei has quit [Ping timeout: 250 seconds]
rwmjones has quit [Ping timeout: 264 seconds]
python476 has quit [Ping timeout: 246 seconds]
moei has joined #ocaml
sh0t has quit [Ping timeout: 240 seconds]
kevinch has joined #ocaml
<orbifx> Any Arch-ers here (Arch Linux)
<orbifx> ?
<ollehar> companion_cube: why would it break things? an effect system, I mean.
<companion_cube> because the stdlib signature would change, I think
<companion_cube> mostly because of functions that raise exceptions
<ollehar> yeah, but... might be worth it.
<companion_cube> I agree, but one does not simply break compatibility in OCaml
<ollehar> stdlib is weird anyway
<ollehar> hm
<Leonidas> orbifx: yes, me.
rwmjones has joined #ocaml
<orbifx> Leonidas: are you familiriar with this "issue": https://bugs.archlinux.org/task/35245#history
<zozozo> orbifx: don't know if it is a possibility for you, but opam is great for managing ocaml libs/packages
<Leonidas> orbifx: the whole issue is that the ocaml packages in arch are a complete joke.
<Leonidas> orbifx: the solution is to install opam from AUR and use that.
<thizanne> one can once every 20 years companion_cube, you just have to decide if you want effects or `end` after `if` :p
<orbifx> Leonidas: I've done that, but I got my ocaml with pacman the rest of the packages from opam.
<Leonidas> orbifx: yes, tell opam not to use the system ocaml
<companion_cube> thizanne: or to break everything: if we break stuff, let us make it worth :D
<orbifx> The issue is that I actually came across a package which actually needed to include from ocaml's header files.
<orbifx> Leonidas: but it will take ages to build the ocaml toolchain right?
<Leonidas> orbifx: I don't even know why the pkgbuild depends on ocaml and aspcud, opam requires neither
raphaelss has joined #ocaml
<orbifx> zozozo: yeah using opam, but I use the ocaml toolchain from Arch's repos.
<companion_cube> opam doesn't work well without aspcud
<Leonidas> it's still an optional dependency
<Leonidas> I use it without aspcud on fedora and it runs pretty ok. but yes, I once had a pathological case.
<orbifx> Leonidas: it's lablqt which needed to include the ocaml header file and I came across the issue. Is it because the package manager has made some... _dubiou_ decisions?
<Leonidas> orbifx: not really, building ocaml takes about 1/2 the time building core.
<orbifx> Leonidas: on a 5 year old machine, what time would that be roughtly?
<zozozo> orbifx: actually, there ar eonly a handful of packages with compilation times long enough to be annoying (such as coq)
<orbifx> zozozo: I may have build coq already.
<Leonidas> orbifx: I run on an 11 year old machine, takes about half an hour, maybe less.
<zozozo> orbifx: great
coody has joined #ocaml
<Leonidas> octachron: I don't even know where I would begin learning about the features you use in that code.
<orbifx> Leonidas: I don't know where the package maintainer got that Ocaml needs to keep its headers in /usr/lib/ocaml. He might be right, but the headers are useless there.
<orbifx> s/useless/awkward
<companion_cube> heh, funny: GADT + object types
<octachron> the object types are just used as type-level record
<companion_cube> yeah
<companion_cube> I do the same :D
sepp2k has quit [Quit: Leaving.]
<companion_cube> bonus points if you do <foo:bar; ..>
<octachron> most of the time I do <foo:foo; .. > and regret that there is no punning for object type
<companion_cube> lulz
<companion_cube> nor row variables
<octachron> Leonidas, the code might look scary due to an accumulation of tricks but the core ideas are pretty simple
<orbifx> what are the < > for?
<companion_cube> object types
<octachron> If we have an object object method f x = x end its type is < f:'a -> 'a >
<octachron> in some situations (GADT or phantom types mostly?), it can be useful to use object type even if you don't deal with objects
<companion_cube> phantom types are great
<mrvn> phantom object types. Haven't seen those yet in real code.
<companion_cube> there are some in my code
kevinch has quit [Quit: Computer has gone to sleep.]
<companion_cube> want to see? :D
<orbifx> octachron: your code above would benefit from some backticks for marking start-end of code :P
<orbifx> Leonidas, zozozo: either has to use libffi headers to install an opam package before?
<orbifx> s/has/had
* orbifx thinks he should go to bed
<zozozo> orbifx: I install all my ocaml package through opam, so nope
<Leonidas> orbifx: well, if the package you want to install depends on libffi headers
<Leonidas> but not in general
pierpa` has joined #ocaml
<orbifx> zozozo: libffi is not an ocaml package, but it's needed by ctypes-foreign
<zozozo> ok, I haven't really used ctypes (or any project that depends on it yet I think), so I'm afraid I can't help you much
<orbifx> Leonidas: yeah, I want to install opasswd, which needs ctypes-foreign, which needs ffi.h, which is not provided by libffi
<orbifx> zozozo: thanks anyway
<orbifx> Leonidas: I take that back.. another funny location for a header file... looked up the libffi list
<orbifx> ok.. so how can I inject an include path for opam builds?
octachron has quit [Quit: Leaving]
<Leonidas> I've just built opasswd, it required ctypes-foreign and rebuilt ctypes and then it was all done.
<orbifx> It might be that I'm building on an ARM architecture.
<orbifx> So that's making things more interesting.
<orbifx> Leonidas: is your ffi.h in /usr/include?
ygrek has quit [Remote host closed the connection]
<Leonidas> orbifx: it seems to be in /usr/lib/libffi-3.2.1/include/ffi.h
<orbifx> yeah, trying to "inject" that include path in opam build
<orbifx> I actually don't see why it would work on yours and fail on my ARM
<orbifx> I'm trying to build it on my desktop which is x86_64
ncthom91 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<orbifx> yeah builds fine on x86_64
<orbifx> hmmm
<Leonidas> are you sure its due to include locations?
enamex has quit [Quit: Leaving]
<orbifx> maybe not
<orbifx> the error is: /home/xxxxx/.opam/system/build/ctypes.0.4.1/src/ctypes-foreign-base/ffi_call_stubs.c:22:17: fatal error: ffi.h: No such file or directory
<orbifx> there are also these two before: # make: Circular _build/src/ctypes/ctypes_primitive_types.cmx <- _build/src/ctypes/ctypes_primitive_types.cmx dependency dropped.
<orbifx> # make: Circular _build/src/ctypes/ctypes_memory_stubs.cmx <- _build/src/ctypes/ctypes_memory_stubs.cmx dependency dropped.
teknozulu has joined #ocaml
Kakadu has quit [Remote host closed the connection]
<orbifx> let's do an upgade, that always fixes things
<orbifx> :P
ygrek has joined #ocaml
ollehar has quit [Quit: ollehar]
ceryo has joined #ocaml
<zozozo> orbifx: when using opam on arch, and with a swithc different from system, I had to reinstall some switches because of some libraries installed with pacman were upgraded to a new version (happened recently with libncurses if I remember correctly)
<zozozo> correction, it happened with libncursesw.so.5
<orbifx> yeah think faced that too.
<orbifx> I'll check that
<orbifx> actually no, it was my haskell installation that freaked out with that
<zozozo> ^^
<orbifx> lol.. man.. solved..
<orbifx> Leonidas, zozozo: needed to install pkg-config :P
<zozozo> :p
<orbifx> went looking into the makefiles and found some empty path values
<orbifx> an error somewhere along the line would have helped. Do/should opam packages check for these deps?
ncthom91 has joined #ocaml
ril has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
segmond has joined #ocaml
<zozozo> orbifx: you don't have base-devel installed ?