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
GeorgeHahn has joined #ocaml
sjrct has joined #ocaml
ygrek_ has quit [Remote host closed the connection]
ygrek has joined #ocaml
javamonn has quit [Remote host closed the connection]
rgrinberg has joined #ocaml
Anarchos has quit [Quit: Vision[0.9.7-H-20140108]: i've been blurred!]
Tekilla has quit [Quit: Quitte]
ygrek has quit [Remote host closed the connection]
ygrek has joined #ocaml
maufred has joined #ocaml
ygrek has quit [Remote host closed the connection]
ygrek has joined #ocaml
MrScout_ has quit [Ping timeout: 265 seconds]
darkf has joined #ocaml
AltGr has joined #ocaml
agarwal1975_ has joined #ocaml
agarwal1975 has quit [Ping timeout: 255 seconds]
xificurC has quit [Read error: Connection reset by peer]
xificurC has joined #ocaml
ncthom91 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
shinnya has quit [Ping timeout: 256 seconds]
javamonn has joined #ocaml
manizzle has quit [Ping timeout: 265 seconds]
nojb has joined #ocaml
javamonn has quit [Remote host closed the connection]
javamonn has joined #ocaml
ncthom91 has joined #ocaml
struktured has joined #ocaml
agarwal1975 has joined #ocaml
jonludlam has quit [Ping timeout: 276 seconds]
ncthom91 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ncthom91 has joined #ocaml
ncthom91 has quit [Max SendQ exceeded]
ncthom91 has joined #ocaml
<struktured> sometimes I wish github had a "save draft" option on comments
Denommus` has joined #ocaml
<struktured> Denommus: I blame the heavy usage white space
badkins has quit []
manizzle has joined #ocaml
javamonn has quit [Remote host closed the connection]
manizzle has quit [Ping timeout: 256 seconds]
Algebr has quit [Remote host closed the connection]
Algebr has joined #ocaml
Algebr has quit [Remote host closed the connection]
Algebr has joined #ocaml
c74d has quit [Remote host closed the connection]
javamonn has joined #ocaml
agarwal1975 has quit [Quit: agarwal1975]
c74d has joined #ocaml
javamonn_ has joined #ocaml
javamonn has quit [Ping timeout: 252 seconds]
BitPuffin|osx has quit [Ping timeout: 245 seconds]
Algebr has quit [Ping timeout: 256 seconds]
Jaood has joined #ocaml
Jaood has left #ocaml [#ocaml]
idegen has quit [Quit: Leaving.]
javamonn has joined #ocaml
ncthom91 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
javamonn_ has quit [Ping timeout: 240 seconds]
javamonn has quit [Read error: Connection reset by peer]
javamonn has joined #ocaml
javamonn has quit [Remote host closed the connection]
javamonn has joined #ocaml
javamonn has quit [Remote host closed the connection]
bjorkintosh has quit [Quit: Leaving]
s1n4 has joined #ocaml
javamonn has joined #ocaml
javamonn has quit [Remote host closed the connection]
javamonn has joined #ocaml
darkf has quit [Quit: Leaving]
darkf has joined #ocaml
nojb has quit [Quit: nojb]
s1n4 has quit [Ping timeout: 256 seconds]
ygrek has quit [Ping timeout: 256 seconds]
osa1 has quit [Ping timeout: 265 seconds]
javamonn has quit [Ping timeout: 250 seconds]
s1n4 has joined #ocaml
sdothum has quit [Quit: ZNC - 1.6.0 - http://znc.in]
palomer has joined #ocaml
bjorkintosh has joined #ocaml
matason has joined #ocaml
c74d has quit [Ping timeout: 276 seconds]
c74d has joined #ocaml
MercurialAlchemi has joined #ocaml
psy_ has quit [Ping timeout: 246 seconds]
Tekilla has joined #ocaml
GeorgeHahn has quit [Read error: Connection reset by peer]
ygrek has joined #ocaml
ygrek_ has joined #ocaml
ygrek has quit [Ping timeout: 256 seconds]
Tekilla has quit [Quit: Quitte]
kushal has joined #ocaml
Tekilla has joined #ocaml
matason has quit []
djellemah has joined #ocaml
freling has joined #ocaml
swgillespie has joined #ocaml
kakadu has joined #ocaml
jonludlam has joined #ocaml
AlexRussia has quit [Ping timeout: 265 seconds]
wildsebastian has joined #ocaml
ygrek_ has quit [Ping timeout: 264 seconds]
manizzle has joined #ocaml
rgrinberg has quit [Ping timeout: 276 seconds]
<flux> how I was advocating ISO8601.. and then it has a bug! how dare it :)
<dmbaturin> flux: A library for handling 8601 dates has a bug? Or the standard itself?
<flux> the library :-)
<flux> the opam package ISO8601
kakadu has quit [Remote host closed the connection]
<flux> but perhaps it will get fixed soon, pr is in!
<flux> it didn't modulo 60 minutes in the time zone field
samrat has joined #ocaml
samrat has quit [Client Quit]
Submarine has quit [Remote host closed the connection]
Simn has joined #ocaml
ontologiae has joined #ocaml
jonludlam has quit [Ping timeout: 265 seconds]
ontologiae has quit [Ping timeout: 272 seconds]
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Haudegen has quit [Ping timeout: 264 seconds]
freling has quit [Quit: Leaving.]
nullcat has joined #ocaml
<nullcat> em, how to pass inline flag to -cflags when using ocamlbuild?
<nullcat> for example, -inline 3
struk|work has quit [Ping timeout: 246 seconds]
ncthom91 has joined #ocaml
Gama11 has joined #ocaml
ncthom91 has quit [Client Quit]
AlexRussia has joined #ocaml
Tekilla has quit [Quit: Quitte]
rgrinberg has joined #ocaml
Haudegen has joined #ocaml
rgrinberg has quit [Ping timeout: 276 seconds]
Cyanure has joined #ocaml
Tekilla has joined #ocaml
Tekilla has quit [Client Quit]
systmkor has quit [Ping timeout: 245 seconds]
sepp2k has joined #ocaml
Erylisia has quit [Quit: Quitte]
matason has joined #ocaml
ia0 has quit [Quit: leaving]
larhat has joined #ocaml
ia0 has joined #ocaml
steshaw has quit [Quit: Connection closed for inactivity]
kakadu has joined #ocaml
nojb has joined #ocaml
nullcat has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
oscar_toro has quit [Ping timeout: 265 seconds]
rgrinberg has joined #ocaml
remyzorg_ has joined #ocaml
rgrinberg has quit [Ping timeout: 256 seconds]
matason has quit []
axiles has quit [Quit: Quitte]
clog has quit [Ping timeout: 256 seconds]
octachron has joined #ocaml
oscar_toro has joined #ocaml
<flux> if everything else fails, then with a custom myocamlbuild.ml..
<adrien_znc> if everything else fails, if you rebuild the whole build system, then maybe...
<adrien_znc> that's why I dislike the very idea of myocamlbuild.ml
<adrien_znc> and "there's a plugin for everything"
<adrien_znc> it's only admitting that the software fails at meeting the needs of the majority of users
rand000 has joined #ocaml
mengu__ has joined #ocaml
<kakadu> "...With ADT it is not alowed to declare types with indexes but it is possible using GADT...". What 'indexes' do mean in this context?
<pippijn> maybe:
<flux> adrien_znc, well, if the plugin mechanism was like putting files to myocamlbuild.ml.d/ then it would be nice I think :-o
<pippijn> type nat = O | S of nat
<pippijn> wait
<pippijn> type _ nat = O : unit | S : 'a nat -> (unit * 'a) nat
<kakadu> pippijn: O: unit nat?
<pippijn> type _ nat = O : unit nat | S : 'a nat -> (unit * 'a) nat
<pippijn> yes
<kakadu> and what is wrong with 'type nat = O | S of nat' ?
<pippijn> no, I'm wrong
remyzorg_ has quit [Ping timeout: 256 seconds]
larhat has quit [Quit: Leaving.]
<kakadu> Okay, it was explained in the next chapter
<kakadu> index seemsto be when we put value into dependent type specification
<kakadu> or declration
<kakadu> hm, and how it is related to GADT?
Submarine has joined #ocaml
Submarine has joined #ocaml
<kakadu> shit
<kakadu> The guy writes that types with indexes are usually called GADT
<kakadu> Never heared something like that.
larhat has joined #ocaml
palomer has quit [Quit: palomer]
rgrinberg has joined #ocaml
jonludlam has joined #ocaml
rgrinberg has quit [Ping timeout: 264 seconds]
asQuirreL has joined #ocaml
MercurialAlchemi has quit [Remote host closed the connection]
MercurialAlchemi has joined #ocaml
palomer has joined #ocaml
yomimono has joined #ocaml
oscar_toro has quit [Ping timeout: 256 seconds]
mengu__ has quit [Remote host closed the connection]
thomasga has joined #ocaml
rgrinberg has joined #ocaml
palomer has quit [Quit: palomer]
rgrinberg has quit [Ping timeout: 256 seconds]
palomer has joined #ocaml
clog has joined #ocaml
matason has joined #ocaml
kaepora has quit [Quit: leaving]
palomer has quit [Quit: palomer]
mengu has joined #ocaml
<raboof> I can't 'opam install ulex' because it can't find camlp4orf (http://paste.debian.net/172527) - any ideas on how to fix this?
<nojb> use sedlex
<nojb> camlp4 is on its way out
mengu has quit [Ping timeout: 240 seconds]
AltGr has left #ocaml [#ocaml]
<raboof> nojb: unfortunately what I'm actually trying to do in install 'cow', which depends on ulex
<nojb> ah ok
<raboof> (what I'm actually actually trying to do is build the 'hello world' from https://github.com/rgrinberg/opium - it now can't find 'cow.syntax' and I assumed installing cow would be the way to fix that)
<nojb> did you install camlp4 ?
<nojb> opam install camlp4
<raboof> 'Package camlp4 is already installed (current version is 4.01.0).'
<nojb> check in ~/.opam/4.01.0/bin
Gama11_ has joined #ocaml
<nojb> can you see camlp4orf there ?
<raboof> 'find ~/.opam | grep camlp4orf' comes up empty (I don't have a ~/.opam/4.01.0/bin though?)
<nojb> what's your version of ocaml ?
Gama11 has quit [Ping timeout: 256 seconds]
mengu has joined #ocaml
<raboof> 4.01.0 (from Debian)
<nojb> ahh
<nojb> try installing camlp4-extra (or something like that) with apt-get
<nojb> yep, camlp4-extra
kushal has quit [Quit: Leaving]
<raboof> yes that did the trick! thanks
theblatt1 has left #ocaml [#ocaml]
Submarine has quit [Quit: Leaving]
sdothum has joined #ocaml
Gama11 has joined #ocaml
ggole has joined #ocaml
Gama11_ has quit [Ping timeout: 240 seconds]
larhat1 has joined #ocaml
_andre has joined #ocaml
rgrinberg has joined #ocaml
larhat1 has quit [Client Quit]
larhat1 has joined #ocaml
larhat1 has quit [Client Quit]
dav- has joined #ocaml
rgrinberg has quit [Ping timeout: 250 seconds]
dav has quit [Ping timeout: 240 seconds]
Algebr has joined #ocaml
thomasga has quit [Quit: Leaving.]
nojb has quit [Quit: nojb]
larhat has quit [Quit: Leaving.]
mengu has quit [Remote host closed the connection]
larhat has joined #ocaml
psy_ has joined #ocaml
shinnya has joined #ocaml
nojb has joined #ocaml
milosn has quit [Quit: leaving]
mengu has joined #ocaml
dav- is now known as dav
thomasga has joined #ocaml
kushal has joined #ocaml
thomasga has quit [Client Quit]
kushal has quit [Read error: Connection reset by peer]
kushal has joined #ocaml
<companion_cube> http://ocsigen.org/lwt/2.4.8/api/Lwt_bytes never saw that before, but it's nice
jabesed has quit [Remote host closed the connection]
jabesed has joined #ocaml
rgrinberg has joined #ocaml
Thacib has joined #ocaml
rgrinberg has quit [Ping timeout: 240 seconds]
Thacib has left #ocaml [#ocaml]
nojb has quit [Quit: nojb]
dav has quit [Ping timeout: 256 seconds]
dav has joined #ocaml
nojb has joined #ocaml
javamonn has joined #ocaml
agarwal1975 has joined #ocaml
Hannibal_Smith has joined #ocaml
yomimono has quit [Ping timeout: 250 seconds]
osa1 has joined #ocaml
agarwal1975 has quit [Quit: agarwal1975]
<apache2> is there a rule of thumb for when it's ok to use (=) vs when one should use (compare) ?
javamonn has quit [Remote host closed the connection]
<companion_cube> compare is only for cases in which you need to order values (e.g. sorting)
thomasga has joined #ocaml
<flux> just (=) when you feel lazy
<flux> compare when you want to be general :)
<flux> oh, right the polymorphic compare?
<flux> then it's as companion_cube said
javamonn has joined #ocaml
larhat1 has joined #ocaml
larhat has quit [Read error: Connection reset by peer]
<nojb> there is also a difference between how compare treats the float nan
<flux> but if you want to make a polymorphic algorithm that depends on equality, inequaliy or order, take the comparison function as a parameter, don't use the polymorphic compare
<nojb> nan = nan is false
<nojb> but compare nan nan = 0
tg has quit [Ping timeout: 256 seconds]
<companion_cube> awwww
<nojb> so in general you should use compare if your data structures have floats in them .
<xificurC> nojb: could it be any other way? nan = nan is false by the standard right? But I can't imagine what else than 0 should compare return
<apache2> I may be misguided, but I was under the impression (=) was for pointer equality testing
<nojb> (==)
<ggole> type comparison = Lt | Eq | Gt | Unordered
tg has joined #ocaml
<ggole> Of course, that would be quite a pain.
<apache2> nojb: (==) is pointer comparison?
<nojb> yes
<companion_cube> it's just that compare shouldn't work at all on floats
<companion_cube> floats are evil
<apache2> thank you. I think I must have made a mental note that there was something fishy about mistakingly using == instead of = and decided to just use compare
<thizanne> I disagree with you, companion_cube
<thizanne> I think compare should work, but maybe =, < and this stuff might not
<companion_cube> apache2: let (==) = `Use_single_equal_instead, à la Janestreet
<thizanne> but we want to be able to sort a float list or to build a float set, whatever this means
<companion_cube> I don't think so, since it makes no sense
rgrinberg has joined #ocaml
<companion_cube> or just make compare raise an exception on the nan/nan case
<companion_cube> Not_comparable
<apache2> companion_cube: in the top of every file in my projects?
<companion_cube> apache2: well... :/
<thizanne> nan/nan case could fail
struktured has quit [Ping timeout: 256 seconds]
<companion_cube> yeah
<companion_cube> that would be more reasonable
<thizanne> but even if ( = ) on floats does not work as you expect, comparing two floats should be doable
<apache2> companion_cube: it's alright, even if it would be nicer to have it as a compiler flag
Hannibal_Smith has quit [Quit: Leaving]
<companion_cube> thizanne: it's just that compare's contract implies it is a total order
<companion_cube> and floats are not totally ordered because of terrible corner cases like this
<thizanne> then just make it arbitrarily totally ordered, so you can build a set of floats
<thizanne> (that's what compare seems to do ?)
<companion_cube> I'm not sure I want a set of float to contain NaN
<companion_cube> :D
<companion_cube> should it contain several instances of NaN?
<ggole> I've never understood the "just use (=)" people. It's the wrong operation in many cases.
<companion_cube> you can't even test if NaN is inside
<ggole> Not just slow, but failing at runtime or giving wrong results.
<thizanne> probably not, if you cannot distinguish two nan in OCaml anyway
<companion_cube> just use ppx_deriving.eq
rgrinberg has quit [Ping timeout: 255 seconds]
<octachron> companion_cube: a set of floats sounds like a very painful way to learn the difference between real arithmetic and floating point arithmetic
<companion_cube> :)
thomasga has quit [Quit: Leaving.]
idegen has joined #ocaml
Haudegen has quit [Ping timeout: 245 seconds]
steshaw has joined #ocaml
osa1 has quit [Ping timeout: 256 seconds]
wildsebastian has quit [Read error: Connection reset by peer]
BitPuffin|osx has joined #ocaml
badkins has joined #ocaml
BitPuffin|osx has quit [Ping timeout: 256 seconds]
Haudegen has joined #ocaml
agarwal1975 has joined #ocaml
osa1 has joined #ocaml
nojb has quit [Quit: nojb]
<cmtptr> there's no way to parameterize a module defined by a file, is there?
freling has joined #ocaml
<cmtptr> that is, the file-scope module
<companion_cube> I don't think so
<companion_cube> it would be useful, but would make the build even more complicated imho
<Drup> not in the compiler at the moment, no
<Drup> there is the big functor proposal, but it's not implemented
thomasga has joined #ocaml
Submarine has joined #ocaml
nojb has joined #ocaml
Submarine has quit [Remote host closed the connection]
<cmtptr> well then
<cmtptr> ocaml sux!!1
<ggole> Stick a module inside that is parameterised?
<cmtptr> I don't even really know that I'll ever need it, it was just an idea I had and wondered if there was a way to do it
darkf has quit [Quit: Leaving]
<thizanne> it's a quite common need cmtptr, and then people do indeed write a single Make functor in the file
<cmtptr> ah, so Foo.Make is the convention?
<ggole> And S for the signature
<cmtptr> makes sense. tanks
rgrinberg has joined #ocaml
mbac has quit [Quit: leaving]
rgrinberg has quit [Ping timeout: 244 seconds]
<cmtptr> oh, so I just realized that a functor's definition actually has to appear in the mli
<nojb> the signature has to appear in the mli
<cmtptr> or, I guess I should ask: does it? I see that Map.Make does
<flux> hmm, map.mli does not have the signature in the functor definition, rather it references to the module type S?
<cmtptr> oh, you're right
mort___ has joined #ocaml
<cmtptr> so when I do define my Foo.Make in foo.ml, do I need to copy the whole of "module Foo (Key : Eq) (Value : Type) : S with type key := Key.t and type value := Value.t = sig..."? Do the substitutions have to appear in both places?
<flux> hmm, I don't think so. you just write it like: module Foo (Key : Eq) (Value : Type) = struct type key = Key.t ... in the implementation
<flux> the 'with' is part of the syntax for making a variation of a module type, but you don't even need the module types in the implementation
<flux> (though you must have the module type S replicated there sadly)
<cmtptr> oh, that's a shame
<companion_cube> unless you use the foo_intf.mli trick
<flux> there'a a way around it, but it's not pretty: stick the module type into another file and include it
<flux> well, I suppose no need to include it either, you can just refer to it
mort___ has quit [Quit: Leaving.]
<cmtptr> hmmmmmm
<flux> though one might expect the signature be there in the 'main' .mli file. you could just module type S = Foo_intf.S it there.
agarie has joined #ocaml
<companion_cube> yep
<cmtptr> or what if I named it foo/s.mli
<flux> module names aren't automatically formed from directory hierarchy
<cmtptr> oh
jeffmo has joined #ocaml
<cmtptr> yeah I guess that would conflict with submodules in foo.mli
<cmtptr> I guess it's not a huge deal since theoretically implementation should change more often than interfaces
<flux> the compiler will kindly indicate if the signatures don't match :)
<Drup> yep, it helps a bit with interface stability
<Drup> flux: "kindly" :3
<flux> yes, compiler the friendly companion
<flux> btw, has someone tried the enhanced error messages branch?-o
<flux> ie. 4.02.0+improved-errors
<ggole> Does it try to improve on good old "Error: Syntax error"?
<flux> no.
<ggole> :(
<flux> sorry, syntax must be correct
<flux> though I think the dangling ; could well deserve some attention
Armael has quit [Quit: WeeChat 0.4.3]
Armael has joined #ocaml
palomer has joined #ocaml
milosn has joined #ocaml
ski has joined #ocaml
srcerer has quit [Ping timeout: 264 seconds]
Haudegen has quit [Ping timeout: 256 seconds]
<cmtptr> is there any reason to prefer sharing constraint over destructive substitution
nojb has quit [Quit: nojb]
<Drup> basically, it boils down to "do you want to erase the type/module from the original module"
<Drup> sometimes it's desirable, sometimes it's not.
<osa1> ocaml noob here, can anyone help me compiling this programs: https://github.com/diml/lambda-term/tree/master/examples I already built the library using oasis(which is installed using opam)
<osa1> ocamlc failing with syntax error, I probably need a preprocessor but I have no ideas what
slash^ has joined #ocaml
<Drup> osa1: ./configure --enable-camlp4
<Drup> then make
<Drup> and oasis will build them
<osa1> awesome, thanks
rgrinberg has joined #ocaml
<Drup> cmtptr: an example: if you have a module M with signature "type t val compare : t -> t -> int"
<Drup> and you use destructive substitution on it
<Drup> you won't be able to use the resulting module with Map.Make
mengu has quit [Remote host closed the connection]
<cmtptr> oooh, right
kdef has joined #ocaml
slash^ has quit [Read error: Connection reset by peer]
slash^ has joined #ocaml
Haudegen has joined #ocaml
calderonth has quit [Quit: Konversation terminated!]
palomer has quit [Quit: palomer]
<cmtptr> so when writing a module that will be a functor's parameter, is it conventional to specify the signature too (which means I might have to sharing constraints) or to just leave it open?
swgillespie has joined #ocaml
<flux> well, nowadays one can use the syntax "module type of Foo", so perhaps it's not essential
<flux> but there used to be a time, not far far a way, when such syntax didn't exist
<cmtptr> oh, how does that syntax work? I haven't seen it
<Drup> cmtptr: yes, it's rather conventional
<Drup> and it should be prefered. "module type of" is useful but still kind of a workaround
<flux> simply where you would use "S" you can use the "module type of Foo". but perhaps drup is right about this.
<cmtptr> "module Foo : Bar with type t = int = struct type t = int end" becomes ??
<Drup> it doesn't help you in this specific case :p
<cmtptr> oh
<cmtptr> just feels like I'm having to duplicate a lot of information
swgillespie has quit [Client Quit]
javamonn has quit [Read error: Connection reset by peer]
<Drup> well, not that much
tane has joined #ocaml
<cmtptr> well not in this particular example, but between this and the .ml/.mli thing earlier...
<Drup> you can use ppx_import for the .ml/.mli interface duplication
<cmtptr> I'll take a look. thanks
kdef has quit [Quit: Leaving]
kushal has quit [Excess Flood]
srcerer has joined #ocaml
kushal has joined #ocaml
kushal has quit [Read error: Connection reset by peer]
kdas_ has joined #ocaml
kdas_ has quit [Read error: Connection reset by peer]
kushal has joined #ocaml
javamonn has joined #ocaml
Choups314 has joined #ocaml
struk|work has joined #ocaml
Denommus` has quit [Ping timeout: 256 seconds]
freling has quit [Quit: Leaving.]
freling has joined #ocaml
sepp2k has quit [Quit: Leaving.]
octachron has quit [Quit: Leaving]
agarwal1975 has quit [Quit: agarwal1975]
Sorella has quit [Ping timeout: 264 seconds]
Sorella has joined #ocaml
mal`` has quit [Ping timeout: 276 seconds]
<ilia> I am sorry to ask what I've already asked: ocamlfind list shows the module I want to open, but ocamlc complains about "unbound module", I reinstalled ocamlfind, but it did not help
kushal has quit [Ping timeout: 264 seconds]
<Drup> how do you compile ?
mal`` has joined #ocaml
<ilia> opam reinstall ocamlfind
slash^ has quit [Read error: Connection reset by peer]
<ilia> it recompiled
<Drup> No. How do you compile your stuff ..
<ilia> ocamlc -o <name> <source.ml>
<ilia> or "open Re;;" in utop
<Drup> yeah, that doesn't work
<kakadu> ocamlfind c -package PACKAGE_NAME sources
n3ss3s has joined #ocaml
<kakadu> How did you get where Re module is from?
<ilia> opam install
<kakadu> opam packages <> ocamlfind packages
<jpdeplaix> ilia: What Kakadu said. in your case: ocamlfind ocamlc -package re <source.ml> -o <name>
<ilia> thanks, jpdeplaix, I know
<jpdeplaix> if <name> is an executable add -linkpkg to the arguments
<ilia> how to use Re in utop?
<jpdeplaix> #package "re";;
<jpdeplaix> I think
<ilia> does not work
<ggole> #require? Unless utop has different directives.
<reynir> ^
<jpdeplaix> oh yes right, bad memory, sorry
<ilia> many thanks!!
ncthom91 has joined #ocaml
jwatzman|work has joined #ocaml
jwatzman|work has quit [Changing host]
jwatzman|work has joined #ocaml
kushal has joined #ocaml
ygrek has joined #ocaml
freling has quit [Quit: Leaving.]
ncthom91 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
kdef has joined #ocaml
Simn has quit [Ping timeout: 252 seconds]
thomasga has quit [Ping timeout: 256 seconds]
jonludlam has quit [Ping timeout: 240 seconds]
robink has quit [Ping timeout: 255 seconds]
robink_ has joined #ocaml
ncthom91 has joined #ocaml
agarie has quit []
jabesed has quit [Quit: Konversation terminated!]
ollehar1 has joined #ocaml
Choups314 has quit [Ping timeout: 264 seconds]
ygrek has quit [Ping timeout: 264 seconds]
matason has quit []
matason has joined #ocaml
<apache2> anyone got any advice for debugging problems like this: [13832.866728] camlp4[4657]: segfault at 41 ip 00002b8b42fb9bd0 sp 00007fffb90d4670 error 4 in dllbigarray.so[2b8b42fb7000+5000]
<apache2> happens every time I try to compile something that uses camlp4. I've tried on two different linux install running different distributions now
<apache2> (in virtual machines). makes me wonder if it dies because it fails to check a memory allocation (that fails due to low memory) and proceeds to use it?
nullcat_ has joined #ocaml
ollehar1 has quit [Ping timeout: 246 seconds]
<n3ss3s> How do I do integer division that allows for a float result?
<n3ss3s> (I hope there is a prettier way than float_of_int'ing the two numbers)
<apache2> you can use mod to get the remainder
<apache2> or define a helper: let divide_with_float_result a b = float a /. float b
<apache2> `float` is an alias of float_of_int in Pervasives
Simn has joined #ocaml
Hannibal_Smith has joined #ocaml
freling has joined #ocaml
manizzle has quit [Ping timeout: 272 seconds]
javamonn has quit [Remote host closed the connection]
oscar_toro has joined #ocaml
n3ss3s has quit [Ping timeout: 244 seconds]
ggole has quit [Ping timeout: 246 seconds]
thomasga has joined #ocaml
thomasga has quit [Client Quit]
jonludlam has joined #ocaml
<smondet_> apache2: are you sure the camlp4 you are using is at the same version as the ocaml compiler?
smondet_ is now known as smondet
javamonn has joined #ocaml
<cmtptr> using String.iter, I need to skip the first element. Is there a better way than having a "isfirst" ref and in the closure, "if !isfirst then isfirst := false else (* stuff I actually want to do *)" ?
<Drup> Use a for loop ?
<apache2> smondet: I'm using the one supplied by opam, how do I check?
<cmtptr> er, sorry I meant Stream.iter
<cmtptr> I'm terrible at this whole typing thing today D:
<Drup> errr, Stream.iter
<apache2> camlp4 -v says 4.02.1 which is also my opam switch. which camlp4 points to my .opam/4.02.1/bin/camlp4
<Drup> just ... don't use Stream
<cmtptr> oh
<apache2> strace -f says it fails after reading through sexplib.cma
<Drup> cmtptr: what do you want to do ?
<smondet> apache2: ok, so version mismatch must not be the problem
<apache2> I do have camlp4 installed in debian, apparently, I'll try getting rid of that and see if it helps
<apache2> it didn't :(
<cmtptr> Drup, I want to parse a file, but skip the first line because it's a column header
<smondet> apache2: the sexpllib.cma comes also in the right opam switch?
<Drup> cmtptr: just call either input_line or Stream.junk once before iterating
<apache2> oh, smondet, you were right about the version mismatch I think
<apache2> [pid 2177] stat("/home/user/.opam/4.02.1/lib/stublibs/dllbigarray.so", 0x7fff0653f990) = -1 ENOENT (No such file or directory)
<apache2> [pid 2177] stat("/usr/lib/ocaml/stublibs/dllbigarray.so", {st_mode=S_IFREG|0644, st_size=23448, ...}) = 0
<apache2> [pid 2177] open("/usr/lib/ocaml/stublibs/dllbigarray.so", O_RDONLY|O_CLOEXEC) = 4
<apache2> [pid 2177] read(4, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\20\36\0\0\0\0\0\0"..., 832) = 832
<apache2> "dllbigarray.so", whatever that is, is being loaded from the system dir
<apache2> sudo rm /usr/lib/ocaml/stublibs/dllbigarray.so worked. lol.
<cmtptr> Drup, yer so smert
<Drup> not really :p
<smondet> apache2: cool !
<apache2> smondet: is dllbigarray.so some sort of "optional" thing?
manizzle has joined #ocaml
<smondet> it's part of a library "bigarray" that is distributed with the compiler
<smondet> but the dynamic-lib-linker of your setup must have paths in the wrong order for some reason
tsumetai has quit [Ping timeout: 272 seconds]
matason has quit []
kakadu has quit [Quit: Page closed]
nullcat_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<apache2> the opam version doesn't have it
<apache2> it tries reading it from a few places in .opam, then reverts back to the system one
<apache2> I should probably just get rid of the system ocaml
<smondet> apache2: what does `opam info base-bigarray` say?
<apache2> install version: base [system 4.02.1]
<smondet> if installation went ok should have that library somewhere
<apache2> it does
<apache2> what happens is:
<apache2> [pid 3314] stat("/home/user/.opam/4.02.1/lib/stublibs/dllbigarray.so", 0x7fff81f85e20) = -1 ENOENT (No such file or directory)
<apache2> [pid 3314] stat("/usr/lib/ocaml/stublibs/dllbigarray.so", 0x7fff81f85e20) = -1 ENOENT (No such file or directory)
<apache2> [pid 3314] stat("/home/user/.opam/4.02.1/lib/ocaml/stublibs/dllbigarray.so", {st_mode=S_IFREG|0700, st_size=29616, ...}) = 0
<apache2> so first it looks in lib/stublibs in opam, which doesn't exist. then it tries the system lib (and segfaults if I don't remove it from there), then it tries ocaml/stublibs/ in the opam dir and finds it
<apache2> that is the output of `strace -f make |& fgrep dllbigarray` in a directory with a project that uses camlp4
hugomg has joined #ocaml
Haudegen has quit [Ping timeout: 272 seconds]
<smondet> weird order indeed
<apache2> I guess for now I can probably symlink ~/.opam/4.02.1/lib/stublibs to ocaml/stublibs
<apache2> oh. no, those are two different directories
ncthom91 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<Denommus> does anyone have any idea on how I can create tests for arrows that represent continuous values?
ollehar has quit [Read error: Connection reset by peer]
swgillespie has joined #ocaml
ollehar has joined #ocaml
A1977494 has joined #ocaml
A1977494 has left #ocaml [#ocaml]
TheLemonMan has joined #ocaml
kushal has quit [Quit: Leaving]
<Denommus> does it make sense to run utop under Emacs?
<flux> well, maybe after you disable some features from it. but I think no.
<flux> though emacs could benefit from it.. perhaps best would be to write some specific top level driver support to utop to make this situation work great.
<flux> just today I was hoping merlin would work in toplevel ;)
mort___ has joined #ocaml
nullcat_ has joined #ocaml
<Denommus> hm. Is there a package with ('a, 'b) result?
<Algebr> Denommus: yea, I use utop under emacs, its pretty good
<Denommus> ah, it's Result.t
<Algebr> Result.t from core is that, I thought
<Denommus> yeah
<flux> algebr, so how does the expanding stuff work?
<Denommus> but core is huge
<Algebr> What do you mean expanding?
<Algebr> So what its huge, (I never understood that argument)
<flux> utop has some dynamic functionality when you write stuff down, it suggests completions
<apache2> Algebr: the size means it's hard to compile it on VPS'es, and it takes for fucking ever to compile
jonludlam has quit [Ping timeout: 272 seconds]
<apache2> if ocaml had dead module/code eliminination that might help
<Algebr> flux: Yea, that's regular tab completion, just opens up the possible completions in another buffer
Haudegen has joined #ocaml
wraithm has joined #ocaml
<Denommus> Algebr: I'm doing a library. As of now the only dependency is unix. Putting core as a dependency may be too much for the user
<flux> algebr, so I guess it has then some emacs magic in it?
<flux> I mean how else could it work
<Algebr> like all other code completion ways that emacs does with other repl like things.
<flux> well is emacs knows nothing about it, it can only do dynamic completion
<smondet> Denommus: flux there is already a utop.el (that's how I use utop)
<flux> but utop knows which modules are in the scope and can complete them
<flux> but yes, I see there is indeed utop.el, so that probably gives all nice stuff
<flux> maybe I'll start using it :)
<Algebr> I installed core from scratch on a 3 year old macbook, took 10 minutes and its a one time deal. I just don't see why people complain about rock solid code given away so that you don't have to reimplement everything again and again.
<flux> algebr, bbbut the binary size!
<Denommus> smondet: I didn't know, thanks
<apache2> a three year old macbook is more than most people have, Algebr
<Denommus> Algebr: I personally don't care about dependencies, but my users may
javamonn_ has joined #ocaml
<flux> science time! I have raspberry pi without core, I'll benchmark :)
<Algebr> Most people is what? Regular people off the street, or developers? Because I would bet that over 90% of developers have at least a 3 year old macbook
<flux> time opan install -y core
<flux> my laptop is much older than 3 years. but I do have a desktop..
javamonn has quit [Ping timeout: 245 seconds]
<Denommus> Algebr: most developers I know never had a macbook
<Algebr> I mean something at least the equavalent of a 3 year old macbook in computing strenght
<apache2> Algebr: most people I know. feel free to use Core with your uptown friends
<flux> ;-)
<smondet> Algebr: on the machine I'm using to write this; compiling core_kernel goes out of memory
<Denommus> I never had a macbook
<cmtptr> hey since we're in anti-core mode, any reading recommendations that don't depend on core?
<flux> welll, in general the non-core counterpart is Batteries
<Algebr> smondet: a VM?
<flux> and maybe OcamlNet
<flux> and some other libraries
<apache2> Algebr: also: how about smartphones? surely your friends have smartphones and want to run ocaml apps? or do they all use iphone and do you want to suggest core + ocaml_of_js ?
<apache2> or js_of_ocaml i guess is the name
<cmtptr> flux, looking for tutorials/books, not libs
<flux> apache2, well, even smartphones are pretty kickass
<apache2> not in terms of memory
<Algebr> What ocaml apps? No one is doing ocaml on iphone, that posteros thing not counting.
<flux> the resulting apps are not huge, or at least not all the code needs to be loaded to memory :)
<apache2> which is what breaks the build flux, the processing time is sort of bearable I guess
<Denommus> I wish there was a library with nothing but result
<Denommus> because that's all I want now, really
<smondet> Algebr: yes a VM, everything I do in OCaml compiles & works on that, and on my ARM chromebook as well. Binary size and compilation craziness is just part of what I have against core-like blobs.
<Algebr> You could implement it, right, its not a complicated type
<Denommus> Algebr: I know, but will it be compatible with Result from other libraries (including core)?
<apache2> there's batteries and containers, Denommus, are they usable?
<Denommus> I'm not very knowledgeable on OCaml's type system yet
<Denommus> screw it, I'm going to implement it
<smondet> Denommus: there are already 3 or 4 libs that implement only Result
<smondet> the interesting ones use polymorphic variants, so they are compatible between each other
<Algebr> smondet: I guess I just don't care about Binary size at all and compliation of code to me is a big so what if I get solid reusable code.
<Denommus> smondet: any particular one I should use?
<Denommus> smondet: thanks
<smondet> Algebr: you also get absurd version constraints, for little changes. You get C code --that you don't even use-- linked-in and running module initializations every time the program starts. etc.
matason has joined #ocaml
<Algebr> smondet: I haven't experienced that pain yet, but I see this as a valid complaint.
mengu has joined #ocaml
ollehar has joined #ocaml
ollehar has quit [Remote host closed the connection]
jonludlam has joined #ocaml
kakadu has joined #ocaml
matason has quit [Ping timeout: 256 seconds]
javamonn_ has quit [Remote host closed the connection]
nullcat_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
ollehar has quit [Remote host closed the connection]
nullcat has joined #ocaml
ollehar has joined #ocaml
javamonn has joined #ocaml
ollehar has quit [Remote host closed the connection]
matason has joined #ocaml
ontologiae has joined #ocaml
xificurC has quit [Remote host closed the connection]
xificurC has joined #ocaml
swgillespie has quit [Quit: Textual IRC Client: www.textualapp.com]
<ilia> I have a question about Re.perl. How to extract groups after match or exec?
<ilia> Re_perl
larhat has joined #ocaml
<Drup> Re.get_all
_andre has quit [Quit: leaving]
<ilia> thanks, will try
<Drup> Re.get_* functions in general, to get the "content" of a substrings
<nullcat> i tried ocaml-re and re2(c++ code) last night.
<nullcat> it's amazing that ocaml-re is even faster..
<ilia> what is faster or easier to use?
<ilia> maybe it depends on specific regexpes
s1n4 has quit [Ping timeout: 244 seconds]
<nullcat> yeah
<flux> rpi is still compiling core.. ;)
<nullcat> i only tried two cases
Anarchos has joined #ocaml
<flux> I'll report the time in the morning.. if it has passed..
Choups314 has joined #ocaml
<Drup> nullcat: re's implementation is insane
<nullcat> insane?
<Drup> it's literally a jewel of design-for-efficiency
<Drup> it has various clever trick that makes it really really fast
<Drup> (and it's also absolutely not documented)
Choups314 has quit [Client Quit]
<ilia> not documented :(
<Drup> ilia: I'm talking about the internal implementation
n3ss3s has joined #ocaml
<Drup> ok, the external interface is also poorly documented ...
<nullcat> external interface is ok to me...
<ilia> I have to look into internal source code
<Drup> eeh, you do ?
<ilia> nothing bad with it though
<nullcat> Drup: I am planning to read the internal code... I am just afraid there might be too many clever tricks I don't understand
<Drup> because the name and the types are pretty explanatory most of the times.
<Drup> nullcat: it's very hard to understand, but it might be ocasionally enlightening
ollehar has joined #ocaml
s1n4 has joined #ocaml
<Drup> but the transition function is .... wow
<nullcat> ok i may seek help from you later...
<Drup> ahah, seek my help
<Drup> like I understand it :D
<nullcat> ... well
<Drup> so, basically
<Anarchos> Drup which transition function ?
<nullcat> i just hate when beautiful code is not documented... like typing/typecore.ml. This community has many amazing project but they are barely readable...
<Drup> yeah
ollehar has quit [Remote host closed the connection]
<nullcat> at least typing/typecore.ml is obscure to me
<Drup> Anarchos: well, the transition table of the automaton.
<Drup> it's regular expression matching, there is an automaton :3
<Drup> nullcat: you might find this interesting: http://okmij.org/ftp/ML/generalization.html
<nullcat> ok thanks!
ollehar has joined #ocaml
<Anarchos> Drup oh sure, but it is generated by ocamllex, no ?
<Drup> in ocaml-re ? certainly not
<Anarchos> Drup then it is time to ask... what is ocaml-re ?
uris77 has joined #ocaml
ontologiae has quit [Ping timeout: 256 seconds]
agarwal1975 has joined #ocaml
s1n4 has quit [Ping timeout: 246 seconds]
<nullcat> i think my skill can improve after reading the source code of a good project, but some of them are not possible for me to read. this is sad...
<Drup> nullcat: bunzli's libraries are readable
<nullcat> ok..!
<Drup> after that, it depends a lot of what you are looking for
rgrinberg has quit [Ping timeout: 264 seconds]
<nullcat> Drup: I'm also wondering how you guys start to have the ability to hack ocaml compiler. i guess one may need to accumulate lots of knowledge and experience to do that?
<Anarchos> nullcat as for every big project : tackle little problems, and go slowly deeper and deeper in the code... (i do'nt hack the ocaml compiler)
<Drup> I have access to jerome vouillon, pierre chambart and grégoire henry in the next offices.
<Drup> that's how I do :D
jwatzman|work has quit [Quit: jwatzman|work]
<nullcat> ...!!
<nullcat> working at OCamlPro?
<Drup> No, but same offices
<nullcat> oh ok
<nullcat> i have access to Jeremy Yallop this summer. hope I can learn something
<Drup> Indeed, that tend to helps :p
jwatzman|work has joined #ocaml
<Drup> nullcat: what are you going to do at OCamllabs ?
<nullcat> it looks like sedlex
<nullcat> Drup: but I just feel sick when reading the scala code https://github.com/begeric/FastParsers
<Drup> Oh, very interesting
<Drup> you are going to be the one working on that, nice.
<nullcat> the paper is straightforward though
<nullcat> yes... I don't feel very confident though
<nullcat> and jeremy wants to implement in MetaOCaml. We first agreed the prototype can be written in OCaml and then we program in ppx.
<Drup> ok
tsumetai has joined #ocaml
<Drup> that seems sensible
<nullcat> but it seems like we are going to stick with MetaOCaml eventually
freling has quit [Quit: Leaving.]
swgillespie has joined #ocaml
struktured has joined #ocaml
mort___ has quit [Quit: Leaving.]
ygrek has joined #ocaml
<nullcat> and to be honest, I haven't written any parser generator before (but i still choose it, hoping to challenge myself)
nullcat has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
javamonn has quit [Read error: Connection reset by peer]
javamonn has joined #ocaml
nullcat has joined #ocaml
s1n4 has joined #ocaml
nojb has joined #ocaml
nullcat has quit [Client Quit]
divyanshu has joined #ocaml
<orbitz> Is there a good document explaining the migration path to Bytes? I'm tryign to do it and concerend my code won't be valid..
<nojb> there's not too much to it really : with -safe-string bytes and string are different types . if you want to know if your code will be valid just use -safe-string and see if it compiles. if it compiles, it will be :)
<orbitz> Swell, thanks
<orbitz> Do you know if you can set this in utop to play around?
<Drup> orbitz: if anything, the main risk is your code being more valid
<Drup> not less
<Drup> (and with more copying)
<nojb> utop -safe-string ?
<orbitz> Hrm looks like that might work
<Drup> btw nojb, we were talking re earlier. Are you still working on your unicode patch
<orbitz> Drup: Yes, in this particular code I'm trying to avoid the copying, but have itbe safe
<orbitz> I know in one place I can cheat and get away with Bytes.unsafe_to_string;;
<orbitz> The main problem is Core though
<struktured> orbitz: what project is this, if you don't mind?
<nojb> Drup: haven't really made much progress since the initial patch
<orbitz> struktured: I'm writing a little on-disk queue
<nojb> (not enough time)
<Drup> ok
<nojb> but am interested in improving it
<orbitz> ment for simple things where you want to have a queue that survives between process restarts
<struktured> orbitz: opensource? if so got a link?
<orbitz> struktured: It doesn't exist yet :)
<struktured> ok ok sorry :)
<orbitz> Well, right now it's just some brokeen code
<orbitz> Right now I'm working on the log portion
<orbitz> and trying to get my bytes and core aligned
<nojb> Jerome sketched a way to implement the missing features (lookahead and lookbehind)
<nojb> I need to dive into the code and figure out how to actually do it ...
<Drup> I can try to give a hand in a few weeks
<nojb> sure that would be great !
rgrinberg has joined #ocaml
MercurialAlchemi has quit [Ping timeout: 240 seconds]
<struktured> orbitz: what makes your real life problem merit it's own queue implementation? Is ocaml lacking a good disk based (pure) one?
<Denommus> the ArrowChoice names don't make a lot of sense in OCaml
<Denommus> ondering if I should call the functions "ok" and "error" instead
<orbitz> struktured: It isn't pure (on the file system, after all), but yes, I have not been able to fidn a trustworthy disk based queue in any language other than maybe Erlang
<orbitz> an that one isn't even that trustworthy
<Denommus> s/ondering/wondering/
tane has quit [Quit: Verlassend]
MercurialAlchemi has joined #ocaml
<struktured> orbitz: I will at least consider ocaml-kafka, although it's possibly a little too much middleware for your needs
<struktured> *will/would
<orbitz> struktured: I'm not looking after middleware. I'm looking after something that will queue things when my middleware is down
<orbitz> so I need an on disk queue library
<struktured> I see, well looking forward to your future project announcement :)
<struktured> Denommus: where is this ArrowChoice code?
<orbitz> struktured: It's pretty small piece of code thankfully. Just data + length + crc-32 (for now). But will be open and probably in opam of course!
<Denommus> struktured: in my library? Still haven't pushed it
<struktured> Denommus: what are the function names called now? Also do you mean actually functions or just a (polymorphic) variant /
Gama11 has quit [Read error: Connection reset by peer]
<Denommus> struktured: actually functions
jwatzman|work has quit [Quit: jwatzman|work]
matason has quit []
MercurialAlchemi has quit [Ping timeout: 265 seconds]
mengu has quit [Remote host closed the connection]
jwatzman|work has joined #ocaml
<apache2> is the bitstring module compatible with -safe-string ?
Simn has quit [Quit: Leaving]
<nojb> no
<apache2> thank you! :D
<nojb> it is not hard to patch to make it compatible if needed (only a couple of lines)
<struktured> Denommus: u mean for first and second functions?
<Denommus> struktured: left and right
<Denommus> maybe I should make a "either" type instead of "result"
<struktured> if it's not in general an error result is sort of a poor choice
<Denommus> it's not an error, usually
<smondet> Denommus: if it is not an error, best is to define a proper type (unless there is an obvious reason why left is left and right is right)
uris77 has quit [Remote host closed the connection]
<Denommus> smondet: the reason is because the position of the parameter, nothing more
javamonn has quit [Remote host closed the connection]
ygrek has quit [Remote host closed the connection]
ollehar1 has joined #ocaml
ygrek has joined #ocaml
kakadu has quit [Remote host closed the connection]
nullcat_ has joined #ocaml
ollehar1 has quit [Remote host closed the connection]
osa1 has quit [Ping timeout: 252 seconds]
larhat has quit [Quit: Leaving.]
TheLemonMan has quit [Remote host closed the connection]
<Drup> rgrinberg: in furl, do you think the host should be specified in the path/in the url or only later (in the eval function, for example)
<Drup> ?
larhat has joined #ocaml
Hannibal_Smith has quit [Quit: Leaving]
<apache2> nojb: but if I wait, perhaps the author will update it?
hugomg has quit [Quit: Leaving]
<nojb> apache2: sure, eventually :)
ollehar1 has joined #ocaml
ygrek has quit [Remote host closed the connection]
<rgrinberg> Drup: IMO later is better
divyanshu has quit [Quit: Textual IRC Client: www.textualapp.com]
tsumetai has quit [Ping timeout: 244 seconds]
<Drup> so, directly in the eval/extract/match functions ?
ygrek_ has joined #ocaml
<Drup> well, extract could not care
nojb has quit [Quit: nojb]
<Drup> rgrinberg: but in theory, we could have routes with different host names
<nicoo> Drup: Your usecase would be binding web APIs that are not served from a single canonical location (i.e. any web API provided but some soft you can install yourself, for instance), I guess ?
<ollehar1> why is there no consensus about how a macro system should be built for a PL? lack of research?
<nicoo> If so, how would it handle http://foo.example/$API vs. http://bar.example/baz/$API ?
<Drup> nicoo: simple. You have the concat function over path.
<nicoo> Ok, so the “host” component would just be a regular path
<Drup> well, currently, it's part of the path, yes
<nicoo> I see
<Drup> ollehar1: because nobody designed a genuinely good one for typed languages.
<ollehar1> hm
<Drup> nicoo: also, don't forget it's also for server, not only for client
tsumetai has joined #ocaml
<rgrinberg> Drup: that's a good point. I imagine the main use case is just tweaking the host for different environments and/or testing
<Drup> or virtual hosts
<Drup> just serving multiple website with one server, in general
osa1 has joined #ocaml
<nicoo> Drup: That was part of my point
<rgrinberg> IMO those use cases are secondary but if they can be supported, then hey, why not
<Drup> currently, it's sort of supported out of the box, because the host is literally integrated with the path
<Drup> but it generates some discutable semantic points, like the concatenation of two paths drop the host of the second one.
<rgrinberg> one thing furl reminds me of is this java lib called retrofit - http://square.github.io/retrofit/. furl is a lot more focused than retrofit but i really like how fast retrofit lets me wrap rest api's.
<rgrinberg> it's not that relevant, but a good inspiration
<Drup> why do people keep thinking pure white background is elegant and grey code on white background is a good idea
<rgrinberg> it's probably some common bootstrap theme :P
<Drup> I call that "internet brainstroke", but I guess it's equivalent
<Drup> rgrinberg: I don't see anything that can't be done already with furl
<Drup> oh, header and post, yeah, that's not here yet
<Drup> the whole return type thing is a great question, though
<Drup> rgrinberg: do you think I should care about it ?
<rgrinberg> Yeah, retrofit isn't directly comparable. I'd imagine wanting to build something like retrofit on top of furl though
<rgrinberg> and no i don't think you should care about it
<Drup> ok
<Drup> I should care about post parameters and http verb at some point, though
<rgrinberg> yeah, it's not so clear if those require cutesy combinators however
<Drup> why not ?
<rgrinberg> maybe i just don't have the imagination ;)
<Drup> Don't worry, I'll find combinators :D
<rgrinberg> but OTOH i imagine something simple and applicative (drawing inspiration from cmdliner)
<Drup> I don't see why the API shouldn't be exactly the same than for query parameters
larhat has quit [Quit: Leaving.]
<rgrinberg> can you give an example? To me, the point of furl is to have something "url like"
<rgrinberg> i could be missing the point though
<Drup> except the mode of transmission, do you make any difference between get and post parameters ?
<Drup> some are in the url, some are not
ncthom91 has joined #ocaml
<Drup> but from an API point of view
<Drup> this is completely insignificant.
<Drup> so I don't see why the combinators to manipulate the should be different
<Drup> you would just say "this pile of stuff is for get params, this for post params" at the end, that's all
<rgrinberg> hmm, ok let's see an example of you imagine a couple of extra headers a json body would be inserted
<rgrinberg> s/a json/and a json/
<Drup> headers is something else :p
<Drup> we were talking post params ;)
<rgrinberg> true, but post params is just a url encoded body. json is just as common.
<Drup> what's the issue with json ?
<rgrinberg> there isn't
<rgrinberg> i just want to get a flavor for the api
<Drup> I wonder if I should special case Json handling
<jcloud> is there overview documentation for cohttp somewhere?
<rgrinberg> jcloud: no. but feel free to ask here
<Drup> it's not really possible to make that fit into Re though, so probably not a good idea
<jcloud> rgrinberg: I see, thanks
<Drup> (ahah, parsing json with Re, krkrkr)
Cyanure has quit [Remote host closed the connection]
<Algebr> rgrinberg: will this be merged soon? https://github.com/mirage/ocaml-cohttp/pull/341/files, it looks like the correct fix
<jyc> when I run `make docs` for cohttp, are the docs not supposed to go in the docs/ directory?
<Drup> (converters are not documented yet, I know)
<rgrinberg> Algebr: I'm not so sure. The client shouldn't just choke when there's no content-length header no?
<Drup> the type of "my_json_url" is: unit -> (Yojson.Safe.json -> 'a, 'a) Furl.t
<Algebr> Well why else would the Body.of_string crap out when given which I guess is an empty body
<rgrinberg> Algebr: exactly, it shouldn't crap out. the fix is just tricking it not to using the server
<rgrinberg> Drup: wait, so this would put json into the url? that's not so useful...
<Drup> I know, but it's to show you how it works for query and that's it's perfectly possible
<Drup> (and useful or not, I have seen it done)
javamonn has joined #ocaml
<rgrinberg> jyc: i believe it's $ make doc
<jyc> oops, sorry, that is what I meant. when I run make doc, I do get documentation, but it is in a bunch of folders named *.docdor and not in docs/
madroach has quit [Ping timeout: 264 seconds]
<rgrinberg> jyc: sounds right to me. i just had a look at the generated docs for like the second time ever
<rgrinberg> man they are broken
<jyc> haha :(
<Drup> :/
<jyc> what do you use instead of the generated docs?
madroach has joined #ocaml
<jyc> I've been reading through the .mli files, but
<rgrinberg> i just read the mli's because merlin can look them up faster
<rgrinberg> Algebr: i should probably write something up in the PR though. thanks for reminding me
<rgrinberg> wait, so do you write the associated ocamldoc below or above the thing you're documenting?
<rgrinberg> seem like we do it both ways in cohttp T_T
<Drup> doesn't matter, as long as there is no space
<Drup> I personally do it 1)below functions in .mli 2)above types and modules 3) above functions in .ml
<rgrinberg> hmm then why do our header docs look so messed up for example
<rgrinberg> ok, first of all there should be a module level doc line
<rgrinberg> but that doesn't fix it
<Drup> 1) first ocamldoc comment is module level, always
<Drup> 2) camlp4 screw up comment locations, badly
<jyc> rgrinberg: neat, didn't know merlin could do that. thanks
<rgrinberg> Drup: i tried 1) doesn't help :/
<rgrinberg> so i guess it's sexp...
<Drup> probably, yes.
<Drup> (you should still add a module header comment)
<nullcat_> can sedlex use ocaml-re? will this increase the speed a lot?
<Drup> not at the moment, two reasons
<Drup> -re doesn't support unicode
<Drup> -re is not streaming
<nullcat_> oh i see
<rgrinberg> another reason, no bigstring support :/
<Drup> rgrinberg: that's independent from using it for sedlex
<rgrinberg> aye
<rgrinberg> nullcat_: does this segfault for you? https://github.com/mirage/ocaml-cohttp/pull/344
<nullcat_> let me see
badon has quit [Disconnected by services]
badon_ has joined #ocaml
<rgrinberg> Drup: we should the next hacking session for cohttp/ocsigen :P
badon_ is now known as badon
<nullcat_> cohttp hacking session sounds nice to me, much much less hardcore than "compiler hacking session"
ollehar1 has quit [Remote host closed the connection]
<rgrinberg> it's an ocsigenserver hacking session
<rgrinberg> where the work is boring and the rewards are miniscule :/
<Drup> rgrinberg: in one and a half week, we finish the ocsigen cohttp stuff for good
robink_ is now known as robink
<nullcat_> rgrinberg: Segmentation fault: 11 for me
<nullcat_> i need to take a nap
<nullcat_> leave a msg anytime