mbishop changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/ | Grab Ocaml 3.10.0 from http://caml.inria.fr/ocaml/release.html (featuring new camlp4 and more!)
piggybox__ has joined #ocaml
CosmicRay has quit ["Client exiting"]
piggybox has joined #ocaml
piggybox_ has quit [Read error: 110 (Connection timed out)]
piggybox__ has quit [Read error: 110 (Connection timed out)]
kelaouchi has quit [Read error: 104 (Connection reset by peer)]
kelaouchi has joined #ocaml
<tsuyoshi> that ocaml-sucks page is mostly complaining about static types
<tsuyoshi> almost everything he complains about is because of the type inference
Smerdyakov has joined #ocaml
david_koontz has joined #ocaml
shawn has quit [Remote closed the connection]
thesoko has quit [Remote closed the connection]
thesoko has joined #ocaml
lucca has quit [Read error: 110 (Connection timed out)]
CosmicRay has joined #ocaml
david_koontz has quit ["Leaving"]
slipstream has quit [Read error: 110 (Connection timed out)]
Submarine has quit [Remote closed the connection]
yminsky has joined #ocaml
screwt8 has quit [Remote closed the connection]
pantsd has joined #ocaml
screwt8 has joined #ocaml
CosmicRay has quit ["Client exiting"]
Smerdyakov has quit ["Leaving"]
rumpl has quit ["Ex-Chat"]
yminsky has quit []
seafoodX has joined #ocaml
slipstream has joined #ocaml
love-pingoo has joined #ocaml
thesoko has quit [Remote closed the connection]
thesoko has joined #ocaml
leo037 has joined #ocaml
thesoko has quit [Remote closed the connection]
thesoko has joined #ocaml
smimou has joined #ocaml
beterraba has joined #ocaml
<krumms> may be a dumb question, but why isn't List.map tail-recursive?
<beterraba> becouse take so much memory and process?
<zmdkrbou> krumms: because the function is supposed to be map on elements in the order of the list, i think
<zmdkrbou> *mapped
<krumms> zmdkrbou: ah okay
<zmdkrbou> same thing as fold_left being tail-rec and fold_right not being tail-rec (and append / rev_append)
<krumms> zmdkrbou: so this is a common problem for implementations of the map function?
<zmdkrbou> dunno. you can try to write a tail-rec map function to see what is the problem precisely
<zmdkrbou> hmmm, well, no.
<zmdkrbou> thinking of it, the problem is the order of the elements after the map : you build a reversed map when doing it tail-rec
<zmdkrbou> reversed list*
* zmdkrbou needs coffee
<krumms> zmdkrbou: haha okay sure - thanks :)
love-pingoo has quit ["Connection reset by pear"]
Icebreaker has joined #ocaml
rwmjones has joined #ocaml
robyonrails has joined #ocaml
rwmjones has quit ["Closed connection"]
rwmjones has joined #ocaml
<jlouis> I ponder if map is tail-rec in Common Lisp
<krumms> likewise
<jlouis> make that mapcar
<jlouis> That you can't destructively update lists seems to be another point
USACE1 has joined #ocaml
rwmjones has quit ["Closed connection"]
ygrek has joined #ocaml
leo037 has quit [Read error: 104 (Connection reset by peer)]
smimou has quit ["bli"]
USACE has quit [Read error: 110 (Connection timed out)]
<flux> I think List.map isn't tail-recursive in o'caml exactly because of immutable lists?
<flux> if you have mutable lists you can just update the tail and you can easily tail-recurse..
robyonrails has quit ["me ne vo'"]
rwmjones has joined #ocaml
<flux> I suppose you could use some Obj.magic-trickness to cast mutable lists into ordinary ones?
<flux> (actually I tried that once, failed, but then again, I didn't really try much..)
bzzbzz has quit ["leaving"]
_JusSx_ has joined #ocaml
_JusSx_ has quit ["leaving"]
USACE1 has quit [Client Quit]
USACE has joined #ocaml
leo037 has joined #ocaml
krumms has quit ["Ex-Chat"]
piggybox has quit [Connection timed out]
ppsmimou has quit ["Leaving"]
ppsmimou has joined #ocaml
CosmicRay has joined #ocaml
piggybox has joined #ocaml
qwwqe has quit ["Leaving"]
qwwqe has joined #ocaml
seafoodX has quit []
pango has quit [Remote closed the connection]
pango has joined #ocaml
ChristopheT has joined #ocaml
leo037 has quit ["Leaving"]
zarvok has joined #ocaml
smimou has joined #ocaml
CosmicRay has quit ["Client exiting"]
ChristopheT has left #ocaml []
twobitsp1ite has joined #ocaml
<twobitsp1ite> what's this I keep hearing about functional languages being easier to optimize?
<twobitsp1ite> I see it glossed over on LTU, but never in much depth
<flux> the idea is that because of no side-effects, the code can be transformed without taking rest of the program into account
<flux> also without assignments things such as aliasing become a non-issue
<flux> these things are relevant to only pure functional programming languages, so not languages such as ocaml..
<flux> atleast haskell's fusion optimizations show some results of such promises
<flux> of course, ocaml could get some of the benefits in such parts of the code that don't use assignment.. but I suppose only mlton does such optimizations, even if that. (does anyone know?)
<flux> atleast, being a full-program-compiler, mlton would be in a position to identify pieces of code that are side-effectful
smimou has quit [Remote closed the connection]
smimou has joined #ocaml
Submarine has joined #ocaml
eroyf has joined #ocaml
ulfdoz has quit [anthony.freenode.net irc.freenode.net]
oracle1 has quit [anthony.freenode.net irc.freenode.net]
fean has quit [anthony.freenode.net irc.freenode.net]
Hadaka has quit [anthony.freenode.net irc.freenode.net]
oracle1 has joined #ocaml
fean has joined #ocaml
ulfdoz has joined #ocaml
Hadaka has joined #ocaml
ulfdoz has quit [anthony.freenode.net irc.freenode.net]
oracle1 has quit [anthony.freenode.net irc.freenode.net]
fean has quit [anthony.freenode.net irc.freenode.net]
oracle1 has joined #ocaml
fean has joined #ocaml
ulfdoz has joined #ocaml
<jlouis> flux: what optimization specifically?
joshcryer has quit [Nick collision from services.]
joshcryer has joined #ocaml
love-pingoo has joined #ocaml
<flux> jlouis, the fusion optimization optimizes map f (map g xs) into map (f . g) xs - maybe something the coder can do by himself, but still allows to write code that is more natural
<jlouis> flux: oh, no, we aren't doing that in MLton
<flux> not only it removes the intermediate lists, but also reduces memory allocations
<flux> well, yeah, I guess that'd be quite a strech, the haskell-version of that doepends on some code-rewriting trickery
<jlouis> MLton is not really doing anything "wild". It is just the ability to whole-program analyze combined with most basic SSA-optimizations available
ygrek has quit ["Leaving"]
<jlouis> it doesn't even do PRE, though it is something that should be added
<jlouis> It is just that an SSA-PRE pass is b*tch to get right
Submarine has quit ["in Soviet Russia, Céline Dion owns you"]
Submarine has joined #ocaml
lexko has quit ["Leaving"]
piggybox has quit [Read error: 110 (Connection timed out)]
piggybox has joined #ocaml
qwwqe has quit [Read error: 110 (Connection timed out)]
<ulfdoz> can ocamllex match begin of line?
<zmdkrbou> i don't think so
Submarine has quit [Remote closed the connection]
screwt8 has quit [Read error: 104 (Connection reset by peer)]
screwt8 has joined #ocaml
david_koontz has joined #ocaml
CosmicRay has joined #ocaml
descender has joined #ocaml
esdee has joined #ocaml
<esdee> is there a way to curry a function that takes two arguments so that it has both args and is now of type (unit -> 'a)?
<zmdkrbou> ?
<zmdkrbou> can you give an example of what you would need ?
<zmdkrbou> (the unit -> 'a sounds really strange)
<esdee> I have a function of type (string -> string -> 'a), and I need to pass it to a function that wants a (unit -> 'a) argument
<zmdkrbou> and the second function needs to call the first one with two strings as arguments ?
<esdee> yep
<zmdkrbou> then you can't
<zmdkrbou> it's against typing
<zmdkrbou> (how would you give two strings as arguments to a function that takes one unit argument .)
<zmdkrbou> s/./?/
<esdee> currying
<zmdkrbou> currying is about changin fun x y -> bla into fun (x,y) -> bla and vice versa
<esdee> lets say the HOF wanted a (string -> 'a) argument, then I could just pass it a curried function where one of the strings has already been passed in
<zmdkrbou> well, that's why i asked you if the HOF function need to call the first function on two strings
<esdee> in a language that has an actual function that does currying, you can use it to curry all the args, so the function now requires nothing to be evaluated
<zmdkrbou> if not, you can pass (fun () -> first_fun a b) to the HOF function
dash has joined #ocaml
<dash> any Deputy users here, or know where i could find some? :)
<dash> i'm getting some frustrating error messages from CIL and i'd like a sanity check