adrien changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/ | OCaml 4.00.1 http://bit.ly/UHeZyT | http://www.ocaml-lang.org | Public logs at http://tunes.org/~nef/logs/ocaml/
lolcathost has joined #ocaml
ulfdoz_ has joined #ocaml
ulfdoz has quit [Ping timeout: 250 seconds]
ulfdoz_ is now known as ulfdoz
ikaros has quit [Quit: Ex-Chat]
oriba has joined #ocaml
leoncamel has joined #ocaml
madroach has quit [Ping timeout: 244 seconds]
madroach has joined #ocaml
eikke has quit [Ping timeout: 264 seconds]
eikke has joined #ocaml
leoncamel has quit [Ping timeout: 265 seconds]
leoncamel has joined #ocaml
areece has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
areece has joined #ocaml
mattrepl has quit [Quit: mattrepl]
eikke has quit [Ping timeout: 255 seconds]
ontologiae has joined #ocaml
lolcathost has quit [Quit: lag]
hongboz has quit [Ping timeout: 265 seconds]
ontologiae has quit [Ping timeout: 246 seconds]
Yoric has joined #ocaml
ben_zen has joined #ocaml
Yoric has quit [Ping timeout: 265 seconds]
oriba has quit [Quit: oriba]
emmanuelux has quit [Remote host closed the connection]
mattrepl has joined #ocaml
weie has joined #ocaml
mye has joined #ocaml
sgnb` is now known as sgnb
areece has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
areece has joined #ocaml
watermind has quit [Quit: Konversation terminated!]
mattrepl has quit [Quit: mattrepl]
jewel has joined #ocaml
Yoric has joined #ocaml
ben_zen has quit [Ping timeout: 256 seconds]
gnuvince has quit [Ping timeout: 245 seconds]
EddieSputz has joined #ocaml
Cyanure has joined #ocaml
EddieSputz has quit [Ping timeout: 244 seconds]
Yoric has quit [Remote host closed the connection]
Yoric has joined #ocaml
lolcathost has joined #ocaml
lolcathost has quit [Quit: test]
Kakadu has joined #ocaml
<adrien> morning :-)
<adrien> is there a way besides the bug tracker to send patches? I'm probably going to have many small patches
lolcathost has joined #ocaml
lolcathost has quit [Quit: Lost terminal]
mathieui has quit [Ping timeout: 260 seconds]
lolcathost has joined #ocaml
fusillia has joined #ocaml
jewel has quit [Ping timeout: 252 seconds]
Cyanure has quit [Remote host closed the connection]
cdidd has joined #ocaml
answer_42 has joined #ocaml
Yoric has quit [Ping timeout: 246 seconds]
larhat has joined #ocaml
larhat has quit [Quit: Leaving.]
Cyanure has joined #ocaml
Qrntz has quit [Ping timeout: 244 seconds]
lolcathost has quit [Quit: brb]
lolcathost has joined #ocaml
mathieui has joined #ocaml
mye has quit [Ping timeout: 245 seconds]
ben_zen has joined #ocaml
ben_zen has quit [Ping timeout: 245 seconds]
mye has joined #ocaml
Xizor has joined #ocaml
<wmeyer> adrien: morning :-)
<wmeyer> adrien: no, I think bugtracker is the place where it lives, in absolute you can attach tar.
<troydm> how do i concat two string's ?
<troydm> or more precisly how do i merge two lists together?
<troydm> like in haskell there is :: operator
<pippijn> strings are not lists
<pippijn> and concatenating two lists is done with the @ operator
<pippijn> :: is the cons operator (add element to list)
<pippijn> haskell's ++ is ocaml's @
<Kakadu> troydm: s1^s2
<troydm> @ or ^ ?
<pippijn> ^ is for strings
<pippijn> @ is for lists
<troydm> oic
<troydm> ocaml's string's are not list
<pippijn> right
<pippijn> haskell's strings are pretty slow because they are lists
<pippijn> so there are byte strings to speed it up
eikke has joined #ocaml
<pippijn> ocaml's strings are ByteStrings
<pippijn> you can make a "char list" type
<pippijn> but that's rarely useful and you'll probably want to use the Buffer module instead
Neros has quit [Read error: Connection reset by peer]
Neros has joined #ocaml
<troydm> pippijn: ic, thx
<troydm> also one thing
<troydm> when i do string_of_float
<troydm> to a number 1.0
<troydm> i get string 1.
<troydm> is there a builtin way to get 1.0
<adrien> wmeyer: well, I was planning to send patches as I make them (I have a few trivial ones so far)
<adrien> I'll spam the bug tracker :P
<wmeyer> ok :-)
pango has quit [Ping timeout: 240 seconds]
<pippijn> troydm: scanf
<troydm> pippijn: i meant out
<troydm> *output
<pippijn> ah yes
<pippijn> printf then
<pippijn> the Printf module
<pippijn> or the Format module
<troydm> is it faster to use Printf ?
<pippijn> faster than what?
<troydm> or i could just concat strings ?
<pippijn> printf is not faster than ^ to concat strings
<troydm> ic, ok
emmanuelux has joined #ocaml
<adrien> do you really need the speed?
pango has joined #ocaml
<troydm> adrien: nah, was just curious
<troydm> if internally it does some optimizations of output
<troydm> rather than concating 4-5 strings
<troydm> also how do i get a square of float ?
<pippijn> flo *. flo
<troydm> sorry square root
<troydm> eg sqrt
<pippijn> yes
<pippijn> that
<adrien> troydm: if you have two strings and want to output them the fastest possible, two calls to print_string are probably going to be faster
<adrien> in_channel/out_channel is buffered
<pippijn> fastest will be Unix.write
<adrien> not necessarily
<pippijn> that's true
Yoric has joined #ocaml
<pippijn> but it's highly likely
eikke has quit [Ping timeout: 250 seconds]
<adrien> for file_descr, it might well be faster to concat in memory first and then output; I'm unable to predict what would be faster
<adrien> faster would be mmap but that's not always usable :P
pango has quit [Remote host closed the connection]
<troydm> adrien: not really output but something like sprintf would be faster than code i've pasted?
<adrien> troydm: String.concat
<pippijn> troydm: faster would be to pre-allocate a buffer
<adrien> it'll be more readable too
<adrien> also, see the Buffer module
<pippijn> and yes, String.concat
<adrien> in your case String.concat will be faster
<troydm> adrien: ic, thx
<adrien> Buffer is for slightly different uses but I can't really explain properly :P
<adrien> but you'll understand when you need it :D
<pippijn> String.concat allocates once
<adrien> (its API is more complex and it'll only be useful for bigger strngs)
pango has joined #ocaml
larhat has joined #ocaml
<troydm> something like this http://pastebin.com/VsWcUrmQ ?
<pippijn> troydm: by the way, String.length a - 1 doesn't need ()
<pippijn> troydm: I think it would be better to add the "," as strings in the list and concat with ""
<adrien> troydm: btw, String.length (like any Foo.length in the standard lib) is basically free
<troydm> adrien: what do you mean by free ?
ikaros has joined #ocaml
<pippijn> troydm: O(1)
<pippijn> List.length is not free
<pippijn> but String and Array are
<troydm> ic
<troydm> you mean to count string's length it doesn't need to traverse each char
<pippijn> right
<pippijn> string length cannot change
<pippijn> array length cannot change, either
<pippijn> and it is stored along with the object
mye_ has joined #ocaml
ontologiae has joined #ocaml
mye has quit [Ping timeout: 245 seconds]
mye_ is now known as mye
<adrien> heh, right, I had forgotten about List and a few friends :P
mye has quit [Ping timeout: 246 seconds]
mye has joined #ocaml
ben_zen has joined #ocaml
larhat has quit [Quit: Leaving.]
xavierm02 has joined #ocaml
milosn has quit [Ping timeout: 255 seconds]
jewel has joined #ocaml
milosn has joined #ocaml
matthewt is now known as fruitcake
milosn has quit [Ping timeout: 255 seconds]
milosn has joined #ocaml
Yoric has quit [Ping timeout: 264 seconds]
weie_ has joined #ocaml
weie has quit [Ping timeout: 260 seconds]
<wmeyer> adrien: I wonder what is possible with GADTs, it looks like omega7.ml in the testsuite/typing-gadts shows what can be done
<wmeyer> for instance it's easy to encode peano natural numbers with two operations, succ and pred, but one somebody is wanting addition it becomes more hairy, as there are no type level functions, therefore the recursion for adding number is not captured in the type
<wmeyer> so there are hacks, to just encode in the plus data structure
ben_zen has quit [Ping timeout: 246 seconds]
<wmeyer> i'm trying to work out a collection of basic data types that exploit GADTs, some obvious candidates would be Nat, List, Option, AVL trees
<adrien> I have no experience with GADTs so far ='(
Cyanure has quit [Remote host closed the connection]
<wmeyer> I understood GADTs after dependent types in fact
<wmeyer> but not to the extent I can throw insane proofs using them
gnuvince has joined #ocaml
<troydm> btw is there a way to turn readline support in ocaml interp
<troydm> or i should use rlwrap?
<adrien> rlwrap or ledit
<adrien> these are the quickest solutions
<adrien> and then there is utop I think
* wmeyer tired, will have a nap
Cyanure has joined #ocaml
ygrek has joined #ocaml
voglerr has joined #ocaml
ben_zen has joined #ocaml
voglerr has quit [Quit: Leaving]
lolcathost has quit [Ping timeout: 255 seconds]
Snark has joined #ocaml
gnuvince has quit [Ping timeout: 255 seconds]
<adrien> if I have a bytecode program and changes ocamlrun, will it still work?
<adrien> changing ocamlrun and nothing else
lolcathost has joined #ocaml
Yoric has joined #ocaml
Yoric has quit [Ping timeout: 255 seconds]
gnuvince has joined #ocaml
fraggle_laptop has joined #ocaml
<adrien> yeah, it works =)
Kakadu has quit [Ping timeout: 244 seconds]
Kakadu has joined #ocaml
hongboz` has joined #ocaml
Kakadu has quit [Client Quit]
Kakadu has joined #ocaml
mattrepl has joined #ocaml
Neros has quit [Ping timeout: 256 seconds]
Neros has joined #ocaml
eikke has joined #ocaml
fraggle_laptop has quit [Ping timeout: 264 seconds]
Cyanure has quit [Remote host closed the connection]
Cyanure has joined #ocaml
Guest95276 is now known as micro
micro is now known as Guest18906
fraggle_laptop has joined #ocaml
Yoric has joined #ocaml
tane has joined #ocaml
Qrntz has joined #ocaml
Qrntz has quit [Changing host]
Qrntz has joined #ocaml
fraggle_laptop has quit [Ping timeout: 245 seconds]
eikke has quit [Ping timeout: 255 seconds]
lolcathost has quit [Quit: brb]
lolcathost has joined #ocaml
fraggle_laptop has joined #ocaml
gnuvince has quit [Ping timeout: 245 seconds]
lolcathost has quit [Quit: brb]
bru` has joined #ocaml
lolcathost has joined #ocaml
lolcathost has quit [Client Quit]
ikaros has quit [Quit: Ex-Chat]
eikke has joined #ocaml
jamii has joined #ocaml
ikaros has joined #ocaml
fruitcake is now known as matthewt
lolcathost has joined #ocaml
eikke has quit [Ping timeout: 255 seconds]
mcclurmc has joined #ocaml
tani has joined #ocaml
tane has quit [Ping timeout: 264 seconds]
thomasga has joined #ocaml
thomasga has quit [Client Quit]
eikke has joined #ocaml
leoncamel has quit [Ping timeout: 265 seconds]
weie_ has quit [Quit: Leaving...]
hongboz` has quit [Ping timeout: 248 seconds]
gnuvince has joined #ocaml
syamajala has joined #ocaml
<syamajala> i have a problem
<syamajala> i want to do something like this
<adrien> syamajala: first: List.mem
<syamajala> i see
<syamajala> is it possible to do the other thing?
<syamajala> i guess i kinda want a closure?
<adrien> you want to use the second definition of "bleh" in the function?
<syamajala> yeah
<syamajala> but i dont really wanna pass it in as argument because that would involve changing a lot of code
<adrien> you can use references which are mutable
<adrien> but using references to avoid refactoring is a bad idea
<adrien> especially since refactoring in ocaml is very easy thanks to the type system
<syamajala> also
<syamajala> in tuareg mode is there anyway to send a whole file to ocaml?
<syamajala> for emacs that is
<syamajala> i use C-c C-e right now
mye has quit [Quit: mye]
ontologiae has quit [Ping timeout: 246 seconds]
jewel has quit [Ping timeout: 255 seconds]
ousado has joined #ocaml
ousado has quit [Changing host]
ousado has joined #ocaml
lolcathost has quit [Ping timeout: 246 seconds]
fraggle_laptop has quit [Remote host closed the connection]
mattrepl has quit [Quit: mattrepl]
BiDOrD_ has joined #ocaml
BiDOrD has quit [Ping timeout: 245 seconds]
syamajala has quit [Remote host closed the connection]
lolcathost has joined #ocaml
wormphlegm has joined #ocaml
Yoric has quit [Ping timeout: 265 seconds]
ygrek has quit [Quit: Leaving]
<matthewt> i want to write a function that generates a list of ints from 1..n http://pastie.org/5540526 this gives me n..1 but reversing the order of n::(interval(n-1)) gives me an error. is there another way i can do it?
<tani> what is the error?
mattrepl has joined #ocaml
<matthewt> it is rather hard to google for documentation on what :: does exactly :p
<ben_zen> matthewt: :: splits the list between the first so many elements and the tail
Cyanure has quit [Remote host closed the connection]
<matthewt> oh, i see
emmanuelux has quit [Remote host closed the connection]
ontologiae has joined #ocaml
tani has quit [Quit: Verlassend]
ikaros has quit [Quit: Ex-Chat]
answer_42 has quit [Remote host closed the connection]
ikaros has joined #ocaml
emmanuelux has joined #ocaml
Kakadu has quit []
<pango> matthewt: a list is either empty ([]) or made of an element and the list of the remaining elements (h :: q)
<pango> matthewt: the types of h and q are different (an element vs. a list), :: is asymetric
<matthewt> thanks pango
<pango> and [a; b; c] is just syntactic sugar for a :: (b :: (c :: []))
Xizor has quit [Remote host closed the connection]
ulfdoz has quit [Ping timeout: 246 seconds]
Yoric has joined #ocaml
ontologiae has quit [Ping timeout: 255 seconds]
xavierm02 has quit [Quit: Leaving]
bru` has quit [Quit: aplouche]
lolcathost has quit [Ping timeout: 252 seconds]
nicoo has joined #ocaml
lolcathost has joined #ocaml
everyonemines has joined #ocaml
leoncamel has joined #ocaml
ontologiae has joined #ocaml
jamii has quit [Read error: Connection reset by peer]
Yoric has quit [Ping timeout: 265 seconds]
wmeyer` has joined #ocaml
wmeyer has quit [Ping timeout: 264 seconds]
wmeyer` has quit [Read error: Connection reset by peer]
wmeyer` has joined #ocaml
alxbl has quit [Remote host closed the connection]
alxbl has joined #ocaml
alxbl has quit [Changing host]
alxbl has joined #ocaml
lolcathost has quit [Ping timeout: 255 seconds]
lolcathost has joined #ocaml