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
Vintila has joined #ocaml
noddy has quit [Ping timeout: 240 seconds]
GeorgeHahn has joined #ocaml
kakadu_ has quit [Remote host closed the connection]
dsheets has joined #ocaml
dsheets has quit [Ping timeout: 252 seconds]
Simn has quit [Quit: Leaving]
GeorgeHahn has quit [Read error: Connection reset by peer]
butts_butts has quit [Ping timeout: 268 seconds]
Emmanuel`_ has quit [Quit: Konversation terminated!]
Emmanuel`_ has joined #ocaml
nicholasf has quit [Remote host closed the connection]
nicholasf has joined #ocaml
seangrove has quit [Remote host closed the connection]
seangrove has joined #ocaml
seangrove has quit [Remote host closed the connection]
seangrove has joined #ocaml
Emmanuel`_ has quit [Quit: Konversation terminated!]
Emmanuel`_ has joined #ocaml
seangrove has quit [Ping timeout: 276 seconds]
Emmanuel`_ has quit [Quit: Konversation terminated!]
seangrove has joined #ocaml
Emmanuel`_ has joined #ocaml
Emmanuel`_ has quit [Quit: Konversation terminated!]
Emmanuel`_ has joined #ocaml
noddy has joined #ocaml
seangrove has quit [Ping timeout: 240 seconds]
nicholasf has quit [Remote host closed the connection]
seangrove has joined #ocaml
nicholasf has joined #ocaml
sh0t has quit [Ping timeout: 240 seconds]
<please_help> I want to pass a string through a markup processor, and then plug the resulting html into my page directly with eliom. However, I don't trust the input string. Is there any library available which provides html escapes? Eliom only does so on non-raw html inputs for obvious reasons. I don't see anything relevant in opam or google.
<Drup> lambdoc maybe
Emmanuel`_ has quit [Quit: Konversation terminated!]
Emmanuel`_ has joined #ocaml
sh0t has joined #ocaml
dsheets has joined #ocaml
<please_help> drup: I don't see anything relevant to escaping HTML in lambdoc's doc or its source at a glance unfortunately.
dsheets has quit [Ping timeout: 250 seconds]
<please_help> nevermind, found it in omd_utils. Thanks.
seangrove has quit [Ping timeout: 260 seconds]
<please_help> unfortunately it requires tyxml < 3.6
Emmanuel`_ has quit [Quit: Konversation terminated!]
Emmanuel`_ has joined #ocaml
seangrove has joined #ocaml
avarsh has joined #ocaml
dsheets has joined #ocaml
Haudegen has quit [Ping timeout: 268 seconds]
dsheets has quit [Ping timeout: 250 seconds]
deko-pyon has quit [Quit: ... the fear fades away.]
deko-pyon has joined #ocaml
Haudegen has joined #ocaml
newbie|2 has joined #ocaml
Emmanuel`_ has quit [Quit: Konversation terminated!]
Emmanuel`_ has joined #ocaml
johnelse has quit [Ping timeout: 240 seconds]
thEnigma has joined #ocaml
<thEnigma> Hi
<thEnigma> I am trying to create a parser, but I have the following issue:
<thEnigma> When I use this, I get unexpected token error
<thEnigma> patom : | aexp { Arith $1 } | STR { String $1 } program : | aexp { Arith $1 } | STR { String $1 } | patom program EOF { Prog ( $1, $2)}
johnelse has joined #ocaml
<thEnigma> Can someone tell me what is wrong with this?
thEnigma has quit [Quit: Page closed]
sh0t has quit [Ping timeout: 248 seconds]
newbie|2 has quit [Ping timeout: 246 seconds]
noddy has quit [Quit: "it's a bit backwards around here"]
dsheets has joined #ocaml
noddy has joined #ocaml
Emmanuel`_ has quit [Quit: Konversation terminated!]
Emmanuel`_ has joined #ocaml
dsheets has quit [Ping timeout: 250 seconds]
johnelse has quit [Ping timeout: 248 seconds]
nicholasf has quit [Remote host closed the connection]
johnelse has joined #ocaml
copy` has quit [Quit: Connection closed for inactivity]
yunxing has quit [Remote host closed the connection]
noddy has quit [Ping timeout: 268 seconds]
Fleurety has quit [Remote host closed the connection]
Emmanuel`_ has quit [Quit: Konversation terminated!]
Emmanuel`_ has joined #ocaml
Akshya_ has joined #ocaml
Algebr has joined #ocaml
<Vintila> Can somone with Cohttp installed run the following and tell me the results: Async.Std.upon (Cohttp_async.Client.get (Uri.of_string "https://google.com.au")) (fun (x,y) -> (Cohttp_async.Body.to_string y >>| print_endline); ());;
<Vintila> Scheduler.go();;
seangrove has quit [Ping timeout: 260 seconds]
nicholasf has joined #ocaml
orbitz has quit [Ping timeout: 252 seconds]
orbitz has joined #ocaml
Emmanuel`_ has quit [Quit: Konversation terminated!]
Emmanuel`_ has joined #ocaml
Emmanuel`_ has quit [Client Quit]
Emmanuel`_ has joined #ocaml
avarsh has quit [Quit: Leaving]
Emmanuel`_ has quit [Quit: Konversation terminated!]
Emmanuel`_ has joined #ocaml
seangrove has joined #ocaml
dsheets has joined #ocaml
badon has quit [Disconnected by services]
badon_ has joined #ocaml
badon_ is now known as badon
dsheets has quit [Ping timeout: 250 seconds]
slash^ has joined #ocaml
Emmanuel`_ has quit [Quit: Konversation terminated!]
Emmanuel`_ has joined #ocaml
seangrove has quit [Ping timeout: 244 seconds]
7YUAALAIW has joined #ocaml
Algebr has quit [Ping timeout: 268 seconds]
Emmanuel`_ has quit [Quit: Konversation terminated!]
Emmanuel`_ has joined #ocaml
Algebr has joined #ocaml
Emmanuel`_ has quit [Quit: Konversation terminated!]
Emmanuel`_ has joined #ocaml
Algebr has quit [Remote host closed the connection]
Algebr has joined #ocaml
dsheets has joined #ocaml
dsheets has quit [Ping timeout: 250 seconds]
Emmanuel`_ has quit [Quit: Konversation terminated!]
Emmanuel`_ has joined #ocaml
seangrove has joined #ocaml
ski has quit [Ping timeout: 260 seconds]
Emmanuel`_ has quit [Quit: Konversation terminated!]
Emmanuel`_ has joined #ocaml
seangrove has quit [Ping timeout: 244 seconds]
Ravana has quit [Quit: Goodbye for now!]
Emmanuel`_ has quit [Quit: Konversation terminated!]
Emmanuel`_ has joined #ocaml
silver has joined #ocaml
malc_ has joined #ocaml
7YUAALAIW has quit [Quit: 7YUAALAIW]
dsheets has joined #ocaml
dsheets has quit [Ping timeout: 248 seconds]
Emmanuel`_ has quit [Quit: Konversation terminated!]
Emmanuel`_ has joined #ocaml
tane has joined #ocaml
nicholasf has quit [Ping timeout: 244 seconds]
nicholasf has joined #ocaml
Algebr has quit [Ping timeout: 240 seconds]
Sorella has quit [Quit: Connection closed for inactivity]
dsheets has joined #ocaml
dsheets has quit [Remote host closed the connection]
dsheets has joined #ocaml
djellemah_ has joined #ocaml
butts_butts has joined #ocaml
darkf has quit [Quit: Leaving]
nicholasf has quit [Remote host closed the connection]
seangrove has joined #ocaml
djellemah_ has quit [Ping timeout: 264 seconds]
seangrove has quit [Ping timeout: 244 seconds]
larhat has joined #ocaml
Simn has joined #ocaml
Haudegen has quit [Ping timeout: 244 seconds]
Emmanuel`_ has quit [Quit: Konversation terminated!]
Emmanuel`_ has joined #ocaml
mettekou has joined #ocaml
Emmanuel`_ has quit [Quit: Konversation terminated!]
Emmanuel`_ has joined #ocaml
slicefd has joined #ocaml
dwillems has joined #ocaml
leyyin has joined #ocaml
Emmanuel`_ has quit [Quit: Konversation terminated!]
Emmanuel`_ has joined #ocaml
Akshya_ has quit [Quit: Leaving]
octachron has joined #ocaml
StatelessCat has quit [Quit: WeeChat 1.4]
TheLemonMan has joined #ocaml
Haudegen has joined #ocaml
djellemah_ has joined #ocaml
StatelessCat has joined #ocaml
pierpa has joined #ocaml
nicholasf has joined #ocaml
Emmanuel`_ has quit [Quit: Konversation terminated!]
Emmanuel`_ has joined #ocaml
nicholasf has quit [Ping timeout: 260 seconds]
copy` has joined #ocaml
tane has quit [Quit: Verlassend]
Emmanuel`_ has quit [Quit: Konversation terminated!]
Emmanuel`_ has joined #ocaml
groovy2shoes has quit [Ping timeout: 250 seconds]
mettekou has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
hunteriam has joined #ocaml
ggole has joined #ocaml
malc_ has quit [Ping timeout: 252 seconds]
foetusSwag has joined #ocaml
<foetusSwag> hey guys
<foetusSwag> is this irc only for ocaml or also for caml light?
dwillems has quit [Ping timeout: 240 seconds]
<ggole> I don't recall much caml light discussion here, but it might be the least worst place to ask
<companion_cube> interesting choice of nickname btw
<ggole> Thanks!
mettekou has joined #ocaml
<companion_cube> I meant foetusSwag :p
seangrove has joined #ocaml
<ggole> ;_;
<companion_cube> :D
<foetusSwag> Thks :P
<foetusSwag> I have some IT homework on Caml and i'm trying to lear the basis of Caml light How much time do you think i need to learn how to manipulate lists for exemple?
<pierpa> from a few minutes to a few days, depending on your background
<companion_cube> bayesian inference tells me there's a 99% proba you're french, in prépa
<flux> companion_cube, lies, bayesian inference would end up at 100%
<flux> (well, according to my experience with dbacl ;))
<companion_cube> :p
seangrove has quit [Ping timeout: 252 seconds]
<artart78> caml light? homework? clearly 100%
<foetusSwag> Yeah :P
<foetusSwag> I'm french in prépa
<foetusSwag> WHy ? do you know someone in the same case? lma
<Drup> It's the only place that uses camllight :]
foetusSwag has quit [Ping timeout: 252 seconds]
fluter has quit [Ping timeout: 248 seconds]
fluter has joined #ocaml
mettekou has quit [Read error: Connection reset by peer]
larhat has quit [Quit: Leaving.]
Emmanuel`_ has quit [Quit: Konversation terminated!]
Emmanuel`_ has joined #ocaml
dsheets has quit [Remote host closed the connection]
octachron has quit [Ping timeout: 244 seconds]
dwillems has joined #ocaml
Emmanuel`_ has quit [Quit: Konversation terminated!]
Emmanuel`_ has joined #ocaml
sgronblo has joined #ocaml
<sgronblo> What's the meaning of this error? Failure: invalid long identifier type?
Anarchos has joined #ocaml
<sgronblo> oh oops, never mind, i had Int instead of int
jackweirdy has joined #ocaml
Simn has quit [Ping timeout: 246 seconds]
Emmanuel`_ has quit [Quit: Konversation terminated!]
Emmanuel`_ has joined #ocaml
butts_butts has quit [Ping timeout: 240 seconds]
mettekou has joined #ocaml
larhat has joined #ocaml
Emmanuel`_ has quit [Quit: Konversation terminated!]
Emmanuel`_ has joined #ocaml
<sgronblo> i think i have this vim merlin thing installed but i am not seeing any errors for a few undefined functions in my program, am i doing something wrong?
<sgronblo> should i have some merlin command on my path or?
<sgronblo> ah its called ocamlmerlin?
<Enjolras> https://github.com/the-lambda-church/merlin/wiki/vim-from-scratch have you followed those instructions ?
<Enjolras> the easiest way is to get merlin from opam
Emmanuel`_ has quit [Quit: Konversation terminated!]
Emmanuel`_ has joined #ocaml
<sgronblo> ok, cool. i was missing the syntastic setting.
dsheets has joined #ocaml
<Enjolras> what is not described here is that you probably want to map some nice command to custom keybindings, on <localleader>something
<Enjolras> check the help, it has some nice things, like Destruct
Emmanuel`_ has quit [Client Quit]
<sgronblo> Enjolras: all right, as a very casual ocamler im happy so far with just the auto completion and the error checking
Emmanuel`_ has joined #ocaml
<sgronblo> did ocaml have some way to use functions as operators like in haskell?
<Enjolras> no. Infix operators are restricted by some syntaxic rules
<Enjolras> but they are functions, if you put () around it, they become normal prefixed functions
<sgronblo> Enjolras: i see
mettekou has quit [Read error: Connection reset by peer]
<Enjolras> if you restrict to autocomplete, and error checking, you will miss the other two killer features, which are jump to definition (like ctags) and printing the type of any expression
dsheets has quit [Ping timeout: 260 seconds]
<sgronblo> wait but, the Pervasives manual shows for example "n lsl m shifts n to the left by m bits"?
<Enjolras> yeah. Pervasives cheats.
<Anarchos> why do i need LC_CTYPE=C each time i use ocaml ??
<sgronblo> so ther is an #infix directive or something?
<Enjolras> sgronblo: afaik those operators are hardcoded in parser, or something magic like this
<Enjolras> lsl is a keyword
<adrien> Anarchos: are you really expecting any answer with such a question?
<Enjolras> let lsl a b = a + b;;
<Enjolras> Error: Syntax error
<Anarchos> adrien yes
<adrien> so here's mine considering how much info you gave
<adrien> it's all because of the illuminati
<Enjolras> sgronblo: that's not ocaml, that's caml light
<sgronblo> wait whats caml light?
<adrien> sgronblo: history
<sgronblo> Enjolras: ok never mind then :)
<Enjolras> caml light is an old version of caml. Old like 20years old
<Anarchos> adrien it seems the compiler relies on the locale to parse floats, which are used internally for hashtable.
<sgronblo> so but then some of the functions in pervasives are infix even though they dont match the infix prefix?
<thizanne> sgronblo │ did ocaml have some way to use functions as operators like in haskell?
<adrien> Anarchos: error message?
<thizanne> you can use a trick for this
<Enjolras> yeah. Plain magic in the stdlib. Actually i think bitwise operators are the only cases
<thizanne> let ( << ) x f = f x;; let ( >> ) f x = f x
<Drup> thizanne: please don't é_è
<thizanne> and then 1 << add >> 2
octachron has joined #ocaml
<Enjolras> >_<
<Anarchos> adrien error "float_of_string"
<adrien> backtrace?
* Anarchos is idle: time to eat
<Enjolras> that's a nice trick, but wouldn't use it in any real code
<thizanne> you don't like fun enough, that's why
<sgronblo> ok, now the vim editing experience is kinda cool already for me
<thizanne> with %apply and %revapply you could even have it with zero overhead :p
<sgronblo> now if only ocaml was as widely available as python or perl
<thizanne> if "widel available" means "installed almost by default or be a dependance of some sotware everyone is using", that's not gonna happen
<thizanne> if it means "you can install it everywhere" it's almost the case
<Enjolras> thizanne: i don't care about overhead, just that the next reader's WTF-O-meter will overflow
<adrien> yeah, only interpreters are installed very widely
<adrien> compilers, only on development machines; but that shouldn't stop anyone
seangrove has joined #ocaml
<Harzilein> thizanne: perhaps "you can host ocaml websites on your shared hosts" would be a nice metric too :)
<Enjolras> adrien: gcc is installed almost everywhere.
<adrien> not by default thought
<thizanne> Harzilein: then python is not really "widely deployed"
<Drup> Harzilein: ocaml binaries don't need anything
jackweirdy has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<Drup> so, you don't need ocaml to be installed ..
<Enjolras> Harzilein: build a native executable, run it
<Harzilein> is fastcgi a common frontend for ocaml web code?
<Enjolras> ah right, shared host only work for interpreted language
<sgronblo> ocaml doesnt have "raw strings" which would treat backslashes as backslashes and not as escape chars?
<sgronblo> like python r'string'
malc_ has joined #ocaml
<Drup> sgronblo: since 4.02 : {|bla"\blo|}
<Enjolras> {||}
<sgronblo> all right, seems like i have 4.02.3
seangrove has quit [Ping timeout: 252 seconds]
<sgronblo> whoa, seems like this Str is a bit different from pcre?
<Enjolras> Drup: i wonder if it is a good practice to use that, since it was done for ppx right ? but i guess any ppx using it will use {ppx_name|foobar|ppx_name}, not the basic {||}
<Enjolras> sgronblo: Str doesn't exist. Move along :p
<Enjolras> for regexp, you can use ocaml-re (pure ocaml), ocaml-pcre (binding to C pcre), or ocaml-re2 (bindings to google re2 library in C++)
<Drup> Enjolras: no, the delimiter should not be used by ppxs
Emmanuel`_ has quit [Quit: Konversation terminated!]
Emmanuel`_ has joined #ocaml
<Enjolras> ok
<Drup> A ppx should do [%foo " ... " ]
<Enjolras> what is the point of giving a name then ?
<Drup> To be able to write that : {bla| |} |bla}
<sgronblo> Enjolras: really?
<sgronblo> it was one of the first things that came up when i googled ocaml regular expressions
<Drup> sgronblo: Yes, avoid str, use re
<Enjolras> (actually, unless you need backreference very badly, don't use ocaml-pcre, ocaml-re and ocaml-re2 both perform better)
newbie|2 has joined #ocaml
<sgronblo> but if my needs are very simple Str should be enough?
<thizanne> if you need backreferences very badly, then you should not use regex anyway
<Enjolras> that is a valid point
<Drup> sgronblo: trust us, use Re :)
<thizanne> should do [%foo " ... " ] │ cnu-
<thizanne> 15:06:20 Enjolras │ what is the point of giving a name then ? │ companion_cube
<thizanne> sorry
<Enjolras> I don't even really know why you shouldn't use Str, but i know it stores state in the runtime as global state, that should be enough to convince you not to use it
<Drup> the API is disastrous
<Drup> it's stateful
<Enjolras> i guess it plays very badly with lwt
<sgronblo> Enjolras: yeah that seemed kinda crappy, but im just writing a toy program
<adrien> API is convenient for short things but after that it gets in the way
<adrien> *short* things
Vintila has quit [Ping timeout: 240 seconds]
<Enjolras> sgronblo: with opam, it is quite easy to depend on external libraries
sh0t has joined #ocaml
<Enjolras> sgronblo: the ocaml stdlib is really minimal, and you should be ready to import some depencies
jackweirdy has joined #ocaml
<Enjolras> It is quite different from most languages where you have almost everything you need in stdlib, like python since you mentionned it
<flux> IMO the most dangerous thing about Str is that even the parts that look like thread safe, aren't, because they are implemented in the terms of the shared state
<flux> ..on the other hand, thread-local-storage would fix those things in a jiffy, but I don't recall an OCaml library to implement that.. or at least Str doesn't use it :)
<Enjolras> isn't that the what multicore does ?
<Drup> flux: lwt has an equivalent ^^'
<Enjolras> but that doesn't solve concurrency monad like lwt
<Drup> (Lwt.key)
<flux> drup, does it require using Lwt.t?
<Drup> but anyway, there is no need for debate, just use re. It has a nice API, good performances, it's small and it even has modules to mimic your favorite regex syntax.
<sgronblo> Ok, your concerns are noted, but I feel safe in using Str for my extremely simple case.
<Drup> (and it's pure ocaml)
<Enjolras> sgronblo: please note you have been warned ;)
<flux> if Str works for you, by no means, use it :)
<flux> s/no/all/ oops ;-)
<sgronblo> hehe
<Drup> flux: well not, it's for lwt threads
<Drup> no*
Emmanuel`_ has quit [Quit: Konversation terminated!]
Emmanuel`_ has joined #ocaml
Emmanuel`_ has quit [Quit: Konversation terminated!]
Emmanuel`_ has joined #ocaml
<sgronblo> hmm, seems like open Str didnt solve the problem of "Reference to undefined global `Str'"
<Drup> add the str package
* Anarchos has returned
dsheets has joined #ocaml
<sgronblo> Drup: needs to be downloaded?
<Drup> No, it's included in the standard distribution
<Drup> How are you compiling ?
<sgronblo> uh i just tried ocaml myfile.ml
<sgronblo> i need to add some lib flags?
<Drup> #use "topfind";; #require "str" ;;
<Drup> in the ocaml toplevel
<flux> in this particular case those lines would go one-by-one to the file, of course
<sgronblo> what is topfind?
nicholasf has joined #ocaml
<Enjolras> (unrelated, but you might want to check utop, it's a toplevel interface more "modern")
Simn has joined #ocaml
<flux> though in general I would advice to just use the compiler
<sgronblo> the compiler?
<sgronblo> ocamlc?
<flux> yep
<flux> well, ocamlbuild does the basics very easily
<sgronblo> i was hoping for something simple like runhaskell
<flux> ocamlbuild myfile.byte
<sgronblo> so i need to create .byte file?
<flux> but actually just using a package requires using a _tags file and then -use-ocamlfind switch or myocamlbuild.ml :)
<flux> sgronblo, well, if you will use just the 'interpreter', you can put #stuff inside the ml file
<flux> sgronblo, but to the compiler those are errors
<flux> so it's basically an either-or-situation
<sgronblo> actually i dont wanna use the interpreter
<sgronblo> im just a complete noob at compiling and running ocaml programs
mettekou has joined #ocaml
<sgronblo> i basicaly have foo.ml that i want to compile and run as easily as possible
<flux> sgronblo, echo 'true: package(str)' > _tags; ocamlbuild -use-ocamlfind foo.byte or foo.native for native build
<flux> and you can add true: debug, bin_annot for some debugging and tooling benefits
nicholasf has quit [Ping timeout: 264 seconds]
<sgronblo> so if i compile to bytecode i need to run the program using some ocamlvm type thing?
<sgronblo> but it will be platform independent?
<sgronblo> but with native i can just ./foo ?
nicholasf has joined #ocaml
<flux> it creates a binary that uses the #! -technique for running it via ocamlrun
<flux> so it works just the same, byte is faster to compile
<sgronblo> ah nie
<sgronblo> nice
<sgronblo> lets try
<flux> in principle the byte code is portable, but I think 32/64-bit and Linux/Windows cause some issues. in practice nobody does it (AFAIK)
<sgronblo> ah so its mostly done to speed up compile times when developing?
<Drup> flux: some people do, sure
<flux> sgronblo, yes. there used to be some other benefits in byte code, such as back traces and dynamic code linking, but nowadays all? that stuff is available for native code as well
<Drup> (there is a warning for 32/64, so that's not really an issue. Not sure about the other, adrien knows)
<sgronblo> all right, my program runs! thanks
<pierpa> sgronblo: you only need to read the first 10 lines of http://caml.inria.fr/pub/docs/manual-ocaml/libstr.html
<pierpa> actually, that's the whole page :)
<sgronblo> what is .cma?
butts_butts has joined #ocaml
<pierpa> a library
<flux> sgronblo, it's an archive of ocaml objects, similar to .a with C and friends
<flux> s/objects/modules/
<Enjolras> (there are only 10 lines in this page, just saying)
<Enjolras> pierpa: you are good at selling stuffs
<pierpa> (it would have been bad if I had told him to res the first 15 lines :)
<pierpa> *read
<sgronblo> would have caused an out of bounds error and cause serious brain damage to me
jackweirdy has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<sgronblo> i still think its a shame that ocaml doesnt have a nice way for you to provide type annotations for your top level functions like in haskell
<pierpa> we've been lucky then
<pierpa> it doesn't?
<companion_cube> edwin, Leonidas: https://github.com/vincent-hugot/iTeML/commit/febe5b4c31c3c76daa08407701ca393aca412a6f <-- new interface for Qcheck begins to stabilize
<companion_cube> (I still need to update the doc)
<flux> sgronblo, the most signatureish way is: let foo : int -> int -> int = fun a b c -> ..
<companion_cube> also of interest to qcheck users
<flux> sgronblo, but of course this doesn't match the syntax in signatures
<sgronblo> is this lack by design or is this something that could be added to ocaml eventually?
<flux> well, I doubt a new syntax for that would be added for arguably marginal benefits..
<Enjolras> i don't see the point of signatures. Unless you want to restrain the type, or add punctually a type constraint to get better errors with polymorphic variants or objects
<ggole> You can already annotate annotate in a signature, at the let level, and at the argument level. Another method would be a bit redundant.
<Enjolras> i feel like finding types is the job of compiler, not mine
<Enjolras> same, i only use signatures for the external api module of lib or for functor arguments
<sgronblo> doesnt Hashtbl have a way to get all the keys?
<Enjolras> You can use fold. Most alternative libraries have a builting function to get keys, but not stdlib
<sgronblo> i see
<sgronblo> the stdlib feels quite weak
<Enjolras> it is.
<ggole> It's deliberately minimal
<ggole> Basically stuff that's needed by the compiler, plus a few bits and pieces
noddy has joined #ocaml
<sgronblo> this feels more like an oversight
<Enjolras> sgronblo: you can use another stdlib. Your choices are core, batteries, and containers
<Enjolras> but i like the fact that you can just pick a lib from opam to do a particular thing when you need it
<sgronblo> yeah but you ideally you would have both a great stdlib and a great package repository
<sgronblo> can you mix those three with each other?
<Enjolras> unless you want your binary to be fat (like 100MB), don't.
nicholasf has quit [Remote host closed the connection]
<Enjolras> there is no point doing that either imo
<Drup> Enjolras: :3
<Enjolras> sgronblo: you can look at those, and pick the one you want, and stick with this choice on a particular project
<sgronblo> i was just wondering what happens when you have other third party dependencies a and b where a uses core and b uses batteries for example?
<Drup> it works fine, your binary get bigger
<Drup> that's all
<Enjolras> sgronblo: that is not ideal :/
<Enjolras> that's why libraries should not depend on core, or batteries
<Enjolras> (core being the biggest one in this game)
<sgronblo> Drup: wont you have cases then where your dep a gives you core.Hashtbl which is incompatible with some function in dep B that expects a batteries.Hashtbl?
<Enjolras> sgronblo: this is not C, everything is scoped
<Enjolras> if you don't open batteries, and batteries is used in a lib you depend, you won't see anything from batteries in your program
<Enjolras> if a lib was re-exporting Hashtbl from batteries and using that in its external api, it would be an issue
<Enjolras> but people are not that dumb :)
<sgronblo> ok
hunteriam has quit [Quit: Connection closed for inactivity]
<sgronblo> hooray, my program also seems to not just compile now but also seems to work correctly
<Enjolras> (even if this case, you would be able to work around the problem by not using open, and using clever module aliases, but fortuntaly i've never seen a lib forcing you to do something like that)
<sgronblo> even though I used Str :)
<sgronblo> the development experience is really nice, but the weak stdlib is a bit sad.
Simn has quit [Quit: Leaving]
Emmanuel`_ has quit [Quit: Konversation terminated!]
Emmanuel`_ has joined #ocaml
mettekou has quit [Read error: Connection reset by peer]
butts_butts has quit [Ping timeout: 240 seconds]
hannes has quit [Quit: Coyote finally caught me]
seangrove has joined #ocaml
seangrove has quit [Ping timeout: 252 seconds]
Algebr has joined #ocaml
TheLemonMan has quit [Quit: "It's now safe to turn off your computer."]
hannes has joined #ocaml
Algebr has quit [Ping timeout: 240 seconds]
orbifx has joined #ocaml
seangrove has joined #ocaml
d0nn1e has quit [Ping timeout: 246 seconds]
d0nn1e has joined #ocaml
Algebr has joined #ocaml
Emmanuel`_ has quit [Quit: Konversation terminated!]
Emmanuel`_ has joined #ocaml
Algebr has quit [Remote host closed the connection]
dwillems has quit [Ping timeout: 240 seconds]
ggole has quit [Ping timeout: 246 seconds]
zaltekk has joined #ocaml
orbifx has quit [Ping timeout: 244 seconds]
_whitelogger has joined #ocaml
<zaltekk> is there something like perlbrew that i can use to bootstrap ocaml and opam on a unix-like system?
groovy2shoes has joined #ocaml
whitequark has left #ocaml [#ocaml]
butts_butts has joined #ocaml
dwillems has joined #ocaml
octachron has quit [Quit: Leaving]
<zaltekk> nevermind, came across ocamlbrew on github. works for what i wanted
Emmanuel`_ has quit [Quit: Konversation terminated!]
Emmanuel`_ has joined #ocaml
noddy has quit [Ping timeout: 240 seconds]
foetusSwag has joined #ocaml
<foetusSwag> hey guys
<foetusSwag> In caml light
<foetusSwag> when did we put ;;
<foetusSwag> ?
<foetusSwag> everytime?
butts_butts has quit [Ping timeout: 240 seconds]
butts_butts has joined #ocaml
Sorella has joined #ocaml
sh0t has quit [Ping timeout: 248 seconds]
<companion_cube> foetusSwag: put it after toplevel statements, it will make your life simpler
GeorgeHahn has joined #ocaml
<foetusSwag> Every line for exemple?
<foetusSwag> let f(x,y,z)=1+x+y+z;; f (1,2,3);;
<foetusSwag> like that?
<lyxia> yes
<lyxia> we prefer writing f x y z
dsheets has quit [Remote host closed the connection]
<foetusSwag> is there any differences?
ygrek has joined #ocaml
<jyc> with the first you're giving the function one argument, which is a 3-tuple
<jyc> if you do let f x y z = 1 + x + y + z, then you give the function three separate arguments
<foetusSwag> whats the main difference?
<foetusSwag> You just need to do f(tuple)?
<jyc> f x y z is much more idiomatic and recommended
<jyc> you can do partial application, your type errors might be a little nicer
<jyc> the main difference is that it is three separate arguments vs one argument
Emmanuel`_ has quit [Quit: Konversation terminated!]
Emmanuel`_ has joined #ocaml
foetusSwag has quit [Quit: Page closed]
butts_butts has quit [Ping timeout: 240 seconds]
groovy2shoes has quit [Quit: Leaving]
mettekou has joined #ocaml
mettekou has quit [Client Quit]
sh0t has joined #ocaml
mettekou has joined #ocaml
<malc_> jyc: http://adam.chlipala.net/mlcomp/ (Currying vs Tupling section)
darkf has joined #ocaml
<jyc> malc_: why are you sending this to me :P
<malc_> jyc: because of the strong remark you made, the link represents, sort of, opposing view
butts_butts has joined #ocaml
dsheets has joined #ocaml
dsheets has quit [Ping timeout: 250 seconds]
mettekou has quit [Read error: Connection reset by peer]
Emmanuel`_ has quit [Quit: Konversation terminated!]
Emmanuel`_ has joined #ocaml
mettekou has joined #ocaml
kakadu_ has joined #ocaml
<jyc> malc_: oh ok, I see
Ravana has joined #ocaml
Emmanuel`_ has quit [Quit: Konversation terminated!]
Emmanuel`_ has joined #ocaml
<Leonidas> companion_cube: i'm in the desert now but will check out when back in civilization.
<Leonidas> companion_cube: TIA!
<companion_cube> TIA?
<companion_cube> well, think of drinking regularly, is all I can say
seangrove has quit [Ping timeout: 252 seconds]
<companion_cube> btw, new blog post: http://cedeela.fr/format-all-the-data-structures.html
<malc_> companion_cube: trouble in algeria.. or thanks in advance
Emmanuel`_ has quit [Quit: Konversation terminated!]
<companion_cube> heh :D
Emmanuel`_ has joined #ocaml
TheLemonMan has joined #ocaml
<malc_> companion_cube: are you into diacritics or something?
<companion_cube> I don't think so?
<malc_> companion_cube: well... you would have to be both into diacritics and dyslexic at the same time, fat chance.. in any case https://en.wikipedia.org/wiki/Cedilla
<flux> cool, sundials numeric solver bindings for ocaml, seems a pretty serious library
<flux> not cool, opam _update_ broke my opam :)
<flux> [ERROR] At ~/ocaml/.opam/repo/default/packages/planets/planets.0.1.14/opam Fatal error: Not a recognised version-control URL
<companion_cube> interesting
<companion_cube> malc_: I use cedilla in french, so it's on my compose key
<flux> I don't quite see what it's complaining about. doesn't it understand https?
<flux> that's not it..
<flux> http://www.modeemi.fi/~flux/random/opam - what's wrong with that?
<Drup> companion_cube: you should link to the box tutorial
<malc_> companion_cube: cedilla is just ç "\C-x 8 ret combining cedilla" way for me poor azerty deprived person
<malc_> s;way;away
<Drup> flux: "https://bitbucket.org/yminsky/planets" <- this is not a repository
<flux> so repositories must be ie. git://.. ?
<Drup> yes
<Drup> (see the manual for the details)
<flux> well git works behind https as well.. :)
<Drup> yes, git+https://
<flux> I guess it would be prudent to not stop functioning after loading in invalid opam-file, though.. but I suppose it would be prudent to find the bug tracker :)
<companion_cube> Drup: right ,done
<companion_cube> https://bitbucket.org/yminsky/planets.git should be a git repo, though
<companion_cube> oh wait, my bad, it's not github
cdidd has quit [Ping timeout: 260 seconds]
<yminsky> Mercurial, not git...
<companion_cube> oh well.
<flux> (does opam do hg?)
<Drup> yes
<malc_> lewd
<flux> so in that case the scheme should be.. hg+https?
<Drup> companion_cube: also, you should get a {h,v,hv}box combinator ...
<Drup> flux: rtfm :D
<companion_cube> CCFormat.vbox;;
<companion_cube> - : ?i:int -> 'a CCFormat.printer -> 'a CCFormat.printer = <fun>
<Drup> then why don't you use it ? :D
<companion_cube> because it's less convenient ?
<companion_cube> I prefer to write boxing in the string when possible
<companion_cube> I could have used it here around the pair, though
noddy has joined #ocaml
slash^ has quit [Read error: Connection reset by peer]
ygrek has quit [Ping timeout: 240 seconds]
seangrove has joined #ocaml
dsheets has joined #ocaml
cdidd has joined #ocaml
dsheets has quit [Ping timeout: 240 seconds]
cdidd has quit [Remote host closed the connection]
seangrove has quit [Ping timeout: 252 seconds]
Haudegen has quit [Ping timeout: 240 seconds]
dwillems has quit [Ping timeout: 240 seconds]
Anarchos has quit [Quit: Vision[0.9.7-H-20140108]: i've been blurred!]
seangrove has joined #ocaml
mettekou has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<flux> the issue I had with the planets package with opam 1.2.0 doesn't anymore break my opam 1.2.2, so everything's fine again ;)
seangrove has quit [Ping timeout: 252 seconds]
dsheets has joined #ocaml
seangrove has joined #ocaml
Algebr has joined #ocaml
martintrojer has quit [Ping timeout: 268 seconds]
MercurialAlchemi has joined #ocaml
mettekou has joined #ocaml
martintrojer has joined #ocaml
<MercurialAlchemi> Drup: looks like the lwt online doc happily displays markup instead of actual doc
Emmanuel`_ has quit [Quit: Konversation terminated!]
dwillems has joined #ocaml
<Drup> Really ? where ?
<MercurialAlchemi> search "wiki" on the page
Emmanuel`_ has joined #ocaml
<MercurialAlchemi> (I suppose it's not a feature)
<Drup> Duh
<Drup> please report ...
<MercurialAlchemi> on the github issue tracker?
<Drup> yes
<MercurialAlchemi> done
TheLemon1an has joined #ocaml
TheLemon1an has quit [Client Quit]
ibor has joined #ocaml
Haudegen has joined #ocaml
<Algebr> so now we have alcotest, ounit, ppx_bisect, quickcheck, qcheck.....which one is the most developed?
<companion_cube> ounit is very popular, and alcotest is just a frontend to it (afaik)
<companion_cube> I don't know much about quickcheck
<companion_cube> and I'm currently merging qcheck and qtest together (so qtest is developed :p)
<MercurialAlchemi> it would be nice to get something like jsverify - the part that lets you generate records declaratively
<Algebr> I only used ounit
cdidd has joined #ocaml
<Drup> MercurialAlchemi: jsverify ?
<Drup> Algebr: you forgot ppx_expect
<MercurialAlchemi> it's a port of quickcheck
<MercurialAlchemi> the 'record' function is pretty cool
<MercurialAlchemi> since (surprise) real-world applications often have (nested) records
<Drup> I am deeply amused by "let's describe type in strings"
cdidd has quit [Remote host closed the connection]
<Algebr> didn't know abut ppx_expect. i like ppx_bisect cause i like shiny things
<Drup> bisect is for coverage, it's just to measure that you are testing, not to actually do the testing
<Algebr> darn
<MercurialAlchemi> eh, well
<MercurialAlchemi> we're using redux at work
<MercurialAlchemi> let's do pattern-matching using a switch on a 'type' field
<MercurialAlchemi> but at least, as of last Friday, we got some type safety by using Typescript :)
<Drup> No flow ?
<MercurialAlchemi> flow is better, imho, but it doesn't read Typescript definition files
<MercurialAlchemi> I like "tsd install randomjslib -s" a lot better than "write the definition yourself using an inacurrate doc and the source code"
dwillems has left #ocaml ["Leaving"]
<MercurialAlchemi> also, we're on Windows, which means the lastest typescript is an "npm install typescript" away, as opposed to "wait for compiled binary or compile yourself"
dwillems has joined #ocaml
cdidd has joined #ocaml
Emmanuel`_ has quit [Quit: Konversation terminated!]
Emmanuel`_ has joined #ocaml
foetus has joined #ocaml
<foetus> Where is the bug
<foetus> let pgcd u v = while v>1 do let c = u let u = v mod u let v = c done ;;
<foetus> :(
<companion_cube> you're using `let` as if it was variable modification
<foetus> We can't?
<companion_cube> but OCaml is not C, and here you're not going to modify v inside the loop
<companion_cube> no
<foetus> How do we modify a variabl?
<companion_cube> let v = c will just make a new variable named v
<companion_cube> well you can't
<companion_cube> you should probably use recursion here
<companion_cube> unless the exercise is specifically about using a loop
<please_help> "The types of client values must be monomorphic from its usage or from its type annotation", what does that mean?
<companion_cube> what is the context?
<companion_cube> (it means a "client" value cannot be polymorphic)
<please_help> foetus: you want ref and <- (or rewrite this in a functional style)
<companion_cube> you mean ref and :=
<companion_cube> :)
<please_help> companion_cube: some error I get from eliom/js_of_ocaml/Lwt
<companion_cube> oh, hmm, I guess values transiting between the client and server must be monomorphic, that is, contain no type variable
<companion_cube> as it's impossible to find the type variable when you deserialize
MercurialAlchemi has quit [Ping timeout: 240 seconds]
<please_help> is there any way to figure out which part holds a type variable?
<Drup> please_help: around the client value
<Drup> [%client (.. : ...)]
Algebr has quit [Remote host closed the connection]
Emmanuel`_ has quit [Quit: Konversation terminated!]
foetus has quit [Quit: Page closed]
wiredsister has joined #ocaml
Emmanuel`_ has joined #ocaml
<please_help> thanks
nicholasf has joined #ocaml
yunxing has joined #ocaml
mettekou has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
butts_butts has quit [Ping timeout: 244 seconds]
Haudegen has quit [Ping timeout: 276 seconds]
dwillems has quit [Quit: Leaving]
foetus has joined #ocaml
<foetus> hi again
<foetus> Why is there an error?
<foetus> let range (premier,dernier,pas) = let taille = (dernier - premier +1) mod pas retourner = make_vect taille 0 for i = 0 to ( taille) do: retourner.(i)<- premier + i*pas;;
<foetus> done ;;
<foetus> *
<foetus> ?
<companion_cube> you can't just write a = b
<companion_cube> every binding is `let x = y in ...`
mettekou has joined #ocaml
<companion_cube> and, `do:` is python
<malc_> hah
<foetus> for i = a to b do
<foetus> didn't work?
<please_help> what's the correct way to reload a page after an interval with eliom or js_of_ocaml? I tried making a dummy widget that calls Dom_html.window##.location##reload after a Lwt_unix.sleep, but that doesn't seem to work.
<foetus> let range (premier,dernier,pas) = let taille = (dernier - premier +1) mod pas let retourner = make_vect taille 0 for i = 0 to (taille) do retourner.(i)<- premier + i*pas done;;
<Drup> Don't use Lwt_unix
<Drup> Use Lwt_js
<foetus> Like that?
octachron has joined #ocaml
<companion_cube> foetus: yeah, but then you need to fix the `let... in`
djellemah_ has quit [Ping timeout: 246 seconds]
<foetus> When i say for i?
wiredsis` has joined #ocaml
<companion_cube> no
<companion_cube> before
antkong has joined #ocaml
<foetus> when? :)
wiredsister has quit [Ping timeout: 250 seconds]
<companion_cube> let taille, let retourner
<please_help> drup: switched to Lwt_js.sleep, but same (lack of) result.
<foetus> let range (premier,dernier,pas) = let taille = (dernier - premier +1) mod pas in let retourner = make_vect taille 0 in for i = 0 to (taille) do retourner.(i)<- premier + i*pas done ;;
<foetus> How to return Retourner?
<companion_cube> done; retourner
nicholasf has quit [Remote host closed the connection]
<foetus> Invalid argument (vect assign when i launch the function :'(
<companion_cube> you need to check: 1/ that the vector has size >= 0 2/ that all array accesses in the loop are valid
<please_help> The proper way to call a js_of_ocaml method which takes no input argument is simply ##method, without a () or extra parameter?
nicholasf has joined #ocaml
<Drup> with ppx, yes
Emmanuel`_ has quit [Quit: Konversation terminated!]
Emmanuel`_ has joined #ocaml
wiredsis` has quit [Ping timeout: 268 seconds]
<foetus> yeah it worls
<foetus> works
<foetus> yeah
<foetus> i'm so happy
<foetus> :D
<foetus> Thank you
<foetus> Thank you :D
<companion_cube> now read it carefully to fully understand each detail ;)
<foetus> oki :)
<foetus> but it not completly works in deed :/
<foetus> let range (premier,dernier,pas) = let taille = (dernier - premier +1) / pas in let retourner = make_vect taille 0 in for i = 0 to (taille-1) do retourner.(i)<- premier + i*pas done; retourner ;; range(1,15,4);;
<foetus> That only shows me 1 5 9
<foetus> but i want also 13 :(
<foetus> Yeah i solve the problem
<foetus> let range (premier,dernier,pas) = let taille = (dernier - premier +1) / pas in let retourner = make_vect (taille+1) 0 in for i = 0 to (taille) do retourner.(i)<- premier + i*pas done; retourner ;; range(1,15,4);;
mettekou has quit [Read error: Connection reset by peer]
<foetus> How do we cut a number
<foetus> for exemple
<foetus> 3.4 ==> 3
<companion_cube> probably `floor`
ygrek has joined #ocaml
<malc_> foetus: int_of_float
<please_help> http://pastebin.com/Aa1FuykF what's wrong with this?
Emmanuel`_ has quit [Quit: Konversation terminated!]
_2can has quit [Ping timeout: 276 seconds]
Emmanuel`_ has joined #ocaml
<foetus> thks guys :P
<foetus> You were all verry helpfull
<foetus> is there any function like make_vect
<foetus> but for lists?
slicefd has quit [Quit: WeeChat 1.4]
<malc_> foetus: what _is_ make_vect
<malc_> ?
<companion_cube> it's caml light
<foetus> it makes a vecto of n time something
<Drup> (Array.make)
<malc_> let rec makelist n init = init :: make_vect (pred n) init;;
<Drup> yeah, try to execute that, I'm watching
<malc_> mea culpa
<malc_> let rec make_list init = function 0 -> [] | n -> init :: (make_list init @@ n -1);;
<foetus> thks :)
sh0t has quit [Ping timeout: 268 seconds]
<foetus> let recherche elt tab= let find=false in for i = 0 to vect_length tab -1 do (if elt=tab.(i) then let find=true else() ) done; find;;
<foetus> Why dont this works? :/
<malc_> most likely due to function names in french
<foetus> lol :P
<foetus> and now ?
<foetus> let research elt tab= let find=false in for i = 0 to vect_length tab -1 do (if elt=tab.(i) then let find=true in ) done; find;;
dsheets has quit [Remote host closed the connection]
<Drup> (please use https://bpaste.net/)
<malc_> uh
<foetus> Why doesn't this works? :)
<malc_> foetus: it doesn't work because it's not valid caml
<malc_> let find = false
<malc_> and then
<malc_> let find = true
<malc_> doesn't do what you think it should do
<malc_> (among other things)
<foetus> What can i do for this?
<foetus> we cant modify something in a loop?
<malc_> you can modify what's mutable
<malc_> find is not
<foetus> how to make it mutable?
<malc_> you really don't need to
<foetus> What that := stand for?
<malc_> let a = ref 0 in a := 1;;
dsheets has joined #ocaml
<malc_> or
<malc_> foetus: is this homework or something?
Emmanuel`_ has quit [Quit: Konversation terminated!]
<foetus> yes :P
<foetus> But i am trying to understand that
<foetus> language
<malc_> foetus: have you read the tutorials?
<malc_> or rosettacode?
<foetus> yeah i red a tutoriel all this night :'(
The_Mad_Pirate has quit [Quit: Konversation terminated!]
<foetus> Here he is
Emmanuel`_ has joined #ocaml
<foetus> in french :(
<malc_> duly noted
dsheets has quit [Ping timeout: 252 seconds]
<foetus> And now?
<malc_> let search elt tab =
<malc_> let rec aux n =
<malc_> if n = vect_length tab then false else
<malc_> if tab.(n) = elt then true else aux (succ n)
<malc_> in aux 0
<malc_>
<malc_> you'll hardly learn anything this way
stomp has quit [Ping timeout: 244 seconds]
<foetus> let research elt tab= let find = ref true in for i = 0 to vect_length (tab ) do if tab.(i)= elt then find:= false else() done; find;;
dsheets has joined #ocaml
malc_ has quit [Quit: ERC (IRC client for Emacs 25.0.50.2)]
leyyin has quit [Ping timeout: 244 seconds]
stomp has joined #ocaml
dsheets has quit [Ping timeout: 250 seconds]
kakadu_ has quit [Remote host closed the connection]
Emmanuel`_ has quit [Quit: Konversation terminated!]
TheLemonMan has quit [Quit: "It's now safe to turn off your computer."]
Emmanuel`_ has joined #ocaml
snhmib has quit [Ping timeout: 276 seconds]
Haudegen has joined #ocaml
sh0t has joined #ocaml
foetus has quit [Ping timeout: 252 seconds]
Vintila has joined #ocaml
octachron has quit [Quit: Leaving]
teiresias has quit [Quit: leaving]
teiresias has joined #ocaml
Vintila has quit [Ping timeout: 252 seconds]
sillyotter has joined #ocaml
sillyotter has quit [Client Quit]