sponge45 changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/
pango_ has joined #ocaml
smimou has quit ["bli"]
pango has quit [Remote closed the connection]
Aradorn has joined #ocaml
hedos has left #ocaml []
MisterC has joined #ocaml
malc_ has joined #ocaml
Skal has quit [Connection timed out]
<SolarBear> Hey, anyone available for a simple question
<malc_> yes
<SolarBear> I'm new to ocaml and I'm trying this :
<SolarBear> let merge_i list1 list2 = List.sort (list1 @ list2)
<SolarBear> I get : This expression has type 'a list but is here used with type 'b -> 'b -> int
<malc_> List.sort has two parameters
<malc_> first comparision function
<malc_> and the second the list to be sorted
<malc_> List.sort compare (list1 @ list2) - should work
<SolarBear> ah
<malc_> comparison even
<SolarBear> Ah! many thanks
<malc_> np
Axioplase has quit ["leaving"]
mbishop has joined #ocaml
lmbdwr has joined #ocaml
<lmbdwr> hi.
<lmbdwr> anyone for a coq question ?
Aradorn has quit ["Leaving"]
solarbear_ has joined #ocaml
SolarBear has quit [Read error: 110 (Connection timed out)]
solarbear_ has quit [Remote closed the connection]
sheets has joined #ocaml
<sheets> In what cases does OCaml iterize tail-recursive functions? I have a function with a simple nested if-then conditional with three branches: base case, recursive case 1, recursive case 2. I get stack overflows. What gives?
<malc_> despite what you think your function is not tail-recursive (for whatever reason)
<sheets> yes... that has become quite obvious. Do you know what OCaml requires for tail-recursion?
<sheets> http://paste2.org/p/649 has my code
<sheets> From what I read, I probably also shouldn't be using lists but this is a learning exercise...
<malc_> looks proper on the first saight
<malc_> sight
<malc_> sigh
<malc_> on what input does it die?
<sheets> hmm... perhaps I mis-spoke
<sheets> it's the only recursive call that I'm using
<sheets> but I can't make it die out of context
<malc_> i would speculate the problem is somewhere else
<sheets> I can't imagine that my other code is giving me stack overflows...
<sheets> unless List.map uses a call that's not tail recursive
<malc_> List.map is a non tail-recursive function all by itself
<malc_> val map : ('a -> 'b) -> 'a list -> 'b list
<malc_> (** [List.map f [a1; ...; an]] applies function [f] to [a1, ..., an], and builds the list [[f a1; ...; f an]] with the results returned by [f]. Not tail-recursive. *)
<sheets> so... if I have a list that is > MAX_STACK_SIZE, List.map will overflow?
<tsuyoshi> the extlib replacement is tail recursive though
<sheets> !?
<malc_> sheets: use rev_map
<sheets> Why the hell would you implement List.map not tail-recursively?! #$&*#
<sheets> rev_map?
<malc_> mailing-list had witnessed long debates on the subject in the past
<sheets> >_<
<malc_> val rev_map : ('a -> 'b) -> 'a list -> 'b list
<malc_> (** [List.rev_map f l] gives the same result as {!List.rev}[ (]{!List.map}[ f l)], but is tail-recursive and more efficient. *)
<sheets> how are you getting this doc?
<malc_> well `man List' and or cat $prefix/lib/ocaml/Module.mli get's me by nicely
<malc_> in otherwords i practice rtfm
<sheets> wow... i had no idea that the distribution installed man pages
<sheets> that will be helpful...
<sheets> additionally, do you know a good, syntactic tutorial? I have functional programming down but the ocaml syntax trips me up sometimes.
<malc_> not really. there are a few sites on the net that describe the differences between sml/ocaml and or revised/orignal syntax
<malc_> those might be handy
<tsuyoshi> I found the "developing applications with ocaml" book pretty useful
<sheets> hmm ok. I'll look into it.
<tsuyoshi> coming from a c/scheme background
<sheets> !
<sheets> yes
<malc_> why do you use map at all?
<sheets> wow. this also looks good
<malc_> after all print_endline returns unit..
<malc_> just say no and use List.iter
<sheets> !
<sheets> excellent
<sheets> That would make much more sense.
sheets has quit [Remote closed the connection]
malc_ has quit ["leaving"]
Smerdyakov has quit ["Leaving"]
microcape has joined #ocaml
setog3 has quit [Read error: 110 (Connection timed out)]
triple_ has joined #ocaml
flux__ has joined #ocaml
love-pingoo has joined #ocaml
_velco has joined #ocaml
Submarine has joined #ocaml
Mr_Awesome has joined #ocaml
love-pingoo has quit ["Connection reset by pear"]
ChoJin has joined #ocaml
pango_ has quit [Remote closed the connection]
pango has joined #ocaml
_fab has joined #ocaml
fridim has quit ["Quitte"]
ChoJin has quit ["This computer has gone to sleep"]
pango has quit [Remote closed the connection]
pango has joined #ocaml
velco has joined #ocaml
flux__ has quit [Remote closed the connection]
Submarine has quit [Remote closed the connection]
flux__ has joined #ocaml
_velco has quit ["I'm outta here ..."]
MrCraps has joined #ocaml
piggybox has joined #ocaml
<piggybox> j postgresql
<piggybox> oops, sry
SolarBear has joined #ocaml
MrCraps has quit [Remote closed the connection]
bluestorm has joined #ocaml
bluestorm is now known as bluestorm_aw
ppsmimou has quit [Remote closed the connection]
ktne has joined #ocaml
ppsmimou has joined #ocaml
Mr_Awesome has quit [Read error: 110 (Connection timed out)]
love-pingoo has joined #ocaml
bzzbzz has quit ["leaving"]
bluestorm_aw is now known as bluestorm
ikaros_ has joined #ocaml
ikaros has quit [Read error: 110 (Connection timed out)]
buluca has quit [Excess Flood]
buluca has joined #ocaml
buluca has quit [Excess Flood]
buluca has joined #ocaml
buluca has quit [Excess Flood]
buluca has joined #ocaml
buluca has quit ["bip è un reazionario"]
Submarine has joined #ocaml
ramkrsna is now known as ramky_away
asm has joined #ocaml
SolarBear has quit ["Leaving"]
gim has joined #ocaml
MrCraps has joined #ocaml
Roughest has quit [Read error: 104 (Connection reset by peer)]
Roughest has joined #ocaml
asm has quit [Read error: 110 (Connection timed out)]
gunark has joined #ocaml
MrCraps has quit [Read error: 110 (Connection timed out)]
Submarine has quit [Read error: 113 (No route to host)]
love-pingoo has quit ["Leaving"]
postalchris has joined #ocaml
postalchris has quit [Client Quit]
buluca has joined #ocaml
ChoJin has joined #ocaml
Smerdyakov has joined #ocaml
velco has quit ["Ex-Chat"]
smimou has joined #ocaml
ikaros_ has quit [Read error: 110 (Connection timed out)]
ikaros_ has joined #ocaml
ikaros has joined #ocaml
ulfdoz_ has joined #ocaml
ikaros_ has quit [Read error: 110 (Connection timed out)]
ulfdoz has quit [Read error: 104 (Connection reset by peer)]
ChoJin has quit ["This computer has gone to sleep"]
buluca has quit ["Siete un pubblico di merda!"]
_velco has joined #ocaml
Demitar_ is now known as Demitar
bluestorm has quit ["Konversation terminated!"]
_velco is now known as velco
joshcryer has quit [Client Quit]
postalchris has joined #ocaml
velco has quit [Read error: 110 (Connection timed out)]
pango has quit ["Leaving"]
pango has joined #ocaml
_velco has joined #ocaml
_velco is now known as velco
velco has quit [Read error: 145 (Connection timed out)]
fab_ has joined #ocaml
_fab has quit [Read error: 110 (Connection timed out)]
_velco has joined #ocaml
_velco has quit [Read error: 110 (Connection timed out)]
ktne has quit []
slipstream-- has joined #ocaml
bluestorm has joined #ocaml
microcape has quit []
slipstream has quit [Connection timed out]
Mr_Awesome has joined #ocaml
pantsd has joined #ocaml
love-pingoo has joined #ocaml
stevan_ is now known as stevan
pantsd has quit [Read error: 104 (Connection reset by peer)]
love-pingoo has quit ["Connection reset by pear"]
Submarine has joined #ocaml
mbishop has quit [Remote closed the connection]
MisterC has quit [Read error: 104 (Connection reset by peer)]
smimou has quit ["bli"]
postalchris has quit [Read error: 110 (Connection timed out)]
bluestorm has quit ["Konversation terminated!"]