adrien changed the topic of #ocaml to: Discussions about the OCaml programming language | http://www.ocaml.org | OCaml MOOC http://1149.fr/ocaml-mooc | OCaml 4.02.3 announced http://ocaml.org/releases/4.02.html | Try OCaml in your browser: http://try.ocamlpro.com | Public channel logs at http://irclog.whitequark.org/ocaml
dksong has joined #ocaml
orbifx has quit [Ping timeout: 240 seconds]
dksong has quit [Client Quit]
orbifx has joined #ocaml
orbifx2 has quit [Ping timeout: 256 seconds]
infinity0 has joined #ocaml
ap305 has quit []
NingaLeaf has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<pierpa> 90% of the traffic in this channel is about the tools which should simplify things...
infinity0 has quit [Remote host closed the connection]
crass_ has joined #ocaml
<profan> LOL , indeed
infinity0 has joined #ocaml
<Algebr2> building code is a problem for everyone
<Drup> johnelse: for me, the main pro is that the programming model is much much much nicer than native threads.
Thooms has quit [Remote host closed the connection]
infinity0 has quit [Remote host closed the connection]
infinity0 has joined #ocaml
madroach has quit [Ping timeout: 248 seconds]
zaquest has quit [Ping timeout: 272 seconds]
Kakadu has quit [Remote host closed the connection]
madroach has joined #ocaml
infinity0 has quit [Remote host closed the connection]
infinity0 has joined #ocaml
aantron has joined #ocaml
orbifx has quit [Ping timeout: 248 seconds]
<Algebr2> stog looks pretty nice actually, anyone here using it
tane has quit [Quit: Verlassend]
NingaLeaf has joined #ocaml
FreeBirdLjj has joined #ocaml
struk|desk|away is now known as struk|desk
zaquest has joined #ocaml
fluter is now known as fluter_
fluter_ is now known as fluter
<struk|desk> pierpa: we really need a tool to simplify making tools to simplify things
* fds gets to work on a monadic tool simplifier generator library.
<struk|desk> you done yet? come on man..aint got all day :)
<pierpa> struk|desk: yeah
<struk|desk> peirpa: I was mostly being sarcastic, but it does have some truth to i
<struk|desk> *it
<pierpa> it's called software engineering. We (everybody) are very very bad at it
<struk|desk> we are so bad we can't define success accurately either. hehe
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
The_Mad_Pirate has quit [Excess Flood]
The_Mad_Pirate has joined #ocaml
tokik_ has quit [Ping timeout: 276 seconds]
crass_ has quit [Remote host closed the connection]
struk|desk is now known as struk|desk|away
struk|desk|away is now known as struk|desk
johnelse has quit [Ping timeout: 252 seconds]
johnelse has joined #ocaml
johnelse is now known as Guest23593
Guest23593 has quit [Ping timeout: 276 seconds]
johnelse_ has joined #ocaml
yegods has quit [Remote host closed the connection]
pierpa has quit [Quit: ERC Version 5.3 (IRC client for Emacs)]
yegods has joined #ocaml
struk|desk is now known as struk|desk|away
copy` has quit [Quit: Connection closed for inactivity]
struk|desk|away is now known as struk|desk
shinnya has quit [Ping timeout: 260 seconds]
kansi has joined #ocaml
tokik has joined #ocaml
antkong has joined #ocaml
slash^ has joined #ocaml
axiles has quit [Remote host closed the connection]
struk|desk is now known as struk|desk|away
axiles has joined #ocaml
accname has joined #ocaml
Simn has joined #ocaml
The_Mad_Pirate has quit [Quit: Konversation terminated!]
shinnya has joined #ocaml
MercurialAlchemi has joined #ocaml
f[x] has quit [Ping timeout: 250 seconds]
lokien has joined #ocaml
orbifx has joined #ocaml
nkhodyunya has joined #ocaml
darkf has quit [Quit: Leaving]
malc_ has joined #ocaml
MercurialAlchemi has quit [Ping timeout: 240 seconds]
larhat has joined #ocaml
kansi has quit [Ping timeout: 260 seconds]
Sorella has quit [Quit: Connection closed for inactivity]
MercurialAlchemi has joined #ocaml
nkhodyunya has quit [Quit: Leaving.]
MercurialAlchemi has quit [Ping timeout: 264 seconds]
nkhodyunya has joined #ocaml
MercurialAlchemi has joined #ocaml
MercurialAlchemi has quit [Ping timeout: 240 seconds]
larhat has quit [Quit: Leaving.]
Algebr2 has quit [Ping timeout: 240 seconds]
nkhodyunya has quit [Quit: Leaving.]
lokien has quit [Quit: Leaving]
Haudegen has quit [Ping timeout: 250 seconds]
nkhodyunya has joined #ocaml
Haudegen has joined #ocaml
nkhodyunya has quit [Quit: Leaving.]
rand__ has joined #ocaml
FreeBirdLjj has quit [Read error: Connection reset by peer]
FreeBirdLjj has joined #ocaml
Algebr2 has joined #ocaml
copy` has joined #ocaml
MercurialAlchemi has joined #ocaml
lokien has joined #ocaml
kansi has joined #ocaml
accname has quit [Remote host closed the connection]
Algebr2 has quit [Ping timeout: 264 seconds]
kansi has quit [Ping timeout: 240 seconds]
tane has joined #ocaml
malc__ has joined #ocaml
orbifx1 has joined #ocaml
malc_ has quit [Ping timeout: 276 seconds]
yegods has quit [Remote host closed the connection]
ggole has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
<lokien> guess 7 = "seven"
<lokien> guess x = "try again"
<lokien> how do I translate this haskell to ocaml?
<copy`> let guess = function | 7 -> "seven" | x -> "try again"
Algebr2 has joined #ocaml
<lokien> oh, wow
foolishmonkey has joined #ocaml
orbifx1 has quit [Quit: WeeChat 1.3]
rand__ has quit [Ping timeout: 272 seconds]
nkhodyunya has joined #ocaml
orbifx has quit [Ping timeout: 260 seconds]
<lokien> is there a function in core that takes n functions and a list, and applies these functions to the list? returning list of results
<artart78> apply each function to one element? or apply all the functions to all the elements?
<lokien> function a b c ~f:x -> [(a x);(b x);(c x)]
<lokien> all to all
<lokien> all to one would be nice too
<lokien> eww, I screwed up with my pseudocode
<lokien> it's not ~f:x, more like ~seq:x
Sorella has joined #ocaml
orbifx has joined #ocaml
<artart78> lokien: what's x? I don't get it
FreeBird_ has joined #ocaml
<lokien> artart78: a b c are functions, x is something they take as an argument.
<artart78> I don't think you can make a function taking as many arguments as you want in ocaml, or at least it won't be natural
FreeBirdLjj has quit [Ping timeout: 240 seconds]
<lokien> function (+2) (+4) (-3) 1 -> [3;5;-2]
<lokien> better now?
<regnat> I don't think it's possible that way
<regnat> But you can use a list of functions
<regnat> (as argument)
<lokien> yeah, I can do that
<lokien> but how?
Algebr2 has quit [Ping timeout: 260 seconds]
<regnat> Somthing like "fun funs x -> List.map ~f:(fun f -> f x) funs"
<ggole> fun fs list -> List.map (List.fold_left compose id fs) list
<ggole> compose and id aren't in Pervasives, but they are probably in Core somewhere
<lokien> thanks regnat, it works :)
<lokien> ggole: I can't find compose in the core, so I'll just go with solution above
<ggole> Actually, never mind: I misread your question anyway :)
<lokien> I'd implemented compose, still doesn't work
<lokien> yeah, my questions are easy to misinterpret /:
<ggole> Yep, my version composes the functions in the list and then maps that
<ggole> eg, [(+) 2; (+) 1] => (+) 3
<regnat> (if you need it somewhere else, compose is Fn.compose in core iirc)
<lokien> I used Fn.compose now, but compiler is still not happy with it
<ggole> I don't use Core, maybe I got the order wrong for that library or something
<lokien> what are people using then? nobody's using core here
<lokien> batteries?
<ggole> Core, batteries, containers and NiH are all popular choices
<lokien> NiH? :D
<lokien> new one!
<ggole> No, it's the oldest choice ;)
<ggole> (NiH = not invented here, eg, writing what you want yourself.)
<lokien> ohh, that small I misguided me
<lokien> I'm writing stuff now so ocaml will become clojure/haskell in my project, I hope I'll stop soon
<lokien> what open source can I read to learn some idioms? or maybe there is a blog entry for that?
<ggole> I'm never sure how to answer that
<lokien> I just.. want to think like an ocamler, not like a clojurist, implementing clojure functions in ocaml :(
<ggole> There's a few books available, maybe look at Thomas Leonard's blog
<lokien> I was reading through real world ocaml and ocaml from the very beginning
<yawnt> as someone who just got started
<yawnt> Opium looks fairly simple to me
<lokien> opium.ml - 42 lines :D
nkhodyunya has quit [Quit: Leaving.]
bacam has quit [Quit: leaving]
<lokien> ggole: this blog looks cool, thank you :)
bacam has joined #ocaml
struk|desk|away is now known as struk|desk
dhil has joined #ocaml
<orbifx> Which blog?
orbifx2 has joined #ocaml
<lokien> orbifx: http://roscidus.com/blog/
<orbifx2> Thanks lokien.
<lokien> np. there is a good post about porting his program from python
dsheets has joined #ocaml
dsheets has quit [Remote host closed the connection]
dsheets has joined #ocaml
NingaLeaf has quit [Quit: Textual IRC Client: www.textualapp.com]
dsheets has quit [Remote host closed the connection]
Algebr2 has joined #ocaml
crass has joined #ocaml
struk|desk is now known as struk|desk|away
antkong has quit [Quit: antkong]
yegods has joined #ocaml
lokien has quit [Quit: Leaving]
pierpa has joined #ocaml
Haudegen has quit [Ping timeout: 260 seconds]
crass has quit [Remote host closed the connection]
dsheets has joined #ocaml
dsheets has quit [Remote host closed the connection]
struk|desk|away is now known as struk|desk
dsheets has joined #ocaml
Algebr2 has quit [Ping timeout: 248 seconds]
Haudegen has joined #ocaml
dsheets has quit [Remote host closed the connection]
dsheets has joined #ocaml
dsheets has quit [Remote host closed the connection]
nkhodyunya has joined #ocaml
larhat has joined #ocaml
dsheets has joined #ocaml
dsheets has quit [Remote host closed the connection]
malc__ is now known as malc_
struk|desk is now known as struk|desk|away
nuuit has joined #ocaml
dsheets has joined #ocaml
FreeBird_ has quit [Ping timeout: 252 seconds]
dsheets has quit [Remote host closed the connection]
dsheets has joined #ocaml
dsheets has quit [Remote host closed the connection]
madroach has quit [Quit: leaving]
Algebr2 has joined #ocaml
Nairwolf has joined #ocaml
larhat has quit [Quit: Leaving.]
<Nairwolf> how can I print a boolean value ?
<Nairwolf> I'm trying to make a simple exercice, I work with a binary tree, and I'm trying to know if it's a leaf or not. I've writen this : https://github.com/Nairolf21/learning/blob/master/ocaml/bintree.ml
<Nairwolf> I have a function isLeaf btree : binary_tree -> boolean
<Nairwolf> And I would like to test this function
<Nairwolf> So I need to evaluate the boolean, do I need to do it with a simple with a sentence like "if boolean-condition then expression1 else expression2" ?
<fds> I think you need to do something like: let print_bool b = if b then print_string "true" else print_string "false"
<fds> But I'm a noob too, so... :-)
<Nairwolf> fds: yes, somethink like that would work. But I wonder if there is already something to do that with the core language (without write a new function)
shinnya has quit [Ping timeout: 264 seconds]
<Nairwolf> oh, there is a "to_string" function
<fds> In the standard library or Core?
<fds> There does seem to be a string_of_bool in the standard library though!
dsheets has joined #ocaml
<icicled> printf "%b" my_bool
<icicled> Printf.printf
<icicled> another option
<Nairwolf> oh, thank you fds "string_of_bool" is what I needed ;)
<Nairwolf> thank you icicled also for your suggestion ;)
<Nairwolf> Just another thing to understand better Printf is a module from the standard library, and "string_of_bool" is from the Core language ?
dsheets has quit [Ping timeout: 264 seconds]
<fds> Nairwolf: `Core' is the name of an alternative standard library (possibly confusingly). `string_of_bool' is in the Pervasives module, which is in the standard library and always opened automatically.
Nairwolf has quit [Ping timeout: 256 seconds]
Algebr2 has quit [Ping timeout: 252 seconds]
Algebr2 has joined #ocaml
ygrek has joined #ocaml
yegods has quit [Remote host closed the connection]
yegods has joined #ocaml
Thooms has joined #ocaml
phonzbm is now known as caw
orbifx2 has quit [Ping timeout: 240 seconds]
orbifx has quit [Ping timeout: 250 seconds]
ygrek has quit [Ping timeout: 272 seconds]
orbifx has joined #ocaml
Nairwolf has joined #ocaml
orbifx has quit [Ping timeout: 264 seconds]
ygrek has joined #ocaml
ygrek has quit [Ping timeout: 240 seconds]
madroach has joined #ocaml
silver has joined #ocaml
The_Mad_Pirate has joined #ocaml
rand__ has joined #ocaml
orbifx has joined #ocaml
darkf has joined #ocaml
dhil has quit [Ping timeout: 240 seconds]
dhil has joined #ocaml
dhil has quit [Ping timeout: 260 seconds]
pgiarrusso has quit [Ping timeout: 252 seconds]
shinnya has joined #ocaml
pgiarrusso has joined #ocaml
Haudegen has quit [Ping timeout: 240 seconds]
pgiarrusso has quit [Quit: pgiarrusso]
pgiarrusso has joined #ocaml
nkhodyunya has left #ocaml [#ocaml]
yegods has quit [Remote host closed the connection]
Kakadu has joined #ocaml
yegods has joined #ocaml
ril has joined #ocaml
antkong has joined #ocaml
pgiarrusso has quit [Quit: pgiarrusso]
Haudegen has joined #ocaml
alexst has joined #ocaml
alexst has quit [Client Quit]
pgiarrusso has joined #ocaml
alexst has joined #ocaml
Simn has quit [Quit: Leaving]
MercurialAlchemi has quit [Ping timeout: 256 seconds]
silver has quit [Read error: Connection reset by peer]
slash^ has quit [Read error: Connection reset by peer]
MercurialAlchemi has joined #ocaml
ggole has quit []
antkong has quit [Quit: antkong]
ygrek has joined #ocaml
larhat has joined #ocaml
larhat has quit [Ping timeout: 240 seconds]
mietek has quit [Ping timeout: 264 seconds]
mietek has joined #ocaml
lobo has joined #ocaml
troydm has quit [Ping timeout: 248 seconds]
ril has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
ygrek has quit [Ping timeout: 248 seconds]
lobo has quit [Read error: Connection reset by peer]
lobo has joined #ocaml
Algebr2 has quit [Remote host closed the connection]
MercurialAlchemi has quit [Ping timeout: 272 seconds]
t4nk545 has joined #ocaml
<t4nk545> Hi, first of all, sorry about throwing random questions at the crowd.
<t4nk545> But I could really use a pointer or two for OCaml.
<t4nk545> let sum paraA paraB = .... in let tempVar = array n (sum identity)....
<t4nk545> the function variable sum is defined with two paramemters
<t4nk545> but in its scope, it's called as (sum identity)
<t4nk545> can someone please explain to me what's going on? Thanks a lot.
<Drup> section "multi argument function"
<t4nk545> array is a function defined as
lobo has quit [Quit: WeeChat 1.4]
<t4nk545> let array n f = let a = Array.initn ( fun i −> lazy ( f i ) ) in fun i −> Lazy.force a.( i )
<t4nk545> Drup: thank you! reading that right now.
yawnt has quit [Ping timeout: 240 seconds]
copy` has quit [Ping timeout: 240 seconds]
<t4nk545> Drup: I already understand the currying (at least I thought so) in multi-var function definitions.
keteim has quit [Ping timeout: 240 seconds]
<t4nk545> Drup: Wait a minute....
<t4nk545> Drup: yeah, I think I just got it.
alexst has quit [Quit: Lost terminal]
copy` has joined #ocaml
jzacsh has joined #ocaml
jzacsh_ has quit [Ping timeout: 240 seconds]
<Drup> :)
<t4nk545> Drup: does it mean that the two-param function "sum" has its first param binded with "identity", and in turn returns a single-param function?
keteim has joined #ocaml
<Drup> yes
yawnt has joined #ocaml
<t4nk545> Drup: amazing. thank you! I think you and the running washing machine helped a lot in this process :D
larhat has joined #ocaml
_berke_ has quit [Remote host closed the connection]
Haudegen has quit [Ping timeout: 240 seconds]
larhat has quit [Ping timeout: 264 seconds]
<t4nk545> Drup: Do you happen to know if "CE" is a pre-defined function? I tried Google and didn't find anything, also tried grep in the source directory.
<Drup> "CE" can't be function, it starts with a capital letter
<t4nk545> Drup: it's used as "(* type of complex expressions *) type expr = CE of Expr.expr * Expr.expr". I assume it stands for "Complex Expression", but it has to be defined somewhere.
<t4nk545> Drup: I'm using Eclipse. After indexing the src files, ctrl + left-click "CE" doesn't go anywhere (as opposed to the declaration of functions)
<Drup> Yes, read the link
<t4nk545> Drup: thank you! reading it now.
<t4nk545> Drup: I have to say that I went through the interactive OCaml tutorial online (http://try.ocamlpro.com). But it doesn't really cover much.
<Drup> No, there are many more comprehensive materials
<t4nk545> Drup: I feel sorry for asking the newb questions. Thank you for your help and patience :) I'll read the book at the link you provided.
Haudegen has joined #ocaml
antkong has joined #ocaml
antkong has quit [Client Quit]
antkong has joined #ocaml
orbifx1 has joined #ocaml
orbifx has quit [Quit: AtomicIRC: The nuclear option.]
orbifx-m has joined #ocaml
Thooms has quit [Remote host closed the connection]
orbifx-m has quit [Client Quit]
orbifx1 is now known as orbifx
The_Mad_Pirate has quit [Quit: Konversation terminated!]
jackweirdy has joined #ocaml
aantron has quit [Remote host closed the connection]
orbifx has quit [Quit: WeeChat 1.3]
ygrek has joined #ocaml
damason has quit [Ping timeout: 240 seconds]
aantron has joined #ocaml
mxv has joined #ocaml
ygrek has quit [Ping timeout: 264 seconds]
lokien has joined #ocaml
j_king has quit [Ping timeout: 248 seconds]
j_king has joined #ocaml
mxv has quit [Ping timeout: 240 seconds]
johnelse_ is now known as johnelse
foolishmonkey has quit [Quit: Leaving]
tane has quit [Quit: Verlassend]