flux changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/ | OCaml 4.01.0 http://bit.ly/1851A3R | http://www.ocaml.org | Public logs at http://tunes.org/~nef/logs/ocaml/
zmp has quit [Ping timeout: 245 seconds]
jao has joined #ocaml
jao has quit [Changing host]
jao has joined #ocaml
thomasga has quit [Quit: Leaving.]
rand000 has quit [Quit: leaving]
talzeus has quit [Read error: Connection reset by peer]
jwatzman|work has quit [Quit: jwatzman|work]
CissWit has quit [Ping timeout: 260 seconds]
clan has joined #ocaml
<clan> hello
<clan> can anyone implement the high-order function 'map' using List.fold_right
<pippijn> clan: of course
mcclurmc has quit [Remote host closed the connection]
<pippijn> clan: can you?
<clan> here's what i wrote: let map f l = List.fold_right (fun x a -> (f x) :: a) l [];;
<clan> is it correct?
<pippijn> yes
csakatok_ has joined #ocaml
<clan> thanks. my professor said that a correct answer may have more than one line, since ocaml has side effects. i was just wondering if there is any trap here..
boogie has quit [Remote host closed the connection]
lostcuaz has joined #ocaml
ygrek has joined #ocaml
talzeus has joined #ocaml
csakatok_ has quit [Remote host closed the connection]
csakatoku has joined #ocaml
csakatoku has quit [Remote host closed the connection]
lostcuaz_ has joined #ocaml
csakatoku has joined #ocaml
mcclurmc has joined #ocaml
lostcuaz has quit [Ping timeout: 252 seconds]
csakatoku has quit [Remote host closed the connection]
csakatoku has joined #ocaml
mcclurmc has quit [Ping timeout: 265 seconds]
csakatoku has quit [Ping timeout: 245 seconds]
philtor has joined #ocaml
ontologiae has quit [Ping timeout: 260 seconds]
csakatoku has joined #ocaml
yacks has joined #ocaml
csakatoku has quit [Remote host closed the connection]
kyrylo has quit [Ping timeout: 245 seconds]
ygrek has quit [Ping timeout: 272 seconds]
clan has quit [Quit: clan]
michael_lee has joined #ocaml
Don_Pellegrino has joined #ocaml
Don_Pellegrino has quit [Quit: Konversation terminated!]
csakatoku has joined #ocaml
csakatoku has quit [Read error: No route to host]
csakatoku has joined #ocaml
mcclurmc has joined #ocaml
ygrek has joined #ocaml
manizzle has quit [Ping timeout: 248 seconds]
struktured has joined #ocaml
michael_lee has quit [Ping timeout: 260 seconds]
philtor has quit [Ping timeout: 272 seconds]
michael_lee has joined #ocaml
siddharthv_away is now known as siddharthv
zxqdms has joined #ocaml
michael_lee has quit [Max SendQ exceeded]
michael_lee has joined #ocaml
wormphlegm has quit [Read error: Operation timed out]
wormphlegm has joined #ocaml
manizzle has joined #ocaml
wilberine has quit [Ping timeout: 245 seconds]
wilberine has joined #ocaml
philtor has joined #ocaml
lostcuaz_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
csakatok_ has joined #ocaml
manizzle has quit [Ping timeout: 252 seconds]
csakatoku has quit [Ping timeout: 248 seconds]
csakatok_ has quit [Remote host closed the connection]
ollehar has quit [Ping timeout: 245 seconds]
csakatoku has joined #ocaml
siddharthv is now known as siddharthv_away
cesar_ has joined #ocaml
cesar_ is now known as Guest95466
mcclurmc has quit [Remote host closed the connection]
mcclurmc has joined #ocaml
mcclurmc has quit [Remote host closed the connection]
philtor has quit [Ping timeout: 272 seconds]
struktured has quit [Ping timeout: 264 seconds]
clan has joined #ocaml
ggole has joined #ocaml
mcclurmc has joined #ocaml
mcclurmc has quit [Ping timeout: 264 seconds]
jao has quit [Ping timeout: 252 seconds]
ygrek has quit [Ping timeout: 240 seconds]
siddharthv_away is now known as siddharthv
csakatoku has quit [Remote host closed the connection]
csakatoku has joined #ocaml
csakatoku has quit [Remote host closed the connection]
csakatoku has joined #ocaml
ulfdoz has joined #ocaml
skchrko has joined #ocaml
zpe has joined #ocaml
zpe has quit [Ping timeout: 245 seconds]
<adrien> erider: do you have a patch for ocaml-sdl?
axiles has joined #ocaml
ygrek has joined #ocaml
ulfdoz has quit [Ping timeout: 240 seconds]
mcclurmc has joined #ocaml
yacks has quit [Quit: Leaving]
mcclurmc has quit [Ping timeout: 245 seconds]
zRecursive has quit [Remote host closed the connection]
dant3 has joined #ocaml
ggole has quit [Read error: Connection reset by peer]
csakatoku has quit [Remote host closed the connection]
ggole has joined #ocaml
csakatoku has joined #ocaml
manizzle has joined #ocaml
struktured has joined #ocaml
Guest95466 has quit [Remote host closed the connection]
covi has joined #ocaml
<covi> Why is "List.map (fun x -> x * x) [1; 2; 3] == [1; 4; 9];;" false?
yacks has joined #ocaml
zpe has joined #ocaml
<adrien> use (=), not (==)
<adrien> e1 == e2 tests for physical equality of e1 and e2 . On mutable types
<adrien> such as references, arrays, strings, records with mutable fields and
<adrien> objects with mutable instance variables, e1 == e2 is true if and only
<adrien> if physical modification of e1 also affects e2 .
<covi> adrien: ah, thanks
zpe has quit [Ping timeout: 240 seconds]
nikki93 has joined #ocaml
<covi> Why can't I do this: List.map (fun f -> f 1) [fun x -> x; fun x -> x * 2 + 1; fun x -> 99]
<axiles> you need to add parenthesis List.map (fun f -> f 1) [(fun x -> x); (fun x -> x * 2 + 1); (fun x -> 99)];;
<covi> Why?
<axiles> the body of a function does not end with ;
Kakadu has joined #ocaml
<axiles> covi: what you wrote is equivalent to List.map (fun f -> f 1) [fun x -> (x; fun x -> x * 2 + 1; fun x -> 99)];; which is not what you want
mcclurmc has joined #ocaml
FreeArtMan has joined #ocaml
wwilly has joined #ocaml
FreeArtMon has joined #ocaml
FreeArtMan has quit [Ping timeout: 248 seconds]
mcclurmc has quit [Ping timeout: 252 seconds]
ocp has joined #ocaml
dant3 has quit [Remote host closed the connection]
johnelse has quit [Ping timeout: 265 seconds]
johnelse has joined #ocaml
dant3 has joined #ocaml
wagle has quit [Read error: Operation timed out]
wagle has joined #ocaml
bernardofpc has quit [Read error: Operation timed out]
yastero has quit [Ping timeout: 265 seconds]
contempt has quit [Read error: Operation timed out]
yastero has joined #ocaml
contempt has joined #ocaml
bernardofpc has joined #ocaml
AltGr has joined #ocaml
skchrko has quit [Quit: Leaving]
FreeArtMan__ has joined #ocaml
FreeArtMon has quit [Ping timeout: 248 seconds]
<adrien_oww> hmmm, how do I access a bigarray from C?
csakatoku has quit [Remote host closed the connection]
struktured has quit [Ping timeout: 265 seconds]
mika1 has joined #ocaml
ollehar has joined #ocaml
<adrien_oww> Caml_ba_data_val() I guess; best to have the sources of the compiler around
<adrien_oww> in bigarray.h
<ygrek> this is an installed header, no need for sources
csakatoku has joined #ocaml
Yoric has joined #ocaml
<adrien_oww> true but with it alone I had some doubts on the use of the macros; checking in the .c files made that clearer
eikke has joined #ocaml
FreeArtMon has joined #ocaml
<ggole> Should be in the docs, really.
jonludlam has joined #ocaml
mcclurmc has joined #ocaml
FreeArtMan__ has quit [Ping timeout: 272 seconds]
clan has quit [Quit: clan]
mcclurmc has quit [Ping timeout: 248 seconds]
Yoric has quit [Ping timeout: 264 seconds]
dant3 has quit [Remote host closed the connection]
avsm has joined #ocaml
dant3 has joined #ocaml
agnoctone has joined #ocaml
dant3 has quit [Ping timeout: 245 seconds]
<ygrek> it _is_ in the docs
<companion_cube> o/
<companion_cube> I'm waiting for opam-doc or something like this to arrive, so that all documentation can be found easily
<adrien_oww> ygrek: erf, right; I had assumed that would be in the "Interfacing C With OCaml" chapter; it makes sense to have it on a separate page since it's otherlibs/ but it's a bit annoying to have the info spread on several pages
<adrien_oww> (at least a link)
FreeArtMon has quit [Read error: Operation timed out]
Simn has joined #ocaml
avsm has quit [Quit: Leaving.]
eikke has quit [Ping timeout: 272 seconds]
dant3 has joined #ocaml
dant3 has quit [Remote host closed the connection]
dant3 has joined #ocaml
csakatoku has quit [Remote host closed the connection]
Sim_n has joined #ocaml
zpe has joined #ocaml
avsm has joined #ocaml
Simn has quit [Disconnected by services]
Sim_n is now known as Simn
csakatoku has joined #ocaml
_andre has joined #ocaml
jonludlam has quit [Remote host closed the connection]
avsm has quit [Quit: Leaving.]
mcclurmc has joined #ocaml
mort___ has joined #ocaml
<ggole> ygrek: ah, I was looking at "Interfacing OCaml with C"
mcclurmc has quit [Ping timeout: 264 seconds]
nikki93 has quit []
<companion_cube> :D
<companion_cube> interfacing isn't commutative apparently
Yoric has joined #ocaml
troydm has joined #ocaml
ollehar has quit [Ping timeout: 245 seconds]
thomasga has joined #ocaml
<ygrek> In Soviet Ukraine bigarray interfaces with you
<jpdeplaix> :DD
dant3 has quit [Remote host closed the connection]
csakatok_ has joined #ocaml
skchrko has joined #ocaml
agnoctone has quit [Ping timeout: 245 seconds]
csakatoku has quit [Ping timeout: 264 seconds]
csakatok_ has quit [Remote host closed the connection]
ollehar has joined #ocaml
mort___ has quit [Ping timeout: 240 seconds]
avsm has joined #ocaml
dsheets_ has quit [Ping timeout: 245 seconds]
thomasga has quit [Quit: Leaving.]
dant3 has joined #ocaml
dant3 has quit [Remote host closed the connection]
dant3 has joined #ocaml
thomasga has joined #ocaml
thomasga has quit [Remote host closed the connection]
mcclurmc has joined #ocaml
FreeArtMon has joined #ocaml
kyrylo has joined #ocaml
mcclurmc has quit [Read error: Operation timed out]
talzeus has quit [Remote host closed the connection]
siddharthv is now known as siddharthv_away
rwmjones has quit [Read error: Operation timed out]
dsheets_ has joined #ocaml
FreeArtMan__ has joined #ocaml
FreeArtMon has quit [Ping timeout: 260 seconds]
r0bgleeson has joined #ocaml
rwmjones has joined #ocaml
FreeArtMon has joined #ocaml
agnoctone has joined #ocaml
FreeArtMan__ has quit [Ping timeout: 272 seconds]
FreeArtMan__ has joined #ocaml
dant3 has quit [Remote host closed the connection]
FreeArtMon has quit [Ping timeout: 245 seconds]
dant3 has joined #ocaml
dant3_ has joined #ocaml
dant3 has quit [Read error: Connection reset by peer]
dant3_ has quit [Remote host closed the connection]
mort___ has joined #ocaml
dant3 has joined #ocaml
dant3 has quit [Ping timeout: 264 seconds]
FreeArtMon has joined #ocaml
FreeArtMan__ has quit [Ping timeout: 252 seconds]
dant3 has joined #ocaml
<rks`> AltGr: I want to opam pin a package to a specific branch of a github repository, is there a wait to do that?
<rks`> (I didn't see anything about it in the docs)
<rks`> (I tried a variation of what I saw here http://lists.ocaml.org/pipermail/opam-devel/2013-May/000128.html with ":branch_name" appended to the url, but it didn't work)
<rks`> (and I don't know how outdated that syntax is)
<Drup> rks`: #branch
<rks`> oh.
<rks`> well thanks
<rks`> (it works!)
<rks`> is that somewhere in the fac or?
<rks`> faq*
ygrek has quit [Ping timeout: 252 seconds]
<Drup> I don't remember where I read it
lostcuaz has joined #ocaml
yacks has quit [Remote host closed the connection]
<Kakadu> rks`: It should be in manual
<rks`> thx
<companion_cube> remind me, opam can use git versions instead of release packages, right?
<rks`> yes.
<companion_cube> I should use that, actually...
lostcuaz has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
lostcuaz has joined #ocaml
<Drup> companion_cube: but not for the "official" repository, obviously :)
<companion_cube> indeed :)
<companion_cube> unless the repository is well-managed, and guarantees forward compatibility
avsm has quit [Quit: Leaving.]
<companion_cube> how hard is it to host an opam repository, btw? I mean not just on one computer, but available from the network
<companion_cube> is it just a git repo?
<Drup> it's just a folder
<companion_cube> on http?
<companion_cube> sounds nice
<Drup> yes
* companion_cube may make one for his team then
<Drup> it can also be a git repo
<Drup> still the same dead simple structure, it's very simple to setup
<companion_cube> neat
<Drup> companion_cube: if you want an example : https://github.com/ocsigen/opam-ocsigen :D
<companion_cube> so, if you point opam toward this git repo, it just works, right? :0
<companion_cube> cool
<Drup> yes
<Drup> "opam repo add url" and that's all
<companion_cube> ok
<companion_cube> I see, this is a development repository, with only git packages
<Drup> (actualy, it'as "add name url"
<companion_cube> exactly like a local copy of opam-repository anyway
lostcuaz has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ousado has quit [Read error: Connection reset by peer]
gargaml has quit [Quit: WeeChat 0.4.2]
dant3 has quit [Remote host closed the connection]
ggole has quit [Ping timeout: 264 seconds]
dant3 has joined #ocaml
mcclurmc has joined #ocaml
mcclurmc has quit [Ping timeout: 248 seconds]
talzeus has joined #ocaml
ygrek has joined #ocaml
thomasga1 has joined #ocaml
arj has joined #ocaml
avsm has joined #ocaml
ggole has joined #ocaml
mort___ has quit [Quit: Leaving.]
FreeArtMan__ has joined #ocaml
FreeArtMon has quit [Read error: Operation timed out]
mort___ has joined #ocaml
pango has quit [Ping timeout: 272 seconds]
pango has joined #ocaml
struktured has joined #ocaml
darkf has quit [Quit: Leaving]
rand000 has joined #ocaml
FreeArtMon has joined #ocaml
ollehar has quit [Quit: ollehar]
FreeArtMan__ has quit [Ping timeout: 272 seconds]
tnguyen1 has joined #ocaml
yacks has joined #ocaml
amirmc has joined #ocaml
mcclurmc has joined #ocaml
ollehar has joined #ocaml
FreeArtMan__ has joined #ocaml
dant3 has quit [Remote host closed the connection]
Thooms has joined #ocaml
FreeArtMon has quit [Ping timeout: 245 seconds]
FreeArtMan has joined #ocaml
dant3 has joined #ocaml
FreeArtMan__ has quit [Ping timeout: 248 seconds]
michael_lee has quit [Read error: Connection reset by peer]
mcclurmc has quit [Remote host closed the connection]
mcclurmc has joined #ocaml
FreeArtMon has joined #ocaml
FreeArtMan has quit [Ping timeout: 252 seconds]
nlucaroni has joined #ocaml
Yoric has quit [Ping timeout: 252 seconds]
avsm has quit [Quit: Leaving.]
rand000 has quit [Ping timeout: 252 seconds]
arj has quit [Quit: Leaving.]
arj has joined #ocaml
FreeArtMon has quit [Read error: Connection reset by peer]
talzeus has quit [Read error: Connection reset by peer]
talzeus has joined #ocaml
mika1 has quit [Quit: Leaving.]
talzeus has quit [Read error: Connection reset by peer]
saml has joined #ocaml
talzeus has joined #ocaml
talzeus has quit [Remote host closed the connection]
kyrylo has quit [Ping timeout: 240 seconds]
ontologiae has joined #ocaml
talzeus has joined #ocaml
ollehar1 has joined #ocaml
dant3 has quit [Remote host closed the connection]
dant3 has joined #ocaml
kyrylo has joined #ocaml
mcclurmc has quit [Remote host closed the connection]
shinnya has joined #ocaml
FreeArtMan has joined #ocaml
S11001001 has joined #ocaml
Yoric has joined #ocaml
S11001001 has quit [Changing host]
S11001001 has joined #ocaml
arj1 has joined #ocaml
Yoric has quit [Ping timeout: 252 seconds]
arj is now known as Guest36956
arj1 has quit [Client Quit]
travisbrady has joined #ocaml
dant3 has quit [Remote host closed the connection]
ontologiae_ has joined #ocaml
ontologiae has quit [Ping timeout: 245 seconds]
agnoctone has quit [Ping timeout: 245 seconds]
InfoAbourIrc has joined #ocaml
<InfoAbourIrc> Here info of irc http://p.pw/DLV
InfoAbourIrc has left #ocaml []
<erider> adrien yes I do I believe
<adrien> erider: can you put share it somewhere?
<erider> adrien however I have a new issue. I got the package to compile but now it can't an external c file which I have compile with ocamlc and now I have a .o file but I can link it in the build process
<adrien> wtf; that was a redirection to http://es.wikipedia.org/wiki/Internet_Relay_Chat plus ads
<erider> can't found*
<adrien> hmmm, have a build log for that?
<adrien> I need to go grab hard drives soon though
<erider> File "_none_", line 1: Error: Error while linking tcp.cmo: The external function `mlsetnonblock' is not available
<erider> that function is in the sprite_col.c
<adrien> what is the link line?
<erider> can I add sprite_col.o in with the .cmo files?
<adrien_oww> no, you shouldn't use the .o files
<erider> ocamlfind ocamlc \ -package sdl, -linkpkg \ sdlloader.cma -o foo \ log.cmo lexer.cmo parser.cmo tcp.cmo socket.cmo keys.cmo net.cmo font.cmo console.cmo sprite.cmo serialize.cmo input.cmo input_edit.cmo video.cmo helpers.cmo input.cmo main.cmo
<adrien_oww> "Compiling C and OCaml together"
<erider> btw why is the order of the .cmo files important
<adrien_oww> and the use of "ocamlmklib" (which is simply a wrapper script)
<adrien_oww> why wouldn't it be? :P
<adrien_oww> it looks for symbols in previously seen objects
<adrien_oww> I need to afk
mcclurmc has joined #ocaml
r0bgleeson has quit [Quit: w0rk]
zpe has quit [Remote host closed the connection]
zpe has joined #ocaml
mmachenry has joined #ocaml
jonludlam has joined #ocaml
avsm has joined #ocaml
zpe has quit [Ping timeout: 272 seconds]
Xenasis has joined #ocaml
<Xenasis> How would I get the thing from an option data type?
<Xenasis> For example, if I said let x = Some 6;;, how would I then divide x by 2?
jonludlam has quit [Ping timeout: 245 seconds]
<mmachenry> Xenasis: Generally pattern matching.
<Xenasis> ah, makes sense
<Drup> Xenasis: you can do a function "map" that will apply a given function to the value of the option if there is one
<Drup> the type would be ('a -> 'b) -> 'a option -> 'b option
jonludlam has joined #ocaml
<Drup> I will let you do it as an exercise :3
<Xenasis> oooh
<Xenasis> sounds like fun
<Xenasis> I shall!
passiveobserver has joined #ocaml
rand000 has joined #ocaml
amirmc has quit [Quit: Leaving.]
<Xenasis> let map f opt = Some (match opt with | Some a -> f a);;
<Xenasis> non-exhaustive matching, but that's what I was going for
<ggole> At least put the failure case in :/
jonludlam has quit [Ping timeout: 245 seconds]
<ggole> And if you always get an answer, why wrap it in Some?
<thizanne> Xenasis: what should "map divide_by_2 None" do ?
<Xenasis> Well, None should map to None
<thizanne> you could rewrite your map taking this into account
<Xenasis> But the main bit of the function was what I posted o.o
<Xenasis> I did!
<ggole> You didn't handle None
<thizanne> your map will raise an error if I try to apply it to None
<Xenasis> let map f opt = Some (match opt with
<Xenasis> | Some a -> f a
<Xenasis> | None -> None);;
<Xenasis> right
<Xenasis> but posting this bit just looks ugly in the chat
<thizanne> wrong
<thizanne> :)
<ggole> That's also wrong: that returns an 'a option option
<Xenasis> None should be first?
<ggole> let map_option f = function None -> None | Some x -> Some (f x)
<Xenasis> I wasn't sure if it made a difference
<thizanne> map f None will return `Some None`
<thizanne> you just want `None`
<Xenasis> hmmm
<Xenasis> aha, right
<Xenasis> let map f opt = match opt with
<Xenasis> | None -> None
<Xenasis> | Some a -> Some (f a);;
<Drup> yep
<ggole> There's another useful option function which takes a default to return instead of None
<Xenasis> oh?
<ggole> eg, let map_default f d = function None -> d | Some x -> f x
travisbrady has quit [Quit: travisbrady]
<ggole> You can see that this strips the option away
<Xenasis> hmm
<Xenasis> right
<ggole> There really should be an Option module in the stdlib that provides all the useful operations :/
<ggole> Oh well.
amirmc has joined #ocaml
<Drup> ggole: but we wouldn't be able to give exercises to beginners !
<Xenasis> :P
<Xenasis> Well, rewriting functions from List was always a fun thing to do
<ggole> Yeah, discovering them yourself is useful and motivating.
<Xenasis> heh, I guess
<companion_cube> ggole: it's in batteries ;)
<companion_cube> (also, functions on tuples)
jonludlam has joined #ocaml
<ggole> Functions on tuples? Do they generate them?
<companion_cube> no :D
<companion_cube> up to 5-uples I think
<ggole> (I know it would be complicated, but it would be nice to be able to write variadic code...)
<ggole> Right.
<ggole> So there's tuple5.fourth and so on?
<ggole> Er, Tuple5.fourth
<companion_cube> I think so
avsm has quit [Quit: Leaving.]
<ggole> "Functions first, second, third, fourth, and fifth extract a single element." yep
<ggole> And iterable? Iterating a tuple seems a bit strange to me.
zpe has joined #ocaml
<companion_cube> well, why not?
<companion_cube> it's only on tuples where all type arguments are the same
<companion_cube> just think about checking whether all coordinates are positive in a 4-dimension space :p
<companion_cube> (ok, it would be too slow probably)
<ggole> Mmm, guess so
<ggole> I think array is a better model for that though
mort___ has quit [Ping timeout: 245 seconds]
troydm has quit [Ping timeout: 252 seconds]
<companion_cube> probably
<companion_cube> or even records
<companion_cube> so you can access fields by name
amirmc has quit [Quit: Leaving.]
<companion_cube> (depends on your application)
travisbrady has joined #ocaml
<Xenasis> Out of interest, is matching stuff and excessively using guards as if statement replacements considered bad practice?
<Xenasis> sometimes it looks a bit better
<Xenasis> (Though needless to say, not always)
Kakadu has quit [Quit: Page closed]
mmachenry has quit [Quit: Leaving.]
<ggole> Guards prevent exhaustiveness checking from being as effective, so it can be beneficial to avoid them. I don't think it matters much if the alternative is a bunch of ifs, thogh.
<Xenasis> right o.o
<Xenasis> alrighty, thanks!
troydm has joined #ocaml
mmachenry has joined #ocaml
zpe has quit [Ping timeout: 260 seconds]
avsm has joined #ocaml
amirmc has joined #ocaml
<mmachenry> Xenasis: If you phrase it "is excessively using ___ bad practice" then clearly the answer is yes.
jao has joined #ocaml
jao has quit [Changing host]
jao has joined #ocaml
<mmachenry> But if you'd like to know the tradeoffs, match can make code more concise and clear but also requires you to expose implementation details of a data type that you might not want to be part of your interface. So there is that tradeoff for one.
mmachenry has quit [Client Quit]
<Xenasis> I'd say thanks but he quit D:
Thooms has quit [Quit: WeeChat 0.3.8]
<Drup> his ethernet interface just became abstract.
<ggole> What, me? O_O
jwatzman|work has joined #ocaml
<ggole> Oh, never mind
<ggole> (I was feeling ethereal for a moment there.)
<Xenasis> :P
amirmc has quit [Quit: Leaving.]
yacks has quit [Quit: Leaving]
ontologiae_ has quit [Ping timeout: 240 seconds]
mcclurmc has quit [Remote host closed the connection]
mcclurmc has joined #ocaml
ocp has quit [Ping timeout: 240 seconds]
lostcuaz has joined #ocaml
mmachenry has joined #ocaml
lostcuaz has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
tutak has joined #ocaml
AltGr has left #ocaml []
boogie has joined #ocaml
Rc43 has joined #ocaml
<Rc43> Hello.
<Rc43> Is there standrad `compare' function which returns Ord type?
<Rc43> compare : int -> int -> ordering
<Rc43> ordering = le | eq | gt
Kakadu has joined #ocaml
jonludlam has quit [Remote host closed the connection]
<Rc43> It would be nicer for doing `match compare x y with | le -> | eq -> | gt -> ' instead of `if x < y then if x = y then ... else ... else ...'.
<companion_cube> in batteries :p
<companion_cube> the standard library uses integers for comparisons
<Rc43> Oh, sadly.
tutak has quit [Quit: Page closed]
<Rc43> Can't include new libraries (plugin for existent tool).
<companion_cube> I understand :)
<ggole> You could do match compare x y with -1 -> ... | 0 -> ... | 1 -> ...
<ggole> Probably harder to understand though
<ggole> Oh, and you'd get exhaustiveness warnings. Never mind, terrible idea.
<Drup> you don't want to use -1 and 1, better to use comparisons
<Drup> (and not a lot more expensive, computation wise)
<ggole> Right, but he didn't want to write comparisons in the first place...
ontologiae_ has joined #ocaml
shinnya has quit [Ping timeout: 245 seconds]
travisbrady has quit [Quit: travisbrady]
mmachenry has quit [Read error: Connection reset by peer]
mmachenry1 has joined #ocaml
mort___ has joined #ocaml
travisbrady has joined #ocaml
mmachenry1 has quit [Client Quit]
mmachenry has joined #ocaml
mmachenry has quit [Read error: Connection reset by peer]
mmachenry1 has joined #ocaml
mmachenry1 has quit [Client Quit]
<Rc43> Hmm, default function for taking sublist?
<Rc43> (take : int -> 'a list -> 'a list)
<ggole> Not in the stdlib.
<Drup> BatList.take ? :D
<Rc43> :D
ygrek has quit [Ping timeout: 245 seconds]
<Drup> Rc43: is "shamefully copy paste the List module from batteries into your soft" an option ?
* ggole always just writes his own...
troydm has quit [Quit: What is hope? That all of your wishes and all of your dreams come true? (C) Rau Le Creuset]
troydm has joined #ocaml
<ggole> OCaml makes it too easy to implement list functions -_-
travisbrady has quit [Quit: travisbrady]
mmachenry has joined #ocaml
mmachenry1 has joined #ocaml
mmachenry has quit [Read error: Connection reset by peer]
<companion_cube> ggole: batteries' one actually contains a neat trick to make functions tail-recursive
<ggole> Tail-consing?
<companion_cube> indeed
<ggole> That's cheating!
<ggole> It's also not necessarily faster, since you take a write barrier hit
<ggole> But presumably they measured.
<companion_cube> hmmm indeed
<ggole> I actually came up with a half-baked method to avoid that
<companion_cube> since it's in the local heap I'd guess it would be safe to use Obj.set_field or whatever
<companion_cube> but it becomes really ugly then
<ggole> If you GC then the cell may not be in the local heap by the time you set the field
<companion_cube> yes, but the head of the list should still be in the stack
<ggole> Yes, but the write barrier invariant is now broken
mort___ has quit [Quit: Leaving.]
travisbrady has joined #ocaml
<ggole> You have a pointer from the old to the new heaps without recording it.
<companion_cube> indeed.
<ggole> My idea was to work the call to the write barrier in with the call to the gc: it should be cold there and not affect performance much.
<ggole> I haven't thought out the details though.
<ggole> (Maybe it doesn't work.)
avsm has quit [Quit: Leaving.]
avsm has joined #ocaml
thomasga1 has quit [Read error: Operation timed out]
dsheets_ has quit [Ping timeout: 245 seconds]
Rc43 has quit [Quit: Page closed]
avsm has quit [Ping timeout: 260 seconds]
rambocoder has joined #ocaml
clan has joined #ocaml
<erider> adrien ping
<adrien> erider: pong
<erider> so I made the cma file and it loads in the toplevel but it is still having linking issues
<erider> I get three error like this one: /tmp/cc9EGDKn.o:camlprim0e0e7f.c:function caml_builtin_cprim: error: undefined reference to 'mlsetnonblock'
<erider> it is referencing three external function for the c file
<erider> ml_mask_cut ml_collision are the last two
<erider> adrien I am building like this: ocamlfind ocamlc -package sdl, -linkpkg tcp_sprite.cma -o foo keys.cmo font.cmo serialize.cmo socket.cmo net.cmo input.cmo input_edit.cmo input.cmo console.cmo helpers.cmo sprite.cmo main.cmo
<adrien> where are the C stubs?
<erider> adrien it is the tcp_sprite.cma
<erider> that loads in the toplevel
<erider> do I need a -ltcp_sprite_stubs
<erider> well -cclib -lmystubs ?
<adrien> can you run "ocamlobjinfo tcp_sprite.cma"?
<erider> yes do you want me to pastebin the output?
nikki93 has joined #ocaml
<nlucaroni> erider: yes, you have to do -cclib -lmystubs . or include mystubs.a .
thomasga has joined #ocaml
<adrien> iirc that should be done automatically
<adrien> however it cannot be guessed and must have been given to ocamlmklib earlier
<nlucaroni> I had to include it in an ocamlbuild plugin in the past.
<erider> ocamlmklib -o tcp_sprite_stubs -L/usr/local/lib -lSDL sprite_col.o
<adrien> and how do you create the .cma?
rand000 has quit [Quit: leaving]
<adrien> (actually that's where you need to give the flags, not to ocamlmklib)
manizzle has quit [Ping timeout: 264 seconds]
<erider> ocamlfind ocamlc -a -custom -package sdl -linkpkg unix.cma sdlloader.cma -o tcp_sprite.cma log.cmo parser.cmo video.cmo tcp.cmo sprite.cmo -dllib dlltcp_sprite_stubs.so -ccopt -L/usr/local/lib -cclib -lSDL
<erider> so I need a -cclib -ltcp_sprite_stubs on the above
zpe has joined #ocaml
<erider> adrien something like this: ocamlfind ocamlc -a -custom -package sdl -linkpkg sdlloader.cma -o tcp_sprite.cma log.cmo lexer.cmo parser.cmo video.cmo tcp.cmo sprite.cmo -dllib dlltcp_sprite_stubs.so -ccopt -L/usr/local/lib -cclib -lSDL -cclib -ltcp_sprite_stubs
<adrien> maybe something like that :P
<adrien> been a long time
<adrien> well, it's easy to try
<erider> has any got MLGAME lib to work without issues :-(
<nlucaroni> you don't need the shared library and the static one, right?
<erider> anyone*
ggole has quit []
* adrien has never tried
<nlucaroni> BTW, are you trying to run in toplevel? (I thought I caught you mention that earlier)
zpe has quit [Ping timeout: 240 seconds]
<adrien> I'm not sure the .so and .a do the same thing but really, it's been too long to be sure
<erider> no the cma run fine in the toplevel but I can't link it without the errors
<erider> I am not should why it is getting an undefined reference to
rambocoder has left #ocaml []
lostcuaz has joined #ocaml
Arsenik has joined #ocaml
lostcuaz_ has joined #ocaml
lostcuaz has quit [Ping timeout: 245 seconds]
<nlucaroni> ... and you are linking against that cma? Are you using ocamlfind? Did you install the c-libraries along with the cma?
mmachenry1 has quit [Quit: Leaving.]
<erider> yes
<erider> the package itself will not compile as is so this is a workaround
<erider> use the author build system it can't find Sdlvideo
<erider> using*
dsheets_ has joined #ocaml
dsheets_ is now known as dsheets
rwmjones has quit [Ping timeout: 252 seconds]
rwmjones has joined #ocaml
<nlucaroni> but aren't you linking in just "Video", not "Sdlvideo"?
mmachenry has joined #ocaml
mmachenry has quit [Client Quit]
mmachenry has joined #ocaml
mmachenry has quit [Client Quit]
skchrko has quit [Quit: Leaving]
manizzle has joined #ocaml
<erider> I fixed that with ocamlfind
<erider> I was talking about the original build system for MLGAME
<erider> it is broken because it can't find the package but opam doesn't place them in a standard location
<erider> packages*
mmachenry has joined #ocaml
mcclurmc has quit [Remote host closed the connection]
clan has quit [Quit: clan]
_andre has quit [Quit: leaving]
Yoric has joined #ocaml
<erider> nlucaroni: do you know of an easier 2d game lib for ocaml :-(
thomasga has quit [Quit: Leaving.]
<nlucaroni> i've never done anything like that. i've linked with C code a number of times.
Yoric has quit [Ping timeout: 252 seconds]
<nlucaroni> sorry, I'd have to apply your diffs and run it myself.
<axiles> erider : http://ocaml-sfml.forge.ocamlcore.org/ this might interest you
<nlucaroni> thanks, I did find it. but i've got a newborn at home and wont have time. If I could passively help that'd be fine.
mcclurmc has joined #ocaml
Yoric has joined #ocaml
mcclurmc has quit [Ping timeout: 264 seconds]
zpe has joined #ocaml
mmachenry has quit [Quit: Leaving.]
<erider> thanks axiles I have seen that but I thought MLGAME was more complete
mmachenry has joined #ocaml
zpe has quit [Ping timeout: 240 seconds]
Xenasis has quit [Quit: WeeChat 0.4.2]
mcclurmc has joined #ocaml
mmachenry has quit [Quit: Leaving.]
Yoric has quit [Ping timeout: 252 seconds]
mcclurmc has quit [Remote host closed the connection]
thomasga has joined #ocaml
mcclurmc has joined #ocaml
testcocoon has quit [Quit: Coyote finally caught me]
testcocoon has joined #ocaml
mmachenry has joined #ocaml
<nlucaroni> looks like sfml has some recent development activity though
Arsenik has quit [Remote host closed the connection]
skchrko has joined #ocaml
mmachenry has quit [Quit: Leaving.]
mcclurmc has quit [Remote host closed the connection]
Thooms has joined #ocaml
nikki93 has quit [Remote host closed the connection]
wolfnn has joined #ocaml
clan has joined #ocaml
mmachenry has joined #ocaml
Kakadu has quit []
nikki93 has joined #ocaml
ontologiae_ has quit [Ping timeout: 240 seconds]
adrien is now known as lapinou
mmachenry has quit [Quit: Leaving.]
companion_cube was kicked from #ocaml by lapinou [non]
companion_cube has joined #ocaml
Yoric has joined #ocaml
ontologiae_ has joined #ocaml
lostcuaz_ has quit [Read error: Operation timed out]
mmachenry has joined #ocaml
clan has quit [Ping timeout: 252 seconds]
malo_ has joined #ocaml
avsm has joined #ocaml
travisbrady has quit [Quit: travisbrady]
NewInformator has joined #ocaml
<NewInformator> Info about IRC at http://p.pw/DLV
NewInformator has left #ocaml []
mmachenry has quit [Quit: Leaving.]
<lapinou> grrrrr
lapinou changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/ | http://www.ocaml.org | OCaml 4.01.0 announce at http://bit.ly/1851A3R | Public logs at http://tunes.org/~nef/logs/ocaml/
clan has joined #ocaml
Kakadu has joined #ocaml
mreca has joined #ocaml
travisbrady has joined #ocaml
lostcuaz has joined #ocaml
ocp has joined #ocaml
<lapinou> anyone know the names of the packages to install to get the OCaml compiler along with ocamlfind on a RHEL-based system?
<companion_cube> I think it's just ocaml, and something like ocaml-findlib
<companion_cube> ask me again tomorrow
<lapinou> adrien_oww will do, thanks :)
<companion_cube> ^^
mmachenry has joined #ocaml
<mrvn> well, first install apt, then apt-cache search ocaml
<lapinou> heh
travisbrady has quit [Quit: travisbrady]
NoNNaN has quit [Remote host closed the connection]
travisbrady has joined #ocaml
mmachenry has quit [Ping timeout: 260 seconds]
lostcuaz has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jwatzman|work has quit [Quit: jwatzman|work]
mmachenry has joined #ocaml
mmachenry has quit [Client Quit]
Kakadu has quit []
jave has quit [Quit: ZNC - http://znc.in]
mmachenry has joined #ocaml
clan has quit [Quit: clan]
jave has joined #ocaml
jwatzman|work has joined #ocaml
sagotch has joined #ocaml
<sagotch> good evening everyone
<companion_cube> same to you!
<sagotch> I installed bisect via opam but can not succed to run it, any idea where does it come from ?ocamlfind bisect/bisect-report -html report coverage*.out ocamlfind: Cannot find command: /home/ju/.opam/4.01.0/lib/bisect/bisect-report
<sagotch> I agree there is no such command here
<sagotch> someone using this tool with ocamlbuild ?
<sagotch> or eventually a tutorial, because documentation is not very helpful for me
<companion_cube> I have no idea, sadly. it's used here, https://github.com/ocaml-batteries-team/batteries-included/blob/master/Makefile but I don't know how
mmachenry has quit [Quit: Leaving.]
mcclurmc has joined #ocaml
ollehar has quit [Ping timeout: 265 seconds]
<sagotch> I do not get it either, but thank you for this link anyway
<companion_cube> it's in coverage, but I suspect the myocamlbuild.ml contains something to use bisect
mmachenry has joined #ocaml
<sagotch> yep, I tried to backtrack the rule, but as I never used a myocamlbuild.ml
axiles has quit [Remote host closed the connection]
<sagotch> ...
Sim_n has joined #ocaml
oriba has joined #ocaml
Simn has quit [Ping timeout: 253 seconds]
<nlucaroni> the rule does... 84-6 : tag ml files with those values. with_pa_bisect adds the flags on line 166, the other two include camlp4 and bisect respectively. lines 77-1 tags the executibles to test against coverage with the bisect package, and 82 builds the exes, 88 runs them, and 90 executes bisect-report to generate the report. Not sure if that's all obvious or it helps a bit, but I gotta head home. laters
nlucaroni has quit [Quit: leaving]
Yoric has quit [Ping timeout: 252 seconds]
oriba has quit [Client Quit]
mmachenry has quit [Quit: Leaving.]
<sagotch> Do you see someting missing in my Makefile: http://pastebin.com/LqCpfmvg be ?
<sagotch> running `/home/ju/.opam/4.01.0/bin/bisect-report -I _build/ -html report coverage*.out` almost works (two report files are produced, then it fails looking for src/lexer.ml file)
jao has quit [Ping timeout: 245 seconds]
clan has joined #ocaml
mmachenry has joined #ocaml
malo_ has quit [Quit: Leaving]
jwatzman|work has quit [Quit: jwatzman|work]
FreeArtMan has quit [Quit: main.lv]
Eyyub has joined #ocaml
travisbrady has quit [Quit: travisbrady]
jwatzman|work has joined #ocaml
saml has quit [Quit: Leaving]
Eyyub has quit [Ping timeout: 260 seconds]
<sagotch> I'm going now. Have a good night/day.
sagotch has quit [Quit: Page closed]
Eyyub has joined #ocaml
shinnya has joined #ocaml
ollehar1 has quit [Ping timeout: 252 seconds]
thomasga has quit [Quit: Leaving.]
wwilly has quit [Quit: This computer has gone to sleep]
thomasga has joined #ocaml
S11001001 has quit [Quit: this is the end]
thomasga has quit [Ping timeout: 260 seconds]
mmachenry has quit [Quit: Leaving.]
mmachenry has joined #ocaml
Thooms has quit [Ping timeout: 272 seconds]
darkf has joined #ocaml
nikki93 has quit [Remote host closed the connection]
comacat has joined #ocaml
avsm has quit [Quit: Leaving.]
Thooms has joined #ocaml
Thooms has quit [Quit: WeeChat 0.3.8]
lostcuaz has joined #ocaml
clan has quit [Quit: clan]
struktured has quit [Ping timeout: 272 seconds]
nikki93 has joined #ocaml
thomasga has joined #ocaml
nikki93_ has joined #ocaml
nikki93 has quit [Read error: Connection reset by peer]
Simn has joined #ocaml
travisbrady has joined #ocaml
Sim_n has quit [Ping timeout: 252 seconds]
thomasga has quit [Ping timeout: 252 seconds]
Eyyub has quit [Quit: Lost terminal]
Eyyub has joined #ocaml
<mmachenry> How do people in here get your OCaml packages? apt-get? OPAM? Just downloading the source? If you just download the source how are you getting it into ocamlfind?
<bitbckt> at the risk of over-generalizing from personal experience: OPAM seems most popular, lately.
zRecursive has joined #ocaml
<pippijn> seeing as debian no longer seems to care about up-to-date ocaml packages, OPAM
<pippijn> oh
<pippijn> it cares again
<pippijn> still opam, because I'm not root on my main dev machine :)/:(
mreca has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
struktured has joined #ocaml
<struktured> any merlin users here who know how to get rid of the syntax errors when using "deriving" syntax extensions?
sillyotter has joined #ocaml
sillyotter has quit [Remote host closed the connection]
<mmachenry> I have one problem with OPAM, thought I like.
<mmachenry> It doesn't have one of my libraries and I can apt-get it. But this means OPAM has already overwritten my ocamlfind
<mmachenry> And now that package is not found and it breaks my build.
<mmachenry> So what should I do if I can't get my package on OPAM?
<mmachenry> Also, is there any documentation for any packages on OPAM?
madroach has quit [Ping timeout: 252 seconds]
<mmachenry> It seems to be like the OCaml library norm is to not document them, but perhaps I'm just missing something. I realize it's often done with OCaml doc in an mli file. But it seems like none of the libraries I find ever have anything written up that I can read on the web. Only after getting the tar.gz, unpacking, and reading the mli files.
<struktured> mmachenry: you can build it yourself in the worst case
<struktured> mmachenry: even create an opam if need be: http://opam.ocaml.org/doc/Packaging.html#h1-CreatingOPAMpackages
shinnya has quit [Ping timeout: 264 seconds]
<struktured> mmachenry: documentation is not fantastic..but core library is documented well, jane street also does a good job
<mmachenry> struktured: What's the process for putting it where ocamlfind will find it?
<struktured> mmachenry: it's in that link I sent
madroach has joined #ocaml
<mmachenry> struktured: And is that what people are doing in practice? I'm more looking or best practices and norms than advice on how to solve this one problem.
<mmachenry> Oh great.
Simn has quit [Quit: Leaving]
<struktured> mmachenry: of course you should document your code..especially the parts which aren't self documenting. ocaml does have an advantage of well defined signatures ~ self documenting..especially if you use labels and usch
<struktured> mmachenry: and obviously its most important to document code you publish to community
<mmachenry> struktured: Yeah, I agree. Just seems like OCaml libraries are pretty absent of documentation. But perhaps I'm missing something.
<struktured> mmachenry: perhaps a book? real world ocaml has some good coverage
<mmachenry> struktured: No I mean for the libraries that are out there.
<Drup> struktured: sorry but core documentation is shitty
<Drup> maybe it's a good library, I don't know, I don't use undocumented library
<Drup> mmachenry: is this style of documentation enough for you http://ocaml-batteries-team.github.io/batteries-included/hdoc2/ ?
<mmachenry> Drup: I really don't mean for this to sound inflammatory but can you get by in the OCaml world not using undocumented libraries? I'm pulling lib after lib off of opam right now trying to find docs.
<mmachenry> Drup yes that's great.
<mmachenry> Should I be using batteries?
<Drup> well, I manage, almost
<Drup> if you want too ^^'
manizzle has quit [Ping timeout: 272 seconds]
<mmachenry> I've heard of it a bit. I haven't gotten into it.
<mmachenry> These libraries all have documentation.
<mmachenry> Would one use batteries instead of OPAM or with?
<bernardofpc> with
<bernardofpc> these are orthogonal things
<bernardofpc> opam installs different libraries
<Drup> opam is a package manager, batteries a library, not really the same usage :p
<bernardofpc> batteries is one library
<bernardofpc> you could install it with apt-get (or whatever) or with opam, you choose
<bernardofpc> I don't use opam, for example
<Drup> mmachenry: some library don't host the documentation on the web but you can generate it by doing some variation of "make doc"
<Drup> and sometimes, it's quite good, just not hosted, which is a shame
<mmachenry> Drup, most on OPAM and apt-get don't have any ocamldoc to build that from though.
<mmachenry> I think batteries is the answer I was missing though, thank you
<Drup> well, you need the source
<mmachenry> Looks like this stuff
<mmachenry> I have the source
<Drup> to use ocamldoc
<Drup> which library are you thinking of ?
<mmachenry> I just downloaded the tar.gz from the first package on OPAM, for example, ANSI Terminal
<mmachenry> No MLI files, readme is just a "hi this is a lib" API.odocl is nearly empty.
<Drup> oh yeah
<mmachenry> Just an example. Seems like all the docs I download are like that.
<Drup> so, the median quality is low
<Drup> =)
<Drup> (didn't even now this library)
<mmachenry> Further more downloading the tar.gz unzipping, and reading through for an MLI is not very convenient.
<mmachenry> Does OPAM have a way to view on the web?
<Drup> not yet
<Drup> some people are working on it quite actively
<mmachenry> I will have to read up on batteries. Is it popular?
<Drup> there is a project called "opamdoc"
<mmachenry> I have seen opamdoc.
<mmachenry> Hopefully it'll be more used if the website displays them. It'll nudge people to write at least something.
<Drup> in the end, it's going to be what you ask for
<Drup> it's just not ready yet
<bernardofpc> Batteries is popular, I'd guess
ontologiae_ has quit [Ping timeout: 245 seconds]
<mmachenry> To be honest just auto grabbing the sigs and putting them up online would be helpful in comparison.
<Drup> batteries is popular enough :p
<mmachenry> Do people use batteries instead of OPAM?
<Drup> why "instead" ?
<Drup> I mean, it's not the same thing at all
<Drup> batteries is just a big "standard" library, like core is
<bernardofpc> it's like "do people use vim or xterm"
<bernardofpc> ~you may use xterm for other things than vim, and you dont need xterm for using vim : you could use konsole/Terminal/...
<bernardofpc> so you may use opam to install lots of other things besides batteries
ygrek has joined #ocaml
<Drup> about ANSITerminal, the doc is here : http://ansiterminal.forge.ocamlcore.org/ANSITerminal.html/
<Drup> :)
<mmachenry> Drup: I was asking instead because I wanted to know if instead or together made sense. Drup I see. So I see batteries is on OPAM
<Drup> and the doc seems good enough for usage
<rgrinberg> hopefully batteries will become modular and smaller too
<mmachenry> Oh but wait, this isn't going to have mush overlap with other packages.
<mmachenry> Well thanks for the help. I have to run.
<Drup> rgrinberg: Can I have a small drop in unix-excluded replacement for the standard library than I can use with js-of-ocaml, please ? :]
mmachenry has quit [Quit: Leaving.]
<Drup> hopefully, I know it's going to happen at some point :)
csakatoku has joined #ocaml
<rgrinberg> Drup: that's exactly what I'm pushing for but I don't know if there's consensus with the other maintainers
<rgrinberg> companion_cube also pushed for having optional deriving support too
<rgrinberg> with opam it's much easier to factor the libraries
<Drup> yes, I know, and some other stuff, I followed the discussion
thomasga has joined #ocaml
manizzle has joined #ocaml