rwmjones changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/ | Grab Ocaml 3.10.1 from http://caml.inria.fr/ocaml/release.html (featuring new camlp4 and more!)
MarSch has quit ["Konversation terminated!"]
m3ga has joined #ocaml
postalchris has quit ["Leaving."]
bzzbzz has joined #ocaml
seafood_ has joined #ocaml
Snrrrub___ has joined #ocaml
Sparkles has quit ["leaving"]
Snrrrub__ has quit [Read error: 110 (Connection timed out)]
Snrrrub___ has quit ["Leaving"]
shortcircuit has quit [Connection timed out]
Morphous has joined #ocaml
kelaouchi has joined #ocaml
seafood_ has quit []
Amorphous has quit [Read error: 110 (Connection timed out)]
dramsay has joined #ocaml
m3ga has quit ["disappearing into the sunset"]
kelaouch1 has joined #ocaml
thermoplyae has quit ["daddy's in space"]
kelaouchi has quit [Read error: 110 (Connection timed out)]
kelaouchi has joined #ocaml
dramsay has left #ocaml []
kelaouch1 has quit [Read error: 110 (Connection timed out)]
m3ga has joined #ocaml
yminsky has quit []
m3ga_ has joined #ocaml
m3ga has quit [Read error: 104 (Connection reset by peer)]
m3ga_ has quit [Client Quit]
m3ga has joined #ocaml
Snrrrub has joined #ocaml
brian` has joined #ocaml
__suri has joined #ocaml
AxleLonghorn has joined #ocaml
AxleLonghorn has quit ["Leaving."]
AxleLonghorn has joined #ocaml
AxleLonghorn has quit [Read error: 110 (Connection timed out)]
m3ga has quit [Remote closed the connection]
tar_ has joined #ocaml
AxleLonghorn has joined #ocaml
<tar_> Does OCaml cache values of pure functions? Or unpure functions which rely on refs that haven't changed?
brian` has quit [Remote closed the connection]
brian` has joined #ocaml
<thelema> no, but it's pretty easy to momoize functions
<tar_> Thanks
m3ga has joined #ocaml
<tar_> Hey, that's great!
brian` has quit [Read error: 110 (Connection timed out)]
m3ga has quit [Remote closed the connection]
__suri has quit [Read error: 113 (No route to host)]
__suri has joined #ocaml
tar_ has quit [Remote closed the connection]
m3ga has joined #ocaml
m3ga has quit [Read error: 104 (Connection reset by peer)]
m3ga has joined #ocaml
__suri has quit [Read error: 104 (Connection reset by peer)]
__suri has joined #ocaml
Snrrrub has quit [Read error: 110 (Connection timed out)]
AxleLonghorn has left #ocaml []
middayc has quit [Read error: 110 (Connection timed out)]
seafood_ has joined #ocaml
jderque has joined #ocaml
ttamttam has joined #ocaml
Tetsuo has joined #ocaml
Snark has joined #ocaml
ttamttam has left #ocaml []
l_a_m has joined #ocaml
Morphous_ has joined #ocaml
mrsolo has joined #ocaml
thelema is now known as thelema|away
Morphous has quit [Read error: 110 (Connection timed out)]
ygrek has joined #ocaml
l_a_m has quit [Read error: 54 (Connection reset by peer)]
l_a_m has joined #ocaml
jderque has quit [Read error: 113 (No route to host)]
jderque has joined #ocaml
Yoric[DT] has joined #ocaml
middayc has joined #ocaml
<Yoric[DT]> hi
marmottine has joined #ocaml
seafood_ has quit []
bluestorm has joined #ocaml
Yoric[DT] has quit ["Ex-Chat"]
Morphous_ has quit ["shutdown"]
Amorphous has joined #ocaml
seafood_ has joined #ocaml
ita has joined #ocaml
pango has quit [Remote closed the connection]
pango has joined #ocaml
olleolleolle has joined #ocaml
ttamttam has joined #ocaml
jderque has quit [Read error: 113 (No route to host)]
olleolleolle has left #ocaml []
m3ga has quit ["disappearing into the sunset"]
jderque has joined #ocaml
ttamttam has left #ocaml []
Demitar has quit [Read error: 110 (Connection timed out)]
jderque has quit [Read error: 113 (No route to host)]
yminsky has joined #ocaml
brian` has joined #ocaml
bongy has joined #ocaml
jderque has joined #ocaml
middayc has quit []
bzzbzz has quit [Read error: 110 (Connection timed out)]
<brian`> @seen snrrrub
middayc has joined #ocaml
__suri has quit []
pango has quit [Remote closed the connection]
jlouis has joined #ocaml
ita has quit ["Hasta luego!"]
jlouis_ has quit [Read error: 110 (Connection timed out)]
seafood_ has quit []
marmottine has quit [Remote closed the connection]
marmottine has joined #ocaml
AxleLonghorn has joined #ocaml
jlouis_ has joined #ocaml
cheatersrealm has joined #ocaml
<cheatersrealm> has anyone had success with ocaide eclipse plugin, under ubuntu?
shortcircuit has joined #ocaml
thermoplyae has joined #ocaml
jlouis has quit [Read error: 110 (Connection timed out)]
shortcircuit has quit [Client Quit]
shortcircuit has joined #ocaml
love-pingoo has joined #ocaml
ttamttam has joined #ocaml
Snrrrub has joined #ocaml
<AxleLonghorn> I have not
<AxleLonghorn> unfortunately
<AxleLonghorn> are you getting the missing class error?
<bluestorm> do you have the good version of eclipse ?
<AxleLonghorn> there's a difference?
<AxleLonghorn> I just used the version in apt
<cheatersrealm> AxleLonghorn: yeah that's what I'm getting
<bluestorm> « OcaIDE needs a 1.5 or 1.6 Java Virtual Machine (from Sun: download the JRE here) and Eclipse 3.3 to work correctly. »
<bluestorm> you may have Eclipse 3.2
<cheatersrealm> bluestorm: you are correct.
<cheatersrealm> 3.2.2 is default in gutsy right now
<bluestorm> hm
<bluestorm> you might find a binary version of eclipse 3.3 somewhere
<cheatersrealm> perhaps there should be version checking against plugins
<bluestorm> (or in the backports maybe ?)
<cheatersrealm> yeah or I can compile it
<bluestorm> hm
<cheatersrealm> but that's a task for another day
<bluestorm> i wouldn't try :-'
<cheatersrealm> odds are I can find a binary package that will work
<cheatersrealm> but compiling on a quad core won't take very long.
<AxleLonghorn> can anyone find a link to a binary?
<bluestorm> hm
<bluestorm> google + "eclipse 3.3 binary"
<cheatersrealm> so do people actually use ocaml for general purpose programming?
<bluestorm> depends on what you call "general purpose"
<bluestorm> s/call/name/
<bluestorm> cheatersrealm: i use OCaml for fun
<bluestorm> is that general purpose enough ? :-'
<cheatersrealm> stuff that would normally be written in like java for instance
<cheatersrealm> bluestorm: hobby is not general purpose in my opinion
<cheatersrealm> I mean as an ML it's good for compilers, most definately
<bluestorm> and general formal language manipulations
<cheatersrealm> but I feel like there are easier languages for things like GUI, even though there is a TCL thing
<bluestorm> i'm not sure GUI is "general purpose"
<bluestorm> the problem with GUI in OCaml is the lack of supported librairies
<bluestorm> once you have a decent binding, OCaml is quite good at it
<bluestorm> you may want to look for example at lablgtk code
<bluestorm> it's not heavier than Python/GTK code
<bluestorm> (don't use Tk, use GTK)
<cheatersrealm> well I don't plan on doing any GUI stuff, I'm using ocaml for a class.
<cheatersrealm> anyhow, I gotta bounce.
<bluestorm> once you stripped away all the comments
<bluestorm> you've got a short and clear code
<cheatersrealm> true
<kig> is there a nice command line parsing lib that returns an ordered_hash or somesuch?
<bluestorm> ordered_hash ?
<kig> well, the data structure i'm thinking of would provide a way to iterate the parsed command line by order of appearance and by flag
<flux> kig, this is not what you're looking for, but have you taken a look at the Arg-module?
darinm has joined #ocaml
<kig> i mean, sometimes you want "convert -scale 400x400 foo.jpg -scale 100x100 foo_sm.jpg" mean a different thing from "convert -scale 400x400 -scale 100x100 foo.jpg foo_sm.jpg", but usually you just want to get the values to each flag and the filenames
<kig> flux: yes, that's why i'm asking :)
<flux> kig, how would the "ordere hash" be used? I'm thinking it would be quite difficult, if you have names associated with arguments, but they still have an order..
<flux> it usually goes either way: either you don't care about the location, or you handle the switches in the order as they appear
<flux> I think Arg is suitable for both kinds of uses
<kig> Cmdline.get parsed_cmdline flag_name -> array_of_values
<flux> it does however always go it in the proper order though.. and I'm not exactly happy with its imperative interface
<kig> Cmdline.get_at parsed_cmdline i -> (flag_name * array_of_values)
<kig> er, (flag_name * value)
<flux> also as the number of command line arguments is usually small, you don't even need an advanced data structure here.. (key * value) list should do
<kig> yep, it's just a matter of the interface
<kig> (started writing a simple clone of unix userland to learn ocaml)
<kig> cat (no cmdline flags) is: open Utils;; let _ = piping_command (output_channel stdout) (atail Sys.argv)
hsuh has joined #ocaml
Yoric[DT] has joined #ocaml
<AxleLonghorn> bluestorm: am I looking for the Eclipse SDK?
<bluestorm> i don't know, sorry
<bluestorm> i don't use eclipse
<AxleLonghorn> haha
<AxleLonghorn> ok
<bluestorm> emacs + tuareg is quite good for ocaml development
<AxleLonghorn> I've never used eclipse either
<bluestorm> (and there are good vim bindings too, if you are that kind of people)
darinm has quit []
<AxleLonghorn> thanks for the help though
<bluestorm> if you have no additional constraints, i'd advise you to try the emacs/vim mode before going the elephant route
pango has joined #ocaml
<Yoric[DT]> emacs+tuareg is nice
<bluestorm> Yoric[DT]: concerning the exception thing
<Yoric[DT]> Yeah ?
<bluestorm> i have the feeling that there was not enough experimentations in the polymorphic variants direction
* Yoric[DT] hasn't seen a "hm" so maybe there's nothing to be afraid of.
<Yoric[DT]> Frankly ?
<bluestorm> most ocaml coders dismissed it as a bit "complicated"
<Yoric[DT]> Me too, but I have the feeling that the missing experience on polymorphic variants is still years away.
<bluestorm> in my case, i see this as as "complicated" feature of OCaml because it's advanced, i have never really used it, and it look a bit tricky
<Yoric[DT]> (with or without polymorphic variants)
<Yoric[DT]> I've used it a bit to encode Peano's arithmetics in OCaml.
<Yoric[DT]> And a few times to provide error reporting, too.
<Yoric[DT]> And I was actually quite satisfied with them at the time.
<Yoric[DT]> Oh, and for phantom types a few times.
<bluestorm> in the exception case
<Yoric[DT]> But I still believe that I'm not experienced enough to use them daily (as I would if they were necessary for *every* error-handling).
<bluestorm> it seems to me that they could be used to provide "light" exception specification in each function
<bluestorm> something like var find : ('a -> bool) -> 'a list -> [ `Found of 'a | `Not_found ]
<bluestorm> (may not be the real syntax, though, but i think i've seen something like that)
<bluestorm> wich is quite nice compared to the need of a supplementary ADT declaration in most cases
<Yoric[DT]> Let's be clear on something: my first reflex when it came to exceptionless error-handling was tu use polymorphic variants.
<bluestorm> :p
<Yoric[DT]> Then the remarks regarding the use of polymorphic variants *as they are inferred by the compiler* + wildcards made me think twice about it.
<bluestorm> anyway this is a side question, as i guess the main ideas in your proposition could cope well with polymorphic variants
<Yoric[DT]> Indeed.
<Yoric[DT]> Well, perhaps not completely.
<bluestorm> in the context of interface-defined functions with closed polymorphic types, i'm not sure the inference problem is that much of a problem
<bluestorm> (but again i don't know those polymorphic variants enough)
<Yoric[DT]> -> [ `Found of 'a | `Not_found ] is much more lightweight than -> may_fail stuff.
<Yoric[DT]> And this may_fail, in turn, is necessary for monadic error management.
<Yoric[DT]> So if you want to write something like this, I guess this would be "take 3".
<Yoric[DT]> bluestorm: my problem there, is that usually, if you trust OCaml to generate your .mli, it gives you the right result. You may want something more specific, but it's usually the right result.
<Yoric[DT]> If you need to close polymorphic types yourself, well, it's not the right result anymore.
ttamttam has left #ocaml []
<bluestorm> as this specification is intended for interface-careful developpers, i'm not sure this is a real problem
<Yoric[DT]> Is it ?
ita has joined #ocaml
<bluestorm> i guess by the time a proposal is accepted, we'll have a rule-them-all decentralized VCS for every OCaml project out there, wich a nice standardized building framework, and free ice creams, and then it will just be a matter of "darcs push ... -p the-right-interface" :-'
<bluestorm> s/wich/with/
Snrrrub has quit [Read error: 110 (Connection timed out)]
thelema|away is now known as thelema
hsuh has quit [Remote closed the connection]
Demitar has joined #ocaml
AxleLonghorn has left #ocaml []
ttamttam has joined #ocaml
ttamttam has left #ocaml []
<Yoric[DT]> bluestorm: :)
<Yoric[DT]> Hopefully, it will be much faster.
<bla> Hm. What's the simpliest way to force a type of let expression?
<bla> I've seen here some nice approach once. But can't figure it out.
<bla> I'm looking where I've done a mistake so the type is wrongly inferred.
<bla> Ok, found mistake... /me was using mod_float as infix operator. Which inferred argument type to something taking mod_float as argument... Hm. ;-)
<bla> Nevertheless - is there a clean method? Or just placing in module and writting sig?
<thelema> bla: you can't really force a type for anything. What you can do is narrow a more general type to something more specific.
<thelema> ex: let f x y : float -> float -> int = x > y
Snark has quit ["Ex-Chat"]
Snrrrub has joined #ocaml
<bla> thelema, thanks.
<thelema> if you try to force a type that doesn't fit, the type checker will error your program out
<bluestorm> thelema:
<bluestorm> iirc it's let f (x : float) (y : float) : bool = x > y
<bluestorm> in your example, float -> float -> int would be the return type of the function
<thermoplyae> it's true, compare is the one that returns ints
ygrek has quit [Remote closed the connection]
<bluestorm> but even let compare x y : int -> int -> int = x - y wouldn't work
<pango> let f : float -> float -> bool = fun x y -> x > y is correct, though
jonathanv has joined #ocaml
<pango> in real life, annotating this function could only be useful to prevent it from being overly polymorphic... annotating either x or y would be enough for that purpose
<bluestorm> it sometimes help to annotate for debugging purposes
<bluestorm> "if it doesn't complain, then the typing is correct up to that piece of code"
* Yoric[DT] uses that quite often.
bongy has quit [Read error: 110 (Connection timed out)]
<thelema> wow, I botched things a lot. Thanks for the corrections.
bluestorm has quit ["Konversation terminated!"]
* thelema doesn't annotate types often
jonafan has quit [Read error: 110 (Connection timed out)]
hkBst has joined #ocaml
Snrrrub__ has joined #ocaml
thelema is now known as thelema|away
StoneNote has quit [Read error: 104 (Connection reset by peer)]
Snrrrub has quit [Read error: 110 (Connection timed out)]
postalchris has joined #ocaml
postalchris has quit [Client Quit]
Snrrrub__ is now known as Snrrrub
jlouis_ has quit [Read error: 110 (Connection timed out)]
m3ga has joined #ocaml
<Snrrrub> Does anyone know what the default behaviour is for the compare function of an Abstract_tag block?
<Snrrrub> Does it just take the defaults from Custom_tag?
<Snrrrub> I see. Thanks!
yminsky has quit [Read error: 104 (Connection reset by peer)]
yminsky has joined #ocaml
<schme> Hey hey. So I'm sitting here with my emacs and I find tuareg-mode and ocaml-mode. .. Is there any difference?
<flux> yes, tuareg-mode is nicer :)
<flux> it however uses stuff that comes with ocaml-mode, such as caml-types.el
<schme> Mmm. Seems I picked the right one then.
<schme> Oh so it's ocaml-mode++
<flux> (hit C-c C-t over a .ml compiled with -dannot and it'll tell you the type of the expression at point)
<schme> That sounds nice.. I guess ;)
<schme> I just started looking at ocaml today anyway.
<pango> In tuareg-mode, I remapped caml-help from C-c h to C-c C-h (C-c h being a prefix used by SCM -version control-, at least in emacs22)
<schme> hmmm..
<pango> (add-hook 'tuareg-mode-hook
<pango> (lambda ()
<pango> ... ;; work around conflict with VC/SCM
<pango> (define-key tuareg-mode-map [?\C-c ?h] nil)
<pango> (define-key tuareg-mode-map [\C-c ?\C-h] 'caml-help))
<flux> I thought C-c was the free keybinding reserved for the final user..
<schme> I don't seem to have any caml-help :)
<flux> (or prefix)
<schme> I think that is C-x.
<flux> C-x is used for lots of stuff
<pango> I don't know emacs policies, if such thing exists ;)
<schme> There is some policy regarding this actually..
* schme looksies.
<flux> I have some C-c bindings I haven't put there, though.. only a few.
<schme> Well I know I read some policy somewhere. Can't find it.
<schme> Not that it matters.
thelema|away has quit [Read error: 110 (Connection timed out)]
love-pingoo has quit ["Connection reset by pear"]
l_a_m has quit [Remote closed the connection]
Yoric[DT] has quit ["Ex-Chat"]
jlouis has joined #ocaml
jderque has quit [Read error: 113 (No route to host)]
ita has quit [Remote closed the connection]
Tetsuo has quit ["Leaving"]
bluestorm has joined #ocaml
thermoplyae has quit ["daddy's in space"]