adrien changed the topic of #ocaml to: Discussions about the OCaml programming language | http://www.ocaml.org | OCaml 4.06.0 release notes: https://caml.inria.fr/pub/distrib/ocaml-4.06/notes/Changes | Try OCaml in your browser: http://try.ocamlpro.com | Public channel logs at http://irclog.whitequark.org/ocaml
pknight has quit [Quit: leaving]
jimmyrcom has joined #ocaml
objmagic_ has joined #ocaml
objmagic has quit [Read error: Connection reset by peer]
nomicflux has joined #ocaml
nkhodyunya has quit [Ping timeout: 256 seconds]
yetanotherion[m] has quit [Ping timeout: 256 seconds]
M-martinklepsch has quit [Ping timeout: 240 seconds]
drsmkl[m] has quit [Ping timeout: 255 seconds]
Bluddy[m] has quit [Ping timeout: 255 seconds]
copy` has quit [Ping timeout: 255 seconds]
peddie[m] has quit [Ping timeout: 252 seconds]
multiocracy[m] has quit [Ping timeout: 276 seconds]
srenatus has quit [Ping timeout: 255 seconds]
Haudegen[m] has quit [Ping timeout: 255 seconds]
aantron has quit [Ping timeout: 255 seconds]
smondet[m] has quit [Ping timeout: 240 seconds]
hdurer[m] has quit [Ping timeout: 240 seconds]
regnat[m] has quit [Ping timeout: 240 seconds]
rizo[m] has quit [Ping timeout: 252 seconds]
M-jimt has quit [Ping timeout: 240 seconds]
maufred has quit [Ping timeout: 256 seconds]
M-ErkkiSeppl has quit [Ping timeout: 256 seconds]
equalunique[m] has quit [Ping timeout: 265 seconds]
ansiwen[m] has quit [Ping timeout: 255 seconds]
isaachodes[m] has quit [Ping timeout: 255 seconds]
rgr[m] has quit [Ping timeout: 255 seconds]
orbifx[m] has quit [Ping timeout: 276 seconds]
aspiwack[m] has quit [Ping timeout: 276 seconds]
M-x-matrix[m] has quit [Ping timeout: 276 seconds]
maufred has joined #ocaml
lukky513 has quit [Ping timeout: 240 seconds]
sh0t has quit [Remote host closed the connection]
jimmyrcom has quit [Ping timeout: 256 seconds]
jimmyrcom has joined #ocaml
silver_ has joined #ocaml
zolk3ri has quit [Quit: leaving]
silver has quit [Ping timeout: 248 seconds]
zolk3ri has joined #ocaml
zolk3ri has quit [Client Quit]
zolk3ri has joined #ocaml
infinity0_ has joined #ocaml
infinity0 has quit [Killed (moon.freenode.net (Nickname regained by services))]
infinity0 has joined #ocaml
infinity0_ is now known as infinity0
multiocracy[m] has joined #ocaml
zolk3ri has quit [Quit: leaving]
lukky513 has joined #ocaml
equalunique[m] has joined #ocaml
M-jimt has joined #ocaml
copy` has joined #ocaml
srenatus has joined #ocaml
M-martinklepsch has joined #ocaml
aspiwack[m] has joined #ocaml
drsmkl[m] has joined #ocaml
aantron has joined #ocaml
peddie[m] has joined #ocaml
smondet[m] has joined #ocaml
hdurer[m] has joined #ocaml
orbifx[m] has joined #ocaml
isaachodes[m] has joined #ocaml
rgr[m] has joined #ocaml
regnat[m] has joined #ocaml
rizo[m] has joined #ocaml
Haudegen[m] has joined #ocaml
M-x-matrix[m] has joined #ocaml
Bluddy[m] has joined #ocaml
yetanotherion[m] has joined #ocaml
M-ErkkiSeppl has joined #ocaml
ansiwen[m] has joined #ocaml
nkhodyunya has joined #ocaml
mfp has quit [Ping timeout: 256 seconds]
jimmyrcom has quit [Ping timeout: 248 seconds]
sh0t has joined #ocaml
jimmyrcom has joined #ocaml
jimmyrcom has quit [Ping timeout: 240 seconds]
objmagic_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jimmyrcom has joined #ocaml
sh0t has quit [Remote host closed the connection]
objmagic has joined #ocaml
Haudegen has quit [Remote host closed the connection]
objmagic has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
al-damiri has quit [Quit: Connection closed for inactivity]
jimmyrcom has quit [Ping timeout: 252 seconds]
infinity0 has quit [Ping timeout: 252 seconds]
infinity0 has joined #ocaml
nomicflux has quit [Quit: nomicflux]
silver_ has quit [Read error: Connection reset by peer]
jimmyrcom has joined #ocaml
octachron has quit [Ping timeout: 248 seconds]
nomicflux has joined #ocaml
jimmyrcom has quit [Ping timeout: 265 seconds]
shinnya has joined #ocaml
jao has quit [Ping timeout: 256 seconds]
spew has joined #ocaml
shinnya has quit [Ping timeout: 276 seconds]
M-martinklepsch has quit [Ping timeout: 255 seconds]
aantron has quit [Ping timeout: 252 seconds]
Haudegen[m] has quit [Ping timeout: 240 seconds]
smondet[m] has quit [Ping timeout: 256 seconds]
multiocracy[m] has quit [Ping timeout: 252 seconds]
copy` has quit [Ping timeout: 240 seconds]
equalunique[m] has quit [Ping timeout: 240 seconds]
ansiwen[m] has quit [Ping timeout: 255 seconds]
regnat[m] has quit [Ping timeout: 255 seconds]
orbifx[m] has quit [Ping timeout: 260 seconds]
Bluddy[m] has quit [Ping timeout: 256 seconds]
drsmkl[m] has quit [Ping timeout: 256 seconds]
aspiwack[m] has quit [Ping timeout: 256 seconds]
hdurer[m] has quit [Ping timeout: 240 seconds]
srenatus has quit [Ping timeout: 240 seconds]
M-ErkkiSeppl has quit [Ping timeout: 252 seconds]
nkhodyunya has quit [Ping timeout: 255 seconds]
M-x-matrix[m] has quit [Ping timeout: 255 seconds]
peddie[m] has quit [Ping timeout: 255 seconds]
rizo[m] has quit [Ping timeout: 255 seconds]
yetanotherion[m] has quit [Ping timeout: 256 seconds]
isaachodes[m] has quit [Ping timeout: 256 seconds]
rgr[m] has quit [Ping timeout: 256 seconds]
M-jimt has quit [Ping timeout: 276 seconds]
nomicflux has quit [Quit: nomicflux]
nomicflux has joined #ocaml
pierpa has joined #ocaml
nomicflux has quit [Quit: nomicflux]
Algebr has quit [Ping timeout: 268 seconds]
jimmyrcom has joined #ocaml
kmicinski has joined #ocaml
<kmicinski> Is there an Ocsigen-specific channel? I have eliom installed and I believe I'm properly including it in _tags / -package / etc.. but still getting "unbound module" errors.
nomicflux has joined #ocaml
kmicinski has quit [Quit: Lost terminal]
spew has quit [Read error: Connection reset by peer]
jimmyrcom has quit [Ping timeout: 255 seconds]
jimmyrcom has joined #ocaml
Algebr has joined #ocaml
mbuf has joined #ocaml
tizoc has quit [Quit: Coyote finally caught me]
tizoc has joined #ocaml
jimmyrcom has quit [Ping timeout: 255 seconds]
nomicflux has quit [Quit: nomicflux]
BitPuffin has joined #ocaml
sapristi has joined #ocaml
dangeranger has quit [Quit: Textual IRC Client: www.textualapp.com]
aspiwack[m] has joined #ocaml
objmagic has joined #ocaml
drsmkl[m] has joined #ocaml
yetanotherion[m] has joined #ocaml
peddie[m] has joined #ocaml
smondet[m] has joined #ocaml
M-jimt has joined #ocaml
orbifx[m] has joined #ocaml
ansiwen[m] has joined #ocaml
isaachodes[m] has joined #ocaml
M-ErkkiSeppl has joined #ocaml
multiocracy[m] has joined #ocaml
copy` has joined #ocaml
rgr[m] has joined #ocaml
equalunique[m] has joined #ocaml
Bluddy[m] has joined #ocaml
rizo[m] has joined #ocaml
M-x-matrix[m] has joined #ocaml
nkhodyunya has joined #ocaml
regnat[m] has joined #ocaml
hdurer[m] has joined #ocaml
aantron has joined #ocaml
Haudegen[m] has joined #ocaml
M-martinklepsch has joined #ocaml
srenatus has joined #ocaml
pierpa has quit [Quit: Page closed]
madroach has quit [Ping timeout: 265 seconds]
madroach has joined #ocaml
MercurialAlchemi has joined #ocaml
dynrzk has joined #ocaml
cbot has quit [Quit: Leaving]
Algebr has quit [Ping timeout: 255 seconds]
mk9 has joined #ocaml
jimmyrcom has joined #ocaml
mk9 has quit [Ping timeout: 268 seconds]
jimmyrcom has quit [Ping timeout: 276 seconds]
nore has joined #ocaml
freyr has joined #ocaml
AltGr has joined #ocaml
mk9 has joined #ocaml
dynrzk has quit [Ping timeout: 256 seconds]
orbifx1 has joined #ocaml
mk9 has quit [Remote host closed the connection]
orbifx1 has quit [Ping timeout: 256 seconds]
mk9 has joined #ocaml
objmagic has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<atchoum> dmBATURIN thanks for the FAQ
<atchoum> really useful
atchoum has quit [Ping timeout: 260 seconds]
mfp has joined #ocaml
argent_smith has joined #ocaml
nullifidian has quit [Ping timeout: 265 seconds]
barcabuona has quit [Ping timeout: 248 seconds]
barcabuona has joined #ocaml
tarptaeya has joined #ocaml
tarptaeya has quit [Quit: Leaving]
nullifidian has joined #ocaml
barcabuona has quit [Ping timeout: 268 seconds]
dynrzk has joined #ocaml
Haudegen has joined #ocaml
dynrzk has quit [Ping timeout: 248 seconds]
barcabuona has joined #ocaml
barcabuona has quit [Ping timeout: 255 seconds]
mk9_ has joined #ocaml
mk9 has quit [Ping timeout: 252 seconds]
mk9_ is now known as mk9
mk9 has quit [Client Quit]
mk9 has joined #ocaml
zpe has joined #ocaml
dhil has joined #ocaml
barcabuona has joined #ocaml
mengu has joined #ocaml
TarVanimelde has joined #ocaml
TarVanimelde has quit [Client Quit]
dynrzk has joined #ocaml
zpe has quit [Remote host closed the connection]
octachron has joined #ocaml
dynrzk has quit [Ping timeout: 260 seconds]
zpe has joined #ocaml
zpe has quit [Remote host closed the connection]
zpe has joined #ocaml
zpe has quit [Remote host closed the connection]
zpe has joined #ocaml
zolk3ri has joined #ocaml
silver has joined #ocaml
zpe has quit [Ping timeout: 260 seconds]
mk9 has quit [Ping timeout: 276 seconds]
barcabuona has quit [Ping timeout: 248 seconds]
groovy2shoes has joined #ocaml
mk9 has joined #ocaml
ziyourenxiang has joined #ocaml
groovy2shoes has quit [Client Quit]
groovy2shoes has joined #ocaml
kakadu has joined #ocaml
barcabuona has joined #ocaml
<andrewalker> hi. I installed ocaml, ocamlbuild and opam in arch linux. `opam install ocamlfind` yields this: Error: Unbound module Toploop
<andrewalker> how can I debug?
mbuf has quit [Quit: Leaving]
<andrewalker> it died in this command apparently: ocamlc -I +compiler-libs -opaque -g -c topfind.ml
<andrewalker> I can post more logs, or more info about my system, I just don't know exactly where is more relevant to look first
<andrewalker> ugh, turns out I needed: pacman -Sy ocaml-compiler-libs
<andrewalker> problem solved
mk9 has quit [Quit: mk9]
jao has joined #ocaml
<Fardale> andrewalker: you have to install ocaml-something because the ocaml package is juste the compiler, if i remember correctly
<Fardale> but on arch the best thing is to install a switch
<andrewalker> Fardale: oh, I think that sounds promising
<andrewalker> because now I'm trying to install cohttp and it's dying in other ways
mk9 has joined #ocaml
dhil has quit [Ping timeout: 276 seconds]
mbuf has joined #ocaml
jao has quit [Ping timeout: 240 seconds]
argent_smith1 has joined #ocaml
argent_smith has quit [Ping timeout: 240 seconds]
govg has quit [Ping timeout: 260 seconds]
shinnya has joined #ocaml
nomicflux has joined #ocaml
govg has joined #ocaml
dhil has joined #ocaml
<Leonidas> yeah, arch ocaml packages are broken in so many ways, I stopped maintaining the AUR ocaml packages
<Leonidas> that said, I don't recommend using brew ocaml packages either, just opam@2 and call it a day
<zozozo> Leonidas: how about maintaining a binary opam2 AUR package ? since the solver is now included, there would be no dependency (hence no breakage, aprt from the glibc upgrades maybe ?)
nomicflux has quit [Quit: nomicflux]
sapristi has quit [Ping timeout: 260 seconds]
<Leonidas> zozozo: opam can build its own ocaml, so you don't need to have it binary and trust some mystery binary not to be malicious.
<zozozo> good point
<Leonidas> zozozo: but as the opam 2.0 release is not very far off I think you'll be able to just install opam 2 binaries from Arch directly
mbuf has quit [Quit: Leaving]
<zozozo> Leonidas: yeah, and I already have done so on my laptop when I had to reinstall arch on it, but I'd prefer if it went through pacman, even if only to have automatic updates, ^^
<thizanne> maintaining an opam aur package doesnt seem a lot of work
<thizanne> if the current maintainer (no idea who it is) doesnt upgrade to opam 2, i'll probably just package it as long as it works (which should be ok)
<Drup> I should update the AUR opam-git package
<Drup> I have an appropriate pkg file already
shinnya has quit [Ping timeout: 248 seconds]
dhil has quit [Ping timeout: 256 seconds]
raduom has joined #ocaml
letoh has quit [Ping timeout: 264 seconds]
letoh has joined #ocaml
dhil has joined #ocaml
<Leonidas> thizanne: opam on arch is currently in [community] which is neat beacause you can download a trusted binary
<companion_cube> well with the opam-git package you compile yourself
<companion_cube> yo-lo
<Leonidas> and I am pretty confident it will get updated quickly after the release, Arch is pretty good in this regards
raduom has quit [Ping timeout: 240 seconds]
<Leonidas> I personally wouldn't bother uploading an opam2 AUR package at this point because the effort is most likely wasted.
<thizanne> it's definitely wasted if someone upgrades the community one
MercurialAlchemi has quit [Ping timeout: 240 seconds]
mk9 has quit [Ping timeout: 240 seconds]
FreeBirdLjj has joined #ocaml
zpe has joined #ocaml
sh0t has joined #ocaml
moei has joined #ocaml
mengu has quit [Remote host closed the connection]
mk9 has joined #ocaml
mbuf has joined #ocaml
jimmyrcom has joined #ocaml
tsani has quit [Quit: ZNC 1.6.5 - http://znc.in]
tsani has joined #ocaml
tsani has quit [Client Quit]
tsani has joined #ocaml
tsani has quit [Client Quit]
tsani has joined #ocaml
tsani has quit [Client Quit]
tsani has joined #ocaml
tsani has quit [Client Quit]
mk9 has quit [Quit: mk9]
dhil has quit [Ping timeout: 260 seconds]
FreeBirdLjj has quit [Remote host closed the connection]
dhil has joined #ocaml
zpe has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
zpe has joined #ocaml
zpe has quit [Ping timeout: 260 seconds]
jimmyrcom has quit [Ping timeout: 276 seconds]
bbear has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 260 seconds]
ziyourenxiang has quit [Ping timeout: 255 seconds]
Jesin has joined #ocaml
zpe has joined #ocaml
freyr has quit [Remote host closed the connection]
Jesin has quit [Quit: Leaving]
zpe has quit [Remote host closed the connection]
zpe has joined #ocaml
jimmyrcom has joined #ocaml
zpe has quit [Ping timeout: 240 seconds]
sapristi has joined #ocaml
aciniglio has joined #ocaml
tsani has joined #ocaml
tsani has quit [Client Quit]
tsani has joined #ocaml
tsani has quit [Client Quit]
tsani has joined #ocaml
jao has joined #ocaml
infinity0 is now known as Guest70793
Guest70793 has quit [Killed (tolkien.freenode.net (Nickname regained by services))]
infinity0 has joined #ocaml
mbuf has quit [Quit: Leaving]
zpe has joined #ocaml
aciniglio has quit [Ping timeout: 265 seconds]
zpe has quit [Remote host closed the connection]
zpe has joined #ocaml
dhil has quit [Ping timeout: 260 seconds]
zpe has quit [Ping timeout: 240 seconds]
shinnya has joined #ocaml
slash^ has joined #ocaml
objmagic has joined #ocaml
Haudegen has quit [Ping timeout: 256 seconds]
mk9 has joined #ocaml
kakadu has quit [Quit: Konversation terminated!]
andreas_ has quit [Quit: Connection closed for inactivity]
jnavila has joined #ocaml
jnavila has quit [Quit: Konversation terminated!]
jnavila has joined #ocaml
zolk3ri has quit [Quit: leaving]
zolk3ri has joined #ocaml
zolk3ri has quit [Client Quit]
zolk3ri has joined #ocaml
zolk3ri has quit [Client Quit]
zolk3ri has joined #ocaml
zolk3ri has quit [Client Quit]
zolk3ri has joined #ocaml
mengu has joined #ocaml
mengu has quit [Ping timeout: 260 seconds]
shinnya has quit [Ping timeout: 256 seconds]
jnavila has quit [Ping timeout: 260 seconds]
kakadu has joined #ocaml
tane has joined #ocaml
letoh has quit [Ping timeout: 276 seconds]
jnavila has joined #ocaml
_andre has quit [Quit: leaving]
sapristi has quit [Ping timeout: 268 seconds]
jnavila has quit [Ping timeout: 240 seconds]
mengu has joined #ocaml
jnavila has joined #ocaml
BitPuffin has quit [Remote host closed the connection]
atchoum has joined #ocaml
mengu has quit [Remote host closed the connection]
slash^ has quit [Read error: Connection reset by peer]
objmagic has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jnavila has quit [Ping timeout: 240 seconds]
jnavila has joined #ocaml
mengu has joined #ocaml
atchoum has quit [Ping timeout: 248 seconds]
atchoum has joined #ocaml
mengu has quit [Remote host closed the connection]
groovy2shoes has quit [Quit: moritura te saluto]
objmagic has joined #ocaml
jimmyrcom has quit [Ping timeout: 248 seconds]
jimmyrcom has joined #ocaml
Haudegen has joined #ocaml
<atchoum> why is this not compiling : let rec print_list list = function [] -> () | e::l -> print_string e; print_list l in print_list [1;2];; ?
<companion_cube> let rec f = function [] -> () | x :: l -> Printf.printf "%d\n" x; f l in f [1;2;3];; <- this works
<companion_cube> you have two arguments, not one
<companion_cube> `function` has an implicit argument
<atchoum> it has to be a single argument ?
<atchoum> ok I get it so if I wanted many argument to enter the pattern matching I would have used let rec f x y = match (x,y) with ..
<atchoum> thank you.
tsani has quit [Quit: ZNC 1.6.5 - http://znc.in]
tsani has joined #ocaml
argent_smith1 has quit [Quit: Leaving.]
<atchoum> let rec p n integer = if (n > 0) then (print_string ((string_of_int integer) ^ "\n");p (n-1) integer else ();; <- this doesn't work neither.
Soni has quit [Ping timeout: 260 seconds]
<octachron> atchoum, unbalanced parentheses
cbot has joined #ocaml
<atchoum> let rec p n integer = if (n > 0) then (print_string (string_of_int integer ^ "\n"));(p (n-1) integer) else ();;
<atchoum> I got syntax error now.
tsani has quit [Quit: ZNC 1.6.5 - http://znc.in]
<atchoum> I put parenthesis around the whole block between then and else and suddenly it began to work.
tsani has joined #ocaml
<octachron> the explanation is that "if _ then _; _ else _" is parsed as "(if _ then _); _ ERROR" and not "if _ then (_;_) else _"
<zolk3ri> yeah, you could use if _ then begin x; y end else _
<atchoum> ; has the lowest precedence then ?
objmagic has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
shakalaka has quit [Ping timeout: 248 seconds]
<atchoum> my brain is gonna explose
<octachron> yes, ";" has the second lowest precedence after "in"
<atchoum> ha, ok
objmagic has joined #ocaml
objmagic has quit [Client Quit]
<atchoum> any equivalent of concatMap in ocaml ?
<atchoum> something with ('a -> ['a]) -> ['a'] type signature.
kolko has quit [Quit: ZNC - http://znc.in]
<Fardale> atchoum: what is ['a] ? An array of elemet of type 'a ?
<thizanne> not in the standard lib
<atchoum> yes A list
<thizanne> but you have List.flatten : 'a list list -> 'a list
<atchoum> yes this is exactly that.
<thizanne> not exactly
<atchoum> not exactly but that is what I was looking for.
<atchoum> merci thizanne
<atchoum> have you a suggestion about which part of the standard library I should learn first ?
tsani has quit [Quit: ZNC 1.6.5 - http://znc.in]
<octachron> and extended libraries probably have some version of flat_map (containers has one for instance)
<thizanne> I don't think that should be the question atchoum
tsani has joined #ocaml
<atchoum> okay:)
<thizanne> you should learn with a proper course, and this course will make you use some parts of the standard library
objmagic has joined #ocaml
<octachron> or with a toy project on a subject that you are interested on
<octachron> learning a standard library is akin to learning a dictionary: it is not very efficient nor fun for most people
<atchoum> yes ; i think coding website are great to take the hang of the basics. I started two days ago but I like ocaml a lot.
shakalaka has joined #ocaml
<atchoum> octachron: I suppose you are right.
<atchoum> I think ocaml is a great language.
<Fardale> for what ? What do you like in OCaml ? (I am curious to know what people like in OCaml)
<atchoum> It's hard to find a good course. Ultimately, what matters if is you can and what you can do with the language. You never know until you try and fail a great deal of times it seems.
<atchoum> Fardale: So far I have taken the path to learn a pure functional language (Haskell). It was rewarding but I couldn't do much and I got stuck very fast when I had to implement some basic data structures (because of immutability of pretty much everything and the difficulty of using unboxed type with the language -- the language is hard enough itself).
<atchoum> say you want arrays for example, you must use this kind of interface: https://hackage.haskell.org/package/array-0.5.2.0/docs/Data-Array-Unboxed.html
<atchoum> Not really complaining, this is just a long way to perfection but then it is a really long way.
<atchoum> I don't know if I am really gifted for programming though. This things are like breathing for many guys out there.
tane has quit [Quit: Leaving]
<atchoum> Well octachron you said it as well, programming is not learning a dictionary, so that's why probably functional programming is cool.
<atchoum> (_, h::s) -> (p n h)@(f n s);; I still got a problem with my concat
<Fardale> I didn't look at Haskell yet, but I will do some day because I want to see how it use monade
<atchoum> (p n h) is a list but the compiler is telling me it has unit type.
jnavila has quit [Remote host closed the connection]
<atchoum> sorry, I was mistaken -- I forgot to update a binding.
objmagic has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<justin_smith> atchoum: (p n h) should execute p with arguments n and h
<Fardale> atchoum: do you use merlin ?
<atchoum> nope
dxtr has joined #ocaml
<atchoum> ha maybe I should.
<Fardale> do you use the top level or compile a file ?
<Fardale> merlin is a great tool for ocaml and for the top level you should have a look at utop
<atchoum> i'm using utop yes.
<atchoum> really I didn't thought of it but [1,2,3] is really a tuple
<Fardale> it a (int*int*int) list
<Fardale> a list of tuple of 1 element
<bartholin> [1;2;3] is a int list
<atchoum> yes
objmagic has joined #ocaml
<Fardale> atchoum: sometimes it is hard to find where a type error come from, a tip is to force the type of variable, the notation is the following let (x:int) = 1 and for fonction let f (x:int) (y:int):int = x + y
objmagic has quit [Client Quit]
mk9 has quit [Quit: mk9]
<atchoum> is this a good code ? http://vpaste.net/LPFTC ?
<atchoum> exception catching seems cool also in Ocaml.
<atchoum> try (something) with Exception -> returnValue.
<thizanne> atchoum: you don't need to match against predicate
<thizanne> pattern-matching is used to distinguish different patterns on some variable, get the values associated to these patterns, and do something for each pattern (possibly using the values)
<atchoum> ok so you just do match list with [] -> foo | h::s -> bar ?
<thizanne> yes
<thizanne> you also don't need parentheses around patterns
<thizanne> neither around the condition of an if
Soni has joined #ocaml
<thizanne> or a value matched
<atchoum> okay
<thizanne> I would also advise, for symmetry reasons, that you do use the (optional) | pipe on the first pattern
<thizanne> that would give http://paste.awesom.eu/b5B7
<thizanne> (I put some spaces that match my personal taste, as far as I saw a lot of people use them too)
orbifx1 has joined #ocaml
<thizanne> now here you can also remove the parentheses around the else body
<atchoum> yes, having a good coding style is of paramount importance.
<thizanne> because it's a single expression
<atchoum> yes.
<thizanne> beware though on this point, when you use imperative code with ;, the else binds tighter (so if a then b else c; d actually is (if a then b else c); d)
<atchoum> yes, I did that mistake earlier.
<thizanne> and then you can also remove the last parentheses, because function application binds tighter than the :: "operator" application
<thizanne> note that the first points are easy to fix, but the last 2 (after my paste) rely on some not-totally-beginner knowledge of the syntax, so you should not be ashamed of leaving these parentheses whenever you're not totally sure if you need them
<justin_smith> as a lazy person who also writes lisp I tend to just put parens everywhere :D
<thizanne> that's probably not good style, but bad style code because to many parentheses is still better than wrong code because not enough parentheses :)
<justin_smith> yeah, I'm aware that doing that is as bad in ocaml as spilling the pringles is in lisp
<Drup> if I have to choose between too many parens and a funky mix of @@ |> and other composition combinator, I'm going to pick the first style
<Drup> some people really overdo it with the combinators
kini has joined #ocaml
<zolk3ri> yup
webshinra has quit [Remote host closed the connection]
sh0t has quit [Remote host closed the connection]
webshinra has joined #ocaml
AltGr has left #ocaml [#ocaml]
<Fardale> What do @@ operator ?
<Drup> let (@@) f x = f x
<octachron> which is useful due to its right associativity and lower precedence " f param1 @@ g param2 @@ h x" is "f param1 (g param2 (h x))"
moei has quit [Quit: Leaving...]
kakadu has quit [Remote host closed the connection]
<atchoum> it's for composition of function
<whoman> why two @'s ?
<atchoum> one is for append constructor
<atchoum> [1;2]@[3;4]