gildor changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/ | OCaml 3.12.1 http://bit.ly/nNVIVH
zorun has joined #ocaml
emmanuelux has joined #ocaml
eikke has quit [Ping timeout: 248 seconds]
asmanur has joined #ocaml
asmanur_ has quit [Ping timeout: 252 seconds]
sepp2k1 has quit [Read error: Connection reset by peer]
destrius has joined #ocaml
emmanuelux has quit [Ping timeout: 264 seconds]
tactics_[home] has joined #ocaml
<dsheets> how to type a function f : ('a -> t_1 -> t_2) as 'a that is conditionally open recursive?
<dsheets> I am trying to write traversal functions for polymorphic variant trees
<dsheets> so i have "let traverse (self : ('a -> t_1 -> t_2) as 'a) = function `A -> … | `B b -> `List [self self b]" etc
<thelema> You could do it with a number of helper functions, but ocaml only has rank 1 polymorphism , and it sounds like what you want to do is naturally expressed using rank 2
<thelema> what would an example implementation of 'self' be?
<dsheets> thelema: hmm… what do you mean with a number of helper functions?
<dsheets> thelema: traverse is an example of self
<dsheets> thelema: also, something that calls traverse but handles more variant cases
<thelema> ah, I see. look at the examples of how to memoize a recursive function in ocaml
<dsheets> so the basic cases are handled at the bottom and self goes back to the top of the function "stack"
<dsheets> ok, thank you, i have to run now
<dsheets> i will keep lurking though and read up on memoizing recursive funs
carm has quit [Ping timeout: 245 seconds]
struktured has joined #ocaml
ankit9 has joined #ocaml
eni has joined #ocaml
Submarine has quit [Ping timeout: 248 seconds]
ftrvxmtrx has quit [Quit: Leaving]
ankit9 has quit [Ping timeout: 264 seconds]
pango is now known as pangoafk
BiDOrD has joined #ocaml
BiDOrD_ has quit [Ping timeout: 244 seconds]
Ptival has quit [Read error: Connection reset by peer]
Ptival has joined #ocaml
cago has joined #ocaml
mika1 has joined #ocaml
djcoin has joined #ocaml
ftrvxmtrx has joined #ocaml
eikke has joined #ocaml
struktured has quit [Ping timeout: 245 seconds]
<Drakken> How do you figure out what the problem is when the type checker says your functor "is not included in" the signature you wrote for it?
struktured has joined #ocaml
<Drakken> It looks like the error message just lists the whole module.
<orbitz> if it's the error message I'm thinking of, it lists the whole module then after it the inconsistent parts
<Drakken> This one just lists what looks like the entire module.
struktured has quit [Read error: Operation timed out]
<Drakken> Yep, it's the whole thing.
<Drakken> There's a lot of stuff in the functor that's not in the signature, but I just wanted the signature to be an interface.
<Drakken> Definitely not all of the things in the functor are par of the signature, but isn't the signature just an interface?
<Drakken> parT
<nicoo> Drakken: Having stuff in the functor that is not in the sig. is alright
struktured has joined #ocaml
<nicoo> Could you pastebin the error message ?
* nicoo is leaving for the lab, so won't read it in the next minutes, though
<Drakken> nicoo here it is: http://pastebin.com/w9HM0gU8
silver has joined #ocaml
<Drakken> Only type pst 'a and the functions after module Expr, except list_n, are in the interface.
<Drakken> "not included" is a strange message if extra things are allowed.
<Drakken> Obviously interfaces don't usually include everything in the module.
Cyanure has joined #ocaml
struktured has quit [Quit: No Ping reply in 180 seconds.]
struktured has joined #ocaml
thomasga has joined #ocaml
<nicoo> Drakken: Could you pastebin the definition of PST, and the offending ode ?
destrius has quit [Ping timeout: 255 seconds]
<Drakken> nicoo here: http://pastebin.com/zpBsz23x
<Drakken> no odes, but there is one functor...
<Drakken> :D
edwin has joined #ocaml
mort___ has joined #ocaml
Cyanure has quit [Ping timeout: 245 seconds]
xcombelle has joined #ocaml
avsm has joined #ocaml
<adrien_oww> avsm: hi, about speed issues with ocamlbuild: if you native-compile and don't have a .mli for a given .ml, ocamlbuild will first make a .cmo; this can eat quite a lot of CPU time
edwin has left #ocaml []
<adrien_oww> and also, not using the .opt versions of ocaml{c,opt} (ocamlfind makes it possible to configure that installation-wide)
<avsm> adrien_oww: yeah, that's actually not too bad with ocamlc.opt though
<avsm> the big (4x) difference is native camlp4 vs bytecode
<avsm> if you add on 6-8 extensions for each file (lwt, cstruct, cow, type_conv, etc) its kind of incredible anything actually works :)
Cyanure has joined #ocaml
<avsm> the old monolithic mirage build bundled all the extensions into one pa_mirage.cmxs, and its lightning fast (but of course, not friendly to adding 3rd party extensions)
adrien_o1w has joined #ocaml
mort___ has quit [Quit: Leaving.]
adrien_oww has quit [Ping timeout: 246 seconds]
adrien_o1w is now known as adrien_oww
<adrien> avsm: yup, I've actually stopped using camlp4 in yypkg for the type-conv+sexplib stuff because it was really slower
<avsm> adrien: should be pretty easy to fix if we plumb through native extension support everywhere. which is unfortunately extremely tedious and touches a lot of external packages
cago1 has joined #ocaml
* avsm is making excellent progress with OPAM and starting to like it a lot
<adrien> 7s to build yypkg with a hot cache and that includes 4 executables with the corresponding calls to the system linker (and one of the executables uses GTK+)
<adrien> used to be > 15s I think
<avsm> yeah, that sounds about right. makes a big difference
<adrien> does opam have a homepage?
cago has quit [Read error: Connection reset by peer]
<avsm> adrien: its not released yet i think, but thomasga has been helping me along. i put my notes up at http://www.openmirage.org/wiki/install (also still changing)
ankit9 has joined #ocaml
<adrien> ok, thanks; I'm getting a bit lost with all the projects however (godi, opam, odb, ocamlbrew, barbra, at least)
<adrien> we still don't have a usable wiki I think, right?
<avsm> adrien: not yet, but github pages are pretty handy to drop notes on
<gasche> or write blog posts
<gasche> summarizing your findings
<gasche> so that I can populate reddit OCaml!
Cyanure has quit [Ping timeout: 265 seconds]
<adrien> I'd prefer a wiki because of the variety of projects: there are at least 5 projects so you need at least that many people in order to get an unbiaised comparison that covers all the aspects
<avsm> gasche is such a karma ho
<gasche> well
<avsm> KIDDING KIDDING
<gasche> you can still blog now, and integrate your post into a nice ocaml-users website later
* avsm can now build his blog, and is past the curse of self-hosting
<avsm> every time we rearrange some internals, unable to update website
<adrien> karma on reddit is quite easy: just check lwn.net regularly and post links to the articles which are there
<avsm> not to mention blasted EC2 changing their APIs all the time
<adrien> dedicated server here, shared with a dozen people, ends up pretty inexpensive
<gasche> adrien, that's a good thing about reddit: there is no point trying to gain karma because you'll be miles away from lolcat posters anyway
<adrien> hahaha :P
<adrien> you mean http://www.reddit.com/r/awww ?
<adrien> (these are cats, not lolcats actually)
<adrien> http://www.reddit.com/r/funny <- over 2 millions readers
avsm has quit [Quit: Leaving.]
tactics_[home] has quit [Read error: Connection reset by peer]
Cyanure has joined #ocaml
struktured has quit [Quit: No Ping reply in 180 seconds.]
struktured has joined #ocaml
sgnb has quit [Ping timeout: 265 seconds]
sgnb has joined #ocaml
sgnb has quit [Read error: Connection reset by peer]
Cyanure has quit [Ping timeout: 248 seconds]
sgnb has joined #ocaml
robthebob has quit [Ping timeout: 252 seconds]
sgnb has quit [Read error: Connection reset by peer]
avsm has joined #ocaml
sgnb has joined #ocaml
sgnb has quit [Remote host closed the connection]
sgnb has joined #ocaml
rossberg has joined #ocaml
Cyanure has joined #ocaml
Cyanure has quit [Ping timeout: 245 seconds]
Cyanure has joined #ocaml
eikke has quit [Ping timeout: 244 seconds]
eikke has joined #ocaml
ankit9 has quit [Ping timeout: 246 seconds]
hongboz has joined #ocaml
thomasga has quit [Ping timeout: 244 seconds]
<hongboz> Did anyone konw how to dynlink the toplevel into your application?
<hongboz> I tried to dynlink it , but it can only execute simple phrases like "Format.eprintf "%d" 3;;"
<hongboz> whenever I execute phrases including bindings like "let a =3 ;;"
<hongboz> Error mssage "Reference to undefined Toploop"
<hongboz> I found this question raised years agon, https://groups.google.com/d/msg/fa.caml/uEUI4cBz_J0/vIlwL7SjzhIJ
<hongboz> but no solution found yet
thomasga has joined #ocaml
ankit9 has joined #ocaml
<gasche> hongboz, there is indeed a problem with mixing Dynlink and the toplevel; I don't remember the details, but I'm not sure it's doable without fixing the compiler to support it
<gasche> (the problem is that Dynlink and the toplevel share a piece of mutable symbol table, and there is a risk of conflict)
<hongboz> gasche: is it easy to fix it?
<gasche> maybe you'll get more details from actually knowledgeable people on the caml-list
<gasche> I don't really know
<gasche> I'd say it's not unduly hard, but it's low-level plumbing you have to fiddle with
<hongboz> gasche: Thanks for your confirmation :-) It would be great to have it
<hongboz> but how to read the error message?
eni has quit [Quit: .]
_andre has joined #ocaml
ankit9 has quit [Quit: Leaving]
xcombelle has quit [Quit: I am a manual virus, please copy me to your quit message.]
ankit9 has joined #ocaml
Progster has joined #ocaml
silver has quit [Ping timeout: 252 seconds]
mort___ has joined #ocaml
silver has joined #ocaml
hongboz has quit [Remote host closed the connection]
sepp2k has joined #ocaml
gnuvince has joined #ocaml
hongboz has joined #ocaml
rixed has joined #ocaml
johnnowak has joined #ocaml
thomasga has quit [Read error: Connection reset by peer]
thomasga has joined #ocaml
<mehdid> hongboz: is it necessary for you to dynlink it into your application?
<hongboz> mehdid: yes. I need to do some compile time evalutation
<hongboz> mehdid: workaround is that I wrote my own interpreter
<hongboz> the problem is the error message doesn't give me any hint where to start?
<hongboz> for people interested, you can duplicate the problem here : https://gist.github.com/3083348
ankit9 has quit [Ping timeout: 264 seconds]
mort___ has quit [Quit: Leaving.]
ankit9 has joined #ocaml
johnnowak has quit [Quit: Leaving.]
robthebob has joined #ocaml
Cyanure has quit [Ping timeout: 245 seconds]
struktured has quit [Ping timeout: 245 seconds]
mcstar has joined #ocaml
struktured has joined #ocaml
Cyanure has joined #ocaml
struktured has quit [Ping timeout: 248 seconds]
struktured has joined #ocaml
struktured has quit [Ping timeout: 240 seconds]
samposm has quit [Ping timeout: 252 seconds]
bzzbzz has quit [Read error: Connection reset by peer]
bzzbzz has joined #ocaml
samposm has joined #ocaml
ankit9 has quit [Ping timeout: 265 seconds]
struktured has joined #ocaml
<hongboz> hey, I workaround it by static linking the toplevel, the ugly bits is I wrote my own camlp4 driver, so no dynamic link required, now I can do compile-time evaluation. beautiful :-)
<thelema> yay.
<hongboz> amazing. Now I can do compile time evaluation like D
<hongboz> more convenient since I can still use camlp4 syntax extension is reflexitive
<hongboz> I still wonder why dynamic linking does not work
<thelema> so you have the toplevel linked into your camlp4 driver? Can this be packaged separately for other projects to use?
<hongboz> exactly. so camlp4-> camlp4toploop, camlp4rf -> camlp4rftoploop
<hongboz> etc
<thelema> I see
<hongboz> Now, i may deleted some grammars in <:compile< >>; otherwise compile time evalutation is so powerful that may delete all my files, haha
<hongboz> Another good thing to write the driver yourself is that you can customize Lexerer without pathing camlp4
mika1 has quit [Quit: Leaving.]
ankit9 has joined #ocaml
cago1 has quit [Quit: Leaving.]
gasche is now known as gasche_
Snark has joined #ocaml
ftrvxmtrx has quit [Quit: Leaving]
silver has quit [Read error: Connection reset by peer]
pou` has joined #ocaml
bobzhang has joined #ocaml
avsm has quit [Quit: Leaving.]
djcoin has quit [Quit: WeeChat 0.3.2]
err404 has joined #ocaml
oriba has joined #ocaml
thomasga has quit [Ping timeout: 250 seconds]
eikke has quit [Ping timeout: 248 seconds]
Kakadu has joined #ocaml
<Kakadu> how to set types near labeled argument in revised syntax?
<Kakadu> value f ~(x: int) = x + 1; doesn't compile
<Kakadu> let f ~(x: int) = x + 1;; compiles in normal syntax
<Kakadu> already resolved
ftrvxmtrx has joined #ocaml
<_habnabit> Kakadu, well, what was the answer
Xizor has joined #ocaml
<orbitz> Sheesh, don't kee it to yourself!
<orbitz> val f : (x : int) i presume since you don't use the ~ in val
<hongboz> Kakadu: you can write some elisp functions to help you switch between revised syntax and normal syntax using camlp4's parser and printer
<hongboz> just like slime for lisp
<Kakadu> _habnabit: value f: ~x:int -> unit = fun ~x -> x+1 ;
emmanuelux has joined #ocaml
xcombelle has joined #ocaml
Tobu_ has quit [Remote host closed the connection]
Tobu has joined #ocaml
Snark has quit [Quit: Quitte]
hongboz has quit [Remote host closed the connection]
emmanuelux has quit [Ping timeout: 246 seconds]
xcombelle_ has joined #ocaml
xcombelle has quit [Ping timeout: 246 seconds]
xcombelle_ has quit [Ping timeout: 252 seconds]
Submarine has joined #ocaml
Submarine has quit [Changing host]
Submarine has joined #ocaml
ankit9 has quit [Quit: Leaving]
xcombelle has joined #ocaml
pangoafk is now known as pango
thomasga has joined #ocaml
xcombelle has quit [Quit: I am a manual virus, please copy me to your quit message.]
gnuvince has quit [Ping timeout: 265 seconds]
thizanne has quit [Ping timeout: 246 seconds]
osa1 has joined #ocaml
Submarine has quit [Ping timeout: 240 seconds]
_andre has quit [Quit: leaving]
Kakadu has quit [Quit: Konversation terminated!]
sepp2k1 has joined #ocaml
sepp2k has quit [Ping timeout: 264 seconds]
osa1 has quit [Ping timeout: 240 seconds]
jlouis has quit [Remote host closed the connection]
djcoin has joined #ocaml
mcstar has quit [Quit: mcstar]
Anarchos has joined #ocaml
eikke has joined #ocaml
Ptival has quit [Quit: leaving]
Ptival has joined #ocaml
Anarchos has quit [Quit: Vision[0.9.7-H-090423]: i've been blurred!]
Cyanure has quit [Remote host closed the connection]
thomasga has quit [Quit: Leaving.]
Xizor has quit [Ping timeout: 260 seconds]
err404 has quit [Remote host closed the connection]
foocraft has quit [Ping timeout: 255 seconds]
gnuvince has joined #ocaml
foocraft has joined #ocaml
zorun has quit [Ping timeout: 264 seconds]
zorun has joined #ocaml
eikke has quit [Quit: Night calls]