gildor changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/ | OCaml 3.12.1 http://bit.ly/nNVIVH
lggr has quit [Ping timeout: 240 seconds]
ontologiae has joined #ocaml
lggr has joined #ocaml
iago has joined #ocaml
lggr has quit [Ping timeout: 246 seconds]
lggr has joined #ocaml
ontologiae has quit [Ping timeout: 260 seconds]
Playground has quit [Ping timeout: 248 seconds]
lggr has quit [Ping timeout: 255 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 246 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 245 seconds]
ulfdoz_ has joined #ocaml
Playground has joined #ocaml
lggr has joined #ocaml
ulfdoz has quit [Ping timeout: 260 seconds]
ulfdoz_ is now known as ulfdoz
Anarchos has quit [Quit: Vision[0.9.7-H-090423]: i've been blurred!]
iago has quit [Quit: Leaving]
Playground has quit [Ping timeout: 246 seconds]
lggr has quit [Ping timeout: 260 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 255 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 248 seconds]
<pippijn> I found something amazing
<pippijn> a branch is less expensive than a field store
<pippijn> or maybe it isn't and ocaml just optimises the entire branch and field store away
lggr has joined #ocaml
madroach has quit [Ping timeout: 265 seconds]
madroach has joined #ocaml
lggr has quit [Ping timeout: 244 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 244 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 260 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 246 seconds]
Yoric has joined #ocaml
lggr has joined #ocaml
lggr has quit [Ping timeout: 255 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 240 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 255 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 252 seconds]
avsm has quit [Quit: Leaving.]
lggr has joined #ocaml
lggr has quit [Ping timeout: 260 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 246 seconds]
lggr has joined #ocaml
Yoric has quit [Ping timeout: 252 seconds]
lggr has quit [Ping timeout: 246 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 245 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 245 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 246 seconds]
lggr has joined #ocaml
poindontcare has quit [Ping timeout: 246 seconds]
lggr has quit [Ping timeout: 260 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 248 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 245 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 240 seconds]
lggr has joined #ocaml
joewilliams has joined #ocaml
cdidd has joined #ocaml
lggr has quit [Ping timeout: 260 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 260 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 245 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 256 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 260 seconds]
nimred_ has quit [Read error: Operation timed out]
lggr has joined #ocaml
lggr has quit [Ping timeout: 256 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 244 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 245 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 246 seconds]
lggr has joined #ocaml
Yoric has joined #ocaml
lggr has quit [Ping timeout: 260 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 255 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 246 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 240 seconds]
Cyanure has joined #ocaml
lggr has joined #ocaml
avsm has joined #ocaml
lggr has quit [Ping timeout: 246 seconds]
lggr has joined #ocaml
<pippijn> has anybody here tried aurochs (or another PEG parser)?
<pippijn> I'm wondering how to debug it
Cyanure has quit [Remote host closed the connection]
lggr has quit [Ping timeout: 240 seconds]
lggr has joined #ocaml
nimred has joined #ocaml
nimred has quit [Client Quit]
avsm has quit [Quit: Leaving.]
lggr has quit [Ping timeout: 255 seconds]
lggr has joined #ocaml
nimred has joined #ocaml
nimred has quit [Changing host]
nimred has joined #ocaml
lggr has quit [Ping timeout: 256 seconds]
lggr has joined #ocaml
<zorun> pippijn: I did try it, but iirc it uses its own format for PEG
<zorun> and the way it works wasn't very clear
Kakadu has joined #ocaml
lggr has quit [Ping timeout: 260 seconds]
<pippijn> zorun: I put a C++ grammar into it
<pippijn> zorun: but the grammar was meant for LR parsing
lggr has joined #ocaml
<pippijn> zorun: it doesn't warn or (I think) do anything else, it just says syntax error on character 1
<zorun> pippijn: oh, that sounds familiar :)
<zorun> I don't think there isn't any standard for writing PEGs
<zorun> so there are a lot of formats out there
<zorun> there *is any standard
<pippijn> the format is not the problem
<pippijn> the grammar doesn't do anything, that's the problem
<pippijn> the parser just stops on the first character
<pippijn> it works if my grammar is "int" "main" "(" ")" "{" "}"
<pippijn> aurochs doesn't output expected characters or anything
<Kakadu> maybe parser is incorrect written ? :)
<pippijn> Kakadu: yes, definitely
<pippijn> but I would like to get error messages
<pippijn> because I don't know how PEGs work
<Kakadu> I only know how GLR should work....
<pippijn> yes, I know that, too
lggr has quit [Ping timeout: 244 seconds]
lggr has joined #ocaml
Snark has joined #ocaml
lggr has quit [Ping timeout: 252 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 246 seconds]
lggr has joined #ocaml
djcoin has joined #ocaml
sepp2k has joined #ocaml
lggr has quit [Ping timeout: 244 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 260 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 260 seconds]
lggr has joined #ocaml
Yoric has quit [Ping timeout: 252 seconds]
ontologiae has joined #ocaml
lggr has quit [Ping timeout: 240 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 240 seconds]
lggr has joined #ocaml
Kakadu has quit [Quit: Konversation terminated!]
lggr has quit [Ping timeout: 245 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 260 seconds]
lggr has joined #ocaml
Kakadu has joined #ocaml
lggr has quit [Ping timeout: 255 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 245 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 252 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 255 seconds]
lggr has joined #ocaml
ontologiae has quit [Read error: Operation timed out]
lggr has quit [Ping timeout: 245 seconds]
lggr has joined #ocaml
Sablier has joined #ocaml
BiDOrD has joined #ocaml
lggr has quit [Ping timeout: 246 seconds]
BiDOrD_ has quit [Ping timeout: 245 seconds]
lggr has joined #ocaml
wmeyer` has joined #ocaml
<wmeyer`> hi
lggr has quit [Ping timeout: 246 seconds]
<adrien> morning o/
lggr has joined #ocaml
lggr has quit [Ping timeout: 256 seconds]
lggr has joined #ocaml
emmanuelux has joined #ocaml
lggr has quit [Ping timeout: 256 seconds]
lggr has joined #ocaml
<wmeyer`> /msg pippijn I am in caffee. pls, give me the IRC server host
<wmeyer`> oops
lggr has quit [Ping timeout: 246 seconds]
ulfdoz has quit [Read error: Operation timed out]
lggr has joined #ocaml
lggr has quit [Ping timeout: 244 seconds]
lggr has joined #ocaml
wmeyer` has quit [Read error: Connection reset by peer]
wmeyer` has joined #ocaml
lggr has quit [Ping timeout: 260 seconds]
ulfdoz has joined #ocaml
lggr has joined #ocaml
lggr has quit [Ping timeout: 248 seconds]
<pippijn> wmeyer`: still?
lggr has joined #ocaml
lggr has quit [Ping timeout: 260 seconds]
lggr has joined #ocaml
eikke has joined #ocaml
osa1 has quit [Ping timeout: 252 seconds]
thomasga has joined #ocaml
thomasga has quit [Client Quit]
lggr has quit [Ping timeout: 246 seconds]
lggr has joined #ocaml
tufisi has joined #ocaml
lggr has quit [Ping timeout: 256 seconds]
lggr has joined #ocaml
<wmeyer`> can opam install Ocsigen darcs?
<wmeyer`> we are setting up a VM for my friend
<wmeyer`> and want to try an alternative to the bundle
lggr has quit [Ping timeout: 244 seconds]
eikke has quit [Ping timeout: 256 seconds]
lggr has joined #ocaml
<jpdeplaix> wmeyer`: Why do you want the darcs version ?
<wmeyer`> jpdeplaix: it's not strictly required, but in general bleeding edge would good
<wmeyer`> jpdeplaix: any release would do
lggr has quit [Ping timeout: 245 seconds]
<wmeyer`> jpdeplaix: of course up to date, the Ocsigen is moving quickly
lggr has joined #ocaml
<wmeyer`> btw: is there any reason of not deploying Ocsigen using OCaml script?
<wmeyer`> assuming that Ocaml itself is on path
<wmeyer`> that would be probably easier to maintain in general
<jpdeplaix> mmmh, you can ask to hnrgrgr for the bundle ;)
<wmeyer`> jpdeplaix: honestly I would contribute my self :) i feel it's needed but my time is limited ; /
<jpdeplaix> On which distribution are you ?
<wmeyer`> we are doing it in jaunty right now, my friend is setting up using vagrant/chef thing
<wmeyer`> he is got no prior experience in OCaml
<wmeyer`> and we've tried remotely to install Ocsigen on his Mac OS X
<wmeyer`> (i had quite few times succesful installation of oscigen so i have no problems)
<wmeyer`> the idea is to prepare a script that does everything, creates vm and prepares ocamlbrew and installs ocsigen
lggr has quit [Ping timeout: 256 seconds]
lggr has joined #ocaml
ontologiae has joined #ocaml
lggr has quit [Ping timeout: 246 seconds]
lggr has joined #ocaml
ontologiae has quit [Ping timeout: 245 seconds]
lggr has quit [Ping timeout: 244 seconds]
lggr has joined #ocaml
<pippijn> I have a Set and my comparison function does not consider all fields of the element type
<pippijn> now, I want to find an element in the set that compares equal to another element but I want to get the contained element
<pippijn> is that possible or should I be using a Map instead?
lggr has quit [Ping timeout: 246 seconds]
<Kakadu> pippijn: does Set has filter function?
<pippijn> yes, but it iterates over all elements
<pippijn> then I might as well use a list
lggr has joined #ocaml
lggr has quit [Ping timeout: 246 seconds]
lggr has joined #ocaml
<wieczyk> Hi
<wieczyk> module MBuild (M:MInterface) = struct
<wieczyk> module M = MBuildSomethingElse(M)
<wieczyk> let p = M.parse
<wieczyk> end
<wieczyk> 'parse' is unboud, why?
<wieczyk> The MBuildSomethingElse provides this value
lggr has quit [Ping timeout: 260 seconds]
lggr has joined #ocaml
<wieczyk> Ok, my mistake.
<wieczyk> Sorry
<wieczyk> OK, another question
<wieczyk> module M(M1 : MSig1)(M2 : MSig2) = struct ... end
<wieczyk> can I add constraint that M1.t = M2.t ?
<wieczyk> ok
lggr has quit [Ping timeout: 246 seconds]
<wieczyk> (M2 : MSig2 with type t = M1.t)
lggr has joined #ocaml
lggr has quit [Ping timeout: 246 seconds]
<pippijn> so I have an algorithm that operates on small sets
<pippijn> two algorithms
<pippijn> one of them uses Maps for lookups and is O(n log n), one uses lists and is O(n^2)
<pippijn> the n log n one is almost twice as slow as the n^2 one
<Kakadu> pippijn: You're measuring speed badly :)
lggr has joined #ocaml
<pippijn> why?
<Kakadu> beacause your O(n*log n) is slower that O(N^2)
<zorun> you obviously know that complexity is (almost) always asymptotic
Yoric has joined #ocaml
<pippijn> my map algorithm will be faster for large data sets
<pippijn> and yes, I know
<adrien> except when you have a constant factor that is so high it'd only be faster on data sets bigger than this universa can accomodate :P
Snark has quit [Ping timeout: 246 seconds]
<pippijn> my data sets are between 1 and 10 elements
<pippijn> but I'm very, *very* unhappy with the speed of the list algorithm, too
<pippijn> I think I'm generally doing something wrong
<pippijn> because it takes 4 seconds
<pippijn> and the algorithm in C++ takes a millisecond
Snark has joined #ocaml
<adrien> well, remove the Unix.sleep 1 :P
lggr has quit [Ping timeout: 246 seconds]
<pippijn> ah wait
<pippijn> hehe
<pippijn> it's not taking 4 seconds
<pippijn> 10K iterations take 4 seconds
<pippijn> I forgot I was measuring time in a loop
lggr has joined #ocaml
lggr has quit [Ping timeout: 246 seconds]
lggr has joined #ocaml
<zorun> :p
cdidd has quit [Read error: Connection reset by peer]
<wieczyk> eh
<wieczyk> w8
<wieczyk> Why I have this error, why Ocaml typechecker don't want to see that
<pippijn> let list_merge a b = if List.length a < List.length b then a @ b else b @ a
<wieczyk> NJoinDriver.value = NOperDrive.value
<wieczyk> ?
<pippijn> this function is worth it (for unordered sets)
<zorun> seriously?
<pippijn> it is, in my case
<pippijn> fewer allocations
<pippijn> it's probably always worth it if the lists differ greatly in size
<zorun> doing two O(n) computations to choose between the least expensive of two others O(n) computations?
<zorun> that sounds weird
<pippijn> zorun: the point is the constant factor
<zorun> hmm
<pippijn> allocations are more expensive than iterations
<wieczyk> btw: topic could be updated, Ocaml 4 is current version
<pippijn> it's out?
lggr has quit [Ping timeout: 245 seconds]
<wieczyk> 2012/07OCaml 4.00.0 released
<pippijn> hmm
<pippijn> good
<wieczyk> GADT includes ;]
<wieczyk> included*
<Kakadu> pippijn: everybody knows that 4.0 is out :D
<wieczyk> Yeah, big sensation.
<pippijn> I don't know it until it's in debian
<wieczyk> Ok, could some help me with typechecker? ;]
<pippijn> and I was probably in nepal when it got out
lggr has joined #ocaml
<pippijn> binary search on 4 elements is faster than iterating through them
<pippijn> and faster than a hash table lookup, too
<pippijn> (the elements are strings)
<pippijn> I'm still generally unhappy about my algorithm
lggr has quit [Ping timeout: 244 seconds]
tufisi has quit [Ping timeout: 245 seconds]
cixaxa has joined #ocaml
lggr has joined #ocaml
<adrien> pippijn: some time ago, I did an unscientific benchmark that showed that a binary tree that you'd balance manually and which was built in a random order was faster than association lists for 4 elements or more
lggr has quit [Ping timeout: 252 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 246 seconds]
Kakadu has quit [Quit: Konversation terminated!]
lggr has joined #ocaml
lggr has quit [Ping timeout: 245 seconds]
lggr has joined #ocaml
osa1 has joined #ocaml
lggr has quit [Ping timeout: 252 seconds]
wmeyer`` has joined #ocaml
lggr has joined #ocaml
wmeyer` has quit [Ping timeout: 244 seconds]
<pippijn> ocaml optimisation makes no sense
<pippijn> let foo = { bar = bloh } in ...
<pippijn> in some cases is faster and in some cases is slower than
<pippijn> let foo = { bar = Obj.magic [] } in foo.bar <- bloh ...
<pippijn> just marginally, though
lggr has quit [Ping timeout: 260 seconds]
<adrien> it's not ocaml optimisations which make no sense :-)
<pippijn> maybe it's the architecture
<pippijn> interesting
<pippijn> Obj.magic is not for free
<pippijn> creating a new empty object instead of setting it to 0 takes less time
lggr has joined #ocaml
<pippijn> wtf
<pippijn> "let rec" gave me faster code than "let"
<pippijn> but not always
<pippijn> usually it's slower
lggr has quit [Ping timeout: 260 seconds]
wmeyer``` has joined #ocaml
emmanuelux has quit [Ping timeout: 246 seconds]
<thizanne> si
lggr has joined #ocaml
<thizanne> sorry
wmeyer`` has quit [Ping timeout: 244 seconds]
wmeyer has quit [Ping timeout: 264 seconds]
Snark has quit [Ping timeout: 246 seconds]
Snark has joined #ocaml
<pippijn> if cond then fn a b c d e else fn a b c d f
<pippijn> is faster than
<pippijn> fn a b c d (if cond then e else f)
lggr has quit [Ping timeout: 245 seconds]
sepp2k has quit [Read error: Connection reset by peer]
<pippijn> making a local variable of the last argument is in between the two
sepp2k has joined #ocaml
lggr has joined #ocaml
<pippijn> wow
avsm has joined #ocaml
<pippijn> List.iter (fun e -> fn a b c d e) list
<pippijn> is *much* faster than
<pippijn> List.iter (fn a b c d) list
<pippijn> I thought that would generate the same code
<pippijn> I think I need to write an ocaml optimiser..
<pippijn> because there is a lot of (prettier) code that can easily be transformed into more efficient code
pango has quit [Ping timeout: 245 seconds]
<pippijn> and by "much" I mean 4%
lggr has quit [Ping timeout: 240 seconds]
xarch has joined #ocaml
lggr has joined #ocaml
lggr has quit [Ping timeout: 252 seconds]
Yoric has quit [Ping timeout: 255 seconds]
pango has joined #ocaml
lggr has joined #ocaml
wmeyer has joined #ocaml
chambart has joined #ocaml
<wmeyer> wtf, google.com domain can't be pinged on any of the computers at home
<wmeyer> gmail stopped working
<wmeyer> \o\ /o/
<wmeyer> strangely fb and skype works ^^
xarch has left #ocaml []
<pippijn> I de-inlined some big stuff and now it's much slower again
<pippijn> but I like it better
<djcoin> pippijn: I do not program much in OCaml, but this kind of "unoptimization" always astonish me. I guess OCaml would be really faster if some optimization on the compiler were made
<wmeyer> djcoin: I keep saying that but I will say what Xavier L says: "Who will write a good inliner for OCaml will be welcome like the Mesiah"
lggr has quit [Ping timeout: 246 seconds]
<wmeyer> In other words nobody had time or took the chalenge
<djcoin> Yeah, I'm far from having the skill. But I think, as OCaml may be chosen for its predictibility, its speed etc. Pushing performance would really be a killer, each step making it closer than C++ performance. Gaining interest/market
<djcoin> s/than/to
chambart has quit [Ping timeout: 260 seconds]
<wmeyer> but if you want to write a functional code then it's so needed
lggr has joined #ocaml
<djcoin> wmeyer: how had this not happen yet ? (if my sentence is proper english)
<pippijn> I'm also very unhappy that while !foo do ... done is faster than let rec loop foo = ... loop newfoo
<pippijn> in my opinion, that should generate exactly the same code
<pippijn> it's non-trivial to transform such code (correctly)
ftrvxmtrx has quit [Read error: Connection reset by peer]
ftrvxmtrx has joined #ocaml
lggr has quit [Ping timeout: 244 seconds]
<wmeyer> what does -dcmm tell?
lggr has joined #ocaml
lggr has quit [Ping timeout: 246 seconds]
lggr has joined #ocaml
<pippijn> wmeyer: that is an awesome option
<pippijn> I like it very much
<pippijn> now that just needs a coloriser
* pippijn writes a colouriser
lggr has quit [Ping timeout: 255 seconds]
avsm has quit [Quit: Leaving.]
lggr has joined #ocaml
lggr has quit [Ping timeout: 256 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 240 seconds]
lggr has joined #ocaml
<wmeyer> pippijn: looks cool :D
lggr has quit [Ping timeout: 260 seconds]
lggr has joined #ocaml
<djcoin> pippijn: what does this do ? oO =)
eikke has joined #ocaml
<wmeyer> it's a dump of the intermediate ast from the compiler
<wmeyer> in this case is just before tranlastion to linear which then gets translated to machine code
lggr has quit [Ping timeout: 252 seconds]
lggr has joined #ocaml
ontologiae has joined #ocaml
lggr has quit [Ping timeout: 256 seconds]
Kakadu has joined #ocaml
lggr has joined #ocaml
avsm has joined #ocaml
ontologiae has quit [Ping timeout: 260 seconds]
lggr has quit [Ping timeout: 245 seconds]
sepp2k1 has joined #ocaml
avsm has quit [Client Quit]
sepp2k has quit [Ping timeout: 246 seconds]
<djcoin> wmeyer: oh, it's rendered as lisp (which makes perfect sense) ?
<djcoin> funny :=)
eikke has quit [Ping timeout: 248 seconds]
osa1 has quit [Quit: Konversation terminated!]
lggr has joined #ocaml
Yoric has joined #ocaml
lggr has quit [Ping timeout: 246 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 252 seconds]
lggr has joined #ocaml
<djcoin> Hmm, trying to compile from bleeding edge ocaml, I get the following error:
<djcoin> File "_none_", line 1:
<djcoin> Error: I/O error: compilerlibs/ocamlcommon.cma: No such file or directory
<djcoin> make[1]: *** [compilerlibs/ocamlcommon.cma] Error 2
<djcoin> make[1]: Leaving directory `/home/makina/sources/ocaml'
<djcoin> make: *** [world.opt] Error 2
lggr has quit [Ping timeout: 246 seconds]
lggr has joined #ocaml
ontologiae has joined #ocaml
<hnrgrgr> djcoin: mkdir compilerlibs
<hnrgrgr> did you use a git mirror of the svn ?
lggr has quit [Ping timeout: 244 seconds]
<djcoin> hnrgrgr: indeed
<djcoin> ah I see, you can't add an empty dir in git but you can in svn maybe ?
<wmeyer> hmm looks like outdated git
<wmeyer> so, the rule to makefile was added to mkdri compilerlibs
<wmeyer> (but maybe not ;-) )
lggr has joined #ocaml
<wmeyer> at least i had the same problem when using git svn
<djcoin> thanks by the way !
<wmeyer> so yes, git is awesome but does not handle empty dirs so nice as svn
<wmeyer> hnrgrgr: ocsigen lwt darcs is failing with ocaml 4.0.00
<wmeyer> (i suspect you strengthen the constraints on type, in unix and io module to be compatible with the standard lib by using type equality)
<wmeyer> and it does not work with 4.0.00 yet
<wmeyer> i didn't look at the darcs history, my friend is installin that at the moment
<wmeyer> is there any verision that works with 4.0.00?
<wmeyer> (sorry about this)
lggr has quit [Ping timeout: 246 seconds]
emmanuelux has joined #ocaml
lggr has joined #ocaml
<wmeyer> the error is
<wmeyer> File "src/unix/lwt_unix.mli", line 298, characters 5-185:
<wmeyer> Error: This variant or record definition does not match that of type
<wmeyer>          Unix.open_flag
<wmeyer>        The field O_SHARE_DELETE is only present in the original
<wmeyer>
lggr has quit [Ping timeout: 245 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 244 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 255 seconds]
lggr has joined #ocaml
tlockney has quit [Excess Flood]
lggr has quit [Ping timeout: 246 seconds]
hongboz has joined #ocaml
tlockney has joined #ocaml
lggr has joined #ocaml
lggr has quit [Ping timeout: 246 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 245 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 256 seconds]
lggr has joined #ocaml
Xizor has joined #ocaml
djcoin has quit [Quit: WeeChat 0.3.7]
lggr has quit [Ping timeout: 255 seconds]
lggr has joined #ocaml
emmanuelux has quit [Quit: emmanuelux]
sepp2k1 has quit [Remote host closed the connection]
ontologiae has quit [Ping timeout: 245 seconds]
lggr has quit [Ping timeout: 246 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 260 seconds]
lggr has joined #ocaml
pngl has joined #ocaml
<pngl> Is there an elegant n.times do ... end in ocaml?
<Kakadu> using stdlib I don't think so
hongboz has quit [Ping timeout: 248 seconds]
<Kakadu> you easily can write function repeat : int -> (unit -> unit) -> unit
lggr has quit [Ping timeout: 245 seconds]
lggr has joined #ocaml
emmanuelux has joined #ocaml
<pngl> Kakadu: yep, thanks
lggr has quit [Ping timeout: 240 seconds]
lggr has joined #ocaml
oCamlGuy has joined #ocaml
Yoric has quit [Ping timeout: 255 seconds]
<oCamlGuy> Could someone help me understand what this data structure looks like? "type 'a tree = | |eaf of 'a | Branch of ( 'a * 'a ) tree"
<oCamlGuy> "type 'a tree = | leaf of 'a | Branch of ( 'a * 'a ) tree" *
<Kakadu> it a binary tree :)
<Kakadu> it's *
<oCamlGuy> Kakadu: isn't it also complete?
lggr has quit [Ping timeout: 256 seconds]
<Kakadu> wait
<oCamlGuy> it should be more then just a binary tree
<Kakadu> Are you sure that this type declaration is correct written?
<oCamlGuy> Kakadu: yes, what are you conceded with?
<oCamlGuy> concerned
<Kakadu> It seems that somebody wanted to write binary tree but failed
<wmeyer> oCamlGuy: it's polymorphic recursion
<oCamlGuy> Kakadu: its not supposed to be just a binary tree
<oCamlGuy> wmeyer: what do you mean
<Kakadu> wmeyer: I'm confused about ( 'a * 'a ) tree
lggr has joined #ocaml
<wmeyer> that would be easier: type 'a tree = Leaf of 'a | Bra of 'a tree * 'a tree
<oCamlGuy> that makes two of us
<oCamlGuy> so are the tuples in this tree?
<wmeyer> i am sure it's try ocaml
<oCamlGuy> huh?
<wmeyer> yes, but with your example the construction is slightly different
<Kakadu> oCamlGuy: where do u read that?
<oCamlGuy> ('a * 'a)
<oCamlGuy> wmeyer: are you saying your type is equivalent?
<Kakadu> oCamlGuy: no
<Kakadu> He wants to say that somebody failed while trying to implement binary tree
<wmeyer> so in one case it's type 'a tree = | leaf of 'a | Branch of ( 'a * 'a ) tree" *
<wmeyer> <Kakadu> it a binary tree :) [21:38]
<wmeyer> <Kakadu> it's *
<wmeyer> <oCamlGuy> Kakadu: isn't it also complete?
<wmeyer> *** lggr (~lggr@84-73-159-126.dclient.hispeed.ch) has quit: Ping timeout: 256
<wmeyer> seconds
<oCamlGuy> Kakadu: no they didn't! this type was made on purpose
<wmeyer> <Kakadu> wait
<wmeyer> <oCamlGuy> it should be more then just a binary tree [21:39]
<wmeyer> <Kakadu> Are you sure that this type declaration is correct written?
<wmeyer> <oCamlGuy> Kakadu: yes, what are you conceded with?
<wmeyer> <oCamlGuy> concerned
<wmeyer> <Kakadu> It seems that somebody wanted to write binary tree but failed
<wmeyer> <wmeyer> oCamlGuy: it's polymorphic recursion
<wmeyer> <oCamlGuy> Kakadu: its not supposed to be just a binary tree [21:40]
<wmeyer> <oCamlGuy> wmeyer: what do you mean
<Kakadu> wmeyer: wait
<wmeyer> <Kakadu> wmeyer: I'm confused about ( 'a * 'a ) tree
<wmeyer> *** lggr (~lggr@84-73-159-126.dclient.hispeed.ch) has joined channel #ocaml
<wmeyer> <wmeyer> that would be easier: type 'a tree = Leaf of 'a | Bra of 'a tree * 'a
<wmeyer> tree
<wmeyer> <oCamlGuy> that makes two of us
<wmeyer> <oCamlGuy> so are the tuples in this tree? [21:41]
<wmeyer> <wmeyer> i am sure it's try ocaml
<wmeyer> <oCamlGuy> huh?
<wmeyer> <wmeyer> yes, but with your example the construction is slightly different
<wmeyer> <Kakadu> oCamlGuy: where do u read that?
<wmeyer> <oCamlGuy> ('a * 'a) [21:42]
<wmeyer> <oCamlGuy> wmeyer: are you saying your type is equivalent? [21:43]
<wmeyer> ERC> so in one case it's type 'a tree = | leaf of 'a | Branch of ( 'a * 'a ) tree" *
<wmeyer> <Kakadu> it a binary tree :) [21:38]
<wmeyer> <Kakadu> it's *
<wmeyer> <oCamlGuy> Kakadu: isn't it also complete?
<wmeyer> *** lggr (~lggr@84-73-159-126.dclient.hispeed.ch) has quit: Ping timeout: 256
<wmeyer> seconds
<wmeyer> <Kakadu> wait
<wmeyer> <oCamlGuy> it should be more then just a binary tree [21:39]
<wmeyer> <Kakadu> Are you sure that this type declaration is correct written?
<wmeyer> <oCamlGuy> Kakadu: yes, what are you conceded with?
<wmeyer> <oCamlGuy> concerned
<Kakadu> OMG
<wmeyer> <Kakadu> It seems that somebody wanted to write binary tree but failed
<wmeyer> <wmeyer> oCamlGuy: it's polymorphic recursion
<wmeyer> <oCamlGuy> Kakadu: its not supposed to be just a binary tree [21:40]
<Kakadu> do you see what I'm seeing?
<wmeyer> <oCamlGuy> wmeyer: what do you mean
<wmeyer> <Kakadu> wmeyer: I'm confused about ( 'a * 'a ) tree
<wmeyer> *** lggr (~lggr@84-73-159-126.dclient.hispeed.ch) has joined channel #ocaml
<wmeyer> <wmeyer> that would be easier: type 'a tree = Leaf of 'a | Bra of 'a tree * 'a
<wmeyer> tree
<wmeyer> <oCamlGuy> that makes two of us
<wmeyer> <oCamlGuy> so are the tuples in this tree? [21:41]
<oCamlGuy> yes
<wmeyer> <wmeyer> i am sure it's try ocaml
<wmeyer> <oCamlGuy> huh?
<oCamlGuy> wtf
<wmeyer> <wmeyer> yes, but with your example the construction is slightly different
<wmeyer> <Kakadu> oCamlGuy: where do u read that?
<wmeyer> <oCamlGuy> ('a * 'a) [21:42]
<wmeyer> <oCamlGuy> wmeyer: are you saying your type is equivalent? [21:43]
<wmeyer> ERC> so in one case it's Branch (Leaf (1, 1)) or Branch(Branch (Leaf ((1,1), (1,1))));;
wmeyer has left #ocaml []
<Kakadu> oCamlGuy: it's either IRC bug or wmeyer's ?
wmeyer has joined #ocaml
lggr has quit [Ping timeout: 245 seconds]
<wmeyer> hm
<wmeyer> so what's that surprising?
<wmeyer> it's different data structure
<wmeyer> but formally represenint the same thing
<oCamlGuy> wmeyer: are you familiar with haskell?
chambart has joined #ocaml
<wmeyer> oCamlGuy: not really, but I did some Haskell in past
err404 has joined #ocaml
<oCamlGuy> I was thinking if someone converted it to haskell i might understand it better
<wmeyer> so yes haskell has higher rank polymorphism aka. polymorphic recursion
<wmeyer> in Haskell you have more intuitive notation
<wmeyer> it would be
<wmeyer> data Tree a = Leaf a | Branch (Tree a) (Tree a)
<wmeyer> for the second case
<wmeyer> and for the first
<wmeyer> data Tree a = Leaf a | Branch (Tree (a a))
<wmeyer> data Tree a = Leaf a | Branch (Tree (a,a))
lggr has joined #ocaml
<wmeyer> (but actually I am not sure if the polymorphic recursive example is OK)
<wmeyer> but then yes, you have tuples instead of regural constructor in Haskell but i suppose there is no other way to represent the tree
<oCamlGuy> so is the structure supposed to be a complete tree of complete trees?
<oCamlGuy> I'm still confused
<wmeyer> it's a binary tree, tree is recursive data structure
<wmeyer> each tree has left subtree and right subtree
<wmeyer> where subtree can be a tree of leaf
<wmeyer> in polymorphic recursive example, each branch generate a new type
<wmeyer> which recursively expand each time to tuple
<wmeyer> then you have leaf, where the type variable is of type as much expanded as branch has done
<wmeyer> so for single Leaf it will be just 'a
lggr has quit [Ping timeout: 256 seconds]
<wmeyer> for single Branch and then Leaf you will get the tuple
<wmeyer> for double nested Branches and leaf you will get double tuple of two elements
<wmeyer> (pair of pair)
<wmeyer> in non polymorphic variant, each Branch constructs just the same type
<wmeyer> where 'a is unified with the type wrapped in the tree
lggr has joined #ocaml
<wmeyer> but you will need each time a tuple of sub trees
<wmeyer> hope it makes sense :-)
Xizor has quit [Quit: So yes it's mIRC under wine under debian double peche capital. ;) I'll soon see in kfreeBSD.]
Snark has quit [Quit: Quitte]
lggr has quit [Ping timeout: 248 seconds]
err404 has quit [Remote host closed the connection]
lggr has joined #ocaml
lggr has quit [Ping timeout: 246 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 252 seconds]
chambart has quit [Ping timeout: 260 seconds]
lggr has joined #ocaml
oCamlGuy has quit [Quit: oCamlGuy]
lggr has quit [Ping timeout: 260 seconds]
lggr has joined #ocaml
panard has joined #ocaml
<panard> Hi
<thelema> hi
<panard> I'm experiencing an odd behaviour with Set equality
lggr has quit [Ping timeout: 246 seconds]
<thelema> Are you using the polymorphic (=) to compare sets?
<panard> is structural equality (=) supposed to give the same result as Set.equal ?
<thelema> no, it is not.
<panard> oh ok
<thelema> (=) will give false negatives
<panard> exactly
<panard> what is the reason?
lggr has joined #ocaml
<thelema> (=) doesn't know the meaning of the values it's comparing, so it can't tell that two trees balanced in different ways represent the same thing.
<panard> oh! I see!
<panard> ok. So actually, I'm using set of sets
<panard> and calling Set.equal also give false negatives
<thelema> are you using Pervasives.compare to compare sets?
<panard> (i.e. I have module A = Set.Make (...) and B = Set.Make(... type t = A.t , etc.), and calling B.equal gives false negative
<thelema> what's your compare function on B?
<panard> for B.compare, I use something like : compare e1 e2 = if A.equal e1 e2 then 0 else compare e1 e2
<thelema> B = Set.Make (struct type t = A.t let compare = A.compare end)
<thelema> you should just use the A.compare function to instantiate B
<thelema> or more easily: module A = Set.Make(...) module B = Set.Make(A)
<thelema> what you're doing is using Pervasives.compare in your 'else'. This function has the same problems as (=)
lggr has quit [Ping timeout: 245 seconds]
<panard> ok, it seems to work!
<thelema> great
<panard> Yes, but as I'm using equal before, it should not return false negative ?
<panard> thanks a lot for these tips
<thelema> it can have false negative because compare won't be stable around different representations of the same set
<thelema> so it my report X < X' where both are the same set
<thelema> *may
<panard> even if I'm checking that A.equal X X' is false ?
<thelema> yes, it may report that X < Y but Y' < X
<panard> ok
<panard> will be more careful with (=) now :-)
lggr has joined #ocaml
lggr has quit [Ping timeout: 245 seconds]
yezariaely has left #ocaml []
lggr has joined #ocaml
lggr has quit [Ping timeout: 244 seconds]
lggr has joined #ocaml
Kakadu has quit [Quit: Konversation terminated!]
oCamlGuy has joined #ocaml
Sablier has quit []
lggr has quit [Ping timeout: 245 seconds]
oCamlGuy has quit [Client Quit]
lggr has joined #ocaml
lggr has quit [Ping timeout: 246 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 244 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 240 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 252 seconds]
panard has quit [Quit: Konversation terminated!]
lggr has joined #ocaml
lggr has quit [Ping timeout: 245 seconds]
lggr has joined #ocaml
pngl has quit [Ping timeout: 246 seconds]
lggr has quit [Ping timeout: 256 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 244 seconds]
lggr has joined #ocaml
Yoric has joined #ocaml
ontologiae has joined #ocaml
emmanuelux has quit [Quit: emmanuelux]