adrien changed the topic of #ocaml to: Discussions about the OCaml programming language | http://www.ocaml.org | Upcoming OCaml MOOC: https://huit.re/ocamlmooc | OCaml 4.03.0 release notes: http://ocaml.org/releases/4.03.html | Try OCaml in your browser: http://try.ocamlpro.com | Public channel logs at http://irclog.whitequark.org/ocaml
faster has quit [Quit: leaving]
johnf has quit [Read error: Connection reset by peer]
johnf has joined #ocaml
Heasummn has quit [Disconnected by services]
Heasummn_ is now known as Heasummn
Heasummn_ has joined #ocaml
Heasummn_ has quit [Disconnected by services]
Heasummn_ has joined #ocaml
Heasummn_ has quit [Remote host closed the connection]
fluter has quit [Ping timeout: 265 seconds]
mfp has quit [Ping timeout: 265 seconds]
fluter has joined #ocaml
sh0t has quit [Remote host closed the connection]
ygrek has joined #ocaml
mengu has quit [Remote host closed the connection]
ygrek has quit [Ping timeout: 265 seconds]
zv has quit [Ping timeout: 276 seconds]
zv has joined #ocaml
pierpa has quit [Ping timeout: 248 seconds]
Heasummn has quit [Ping timeout: 255 seconds]
sigjuice has quit [Quit: ZNC - http://znc.in]
sigjuice has joined #ocaml
<ydl> is there a timeline for modular implicits? are they expected in 4.04?
sdothum has quit [Quit: ZNC - 1.6.0 - http://znc.in]
al-damiri has quit [Quit: Connection closed for inactivity]
axiles has quit [Ping timeout: 276 seconds]
axiles has joined #ocaml
ydl` has joined #ocaml
evhan has quit [Quit: de irc non curat lector]
evhan has joined #ocaml
ydl has quit [Ping timeout: 265 seconds]
tmtwd has joined #ocaml
ydl` has left #ocaml ["ERC (IRC client for Emacs 24.5.1)"]
ygrek has joined #ocaml
mengu has joined #ocaml
mengu has quit [Ping timeout: 264 seconds]
rgrinberg has quit [Quit: WeeChat 1.5]
rgrinberg has joined #ocaml
slash^ has joined #ocaml
MercurialAlchemi has joined #ocaml
Simn has joined #ocaml
rgrinberg has quit [Ping timeout: 240 seconds]
tmtwd has quit [Ping timeout: 272 seconds]
shinnya has joined #ocaml
ggole has joined #ocaml
tmtwd has joined #ocaml
FreeBirdLjj has joined #ocaml
copy` has quit [Quit: Connection closed for inactivity]
wu_ng has joined #ocaml
wu_ng has quit [Remote host closed the connection]
Intensity has quit [Ping timeout: 255 seconds]
_whitelogger has quit [K-Lined]
_whitelogger has joined #ocaml
sdothum has quit [Quit: ZNC - 1.6.0 - http://znc.in]
<faster_> hmm, OCaml warns that Warning 16: this optional argument cannot be erased
sh0t has joined #ocaml
igoroliveira has joined #ocaml
<faster_> works though
<zozozo> indeed, one way to circumvent this is to add a unit argument to f: let f ?x () = ...
<zozozo> because, as x is an optional argument is should be possible to not provide it, and thus call f as : "f ()", but it's not possible if the last argument is optional
ldopa has joined #ocaml
igoroliveira has quit [Client Quit]
<faster_> Oh I see. I suspect the best appraoch is just to build typechecks into the pipeline because it makes the code more straightforward for people reading it
igt0 has joined #ocaml
bruce_r has joined #ocaml
ygrek_ has joined #ocaml
sdothum has joined #ocaml
ygrek has quit [Ping timeout: 248 seconds]
octachron has joined #ocaml
faster_ is now known as faster
dtp has quit [Quit: Fix config.]
pyon has joined #ocaml
shinnya has quit [Ping timeout: 244 seconds]
Simn has joined #ocaml
dmerc has joined #ocaml
Intensity has joined #ocaml
octachron has quit [Read error: Connection reset by peer]
dmerc has quit [Ping timeout: 265 seconds]
dmerc has joined #ocaml
<faster> Is batteries or Core more popular?
octachron has joined #ocaml
<zozozo> depends who you ask ,:p
<zozozo> there's also containers
<faster> Looks like "open Batteries" shows up 3000 times and "open Core.Std" shows up 10,000 times and counting on Github
octachron has quit [Remote host closed the connection]
<zozozo> well, a lot of people actually dislike opening modules as it tends to shadow identifiers
bruce_r has quit [Ping timeout: 248 seconds]
<zozozo> so, I wouldn't take that as a measure of popularity
<faster> Well then, among users that open their standard library module, Core seems much more popular.
mcc has joined #ocaml
<faster> The annoying thing is List.sum and List.avg and the like aren't there from what I can tell
ygrek_ has quit [Ping timeout: 240 seconds]
trystero is now known as tristero
<zozozo> List.sum = List.fold_left (+) 0
<zozozo> (eventually, with (+.) and 0. for float lists)
laserpants has quit [Ping timeout: 248 seconds]
<zozozo> for the average, depends on how efficient you want it to be
Anarchos has joined #ocaml
<letaris> Core.Std is very careful not to shadow stuff
<letaris> almost all the functionality is in sub modules
<letaris> But I generally agree with your point about opening modules, it's something one should be careful about
<zozozo> letaris: well, the point of opening Core.Std is to at least shadow the stdlib modules, so that List become Core's rather than the stdlib, no ?
<letaris> Yes
<letaris> open is very powerful, so it should be used carefully.
nore has quit [Ping timeout: 248 seconds]
<letaris> I guess I'm saying in the case of Core.Std it was thought about pretty carefully, so I think it's probably almost always safe to do, assuming you want to use core
<letaris> As far as Core vs Batteries, I don't know. I've never used batteries.
agarwal1975 has quit [Quit: agarwal1975]
<ggole> The assumption seems to be that if you use Core, you don't also use the stdlib.
<ggole> Which is probably not all that unreasonable an assumption, but I can imagine it being annoying for somebody who has existing code and wants to use a little thing that happens to be in Core.
sdothum has quit [Quit: ZNC - 1.6.0 - http://znc.in]
<letaris> I mean, it's really easy right
<letaris> module Z = Core.Std.ThingIWantToUse
<ggole> (And it's probably OK if that person realises that they should not do 'open Core'.)
<ggole> Right.
<letaris> I don't think mixing core with other stuff is problematic. Async is another matter ...
<ggole> I can imagine a (sloppily run) project with some files using open Core and others not, and massive confusion ensuing.
<ggole> But I doubt it happens much in practice.
<ggole> It seems to be mainly newbies that trip over it.
<Anarchos> Is there a library to read Elf binaries in OCaml ,
<Anarchos> ?
<ggole> They follow RWO, start up the regular toplevel, and then wtf.
<letaris> That would indeed be strange.
<faster> hehe I was in that trap last week, ggole
cube_bot has quit [Remote host closed the connection]
cube_bot has joined #ocaml
<ggole> Anarchos: I think there's a libelf wrapper somewhere
<companion_cube> !search batter
<cube_bot> [!batteries_doc]
<companion_cube> !batteries_doc
<companion_cube> ok, so the bot now has !search
Algebr` has joined #ocaml
<ggole> It's not a libelf wrapper at all
<letaris> I'm curious what you want an elf lib for?
<letaris> compiler?
tmtwd has joined #ocaml
<faster> !search statistics
<cube_bot> []
<companion_cube> it's looking in pre-registered factoids
<companion_cube> !statistics = https://github.com/hammerlab/oml
<cube_bot> Bien reçu
<companion_cube> oops
cube_bot has quit [Remote host closed the connection]
cube_bot has joined #ocaml
<companion_cube> !statistics
<companion_cube> sorry for the remaining bits of french
<Anarchos> what is the status of ocaml multithread ?
<companion_cube> !search multi core
<cube_bot> [!multicore]
<companion_cube> !multicore
rwmjones_hols is now known as rwmjones
<faster> awesome library, thanks!
<companion_cube> !awesome
<companion_cube> !awesome = https://github.com/rizo/awesome-ocaml
<cube_bot> done.
<companion_cube> a good place to look for libraries
<faster> lol wow. I just found ocurl there. Thanks again
<companion_cube> no pb! :)
<faster> It's amazing how easy OCaml is to understand and read, even without explicit documentation
nore has joined #ocaml
octachron has joined #ocaml
soupault has joined #ocaml
<faster> how do you turn the infix * operator into a function?
<faster> (*) is a comment
<zozozo> ( * )
CuriousErnestBro has quit [Ping timeout: 264 seconds]
<zozozo> faster: ^
<Algebr`> let ( * ) a b = ...
<faster> thanks!
<Algebr`> faster: yep, the type system helps so much
<companion_cube> Algebr`: have you seen the new !search feature? :p
soupault has quit [Remote host closed the connection]
<Algebr`> no
<Algebr`> !search lwt
<cube_bot> [!lwt_log; !lwt_io; !lwt; !concurrency]
<Algebr`> !search javascript
<cube_bot> []
<Algebr`> !search opam
<cube_bot> [!repl; !opam]
<Algebr`> neat!
<Algebr`> !search tutorial
<cube_bot> [!tutorials]
<Algebr`> !tutorials
tmtwd has quit [Ping timeout: 240 seconds]
<Algebr`> anyone have examples about how to pass stuff like uint32_t from C side to OCaml side?
<Anarchos> Algebr` Val_int32(uint32_t v) ?
<Algebr`> hmm, I thought I tried that, maybe I wrote Val_uint32
<Algebr`> yes, that doesn't exist
tmtwd has joined #ocaml
phase_ has joined #ocaml
<pigoz> anyone uses ounit? it's kinda strange that assert_equal "foo" "bar" doesn't print something like.
phase_ has quit [Client Quit]
<pigoz> expected foo, got bar instead
<nore> pigoz: IIRC, you have to give it a printer function for the values you compare
<nore> I guess it just skips the printing if that function is not given
zv has quit [Read error: Connection timed out]
trevorriles has quit [*.net *.split]
hnrgrgr has quit [*.net *.split]
tg has quit [*.net *.split]
jpdeplaix has quit [*.net *.split]
artart78 has quit [*.net *.split]
luzie has quit [*.net *.split]
gasche has quit [*.net *.split]
ski has quit [*.net *.split]
fedruantine has quit [*.net *.split]
_habnabit has quit [*.net *.split]
zaltekk has quit [*.net *.split]
sheijk has quit [*.net *.split]
henrytill has quit [*.net *.split]
jrslepak has quit [*.net *.split]
low-profile has quit [*.net *.split]
rseymour has quit [*.net *.split]
pigoz has quit [*.net *.split]
MasseR has quit [*.net *.split]
pigoz has joined #ocaml
trevorriles has joined #ocaml
tg has joined #ocaml
hnrgrgr has joined #ocaml
jpdeplaix has joined #ocaml
ski has joined #ocaml
luzie has joined #ocaml
gasche has joined #ocaml
low-profile has joined #ocaml
rseymour has joined #ocaml
zaltekk has joined #ocaml
_habnabit has joined #ocaml
jrslepak has joined #ocaml
henrytill has joined #ocaml
fedruantine has joined #ocaml
artart78 has joined #ocaml
sheijk has joined #ocaml
MasseR has joined #ocaml
danieli has quit [Ping timeout: 255 seconds]
danieli has joined #ocaml
faster has quit [Ping timeout: 250 seconds]
faster has joined #ocaml
faster has quit [Ping timeout: 276 seconds]
faster has joined #ocaml
zv has joined #ocaml
Ferlex has joined #ocaml
<Ferlex> hey guys, how can i declare a function with an if statement??
<companion_cube> let f x = if … then … else …
<companion_cube> ?
<flux> maybe he means vice versa. but let's hear.. :)
<Ferlex> yeah that works, thank you very much!
<ggole> Ferlex: you want to define a function that has a different definition depending on a condition?
<Ferlex> well that would be interesting
<Ferlex> how can i do that?
<companion_cube> let f = if … then (fun x -> …) else (fun x -> …)
bruce_r has joined #ocaml
<Drup> or, in a more readable fashion, "let f = let g = .. in let h = ... in if .. then h else g"
<ggole> Yeah. That's what I thought you were asking for.
<bruce_r> What does it mean when you get the Error Modules do not match, sig ... is not included in ..., without any more explanation? Often I get an extra "value x is required but not provided" or "values do not match", but here there's no other detail. Does it mean I have mismaches with my functorial parameters?
<bruce_r> (sorry if I paste this twice, not sure if the first one went through)
<Drup> bruce_r: can you past the exact message ?
<companion_cube> it means that the type of `x` does not fit, or that the signature asks for `x` but the implementation does not provide it
<Drup> usually, it's just that the typechecker couldn't figure out a small difference
<bruce_r> File "user.ml", line 9, characters 24-48: Error: Signature mismatch: Modules do not match: sig module FrontandBackendReactGame : functor (GameInProgress : Types.GAME_IN_PROGRESS) (Game : Types.GAME) (Piece : Types.PIECE) (ReactDB : Types.REACT_DB) -> sig type t = FrontAndBackendReactGame.FrontandBackendReactGame(GameInProgress)(Game)(Piece)(ReactDB).t
<bruce_r> I don't think this is gonna be very helpful :s
<Drup> use a pastebin, but yes, it looks like parameter mismatch
faster has quit [Ping timeout: 264 seconds]
faster has joined #ocaml
faster has joined #ocaml
faster has quit [Changing host]
<bruce_r> how do you keeps the newline characters for pasting in here?
<bruce_r> keep*
<flux> please don't paste multi-line stuff to the channel
<Drup> don't paste here, use a pastebin
<bruce_r> ok makes sense, sorry about that
<bruce_r> I didn't know this kind of stuff existed, learning stuff everytime on this channel :)
jbrown has quit [Ping timeout: 265 seconds]
<bruce_r> I tend to create files called myFile.ml, and create a module inside called MyFile . But I feel like it's a bit messy sometimes when I do open MyFile, and after I use MyFile and I don't know if it's the file or the module. Do you guys have a recommendation on this matter?
<companion_cube> well, try not to create sub-moduels that have the same name as the file? :D
<flux> bruce_r, I suggest not to use 'open'
<companion_cube> (or avoid opening)
<Drup> the canonical name for the main subfunctor in a module is "Make"
<flux> if the name is too annoying, you can shorten it with module M = MyFile
<flux> also locally with let module M = MyFile in ..
faster has quit [Ping timeout: 255 seconds]
<bruce_r> Oh yes Make, I like this idea thanks
<companion_cube> only if it's a functor, of course
faster has joined #ocaml
<Drup> if it's a module, there is no canonical name
<flux> (if you do have a module you would like to open, like shared by all the files between the project, I like to make a common.ml that has include Z module Y = MyFile etc, and then open that in all the rest of the modules)
<Drup> well, there is M, but that's for internal things
<bruce_r> I tend to not like to open, because like in python you don't know where the code comes from, but if your file only has one module, I find it pretty acceptable, because I don't really like either to have to write MyFile.Myfile.stuff
<companion_cube> why not put stuff in MyFile then?
<Drup> on the other hand, why not just remove the middle module ?
<bruce_r> well it's a functor
<bruce_r> I agree that if its' not a functor I won't write the middle module
Ferlex has quit [Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]
kamog` has joined #ocaml
<bruce_r> OK I like the idea of Make, thanks guys
Nahra` has joined #ocaml
<bruce_r> also, I have a types.ml file that contains all my type definitions used my multiple different files, and all my modules and functor signatures. And I open this in all my files. What do you think about that?
arc- has quit [Ping timeout: 244 seconds]
igt0 has quit [Quit: Connection closed for inactivity]
Nahra has quit [Remote host closed the connection]
danieli has quit [Max SendQ exceeded]
kamog has quit [Ping timeout: 260 seconds]
arc- has joined #ocaml
faster_ has joined #ocaml
spion_ has quit [Ping timeout: 244 seconds]
jbrown has joined #ocaml
faster has quit [Ping timeout: 244 seconds]
danieli has joined #ocaml
spion has joined #ocaml
tmtwd has quit [Ping timeout: 265 seconds]
pyon is now known as dtp
bruce_r has quit [Ping timeout: 248 seconds]
TheLemonMan has joined #ocaml
rseymour has quit [Ping timeout: 250 seconds]
rseymour has joined #ocaml
Anarchos has quit [Quit: Vision[0.9.7-H-20140108]: i've been blurred!]
larhat1 has joined #ocaml
larhat has quit [Read error: Connection reset by peer]
larhat has joined #ocaml
larhat1 has quit [Read error: Connection reset by peer]
CuriousErnestBro has joined #ocaml
larhat1 has joined #ocaml
larhat has quit [Read error: Connection reset by peer]
shinnya has joined #ocaml
larhat1 has quit [Ping timeout: 272 seconds]
phase_ has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
gasche` has joined #ocaml
gasche has quit [Read error: Connection reset by peer]
jrslepak has quit [Ping timeout: 250 seconds]
jrslepak has joined #ocaml
<faster_> Stupid question, can ocaml be installed with opam? I don't see how in the docs
<ggole> opam switch changes to a different ocaml
<ggole> (Note that you'll need to reinstall any packages unless you do the keep-my-packages dance, which I can never remember.)
agarwal1975 has joined #ocaml
<zozozo> ggole: opam switch export tmp; opam switch import tmp ?
<ggole> That's the one.
<ggole> Dunno why my brain doesn't want that to stick. :/
<zozozo> ^^
phase_ has quit [Remote host closed the connection]
Heasummn has joined #ocaml
orbifx has joined #ocaml
<orbifx> is it better returning closures or tuples? or does it not matter?
ee_ks has joined #ocaml
<ggole> What do you mean, better?
<ggole> They're pretty different things :)
shinnya has quit [Ping timeout: 265 seconds]
<faster_> Is the best workflow to install dependencies, first you depext install the dependecies, then you opam install the module?
<faster_> opam doesn't do both automatically?
<ggole> opam install should fetch the dependencies for you
<faster_> I wonder if I just need to restart
<faster_> maybe that will fix my opam
phase_ has joined #ocaml
TheLemonMan has quit [Quit: "It's now safe to turn off your computer."]
MercurialAlchemi has quit [Ping timeout: 244 seconds]
annoymouse has quit [Quit: Connection closed for inactivity]
faster_ has quit [Ping timeout: 244 seconds]
faster has joined #ocaml
dmerc has quit [Ping timeout: 265 seconds]
<orbifx> ggole: more efficient or logaically correct
<faster> wow I love oml
<orbifx> oml?
<cube_bot> OK.
<companion_cube> !oml += https://github.com/hammerlab/oml
<cube_bot> done.
CuriousErnestBro has quit [Ping timeout: 260 seconds]
ggole has quit []
bruce_r has joined #ocaml
Simn has quit [Quit: Leaving]
dmerc has joined #ocaml
trystero has joined #ocaml
tristero has quit [Ping timeout: 265 seconds]
tane has quit [Quit: Leaving]
CuriousErnestBro has joined #ocaml
nicoo has quit [Quit: WeeChat 1.3]
CuriousErnestBro has quit [Remote host closed the connection]
nicoo has joined #ocaml
CuriousErnestBro has joined #ocaml
antonis has left #ocaml [#ocaml]
faster has quit [Ping timeout: 265 seconds]
faster has joined #ocaml
eni has quit [Ping timeout: 248 seconds]
octachron has quit [Quit: Leaving]
nicoo has quit [Quit: WeeChat 1.3]
nicoo has joined #ocaml
bruce_r has quit [Ping timeout: 272 seconds]
orbifx has quit [Quit: WeeChat 1.5]
ldopa has left #ocaml ["Killed buffer"]
nickapos has quit [Ping timeout: 276 seconds]
danieli has quit [Ping timeout: 265 seconds]
d0nn1e has quit [Ping timeout: 244 seconds]
d0nn1e has joined #ocaml
nickapos has joined #ocaml
yegods has joined #ocaml
danieli has joined #ocaml
igt0 has joined #ocaml
zozozo has quit [Ping timeout: 250 seconds]
ygrek_ has joined #ocaml
dtp has quit [Quit: Fix config.]
faster has quit [Ping timeout: 255 seconds]
pyon has joined #ocaml
ygrek_ has quit [Ping timeout: 265 seconds]
ydl has joined #ocaml
yegods has quit [Remote host closed the connection]
yegods has joined #ocaml