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
<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?
<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
<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
<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
<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>
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).
<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]