00:01
dksong has joined #ocaml
00:01
orbifx has quit [Ping timeout: 240 seconds]
00:03
dksong has quit [Client Quit]
00:06
orbifx has joined #ocaml
00:09
orbifx2 has quit [Ping timeout: 256 seconds]
00:15
infinity0 has joined #ocaml
00:17
NingaLeaf has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
00:20
<
pierpa >
90% of the traffic in this channel is about the tools which should simplify things...
00:21
infinity0 has quit [Remote host closed the connection]
00:22
crass_ has joined #ocaml
00:23
<
profan >
LOL , indeed
00:23
infinity0 has joined #ocaml
00:25
<
Algebr2 >
building code is a problem for everyone
00:25
<
Drup >
johnelse: for me, the main pro is that the programming model is much much much nicer than native threads.
00:26
Thooms has quit [Remote host closed the connection]
00:31
infinity0 has quit [Remote host closed the connection]
00:33
infinity0 has joined #ocaml
00:33
madroach has quit [Ping timeout: 248 seconds]
00:34
zaquest has quit [Ping timeout: 272 seconds]
00:35
Kakadu has quit [Remote host closed the connection]
00:35
madroach has joined #ocaml
00:41
infinity0 has quit [Remote host closed the connection]
00:43
infinity0 has joined #ocaml
00:52
aantron has joined #ocaml
01:21
orbifx has quit [Ping timeout: 248 seconds]
01:28
<
Algebr2 >
stog looks pretty nice actually, anyone here using it
01:35
tane has quit [Quit: Verlassend]
01:41
NingaLeaf has joined #ocaml
01:45
FreeBirdLjj has joined #ocaml
01:49
struk|desk|away is now known as struk|desk
01:52
zaquest has joined #ocaml
01:53
fluter is now known as fluter_
01:53
fluter_ is now known as fluter
02:03
<
struk|desk >
pierpa: we really need a tool to simplify making tools to simplify things
02:05
* fds
gets to work on a monadic tool simplifier generator library.
02:19
<
struk|desk >
you done yet? come on man..aint got all day :)
02:19
<
pierpa >
struk|desk: yeah
02:19
<
struk|desk >
peirpa: I was mostly being sarcastic, but it does have some truth to i
02:20
<
pierpa >
it's called software engineering. We (everybody) are very very bad at it
02:24
<
struk|desk >
we are so bad we can't define success accurately either. hehe
02:30
FreeBirdLjj has quit [Remote host closed the connection]
02:31
FreeBirdLjj has joined #ocaml
02:45
The_Mad_Pirate has quit [Excess Flood]
02:46
The_Mad_Pirate has joined #ocaml
02:54
tokik_ has quit [Ping timeout: 276 seconds]
02:56
crass_ has quit [Remote host closed the connection]
03:20
struk|desk is now known as struk|desk|away
03:36
struk|desk|away is now known as struk|desk
04:02
johnelse has quit [Ping timeout: 252 seconds]
04:05
johnelse has joined #ocaml
04:05
johnelse is now known as Guest23593
04:24
Guest23593 has quit [Ping timeout: 276 seconds]
04:25
johnelse_ has joined #ocaml
04:28
yegods has quit [Remote host closed the connection]
04:34
pierpa has quit [Quit: ERC Version 5.3 (IRC client for Emacs)]
04:35
yegods has joined #ocaml
05:21
struk|desk is now known as struk|desk|away
05:22
copy` has quit [Quit: Connection closed for inactivity]
05:29
struk|desk|away is now known as struk|desk
05:41
shinnya has quit [Ping timeout: 260 seconds]
06:07
kansi has joined #ocaml
06:31
tokik has joined #ocaml
06:51
antkong has joined #ocaml
07:11
slash^ has joined #ocaml
07:17
axiles has quit [Remote host closed the connection]
07:31
struk|desk is now known as struk|desk|away
07:32
axiles has joined #ocaml
08:19
accname has joined #ocaml
08:26
Simn has joined #ocaml
08:44
The_Mad_Pirate has quit [Quit: Konversation terminated!]
08:45
shinnya has joined #ocaml
08:51
MercurialAlchemi has joined #ocaml
08:52
f[x] has quit [Ping timeout: 250 seconds]
09:07
lokien has joined #ocaml
09:20
orbifx has joined #ocaml
09:31
nkhodyunya has joined #ocaml
09:32
darkf has quit [Quit: Leaving]
09:38
malc_ has joined #ocaml
09:42
MercurialAlchemi has quit [Ping timeout: 240 seconds]
09:58
larhat has joined #ocaml
10:00
kansi has quit [Ping timeout: 260 seconds]
10:04
Sorella has quit [Quit: Connection closed for inactivity]
10:08
MercurialAlchemi has joined #ocaml
10:13
nkhodyunya has quit [Quit: Leaving.]
10:16
MercurialAlchemi has quit [Ping timeout: 264 seconds]
10:21
nkhodyunya has joined #ocaml
10:22
MercurialAlchemi has joined #ocaml
10:30
MercurialAlchemi has quit [Ping timeout: 240 seconds]
10:33
larhat has quit [Quit: Leaving.]
10:33
Algebr2 has quit [Ping timeout: 240 seconds]
10:37
nkhodyunya has quit [Quit: Leaving.]
10:40
lokien has quit [Quit: Leaving]
10:52
Haudegen has quit [Ping timeout: 250 seconds]
10:53
nkhodyunya has joined #ocaml
11:10
Haudegen has joined #ocaml
11:16
nkhodyunya has quit [Quit: Leaving.]
11:24
rand__ has joined #ocaml
11:27
FreeBirdLjj has quit [Read error: Connection reset by peer]
11:28
FreeBirdLjj has joined #ocaml
11:30
Algebr2 has joined #ocaml
11:44
copy` has joined #ocaml
11:47
MercurialAlchemi has joined #ocaml
11:56
lokien has joined #ocaml
11:58
kansi has joined #ocaml
11:58
accname has quit [Remote host closed the connection]
12:04
Algebr2 has quit [Ping timeout: 264 seconds]
12:19
kansi has quit [Ping timeout: 240 seconds]
12:24
tane has joined #ocaml
12:26
malc__ has joined #ocaml
12:27
orbifx1 has joined #ocaml
12:27
malc_ has quit [Ping timeout: 276 seconds]
12:42
yegods has quit [Remote host closed the connection]
12:42
ggole has joined #ocaml
12:44
FreeBirdLjj has quit [Remote host closed the connection]
12:44
FreeBirdLjj has joined #ocaml
12:59
<
lokien >
guess 7 = "seven"
12:59
<
lokien >
guess x = "try again"
12:59
<
lokien >
how do I translate this haskell to ocaml?
13:00
<
copy` >
let guess = function | 7 -> "seven" | x -> "try again"
13:00
Algebr2 has joined #ocaml
13:01
foolishmonkey has joined #ocaml
13:09
orbifx1 has quit [Quit: WeeChat 1.3]
13:09
rand__ has quit [Ping timeout: 272 seconds]
13:10
nkhodyunya has joined #ocaml
13:24
orbifx has quit [Ping timeout: 260 seconds]
13:26
<
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
13:27
<
artart78 >
apply each function to one element? or apply all the functions to all the elements?
13:27
<
lokien >
function a b c ~f:x -> [(a x);(b x);(c x)]
13:28
<
lokien >
all to all
13:28
<
lokien >
all to one would be nice too
13:28
<
lokien >
eww, I screwed up with my pseudocode
13:28
<
lokien >
it's not ~f:x, more like ~seq:x
13:29
Sorella has joined #ocaml
13:29
orbifx has joined #ocaml
13:29
<
artart78 >
lokien: what's x? I don't get it
13:30
FreeBird_ has joined #ocaml
13:30
<
lokien >
artart78: a b c are functions, x is something they take as an argument.
13:31
<
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
13:31
FreeBirdLjj has quit [Ping timeout: 240 seconds]
13:31
<
lokien >
function (+2) (+4) (-3) 1 -> [3;5;-2]
13:32
<
lokien >
better now?
13:32
<
regnat >
I don't think it's possible that way
13:33
<
regnat >
But you can use a list of functions
13:33
<
regnat >
(as argument)
13:34
<
lokien >
yeah, I can do that
13:35
Algebr2 has quit [Ping timeout: 260 seconds]
13:35
<
regnat >
Somthing like "fun funs x -> List.map ~f:(fun f -> f x) funs"
13:36
<
ggole >
fun fs list -> List.map (List.fold_left compose id fs) list
13:36
<
ggole >
compose and id aren't in Pervasives, but they are probably in Core somewhere
13:41
<
lokien >
thanks regnat, it works :)
13:42
<
lokien >
ggole: I can't find compose in the core, so I'll just go with solution above
13:43
<
ggole >
Actually, never mind: I misread your question anyway :)
13:44
<
lokien >
I'd implemented compose, still doesn't work
13:44
<
lokien >
yeah, my questions are easy to misinterpret /:
13:44
<
ggole >
Yep, my version composes the functions in the list and then maps that
13:44
<
ggole >
eg, [(+) 2; (+) 1] => (+) 3
13:45
<
regnat >
(if you need it somewhere else, compose is Fn.compose in core iirc)
13:45
<
lokien >
I used Fn.compose now, but compiler is still not happy with it
13:46
<
ggole >
I don't use Core, maybe I got the order wrong for that library or something
13:46
<
lokien >
what are people using then? nobody's using core here
13:47
<
lokien >
batteries?
13:47
<
ggole >
Core, batteries, containers and NiH are all popular choices
13:48
<
ggole >
No, it's the oldest choice ;)
13:48
<
ggole >
(NiH = not invented here, eg, writing what you want yourself.)
13:49
<
lokien >
ohh, that small I misguided me
13:50
<
lokien >
I'm writing stuff now so ocaml will become clojure/haskell in my project, I hope I'll stop soon
13:51
<
lokien >
what open source can I read to learn some idioms? or maybe there is a blog entry for that?
13:54
<
ggole >
I'm never sure how to answer that
13:55
<
lokien >
I just.. want to think like an ocamler, not like a clojurist, implementing clojure functions in ocaml :(
13:56
<
ggole >
There's a few books available, maybe look at Thomas Leonard's blog
13:56
<
lokien >
I was reading through real world ocaml and ocaml from the very beginning
13:57
<
yawnt >
as someone who just got started
13:57
<
yawnt >
Opium looks fairly simple to me
13:58
<
lokien >
opium.ml - 42 lines :D
14:00
nkhodyunya has quit [Quit: Leaving.]
14:02
bacam has quit [Quit: leaving]
14:03
<
lokien >
ggole: this blog looks cool, thank you :)
14:04
bacam has joined #ocaml
14:04
struk|desk|away is now known as struk|desk
14:05
dhil has joined #ocaml
14:07
<
orbifx >
Which blog?
14:12
orbifx2 has joined #ocaml
14:12
<
orbifx2 >
Thanks lokien.
14:13
<
lokien >
np. there is a good post about porting his program from python
14:14
dsheets has joined #ocaml
14:20
dsheets has quit [Remote host closed the connection]
14:22
dsheets has joined #ocaml
14:27
dsheets has quit [Remote host closed the connection]
14:31
Algebr2 has joined #ocaml
14:35
crass has joined #ocaml
14:35
struk|desk is now known as struk|desk|away
14:36
antkong has quit [Quit: antkong]
14:38
yegods has joined #ocaml
14:38
lokien has quit [Quit: Leaving]
14:47
pierpa has joined #ocaml
14:54
Haudegen has quit [Ping timeout: 260 seconds]
14:57
crass has quit [Remote host closed the connection]
14:59
dsheets has joined #ocaml
14:59
dsheets has quit [Remote host closed the connection]
14:59
struk|desk|away is now known as struk|desk
15:01
dsheets has joined #ocaml
15:05
Algebr2 has quit [Ping timeout: 248 seconds]
15:12
Haudegen has joined #ocaml
15:13
dsheets has quit [Remote host closed the connection]
15:14
dsheets has joined #ocaml
15:17
dsheets has quit [Remote host closed the connection]
15:21
nkhodyunya has joined #ocaml
15:23
larhat has joined #ocaml
15:24
dsheets has joined #ocaml
15:26
dsheets has quit [Remote host closed the connection]
15:27
malc__ is now known as malc_
15:29
struk|desk is now known as struk|desk|away
15:29
nuuit has joined #ocaml
15:29
dsheets has joined #ocaml
15:35
FreeBird_ has quit [Ping timeout: 252 seconds]
15:37
dsheets has quit [Remote host closed the connection]
15:38
dsheets has joined #ocaml
15:40
dsheets has quit [Remote host closed the connection]
15:49
madroach has quit [Quit: leaving]
16:01
Algebr2 has joined #ocaml
16:08
Nairwolf has joined #ocaml
16:14
larhat has quit [Quit: Leaving.]
16:16
<
Nairwolf >
how can I print a boolean value ?
16:17
<
Nairwolf >
I have a function isLeaf btree : binary_tree -> boolean
16:18
<
Nairwolf >
And I would like to test this function
16:19
<
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" ?
16:20
<
fds >
I think you need to do something like: let print_bool b = if b then print_string "true" else print_string "false"
16:20
<
fds >
But I'm a noob too, so... :-)
16:21
<
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)
16:21
shinnya has quit [Ping timeout: 264 seconds]
16:21
<
Nairwolf >
oh, there is a "to_string" function
16:23
<
fds >
In the standard library or Core?
16:23
<
fds >
There does seem to be a string_of_bool in the standard library though!
16:25
dsheets has joined #ocaml
16:25
<
icicled >
printf "%b" my_bool
16:25
<
icicled >
Printf.printf
16:26
<
icicled >
another option
16:26
<
Nairwolf >
oh, thank you fds "string_of_bool" is what I needed ;)
16:27
<
Nairwolf >
thank you icicled also for your suggestion ;)
16:28
<
Nairwolf >
Just another thing to understand better Printf is a module from the standard library, and "string_of_bool" is from the Core language ?
16:30
dsheets has quit [Ping timeout: 264 seconds]
16:31
<
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.
16:35
Nairwolf has quit [Ping timeout: 256 seconds]
16:36
Algebr2 has quit [Ping timeout: 252 seconds]
16:43
Algebr2 has joined #ocaml
16:45
ygrek has joined #ocaml
16:47
yegods has quit [Remote host closed the connection]
16:48
yegods has joined #ocaml
16:54
Thooms has joined #ocaml
16:57
phonzbm is now known as caw
16:58
orbifx2 has quit [Ping timeout: 240 seconds]
16:59
orbifx has quit [Ping timeout: 250 seconds]
17:00
ygrek has quit [Ping timeout: 272 seconds]
17:03
orbifx has joined #ocaml
17:07
Nairwolf has joined #ocaml
17:12
orbifx has quit [Ping timeout: 264 seconds]
17:17
ygrek has joined #ocaml
17:23
ygrek has quit [Ping timeout: 240 seconds]
17:42
madroach has joined #ocaml
17:51
silver has joined #ocaml
17:58
The_Mad_Pirate has joined #ocaml
17:59
rand__ has joined #ocaml
18:10
orbifx has joined #ocaml
18:30
darkf has joined #ocaml
18:30
dhil has quit [Ping timeout: 240 seconds]
18:33
dhil has joined #ocaml
18:39
dhil has quit [Ping timeout: 260 seconds]
18:46
pgiarrusso has quit [Ping timeout: 252 seconds]
18:46
shinnya has joined #ocaml
18:51
pgiarrusso has joined #ocaml
18:58
Haudegen has quit [Ping timeout: 240 seconds]
19:01
pgiarrusso has quit [Quit: pgiarrusso]
19:03
pgiarrusso has joined #ocaml
19:04
nkhodyunya has left #ocaml [#ocaml]
19:16
yegods has quit [Remote host closed the connection]
19:19
Kakadu has joined #ocaml
19:20
yegods has joined #ocaml
19:20
ril has joined #ocaml
19:33
antkong has joined #ocaml
19:37
pgiarrusso has quit [Quit: pgiarrusso]
19:38
Haudegen has joined #ocaml
19:40
alexst has joined #ocaml
19:41
alexst has quit [Client Quit]
19:42
pgiarrusso has joined #ocaml
19:42
alexst has joined #ocaml
20:11
Simn has quit [Quit: Leaving]
20:13
MercurialAlchemi has quit [Ping timeout: 256 seconds]
20:24
silver has quit [Read error: Connection reset by peer]
20:29
slash^ has quit [Read error: Connection reset by peer]
20:30
MercurialAlchemi has joined #ocaml
20:32
antkong has quit [Quit: antkong]
20:37
ygrek has joined #ocaml
20:44
larhat has joined #ocaml
20:48
larhat has quit [Ping timeout: 240 seconds]
20:52
mietek has quit [Ping timeout: 264 seconds]
20:54
mietek has joined #ocaml
20:55
lobo has joined #ocaml
21:00
troydm has quit [Ping timeout: 248 seconds]
21:04
ril has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
21:05
ygrek has quit [Ping timeout: 248 seconds]
21:05
lobo has quit [Read error: Connection reset by peer]
21:06
lobo has joined #ocaml
21:13
Algebr2 has quit [Remote host closed the connection]
21:14
MercurialAlchemi has quit [Ping timeout: 272 seconds]
21:19
t4nk545 has joined #ocaml
21:20
<
t4nk545 >
Hi, first of all, sorry about throwing random questions at the crowd.
21:20
<
t4nk545 >
But I could really use a pointer or two for OCaml.
21:21
<
t4nk545 >
let sum paraA paraB = .... in let tempVar = array n (sum identity)....
21:21
<
t4nk545 >
the function variable sum is defined with two paramemters
21:22
<
t4nk545 >
but in its scope, it's called as (sum identity)
21:22
<
t4nk545 >
can someone please explain to me what's going on? Thanks a lot.
21:23
<
Drup >
section "multi argument function"
21:23
<
t4nk545 >
array is a function defined as
21:24
lobo has quit [Quit: WeeChat 1.4]
21:24
<
t4nk545 >
let array n f = let a = Array.initn ( fun i −> lazy ( f i ) ) in fun i −> Lazy.force a.( i )
21:25
<
t4nk545 >
Drup: thank you! reading that right now.
21:26
yawnt has quit [Ping timeout: 240 seconds]
21:26
copy` has quit [Ping timeout: 240 seconds]
21:26
<
t4nk545 >
Drup: I already understand the currying (at least I thought so) in multi-var function definitions.
21:26
keteim has quit [Ping timeout: 240 seconds]
21:26
<
t4nk545 >
Drup: Wait a minute....
21:26
<
t4nk545 >
Drup: yeah, I think I just got it.
21:27
alexst has quit [Quit: Lost terminal]
21:27
copy` has joined #ocaml
21:27
jzacsh has joined #ocaml
21:27
jzacsh_ has quit [Ping timeout: 240 seconds]
21:28
<
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?
21:28
keteim has joined #ocaml
21:29
yawnt has joined #ocaml
21:29
<
t4nk545 >
Drup: amazing. thank you! I think you and the running washing machine helped a lot in this process :D
21:45
larhat has joined #ocaml
21:47
_berke_ has quit [Remote host closed the connection]
21:48
Haudegen has quit [Ping timeout: 240 seconds]
21:49
larhat has quit [Ping timeout: 264 seconds]
21:57
<
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.
21:58
<
Drup >
"CE" can't be function, it starts with a capital letter
21:58
<
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.
21:59
<
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)
21:59
<
Drup >
Yes, read the link
21:59
<
t4nk545 >
Drup: thank you! reading it now.
22:00
<
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.
22:01
<
Drup >
No, there are many more comprehensive materials
22:06
<
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.
22:07
Haudegen has joined #ocaml
22:10
antkong has joined #ocaml
22:11
antkong has quit [Client Quit]
22:13
antkong has joined #ocaml
22:18
orbifx1 has joined #ocaml
22:21
orbifx has quit [Quit: AtomicIRC: The nuclear option.]
22:21
orbifx-m has joined #ocaml
22:22
Thooms has quit [Remote host closed the connection]
22:22
orbifx-m has quit [Client Quit]
22:22
orbifx1 is now known as orbifx
22:24
The_Mad_Pirate has quit [Quit: Konversation terminated!]
22:31
jackweirdy has joined #ocaml
22:33
aantron has quit [Remote host closed the connection]
22:36
orbifx has quit [Quit: WeeChat 1.3]
22:40
ygrek has joined #ocaml
22:57
damason has quit [Ping timeout: 240 seconds]
22:57
aantron has joined #ocaml
23:02
mxv has joined #ocaml
23:07
ygrek has quit [Ping timeout: 264 seconds]
23:13
lokien has joined #ocaml
23:14
j_king has quit [Ping timeout: 248 seconds]
23:16
j_king has joined #ocaml
23:19
mxv has quit [Ping timeout: 240 seconds]
23:22
johnelse_ is now known as johnelse
23:42
foolishmonkey has quit [Quit: Leaving]
23:47
tane has quit [Quit: Verlassend]