gildor changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/ | OCaml 3.12.0 http://bit.ly/aNZBUp
Amorphous has quit [Read error: Operation timed out]
robinnn has joined #ocaml
robinn has joined #ocaml
robinn has quit [Remote host closed the connection]
Amorphous has joined #ocaml
_andre has joined #ocaml
ikaros has quit [Quit: Leave the magic to Houdini]
lamawithonel_ has quit [Remote host closed the connection]
sepp2k has quit [Quit: Leaving.]
ymasory_ has quit [Quit: Leaving]
ymasory_ has joined #ocaml
ymasory_ has quit [Client Quit]
ymasory_ has joined #ocaml
<joelr> darn
<orbitz> drats
enthymeme has joined #ocaml
hto has quit [Quit: Lost terminal]
hto has joined #ocaml
hto has quit [Client Quit]
hto has joined #ocaml
hto has quit [Client Quit]
<joelr> thelema: you were almost there. see the reply from jacques on the mailing list
<joelr> thelema: just needed
<joelr> just needed 'type request = private < write: Protocol.t -> unit; ... >
<joelr> private being key
<joelr> thanks!
<joelr> off to sleep
tauntaun has joined #ocaml
joelr has quit [Quit: joelr]
arubin has joined #ocaml
EM03 has left #ocaml []
Associat0r has joined #ocaml
dnolen has joined #ocaml
joewilliams is now known as joewilliams_away
hto has joined #ocaml
hto has quit [Client Quit]
hto has joined #ocaml
hto has quit [Client Quit]
Associat0r has quit [Quit: Associat0r]
_andre has quit [Quit: leaving]
hto has joined #ocaml
hto has quit [Client Quit]
hto has joined #ocaml
boscop has quit [Ping timeout: 255 seconds]
robinnn has quit [Remote host closed the connection]
hto has quit [Quit: Lost terminal]
Associat0r has joined #ocaml
tauntaun has quit [Quit: Ex-Chat]
tauntaun has joined #ocaml
Associat0r has quit [Quit: Associat0r]
tauntaun has quit [Quit: Ex-Chat]
lopex has quit []
Associat0r has joined #ocaml
ulfdoz has joined #ocaml
enthymeme has quit [Quit: rcirc on GNU Emacs 23.1.1]
dnolen has quit [Quit: dnolen]
arubin has quit [Quit: arubin]
emmanuelux has quit [Ping timeout: 260 seconds]
vivanov has quit [Quit: Lost terminal]
ikaros has joined #ocaml
ygrek has joined #ocaml
Yoric has joined #ocaml
vivanov has joined #ocaml
hto has joined #ocaml
yezariaely has joined #ocaml
yezariaely has left #ocaml []
larhat has joined #ocaml
vivanov has quit [Ping timeout: 248 seconds]
vivanov has joined #ocaml
vivanov has quit [Client Quit]
Yoric has quit [Quit: Yoric]
ttamttam has joined #ocaml
ttamttam has left #ocaml []
ikaros has quit [Quit: Leave the magic to Houdini]
joelr has joined #ocaml
explodus has quit [Ping timeout: 276 seconds]
edwin has joined #ocaml
Yoric has joined #ocaml
explodus has joined #ocaml
Yoric has quit [Quit: Yoric]
Yoric has joined #ocaml
Cyanure has joined #ocaml
ygrek has quit [Ping timeout: 246 seconds]
joelr has quit [Quit: joelr]
ulfdoz_ has joined #ocaml
ulfdoz has quit [Ping timeout: 260 seconds]
ulfdoz_ is now known as ulfdoz
Snark has joined #ocaml
smerz has joined #ocaml
Fullma has joined #ocaml
_andre has joined #ocaml
ygrek has joined #ocaml
boscop has joined #ocaml
avsm has joined #ocaml
joelr has joined #ocaml
Yoric has quit [Quit: Yoric]
Yoric has joined #ocaml
fraggle_ has quit [Quit: -ENOBRAIN]
Yoric has quit [Read error: Connection reset by peer]
robinnn has joined #ocaml
robinn has joined #ocaml
robinn has quit [Read error: Connection reset by peer]
Yoric has joined #ocaml
fraggle_ has joined #ocaml
ygrek has quit [Ping timeout: 246 seconds]
avsm has quit [Quit: Leaving.]
tauntaun has joined #ocaml
sepp2k has joined #ocaml
edwin has quit [Remote host closed the connection]
lopex has joined #ocaml
<joelr> can you parameterize a module with multiple modules, e.g. module A (X: M1, Y: M2, Z: M3)
<f[x]> yes
<joelr> awesome
tauntaun has quit [Quit: Ex-Chat]
lamawithonel has joined #ocaml
<rproust> joelr: not sure but I think the functor needs to be curried (anyone can confirm?)
<f[x]> module M (S1:Set.OrderedType) (S2:Set.OrderedType) = struct end;;
tauntaun has joined #ocaml
<joelr> ah, that makes total sense
<joelr> f[x]: thanks
dnolen has joined #ocaml
ikaros has joined #ocaml
vivanov has joined #ocaml
edwin has joined #ocaml
Cyanure has quit [Remote host closed the connection]
vivanov has quit [Quit: Lost terminal]
<rproust> Anyone using the deriving package? I can't get it to produce the printer associated to a map…
<thelema> rproust: batteries has a composable printing infrastructure that includes printing maps
<thelema> but I've not worked with deriving
<rproust> deriving (source code indicates that it) is able to print maps, it's just a syntax extension problem
<rproust> thelema: I'll looked into batteries, thx
<thelema> sure. I've had bad luck with syntax extensions and stay away from them at the moment.
<thelema> Maybe I can still help - how are you compiling?
<hcarty> joelr: If you've tried both - how does (OCaml) ZeroMQ compare with (OCaml) MPI?
<rproust> I use OCamlMakefile and I have the associated line on top of my file
<rproust> the problem is not with invocation of the pp
<rproust> it's just that I need to put "deriving (Show)" where the type of Maps is defined
<rproust> but the type instanciation is inside the functor
<rproust> I'm not sure where is the "deriving (Show)" supposed to be placed in this case
<thelema> rproust: ah, that I can't help with. My best guess would be at the instantiation of the functor, but I can't imagine the magic to make that work
<rproust> thelema: I tried with a type constraint… didn't work! But there might be a special way to place the constraint…
<thelema> rproust: according to this, deriving can't show a map
<rproust> thelema: it might be a recent addition… idk
<thelema> so you don't put show anywhere, you just instantiate this show map with an ordered type and the show modules for keys and values
<thelema> s/put show/put deriving(Show)/
<rproust> according to implem it's suppose to output "{ key1 => val1; … }
<thelema> for example:
<thelema> module CharIntShowMap = Show_map(Char)(Show_char)(Show_int)
<rproust> thelema: will try
Cyanure has joined #ocaml
<rproust> thelema: it compiles
<rproust> thelema: it works (thanks)
<thelema> you're welcomd
Associat0r has quit [Quit: Associat0r]
Associat0r has joined #ocaml
dnolen has quit [Quit: dnolen]
explodus has quit [Ping timeout: 276 seconds]
ymasory_ has quit [Quit: Leaving]
explodus has joined #ocaml
<joelr> hcarty: i haven't used mpi but zeromq has excellent documentation
larhat has quit [Quit: Leaving.]
philtor has joined #ocaml
lopex has quit []
<joelr> what is a good way to dispatch on object type? assuming that i don't want to perpetuate objects but i'm forced to receive packets as objects>
<rproust> joelr: what do you mean when you say dispatch? work differently on different types?
<joelr> rproust: well, i should probably look at how thrift unions are implemented again but i don't remember ocaml having a typeof function
<joelr> yes, i'm thinking of a match statement
<rproust> type dispatcher = ObjA of object_type_a | ObjB of object_type_b
<joelr> rproust: thanks
<rproust> match foo with ObjA o -> dispatch_to_a o | ObjB o -> dispatch_to_b o
<rproust> though you need to know what your bindings return…
<rproust> (and btw, there's no type information left in the compiled code. It makes it faster but it also prevents any typeof constructor (which needs to be encoded in a variant or something)
oriba has joined #ocaml
<joelr> well, looks like i still get a single object
<joelr> a "union" object of sorts where fields are options
<joelr> and i need to figure out myself what object was set by looking at the only field that's not None
<joelr> ouch
oriba has quit [Quit: Verlassend]
tauntaun has quit [Quit: Ex-Chat]
vivanov has joined #ocaml
lopex has joined #ocaml
Yoric has quit [Quit: Yoric]
emmanuelux has joined #ocaml
<mrvn> Do that in your bindings and transform it into a ocaml variant type.
<joelr> mrvn: yeah, i'll have to write a wrapper for every packet type
<joelr> that i need to dispatch on
<mrvn> type union = type1 option * type2 option * type3 option * type4 option * ... seems like a really bad way to implement unions though. Who came up with that idea?
<joelr> mrvn: they are using classes
<joelr> not tuples
<mrvn> If they use classes it can be best to also use classes in ocaml
<mrvn> sometimes :)
<joelr> no way
<joelr> i like me functional programmers and i particularly like me pattern matching
ymasory has quit [Remote host closed the connection]
<orbitz> pattern matching FTW
robinnn has quit [Quit: Leaving]
robinnn has joined #ocaml
robinn has joined #ocaml
Yoric has joined #ocaml
<joelr> can you
<joelr> can you "instantiate" a module that has 'val x' multiple times such that x is always different?
<thelema> joelr: functorize so that x is passed in?
<joelr> thelema: i thought that only types can be passed in
<thelema> anything that goes into a module can be passed in - this means types and values
<orbitz> Argh I have ot learn tuareg mode better, getting all kinds of funky indentation
<thelema> orbitz: code better
<orbitz> I don't htink it' smyc oding
<orbitz> things like 'let open F in' aren't indenting properly
<joelr> awesome, thanks
<orbitz> this is the version of taureg mode i modifeid for lwt
<orbitz> I think I broke it
<thelema> orbitz: ah, I don't think tuareg knows about the 3.12 syntax
<orbitz> oh ok
<orbitz> maybe i can add let open
<orbitz> right now i'm getting around it by wrapping the entire expresison in ()
<orbitz> it's ugly but works
ymasory has joined #ocaml
joewilliams_away is now known as joewilliams
<joelr> thelema: so how do you parameterize a module on an int, for example? this doesn't work
<joelr> module T (X: int) = struct let x = X end;;
<thelema> module T (X : sig val x : int end) = struct let x = X.x end;;
<joelr> thanks!
<orbitz> functors take modules as parameters as far as i understnad
<thelema> orbitz: exactly
<thelema> I guess I was a bit inexact saying that anything that goes in a module can be passed as an argument to a functor.
<thelema> But I hope it's clear now.
<orbitz> I still don't quote grok functors (I think I get what they do, just not why it's helpful), but I"m slowly coming to it as I start thinking more about type systems
<hcarty> orbitz: I found functors baffling when I started with OCaml... and at some point they clicked.
<orbitz> hcarty: yeah i'm slowly gettign there. I spent the first year of ocaml dabbling writing it like Python
<hcarty> orbitz: They can be helpful in reducing code duplication
<orbitz> now I'm starting ot write it like an MLer i think. so functor should coem in time
<hcarty> orbitz: It's nice that OCaml allows that :-)
<thelema> I was lucky - I learned Ada generics early, and functors are just a different syntax for the same thing.
<orbitz> yeah, i'm finding my ML version of the code to be much mroe concise and obviously maintainable
<hcarty> thelema: OCaml saved me from diving in to Ada. I may give it a shot eventually, but it seems extremely verbose.
<orbitz> and i've figured out how to usefully push a lot of the owrk to the type system (before I was just using type inferencing to avoid writing types, now I use it to make code cleaner but specify types to make it safer)
<thelema> hcarty: it's such a pain to program anything significant in
<thelema> hcarty: it does reward benchmark writers, though, as it compiles damn efficiently
<orbitz> thelema: interesting
<joelr> <- hopes to push python out by virtue of awesome ocaml code
<thelema> Ada isn't not GC'ed, and just about everything's statically sized. This makes the compiler able to do impressive data representation optimizations.
avsm has joined #ocaml
ulfdoz has quit [Ping timeout: 250 seconds]
<orbitz> what do you think of LiML? No GC because everything is a linear type, but is that good or bad/
joewilliams is now known as joewilliams_away
avsm has quit [Quit: Leaving.]
<hcarty> orbitz: Interesting ... I tried to search on Google for LiML and didn't find anything, but the first link was to Links, which is apparently web programming language written in OCaml
vivanov has quit [Ping timeout: 276 seconds]
enthymeme has joined #ocaml
<mrvn> "LIML computes the limited information maximum likelihood estimator for a single equation linear structural model." probably not what you ment. Any url for liml?
vivanov has joined #ocaml
ulfdoz has joined #ocaml
<bitbckt> google "linearml"
<bitbckt> pikatchu is the author.
<bitbckt> (what he said)
<orbitz> whoops didn't see what you wrote bitbckt
<bitbckt> :)
<adrien> argh, github just killed me: when you click on a link, it uses a "slide" effect to show it, and another one when you go back in history ='(
<orbitz> :)
tauntaun has joined #ocaml
Snark has quit [Quit: Ex-Chat]
_andre has quit [Quit: leaving]
joewilliams_away is now known as joewilliams
<hcarty> thelema: I just tried odb.ml with a fresh OCaml 3.12.0 and findlib 1.2.6 install. "ocaml odb.ml batteries" says that it is already installed.
<hcarty> thelema: "ocamlfind list" only lists the stock packages, no Batteries, Camomile, etc.
<hcarty> Any suggestions on where to start looking for the cause?
<thelema> hcarty: I just pushed a fix for that maybe 10 minutes ago
<thelema> 13 minutes ago.
chewbranca has joined #ocaml
<thelema> thank superbobry for finding the bug
<thelema> and reporting it.
<hcarty> thelema: Closer. It grabbed batteries, but didn't automatically download and install camomile
<thelema> curious...
<chewbranca> hi all, noob question, I'm trying to use this ocaml library for seam carving: http://eigenclass.org/hiki/object-removal-with-seam-carving
<chewbranca> I'm running on ubuntu with libcamlimages-ocaml-dev installed, but whenever I try and compile the library, I get the error Error: Cannot find file ci_png.cmxa
<chewbranca> any ideas?
<thelema> chewbranca: libcamlimages-ocaml-dev version 1.3.0.1-*?
<chewbranca> thelema: 1:3.0.1-5build2
<thelema> that's what I have too, and you're right, there's no ci_png.cmxa
<chewbranca> hrmm... this code is from 2007 so highly likely something changed since then
<chewbranca> here is the darcs repo: http://eigenclass.org/repos/seamcarve/head/
robinn has quit [Quit: Leaving]
Cyanure has quit [Read error: Operation timed out]
<thelema> the problem is the camlimages version...
<thelema> version 2.2 of camlimages has a ci_png.cmxa
ankit9 has joined #ocaml
<chewbranca> that seems weird, this code was from 2007, was 2.2 around then? seems weird to be on 1.3.x if 2.2 was around in 2007
* thelema is looking into it
<thelema> maybe ubuntu's ocaml packagers are way behind the times.
<hcarty> chewbranca: You have a newer verison (3.x) than what the code expects, from what it sounds like
<thelema> or the other way around...
<hcarty> thelema: If the version is 1:3.0.1-5build2, that looks like upstream 3.x
<chewbranca> hrmm..
<thelema> hcarty: ah, not so good at reading ubuntu version numbers. ok.
<thelema> try replacing all the ci_foo.cmxa modules with "camlimages.cmxa"
<thelema> chewbranca: ^^^
<chewbranca> thelema: ok will do, I've got a debian server that can install version 1:2.2.0-4+lenny3 if that doesn't work
<thelema> ocamlfind ocamlopt -package camlimages, graphics -o carver -unsafe seamcarving.ml sobel.ml gradientHist.ml carve.ml
<thelema> or this command to use ocamlfind
<thelema> debian won't help - the problem is that at least the module structure of camlimages has changed. Let's hope more of the internals haven't changed
lopexx has joined #ocaml
<thelema> unless that debian has the older version of ocamlimages
<joelr> question... to make module Service here work, do I need to bring Message functions into Endpoint, both for request and reply? https://gist.github.com/885845
lopex has quit [Ping timeout: 276 seconds]
<thelema> joelr: only if they differ
lopex has joined #ocaml
<joelr> thelema: well, my code does not complain, as usual :-). it says E.request is an unbound value
<joelr> code does not compile, sorry
<thelema> Endpoint is a functor, unless you apply it to Req and Rep modules, you can't access its fields
<thelema> trying to access E.request is like trying to access the result of a function that you've not given any arguments to.
<joelr> thelema: so i need to modify module Service (E : Endpoint) to include Rep and Req in Endpoint?
ymasory has quit [Quit: Leaving]
<joelr> that didn't sound well
<thelema> yes, try inserting at L30 "module E = E(Req)(Rep)" and adding the two more functor parameters to Service
<chewbranca> thelema: not having much luck so far, when you said replace ci_foo.cmxa did you mean replace it with camlimages_foo.cmxa or just replace ci_*.cmxa with one camlimages.cmxa
<thelema> chewbranca: the second
<chewbranca> ok that's what I thought, end result of doign that is: https://gist.github.com/885855
<joelr> module Service (E : Endpoint) (Req: Message) (Rep: Message) =
<joelr> struct
<joelr> module E = E(Req)(Rep)
<joelr> still not found
<joelr> hmm
<thelema> E.request is a type, not a value. you can't use it as a value
<thelema> maybe you mean L23 "val request : Req.klass"
<joelr> i was thinking of it as a nested module of sorts
<thelema> and similarly for reply
<joelr> thelema: well, no, i was thinking of using them to refer to the functions of the message module they are bound to
<joelr> let var = E.request.convert req in
<thelema> chewbranca: sudo apt-get install liblablgtk2-ocaml-dev (or something like that)
<joelr> here i'm trying to say "use the convert function for the request that the Endpoint functor is parameterized on"
<thelema> chewbranca: should have been a dependency. err, it's probably already installed
<thelema> chewbranca: just use the ocamlfind command I wrote earlier
<joelr> my assumption is that Endpoint has already been parameterized by the time I use it to parameterize Service
<thelema> joelr: type E.request = private <write : Protocol.t -> unit; ..>
<thelema> joelr: E.request is a *type*
<joelr> hmm, true
<joelr> thelema: does it mean that i need to duplicate the create, read, dump and convert functions in endpoint, once for Rep and once for Req?
<thelema> no
<joelr> alternatively, how do i get hold of the convert function for Req from Service?
<thelema> Service is parameterized by Req
<joelr> assuming, again, that Endpoint has already been parameterized by the time I give it to Service
<joelr> thelema: but I don't want to do that, it looks ugly
<joelr> i want to parameterize Service on Endpoint and parameterize Endpoint on Req and Rep
<thelema> then you have to expose any parts of Req and Rep you want to use in Service in Endpoint
<thelema> then you have to expose in Endpoint any parts of Req and Rep you want to use in Service
<joelr> thelema: that's what I meant by duplicating the functions for re[/req in endpoint
<thelema> yes
<joelr> ok, thanks
<thelema> which is why giving those modules to Service isn't so bad
<chewbranca> thelema: yeah I was playing around with that ocamlfind command, but was having issues, looks like you have to use one -package for each package, so I changed that, then been working down dependency errors by adding in all the .ml files but still failing
<thelema> joelr: I'd recommend getting out of the clouds of functor-land for a while.
<joelr> thelema: it's too enticing. and works too nicely. i'm trying to codify client/server patterns
<joelr> i think i just need to persist with my learning
<thelema> chewbranca: there's some proper modifications to the OMakefile to make the build happen easily
<thelema> chewbranca: I'll just have to test it on my end to make my guesses faster
<chewbranca> thelema: yeah I hear you, thanks for helping out, this is my first time diving into ocaml so I'm not making this any easier, I might just come back to it later or look for an alternative
joewilliams is now known as joewilliams_away
<thelema> chewbranca: does that help?
<thelema> you do need the omake program to use omakefiles
<chewbranca> thelema: wow you rock, that did the trick!
<thelema> chewbranca: I'm just glad the internals of camlimages didn't change
<thelema> chewbranca: enjoy seam carving with ocaml
<chewbranca> thelema: thanks, much appreciated!
<hcarty> thelema: Any suggestions for tracking down why odb.ml is missing dependencies?
<thelema> hcarty: back to odb now...
Cyanure has joined #ocaml
<thelema> hcarty: try the newly pushed version
<thelema> with --debug
<hcarty> thelema:
<thelema> hah, I need to fix versioned dep vs. not installed too
lopexx has quit []
<thelema> ok, hopefully last push on this issue
<thelema> apparently I was pretty sloppy in testing version dependencies
<hcarty> thelema: This looks more promising. Camomile is building now.
<hcarty> thelema: Thank you!
<thelema> thank you for reporting the bug
<thelema> not too hard to fix
<hcarty> You're welcome. I'll see if I can put together a package or two.
<hcarty> Probably the Calendar library to start out.
<hcarty> thelema: line 101 - "as x" is unused
<thelema> fix pushed
<hcarty> And now it's not finding camomile after it's installed - another instance of the same versioning issue maybe?
<hcarty> "Problem with installed package:..."
<thelema> did you read the message?
<chewbranca> thelema: nice, this is working well
<hcarty> thelema: Yes, both variables are set
<chewbranca> check it out, sample image: http://static.chewbranca.com/images/buildings_small.jpg
<thelema> hcarty: hmm, odd.
<chewbranca> with double carving on height and width: http://static.chewbranca.com/images/buildings_double_carve.jpg
<hcarty> And "ocamlfind remove camomile -destdir ~/.odb/lib" works
<thelema> chewbranca: that's really carved
<thelema> what's the output of ocamlfind query -format %v camomile
<thelema> hcarty: ^^^
<hcarty> thelema: 0.8.1
<chewbranca> yeah basically I'm sig of dealing with image processing and I've been looking for a better way to coerce random user image uploads into 4:3 dimensions
<thelema> chewbranca: this may work for you
<thelema> hcarty: hmm, and it's saying that camomile isn't installed?
<hcarty> thelema: Yes - "Installed package is not available to the system"
<thelema> "package camomild dependency satisfied: false"?
<thelema> *camomile
<hcarty> Yes
<hcarty> Printed twice
groovy2shoes has joined #ocaml
<thelema> well, I've got a different deadline now, I should be able to look at this later
<thelema> if you want to trace things, start at the has_dep function
<hcarty> thelema: Ok, thank you for your time
<hcarty> I'll see if it's something I can fit in
<hcarty> thelema: Found at least one problem - a typo in has_dep
<hcarty> thelema: I'll send a patch once I've tested it
<thelema> what line?
<hcarty> 94, assuming I didn't add any newlines...
<thelema> ah, I'm missing the space
<hcarty> thelema: The %v needs a space before the "
<hcarty> Yep
<thelema> that would mess things up.
<thelema> grr, I should write a Sys.command wrapper that takes an array of strings and handles all the magic necessary to push that array as argv in the next program
<thelema> (magic = escaping, joining by spaces, etc.)
<hcarty> thelema: I've wanted to do the same. Along with a Sys.command which returns (code, stdout, stderr).
<thelema> int * string * string, yes...
<thelema> pushed
<hcarty> thelema: odb.ml install --debug batteries -> success
<thelema> yay, thanks
<thelema> time for me to go. deadline reached
<hcarty> thelema: You're welcome, and thank you!
<hcarty> thelema: camlzip's installation doesn't work properly, but that seems to be down to having no META file so the installation can't be verified.
joelr has quit [Quit: joelr]
ankit9 has quit [Quit: Leaving]
robinnn has quit [Quit: Leaving]
joewilliams_away is now known as joewilliams
edwin has quit [Remote host closed the connection]
joewilliams is now known as joewilliams_away
sepp2k1 has joined #ocaml
sepp2k has quit [Ping timeout: 255 seconds]