mbishop changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/ | Grab OCaml 3.10.2 from http://caml.inria.fr/ocaml/release.html (featuring new camlp4 and more!)
mfp has quit [Read error: 110 (Connection timed out)]
mfp has joined #ocaml
seafood has joined #ocaml
orbitz has quit [Read error: 104 (Connection reset by peer)]
pango_ has quit [Remote closed the connection]
pango_ has joined #ocaml
robozni has joined #ocaml
Amorphous has quit [Read error: 110 (Connection timed out)]
Amorphous has joined #ocaml
Ched- has quit [Read error: 110 (Connection timed out)]
Ched- has joined #ocaml
nysin has joined #ocaml
seafood has quit [Read error: 110 (Connection timed out)]
LordMetroid has quit ["*dunk* ZzZzZz"]
sporkmonger has joined #ocaml
orbitz has joined #ocaml
marmottine has quit ["Quitte"]
netx has quit ["Leaving"]
netx has joined #ocaml
yziquel has quit [Remote closed the connection]
seafood has joined #ocaml
l_a_m has joined #ocaml
<palomer> hrmph
dibblego has quit ["Leaving"]
mattam has joined #ocaml
filp has joined #ocaml
<flux> jonafan, I think it should be possible to work around that:
<flux> class type foo = object method foo : 'a.'a -> 'a end
<flux> class virtual foobar = object method virtual f : foo end
ygrek has joined #ocaml
seafood has quit []
mfp has quit [leguin.freenode.net irc.freenode.net]
koobe has quit [leguin.freenode.net irc.freenode.net]
mbishop has quit [leguin.freenode.net irc.freenode.net]
r0bby has quit [leguin.freenode.net irc.freenode.net]
thelema has quit [leguin.freenode.net irc.freenode.net]
Oatschool has quit [leguin.freenode.net irc.freenode.net]
kAworu has quit [leguin.freenode.net irc.freenode.net]
ppsmimou has quit [leguin.freenode.net irc.freenode.net]
mfp has joined #ocaml
koobe has joined #ocaml
mbishop has joined #ocaml
kAworu has joined #ocaml
ppsmimou has joined #ocaml
thelema has joined #ocaml
Oatschool has joined #ocaml
mfp has quit [Read error: 104 (Connection reset by peer)]
mfp has joined #ocaml
Yoric[DT] has joined #ocaml
<Yoric[DT]> hi
mfp has quit [Read error: 110 (Connection timed out)]
hkBst has joined #ocaml
mlh_ has quit [Connection timed out]
seafood has joined #ocaml
mfp has joined #ocaml
<flux> hmph, I so hate accidentally committing too many files to svn, maybe one of these days the office will switch to git or something :)
seafood has quit [Read error: 110 (Connection timed out)]
<palomer> git?
<flux> hmm.. you don't know what git is?
seafood has joined #ocaml
<vixey> git's another svn/darcs/cvs clone
<flux> I'd rather day darcs/mercury/arch clone :)
<vixey> I've never suffered mercury or arch
<flux> hm, s/mercury/mercurial/
<flux> which vcs have you enjoyed then?
<vixey> none yet,
<flux> uhm, so new to programming then?
<flux> oh, right, you answered to the actual question :)
<palomer> I don't use vcs much, and I've been programming for ages
<palomer> then again, I've never coded in a team
* palomer is off
LordMetroid has joined #ocaml
mlh has joined #ocaml
<flux> vcs is nice to have even when programming solo
Snark_ has joined #ocaml
nysin has quit [Remote closed the connection]
Yoric[DT] has quit [Read error: 110 (Connection timed out)]
LordMetroid has quit ["Leaving"]
Linktim has joined #ocaml
Linktim_ has joined #ocaml
sporkmonger has quit []
Linktim has quit [Read error: 110 (Connection timed out)]
Linktim- has joined #ocaml
Yoric[DT] has joined #ocaml
OChameau has joined #ocaml
Linktim_ has quit [Read error: 110 (Connection timed out)]
Linktim- has quit [Read error: 110 (Connection timed out)]
sporkmonger has joined #ocaml
TychoBrahe has quit ["KVIrc 3.4.0 Virgo http://www.kvirc.net/"]
delamarche has joined #ocaml
<flux> hm, is there a good way to 'make depend' so that the dependant packages would also be accounted for?
<flux> often developing I can change a module I depend on, and essentially the recourse is to 'make clean'
<flux> while only a few modules actually depend on the foreign module
<tsuyoshi> are you usin omake?
<tsuyoshi> using
<flux> nope, plain make
<flux> omake can do that?
<flux> I would need to see through ocamlfind to put the dependencies there
<tsuyoshi> well, omake has way way better dependency trackin than makie
<tsuyoshi> than make
<flux> and it can see through ocamlfind packages?
<tsuyoshi> and it has special support for ocaml
<flux> obviously actual dependencies are constructed with ocamldep
<tsuyoshi> uhh.. you know, I think it does support ocamlfind packaes
<tsuyoshi> but not sure if it will detect new versions of packages
ygrek has quit [Remote closed the connection]
<tsuyoshi> if you want that though.. doin it with omake is definitely easier than make
<flux> well, if omake doesn't do that, I'm not sure it would be any easier that doing it with ocamldep
<flux> actuall ocamldep comes from ocamlfind, so it would be patching-ocamlfind-time
<flux> (well, it doesn't come from ocamlfind, but ocamlfind has support for it)
ygrek has joined #ocaml
<tsuyoshi> omake has its own internal ocamldep iirc
struk_atwork has joined #ocaml
Yoric[DT] has quit [Read error: 110 (Connection timed out)]
delamarche has quit []
bluestorm has joined #ocaml
asmanur has joined #ocaml
tty56 has joined #ocaml
asmanur has quit [Remote closed the connection]
nysin has joined #ocaml
<nysin> I want a polymorphic identity function factory (well, really I want something more complex but if I can't even get the type system to swallow this...) and I'm having trouble - see pastebin link for elaboration
<nysin> Is this possible?
<bluestorm> nysin:
<bluestorm> let id_factory () x = id x
<nysin> ah, thanks.
<bluestorm> (and don't complain this is hacky or painful : it is not a bug, and you could do bad things if this restriction was lifted)
<bluestorm> something like
<bluestorm> let id_factory () = let acc = ref None in fun x -> acc := Some x; x;;
<bluestorm> if this (id_factory ()) was typed 'a -> 'a, *bad things* could happen
<nysin> well yeah, I saw an example using refs elsewhere too
<bluestorm> ok
pango_ has quit [Remote closed the connection]
<bluestorm> i'm saying this because i thought it was an unnecessary redundancy for a long time :]
<nysin> I figured since I removed the only maybe-ref-like-thing in it (exception handling, which I don't know how is implemented)
<nysin> that that wasn't relevant to the typing
<nysin> Well I still don't entirely understand it so...
<bluestorm> the idea is that references should be weakly polymorphic
<bluestorm> let foo = ref None cannot be a ('a option ref)
<bluestorm> because if it were 'a, you could put anything, ie. Some 2 then Some "foo"
<bluestorm> (epic failure)
<nysin> yes there I agree
<bluestorm> so it is an ('_a option ref), wich means the type system don't know the type yet, but there is only one possible
<nysin> and that makes sense
<bluestorm> but you can hide those nasty references inside a partial application
<nysin> what I don't get is why that applies when there aren't refs
pango_ has joined #ocaml
<nysin> (IIRC there was some Java generics runtime failure mechanism related to the refs thing)
<nysin> (don't use Java, so never looked into it much)
<bluestorm> # let id_factory () = (fun x -> x);;
<bluestorm> val id_factory : unit -> 'a -> 'a = <fun>
<bluestorm> # let id_factory () = let acc = ref None in fun x -> acc := Some x; x;;
<bluestorm> val id_factory : unit -> 'a -> 'a = <fun>
<bluestorm> they are typed the same
<bluestorm> and the type system cannot make any difference between them
<bluestorm> if the first id_factory () was 'a -> 'a, then the second would be too
<nysin> ah, right
<bluestorm> the second *has* to be '_a -> '_a
<bluestorm> so the first is too
<nysin> alright, now I understand (I think)
<bluestorm> the idea is that when you write let id_factory () x = ...
<bluestorm> the second argument ensures that you haven't hidden any mutable state in the between
<bluestorm> with let id_factory () = .... , you can do whatever you want, and mess things up
struk_atwork has quit [Read error: 104 (Connection reset by peer)]
<nysin> # let id_factory () x = let acc = ref None in acc := Some x; x;;
<nysin> val id_factory : unit -> 'a -> 'a = <fun>
<nysin> # let a = id_factory ();;
<nysin> val a : '_a -> '_a = <fun>
<nysin> seems to have the same outcome though?
<nysin> in your example just now at least
<nysin> which seems to be the right thing, because it would seem to have exactly the same problems as the non-curried form
Axioplase has joined #ocaml
LordMetroid has joined #ocaml
<nysin> and in fact when I try in my original example:
<nysin> let id_factory () x = x;;
<nysin> let id_from_factory = id_factory ();;
pango_ has quit [Remote closed the connection]
<nysin> or ... () x = id x;;
<nysin> then I see the same issue. am I missing something obvious then?
pango_ has joined #ocaml
<bluestorm> no
<bluestorm> let id_factory () x = id x;;
<bluestorm> doesn't have the problem
<bluestorm> hmmm
<nysin> it does here
<bluestorm> seems it does :D
<nysin> So what else might work?
<nysin> It's in some sense nice actually that trivial-seeming differences in function definitions don't have surprising effects here at least :p
<bluestorm> hah
<bluestorm> i get id
<bluestorm> -d+t
<nysin> which isn't the issue here (I think?)
<bluestorm> the beta-expansion should not take place at definition location, but at use location
<bluestorm> instead of
<bluestorm> let foo = id_factory ();;
<bluestorm> use
<bluestorm> let foo x = id_factory () x;;
<bluestorm> let id_factory () = id;;
<bluestorm> let foo x = id_factory () x;;
<bluestorm> works fine
<nysin> it's been a while since I've done stuff with alpha/beta/eta expansions/reductions so I'll look that up too (don't remember it very well) but at least yes, this does work
<bluestorm> hum
<bluestorm> beta-expansion only means "add an parameter to each sides" here, nothing lambdious
<Axioplase> bluestorm: that's "eta expansion", not "beta expansion"
<bluestorm> hmm
<bluestorm> you must be right
* bluestorm apologies
<Axioplase> :)
<bluestorm> actually, i'm manipulating recursive datatypes and fold/unfold at the same time, doesn't really help my crap-saying symptoms
<nysin> hm, this appears to be an application of the FAQ on eta expansion you linked, even
filp has quit ["Bye"]
<nysin> Is there an intuition behind "results from application are weakly polymorph" though?
<nysin> it seems separate, I'd think, from the ref stuff
<nysin> (an aside, that answer needs a bit of native English editing...)
struk_atwork has joined #ocaml
<nysin> "This conversion is only valid if bottom and \ x . bottom are equivalent in all contexts. They are certainly equivalent when applied to some argument - they both fail to terminate. If we are allowed to force the evaluation of an expression in any other way, e.g. using seq in Miranda or returning a function as the overall result of a program, then bottom and \ x . bottom will not be equivalent. " maybe
<nysin> since the last part is true in O'Caml
<bluestorm> hmm
<nysin> or well returning blahblah
<bluestorm> beware of the haskellish considerations
<nysin> Yes I found that page on the Haskell wiki
<nysin> they like point-free programming :p
<bluestorm> in ocaml it's directly related to mutable data structures, and i'm not sure it is equivalent to the monomorphism restriction
<bluestorm> even if the effects are actually the same
<bluestorm> i mean
<bluestorm> "bottom" is a lazy language consideration
<nysin> O'Caml has delay & promise in some form I thought
<bluestorm> yes but i think it's not that way
<bluestorm> the link between "lazy things" on one hand and "mutable things" on the other hand
<nysin> ah
<bluestorm> may be that "lazy things" imply "thunks" that are (silently) mutated, then having some common points with "mutable things"
<bluestorm> but this is pure guesswork, i haven't looked at that
<nysin> It seems like O'Caml has that anyway too, in streams
<nysin> so it would have a superset of Haskellish concerns
<nysin> or a largely-overlapping set at least
<bluestorm> anyway, there are two theoretic problem, wich i'm not sure are the same (the haskell downsides of removing the monomorphism restriction would be to re-evaluate more values iirc), but have the same consequences on the typing system
<bluestorm> nysin: if the problem was only lazyness-related, you would only encouter it when using lazy values inside ocaml, ie. the "lazy" keyword and the Lazy module
<bluestorm> wich is not the case
ygrek has quit [Remote closed the connection]
ygrek has joined #ocaml
seafood has quit []
jeremiah has quit [Read error: 104 (Connection reset by peer)]
Snrrrub has joined #ocaml
vbmithr has joined #ocaml
thelema has quit [Read error: 110 (Connection timed out)]
Linktim has joined #ocaml
OChameau has quit ["Leaving"]
jeremiah has joined #ocaml
Yoric[DT] has joined #ocaml
postalchris has joined #ocaml
drewism_ has joined #ocaml
drewism_ has quit [Client Quit]
Linktim_ has joined #ocaml
Linktim has quit [Read error: 110 (Connection timed out)]
ygrek has quit [Remote closed the connection]
ygrek has joined #ocaml
psnively has joined #ocaml
psnively has quit [Client Quit]
Yoric[DT] has quit ["Ex-Chat"]
nysin has quit ["Leaving"]
RobertFischer has joined #ocaml
lordmetroid_ has joined #ocaml
Yoric[DT] has joined #ocaml
LordMetroid has quit [Connection timed out]
<flux> hmh, I'd really like to see a Map with many of Set's functions for keys: min_elt, max_elt, split, choose, ..
<Yoric[DT]> hi
<Yoric[DT]> Well, I guess I could write something such for Batteries => ExtLib.
<flux> it seems so wasteful to have both Set and Map when they could conceivably be implemented with the same source (of Map). infact Set would then just be a special case of Map. well, almost
<flux> that would be nice
<flux> nice, map.ml is only 200 lines long
lordmetroid__ has joined #ocaml
<flux> argh, it actually has function "min_binding" but it's not exposed :)
<flux> one trick I've used with sets has been making a set of (a * b), and if I know the lower bound of b, I can just do Set.split (a, lower_bound) to find the association
<flux> yoric[dt], would taking the map.ml from the standard library the be the base be ok license-wise?
<Yoric[DT]> Normally, everything is LGPL+linking exception.
<flux> and that's what the std lib is too?
<flux> apparently yes
<flux> I guess it should be a small task to implement that then
thelema has joined #ocaml
<Yoric[DT]> If you want to write that, feel free, too :)
<flux> ;-)
lordmetroid__ has quit ["Leaving"]
Linktim_ has quit [Read error: 104 (Connection reset by peer)]
lordmetroid_ has quit [Connection timed out]
Linktim_ has joined #ocaml
ofaurax has joined #ocaml
Linktim_ has quit [Remote closed the connection]
Snark_ has quit ["Ex-Chat"]
<flux> I'm done. Perhaps I should do some testing..
<flux> uh, why would "choose" use "min_elt" instead of using the root.. I suppose they've wanted to give the guarantee that the order of 'choose' will be the same if the trees (logically) are
tty56_ has joined #ocaml
<flux> I wonder if that guarantee is worth the log n ;)
<flux> I would like to think the name 'choose' would just do that, choose an arbitrary element, and might not be repeatable if the tree was constructed in another fashion
<pango_> I guess many algorithms that use 'choose' build the new set without the returned element, to handle all elements recursively...
Snrrrub has quit []
sporkmonger has quit []
<pango_> removing the root each time may require more rebalancing?
<bluestorm> wouldn't a fold be better to handle all the elements ?
<flux> pango_, I think it might not
<flux> bluestorm, well, if you sometimes need to stop the processing early
<bluestorm> (the docs says that " equal elements will be chosen for equal sets.")
Axioplase has quit [Read error: 110 (Connection timed out)]
<pango_> for what definition of equal anyway
<flux> pango_, balancing is performed if the branches differ more than 2 in height
<flux> I think for compare a b = 0
<bluestorm> pango_: Set.S.Equal ?
<bluestorm> .equal, sorry
<bluestorm> « equal s1 s2 tests whether the sets s1 and s2 are equal, that is, contain equal elements. »
<bluestorm> so this is logical equality
<pango_> then flux analysis may be correct, they chose that algorithm to satisfy this condition
tty56 has quit [Read error: 110 (Connection timed out)]
<flux> anyway, here is the map with a few set-operations: min_elt, max_elt, choose, split - http://www.modeemi.fi/~flux/software/darcs/map-set
<flux> tested it out and gave a new glance to the modifications, it looks ok ;) (the set and map appear to use the same kind of code; boo, no code sharing! ;-))
r0bby has joined #ocaml
<flux> I'm hoping the CVS version of map hasn't been much in the flux, I just happened to have one around from my last godi installation.. but I guess they've been quite stable, as most of the standard library has been.
sporkmonger has joined #ocaml
filp has joined #ocaml
<flux> for extlib it's missing the exceptionless interface
<flux> and perhaps the rest of the set functions could be added too
<flux> atleast the ones that cannot be implemented efficiently without seecret access
<flux> (it would be the union/subset functions)
delamarche has joined #ocaml
delamarche has quit []
Axioplase has joined #ocaml
det has quit [Read error: 104 (Connection reset by peer)]
det has joined #ocaml
<Yoric[DT]> Okay, testsuite passed.
<Yoric[DT]> That's a big yeaaah.
<Yoric[DT]> (despite the fact that the testsuite is so small)
tty56_ has quit []
ygrek has quit [Remote closed the connection]
Ched- has quit [Remote closed the connection]
sporkmonger has quit [Read error: 110 (Connection timed out)]
jlouis has joined #ocaml
jdev has quit [Read error: 104 (Connection reset by peer)]
jdev has joined #ocaml
filp has quit ["Bye"]
<palomer> erm
<palomer> (1,(2,3)) has type (int*int*int)
<palomer> how do I get a term of type (int*(int*int)) ?
<jlouis> # (1, (2,3));;
<jlouis> - : int * (int * int) = (1, (2, 3))
<jlouis> huh?
<palomer> my bad!
ofaurax has quit ["Leaving"]
bluestorm has quit ["Konversation terminated!"]
vpalle has joined #ocaml
RobertFischer has left #ocaml []
l_a_m has quit [Remote closed the connection]
sporkmonger has joined #ocaml
vpalle_ has joined #ocaml
hoelzro has joined #ocaml
<hoelzro> hello, is there a setenv() function in Ocaml?
vpalle has quit [Read error: 110 (Connection timed out)]
<det> Unix.putenv
<hoelzro> thanks
hoelzro has left #ocaml []
vpalle_ has quit ["Leaving"]
Yoric[DT] has quit ["Ex-Chat"]
vbmithr has quit ["Zz"]
davidrichards has joined #ocaml
<davidrichards> hey everyone, I am new to OCaml, and wanted to noodle around a bit with it today.
<davidrichards> But, funny thing, I couldn't find a way to get Euler's constant (e) in OCaml.
<davidrichards> Any suggestions?
<davidrichards> Does anyone see this post? I'm not seeing anything (own posts, or any other posts)
Axioplase has quit ["leaving"]
<davidrichards> .
<davidrichards> Is anyone here?
davidrichards has left #ocaml []
davidrichards has joined #ocaml
davidrichards has left #ocaml []
hkBst has quit ["Konversation terminated!"]