<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
<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
<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
<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.)