flux changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/ | 3.11.0 out now! Get yours from http://caml.inria.fr/ocaml/release.html
Camarade_Tux_ has quit ["Leaving"]
animist has joined #ocaml
animist has quit [Remote closed the connection]
verte has quit ["http://coyotos.org/"]
Yoric[DT] has quit ["Ex-Chat"]
jeanb-- has joined #ocaml
jeanbon has quit [Nick collision from services.]
jeanb-- is now known as jeanbon
mwhitney__ has quit [Read error: 110 (Connection timed out)]
mwhitney__ has joined #ocaml
slash_ has quit ["leaving"]
bluestorm has quit [Remote closed the connection]
Associat0r has quit []
<palomer> what's the third kind?
<Alpounet> is it ironical, palomer ?
<Alpounet> Has anyone read "The Society of Mind", by Minsky ?
<palomer> more funny than ironic, methinks
verte has joined #ocaml
seafood has quit []
verte_ has joined #ocaml
jeanbon has quit [Read error: 113 (No route to host)]
verte has quit [Nick collision from services.]
verte_ is now known as verte
seafood has joined #ocaml
animist has joined #ocaml
seafood_ has joined #ocaml
animist has quit [Remote closed the connection]
seafood has quit [Read error: 110 (Connection timed out)]
Ched has quit [Remote closed the connection]
seafood has joined #ocaml
jeddhaberstro has joined #ocaml
seafood has quit []
seafood has joined #ocaml
seafood_ has quit [Read error: 110 (Connection timed out)]
smimou has quit [Read error: 104 (Connection reset by peer)]
smimou has joined #ocaml
seafood has quit []
jeddhaberstro has quit []
animist has joined #ocaml
animist has quit [Read error: 60 (Operation timed out)]
seafood has joined #ocaml
seafood has quit []
jonafan_ has joined #ocaml
<jonafan_> is there a way to compile with ocamlopt on windows?
<Alpounet> yeah
<Alpounet> the same way than anywhere else ocamlopt has been ported to
<jonafan_> i think you've oversimplified things a bit
<Alpounet> just call it naturally
<Alpounet> ocamlopt -o my_binary binary.ml
<jonafan_> ** Fatal error: cannot find file "libws2_32"
<jonafan_> File "caml_startup", line 1, characters 0-1:
<jonafan_> Error: Error during linking
<Alpounet> what's your compile command ?
<Alpounet> how do you have installed OCaml ?
<Alpounet> btw, libws2_32 is winsock lib, right ?
<jonafan_> i guess?
<jonafan_> ocamlopt -o test iamdumb.ml is the command
<Alpounet> is there some network stuffs ?
<Alpounet> oh
<jonafan_> i installed the mingw version of caml
<Alpounet> do you have mingw in path ?
<jonafan_> yes
<jonafan_> you also have to install flexlinker
<jonafan_> wait i have an idea
<jonafan_> AH HAh
<jonafan_> FLEXLINKFLAGS="-nocygpath -L C:\MinGW\lib"
<jonafan_> i have no idea what it is, but i found it on a blog, and it makes ocamlopt works
<jonafan_> *work
ygrek has joined #ocaml
genericplayer has quit ["Leaving"]
jonafan_ has quit ["XCHAT NEGROS"]
animist has joined #ocaml
animist has quit [Remote closed the connection]
burton_ has left #ocaml []
Alpounet has quit [Read error: 110 (Connection timed out)]
mwhitney__ has quit [Read error: 104 (Connection reset by peer)]
mwhitney__ has joined #ocaml
animist has joined #ocaml
Snark has joined #ocaml
animist has quit [Remote closed the connection]
pierre_m has joined #ocaml
animist has joined #ocaml
animist has quit [Remote closed the connection]
jeffrey_ has joined #ocaml
ryan_xffff has joined #ocaml
jeffrey_ has quit ["leaving"]
animist has joined #ocaml
animist has quit [Read error: 60 (Operation timed out)]
haveo__ has joined #ocaml
haveo__ is now known as haveo
haveo is now known as havo
havo is now known as haveo
mwhitney__ has quit [Read error: 104 (Connection reset by peer)]
mwhitney__ has joined #ocaml
jsk has joined #ocaml
Ched has joined #ocaml
ryan_xffff has left #ocaml []
jeanbon has joined #ocaml
mwhitney__ has quit [Read error: 110 (Connection timed out)]
mwhitney__ has joined #ocaml
haveo has quit ["http://www.mibbit.com ajax IRC Client"]
sparta has joined #ocaml
mwhitney__ has quit [Read error: 60 (Operation timed out)]
Camarade_Tux has joined #ocaml
seafood has joined #ocaml
ttamttam has joined #ocaml
ttamttam has left #ocaml []
jeanbon has quit [Read error: 113 (No route to host)]
jeanbon has joined #ocaml
mwhitney__ has joined #ocaml
mwhitney__ has quit [Read error: 110 (Connection timed out)]
animist has joined #ocaml
animist has quit [Remote closed the connection]
animist has joined #ocaml
bluestorm has joined #ocaml
jonafan_ has joined #ocaml
jonafan has quit [Read error: 110 (Connection timed out)]
mwhitney__ has joined #ocaml
Yoric[DT] has joined #ocaml
seafood has quit []
bluestorm has quit [Remote closed the connection]
mwhitney__ has quit [Read error: 110 (Connection timed out)]
schme is now known as schmx
mwhitney__ has joined #ocaml
<flux> wish people put the automatically generated documentation to the 'documentation' tab of ocaml forge
catface has joined #ocaml
mwhitney__ has quit [Read error: 60 (Operation timed out)]
mwhitney__ has joined #ocaml
verte has quit ["http://coyotos.org/"]
jeanbon has quit ["J'y trouve un goût d'pomme."]
jeanbon has joined #ocaml
mwhitney__ has quit [Read error: 110 (Connection timed out)]
sparta has quit [Read error: 113 (No route to host)]
sparta has joined #ocaml
mwhitney__ has joined #ocaml
maxibolt has joined #ocaml
<maxibolt> hello
<maxibolt> does anybody know a profiling tool for caml light ?
pierre_m has left #ocaml []
<thelema_> maxibolt: why are you using caml light?
mwhitney__ has quit [Read error: 110 (Connection timed out)]
<maxibolt> thelema: i have no choice
<maxibolt> it s for my studies
<maxibolt> buit after i witch to ocaml
<maxibolt> switch*
mwhitney__ has joined #ocaml
<thelema_> okay, I guess...
<thelema_> I don't know about profilers for caml light
<thelema_> I imagine you could easily test runtime by something like:
<Camarade_Tux> you might just adapt your program to ocaml, profile it and backport the changes
<Camarade_Tux> btw, see "How hard is it to convert code from Caml Light to Objective Caml?" at http://caml.inria.fr/pub/old_caml_site/ocaml/bigpicture.html
<thelema_> let time_f f x = (f x; Sys.time()) -. (Sys.time())
mwhitney__ has quit [Read error: 110 (Connection timed out)]
Ched has quit ["Ex-Chat"]
Ched has joined #ocaml
Amorphous has quit [Read error: 104 (Connection reset by peer)]
sparta has quit [Remote closed the connection]
maxibolt has quit ["Miranda IM! Smaller, Faster, Easier. http://miranda-im.org"]
xian has quit ["Reconnecting"]
xian has joined #ocaml
Camarade_Tux has quit ["Leaving"]
mwhitney__ has joined #ocaml
<palomer> hrmph
<palomer> how do I do "constraint 'a = #(foo bar)" ?
<palomer> where bar is a parametric class
<mfp> constraint 'a = foo #bar
<mfp> # class ['a] foo (x : 'a) = object method foo = x end;;
<mfp> class ['a] foo : 'a -> object method foo : 'a end
<mfp> # type 'a t = 'a constraint 'a = int #foo;;
<mfp> type 'a t = 'a constraint 'a = int #foo
<mfp> # (object method foo = "a" end : _ t);; Error: This expression has type < foo : string > but is here used with type int #foo t Types for method foo are incompatible
Amorphous has joined #ocaml
<mfp> palomer: do constraints really simplify the type errors you expect?
<mfp> I mean, relative to just annotating function args
<mfp> (x : _ int_foo) vs. (x : int #foo)
<palomer> ahh, gotcha
<palomer> mfp, not at all
<palomer> I wish I knew a way of simplifying type errors
<palomer> I think constraint is to constrain the parametric argument of classes
<palomer> but I'm not sure
<palomer> I think class foo : bar = ... simplifies type errors
<palomer> sometimes
<mfp> the syntax for class parameter constraints is class ['a] foo = object constraint 'a = whatever ... end
<mfp> in general, you constrain a type variable, no matter where it comes from, polymorphic type or parameter class
<palomer> you can also constrain the class itself
<palomer> class foo = object constrain foo = #bar end
<palomer> and you can also do it with self
<palomer> class foo = object(_:'self) constraint 'self = #bar end
<palomer> I think there are differences between those 2 approaches
<mfp> in the former, it sort of acts as a type variable, doesn't it? (since there's an implicit row variable)
<mfp> the latter is just another type variable which happens to be a self type
<mfp> the error you get with constraint foo = #bar is less informative than that with inherit bar
<mfp> Error: The abbreviation foo expands to type < > but is used with type #bar vs. Error: This class should be virtual. The following methods are undefined : foo
jeremiah has quit [Read error: 104 (Connection reset by peer)]
Mr_Awesome has quit [Read error: 110 (Connection timed out)]
Mr_Awesome has joined #ocaml
ttamttam has joined #ocaml
mwhitney__ has quit [Read error: 110 (Connection timed out)]
mwhitney__ has joined #ocaml
jeremiah has joined #ocaml
mwhitney__ has quit [Read error: 104 (Connection reset by peer)]
mwhitney__ has joined #ocaml
mwhitney__ has quit [Read error: 60 (Operation timed out)]
mwhitney__ has joined #ocaml
<palomer> http://pastebin.com/m48b4b856 <--how do I do something like this?
<palomer> (gives me an error)
<mfp> palomer: module Dud : Dummy with type t = int
Snark has quit ["Ex-Chat"]
<palomer> thx
rwmjones has quit [Read error: 60 (Operation timed out)]
kelaouchi has quit ["Lost terminal"]
<mattam> ocaml cannot handle second-order abstraction in type defs right? Or is it possible to define something like this: type ('a,'m) t = { foo : ('a) 'm }
kelaouchi has joined #ocaml
<mrvn> What is ('a) 'm supposed to be?
<mattam> Application of the type constructor 'm to 'a.
<mattam> Actually, I found it is forbidden by the grammar itself.
<mattam> Only named type constructors are allowed.
<mrvn> like ('a, Hashtbl.t) t = { foo : 'a Hashtbl.t }?
<mattam> Yep.
<mrvn> I would think a functor could do that
<mattam> Yep. But I tried to avoid that precisely.
<mrvn> Why do you need 'a 'm? Why not just call it 'a?
<mattam> Is there an existing monad/monad-transformer library in OCaml?
<mattam> mrvn: the actual type is much more complicated.
<mrvn> Maybe you can use type ('a, 'b) t = { foo : 'a } with some constraint that 'b = 'a 'm
<mattam> Nope: ['a 'm] is just wrong syntaxically.
<mrvn> I'm not saying write 'a 'm. But some constraint that will have the same effect
<mattam> My guess is that it is not supported at all, and probably for a good theoretical or practical reason, I just couldn't find it yet :)
mwhitney__ has quit [Read error: 110 (Connection timed out)]
<mrvn> well, a functor supports it.
<mattam> It's not exactly the same if you have to instantiate statically.
<mrvn> no it isn't.
<palomer> http://pastebin.com/mab54931 <--why won't ocaml generalize my type variables?
<mattam> I may content myself with functors though :)
<palomer> the mtl!
<mrvn> palomer: because methods are class polymorphic.
<palomer> mrvn, what does that mean?
<mrvn> palomer: what is the source?
<palomer> really big
<palomer> here:
<palomer> the ... is huge
<mattam> palomer: mtl in OCaml?
<mrvn> # class ['a] foo (x : 'a) = object end;;
<mrvn> class ['a] foo : 'a -> object end
<mrvn> palomer: I would have said you need to specify the polymorphic types like you did.
jado has joined #ocaml
<jado> is it possible to create a postfix operator in ocaml to define something like i++ ?
<palomer> mattam, mattam don't know if it exists
<mrvn> palomer: beats me why it doesn't work for you.
<palomer> creating a test case
<palomer> one sec
<mrvn> jado: I don't see any postfix symbols in the grammar.
<jado> ok thanks
<mrvn> # let (++) x = x+1;;
<mrvn> # 1++;;
<mrvn> Error: Syntax error
<mrvn> # ++1;;
<mrvn> Error: Syntax error
<mrvn> # 1++1;;
<mrvn> Error: This function is applied to too many arguments,
<mrvn> maybe you forgot a `;'
<mrvn> And no unary infix operators.
<mrvn> # (++) 1;;
<mrvn> - : int = 2
<jado> only infix for two so
chahibi has quit ["Leaving"]
<mrvn> # let (++) x () = x + 1;;
<mrvn> # 1++();;
<mrvn> - : int = 2
<mrvn> Actually: let (++) x () = x
<jado> ^^
<palomer> http://pastebin.com/m39465a26 <--my test case
<mrvn> jado: or let (++) x () = let t = x in incr x; t
<jado> yes ok
<jado> thanks
<mrvn> let (++) x () = let t = !x in incr x; t
<mrvn> # let x = ref 0;;
<mrvn> val x : int ref = {contents = 0}
<mrvn> # x++();;
<mrvn> - : int = 0
<mrvn> # x;;
<mrvn> - : int ref = {contents = 1}
<palomer> damn you ocaml, generalize!
<mrvn> jado: Not sure what you want with x++ though. It only makes sense for references and mutables.
<jado> actually it was just by curiosity that i wanted to know if postfix operators could be defined ; but i don't really need them
<mrvn> palomer: is one of the initializers calling a not fully polymorphic function on the 'a and thereby fixing the 'a to '_a?
<mrvn> jado: then no. :)
<mrvn> infix with () is the best I can think of to emulate it.
<jado> ok
<palomer> http://pastebin.com/m3208be10 <--simpler, with an error message
<palomer> not fully polymorphic?
<palomer> actually
<palomer> it's possible that embedded_col_pred isn't polymorphic
<palomer> is that the case?
<mrvn> palomer: Sometimes you can have a polymorphic function but when you use it with a specific type it gets stuck with that type.
<palomer> but here it gets stuck with '_a
<palomer> I have no idea where it popped up
<mrvn> palomer: which is a specific (but unknown so far) type.
<palomer> right
<mrvn> palomer: maybe model#set" needs to be 'a. 'b -> 'c-> 'a -> unit
<mrvn> or your create_completion
<mrvn> Actualy I think you can't use let embedded_cols = new GTree.column_list
<palomer> hmm?
<palomer> why not
<mrvn> that is an 'a GTree.something, right?
<palomer> right
<mrvn> once you use it the 'a gets fixed to a specific type.
<palomer> lemme check
<mrvn> You can't use the same embedded_cols for an int GTree.something and float GTree.something (or whatever the 'a are).
<palomer> column_list is not polymorphic
<palomer> method set : 'a. row:Gtk.tree_iter -> column:'a column -> 'a -> unit <--but model#set looks suspicious
<palomer> I don't see how that fixes the variable, though
<mrvn> palomer: no, the 'a. makes it polymorphic.
<palomer> so the problem is not with set?
<mrvn> shouldn't be.
<palomer> removing the call to set fixes the problem
<palomer> hah
<palomer> found the problem
<palomer> let embedded_cols = new GTree.column_list
<palomer> let embedded_col_pred = embedded_cols#add (Gobject.Data.caml : ('a ) Gobject.data_conv)
<palomer> that code gives me the same error
<palomer> but ocaml waits until later to give me the error
* palomer kicks ocaml
<palomer> method add : 'a. 'a Gobject.data_conv -> 'a column
<palomer> for some reason that fixes 'a
<mrvn> embedded_col_pred needs a 'a.
<mrvn> let embedded_col_pred : 'a. 'a -> unit = embedded_cols#add (Gobject.Data.caml : ('a list) Gobject.data_conv) ?
<mrvn> palomer: The error goes away when you inline the #add call, right=
<mrvn> ?
<palomer> inline?
<palomer> if I put all the code in my class the error goes away
<palomer> is that what you mean by inline?
<palomer> how do I tell ocaml that I want a type variable to remain fully general?
<thelema_> palomer: you can't insist that - if it's used in any non-fully-general way, you'll get a type restriction.
ttamttam has left #ocaml []
jeanb-- has joined #ocaml
jeanbon has quit [Nick collision from services.]
jeanb-- is now known as jeanbon
slash_ has joined #ocaml
<palomer> bummer
AxleLonghorn has joined #ocaml
AxleLonghorn has left #ocaml []
AxleLonghorn has joined #ocaml
Associat0r has joined #ocaml
<hcarty> jado: pa-do allows one to define postfix operators (among many other things).
<jado> ok hcarty thanks
<hcarty> Yoric[DT]: Should Array.(make|init|get|set) be allowed to throw exceptions in the Array.Exceptionless module?
Associat0r has quit []
oriba has joined #ocaml
<hcarty> Also, Jérémie Dimino++ for the Batteries.Print module and related syntax. That thing is downright nifty.
ygrek has quit [Remote closed the connection]
<palomer> does ocaml have higher order signatures?
<flux> palomer, signatures are about the same as module types, and those can be higher order
schmx has quit [calvino.freenode.net irc.freenode.net]
mttobks has quit [calvino.freenode.net irc.freenode.net]
mishok13 has quit [calvino.freenode.net irc.freenode.net]
l_a_m has quit [calvino.freenode.net irc.freenode.net]
l_a_m has joined #ocaml
schmx has joined #ocaml
mishok13 has joined #ocaml
oriba has left #ocaml []
<mrvn> palomer: isn't a functor a higher order signature?
<palomer> I thought a functor has a higher order module
<palomer> hrmph
<mrvn> palomer: and what is the difference between a module and a signature?
<palomer> how can I tell ocamlfind NOT to export some modules?
<palomer> mrvn, a signature is about the same as a module type
<palomer> (according to flux, 5 lines up)
<mrvn> # module M = struct type t = int end;;
<mrvn> module M : sig type t = int end
<mrvn> You could say a module is a signature + the code for it.
<AxleLonghorn> as far as I understand it, a module is like a function, the signature is like the type of the function
<palomer> err, that's one way of looking at it
<mrvn> and a functor is sig -> sig
<AxleLonghorn> is it possible to write a functor that takes a functor as argument?
<mrvn> AxleLonghorn: I din't see why not. You just have to write the right module type for it.
<AxleLonghorn> I don't know how to do so
<hcarty> AxleLonghorn: Higher order functors are supported
<palomer> do you have functors that take functors that take functors?
<hcarty> I imagine you could go as deep with nesting as you want
<AxleLonghorn> hcarty: how do you write one?
<mrvn> module type M = sig type t end
<mrvn> module F = functor (M:M) -> struct type t = M.t end
<mrvn> module type M2 = functor (M : M) -> sig type t = M.t end
<mrvn> module F2 = functor (M2:M2) -> functor (M:M) -> struct module Mx = M2(M) end;;
<mrvn> module F2 :
<mrvn> functor (M2 : M2) ->
<mrvn> functor (M : M) -> sig module Mx : sig type t = M.t end end
<palomer> hrmph, I have a program with a file called Utilities.ml, and I installed a package with ocamlfind which has a file Utilities.cmi so they conflict
<palomer> how do I fix this?
* palomer doesn't understand why they conflict though
<palomer> maybe I should write a test case
<mrvn> doesn't the package have a common namespace where all its files are?
<mrvn> like Foo.Utilities.bla?
<palomer> ohhh, that would be a good idea
<thelema_> mrvn: most don't
<palomer> but they should!
<palomer> that way you won't get any conflicts
<mrvn> Then they should not have a name like Utilities
<palomer> right?
<palomer> so I should only export a single cmi, right?
<palomer> but the conflict is coming from the installed package
<palomer> that's the weird part
<palomer> The files Utilities.cmi and /usr/local/lib/ocaml/3.10.2/oset/Oset.cmi
<palomer> make inconsistent assumptions over interface Utilities
<palomer> (even when I add a toplevel module)
<thelema_> rename your module
<palomer> Utitilies.ml ?
<palomer> but there will always be potential name conflicts
<palomer> I have a module called gui
<palomer> that's pretty common too
* thelema_ mumbles something about bad naming
jeanb-- has joined #ocaml
jeanbon has quit [Nick collision from services.]
jeanb-- is now known as jeanbon
<palomer> better to prepend every module name with the name of the package?
<thelema_> palomer: that would eliminate these conflicts
<thelema_> there's a big cost to packed libraries - the entire library gets compiled in to anything that uses a part of it
seafood has joined #ocaml
<palomer> thelema_, I don't mind that so much
<palomer> I'm writing a gui toolkit
<palomer> ok, I have a test case!
<palomer> hrmph, better zip this stuff
<palomer> unzip, go into the findlib directory, do make install, go into the omake directory, type make
<palomer> and then you get the error
det has quit [calvino.freenode.net irc.freenode.net]
bartiosze has quit [calvino.freenode.net irc.freenode.net]
sbok has quit [calvino.freenode.net irc.freenode.net]
tab has quit [calvino.freenode.net irc.freenode.net]
det has joined #ocaml
sbok has joined #ocaml
bartiosze has joined #ocaml
tab has joined #ocaml
<palomer> plenty of packages have common module names
<palomer> things like "xml"
jeanbon has quit [Read error: 113 (No route to host)]
sbok has quit [Remote closed the connection]
jeanbon has joined #ocaml
tab__ has joined #ocaml
tab has quit [Remote closed the connection]
sbok has joined #ocaml
komar_ has joined #ocaml
<mrvn> Be prepend do you mean Foo_Utilities or Foo.Utilities?
<palomer> mrvn, Foo_Utitilies
<palomer> Foo.utilities doesn't fix anything
<palomer> there, the full test case with files
<palomer> I find this state of affairs rather disturbing
<palomer> looks like I'm going to have to preppend an O to all my files
<palomer> yuck.
<Yoric[DT]> hcarty: I believe that it should be allowed to raise Invalid_arg exceptions.
det has quit [Connection timed out]
<hcarty> Yoric[DT]: Ok, cool
<Yoric[DT]> The rationale being that Invalid_arg is not actually an *exception*, it's more an *error*.
<hcarty> That makes sense
<hcarty> Should List's hd, tl, first, last be added to Exceptionless?
<hcarty> Also nth, reduce, min, max
<hcarty> If not, then perhaps I should remove them from Seq.Exceptionless
jado has quit [Remote closed the connection]
_zack has joined #ocaml
jsk has quit ["Leaving."]
<mrvn> palomer: your testcase doesn't have Test.Foo, only Foo.
det has joined #ocaml
infoe|wk has quit [Read error: 60 (Operation timed out)]
_zack has quit ["Leaving."]
komar_ has quit [Remote closed the connection]
<palomer> mrvn, even if you change it around, it doesn't matter
<palomer> oh, I understand what you're saying
<palomer> actually, I don't
<palomer> what's the solution being proposed here:P
<palomer> how do I add a toplevel module to every module?
seafood has quit [Read error: 110 (Connection timed out)]
vuln has joined #ocaml
Camarade_Tux has joined #ocaml
<palomer> do I need to put my whole library in a single file?
<thelema_> palomer: look up -pack
<palomer> ocamlfind?
<palomer> I use it
<palomer> install: oset.cma oset.cmxa
<palomer> OCamlLibrary(oset,$(FILES))
<palomer> that packs my whole library into oset.cma and oset.cmxa
<palomer> but I still get the inconsistency error
<palomer> that's what I don't understand
<palomer> (it's also in my test case)
jeanbon has quit ["J'y trouve un goût d'pomme."]
bartiosze has quit [Read error: 110 (Connection timed out)]
Camarade_Tux has quit ["Leaving"]