Re: [Caml-list] stl?

2009-03-11 Thread David Rajchenbach-Teller
On Wed, 2009-03-11 at 06:57 +0100, David Rajchenbach-Teller wrote: How would you determine that = or foo maps to Foo? IMHO, that's the main problem with getting typeclasses in OCaml. Ah, ok, I just realized that I had understood your example backwards. My bad. Cheers, David -- David

Re: [Caml-list] OCamlBuild + OCamlDoc is slooooow

2009-03-11 Thread David Rajchenbach-Teller
I'm using ocamldoc, as I need a custom generator. I've considered using ocamldoc.opt to generate the n first dumps and I may do this, if I find out how to get OCamlBuild to do this. However, the last load already takes something like 8 minutes, so that would not solve all issues. Thanks, David

[Caml-list] Reference to undefined global `Camlp4_config'

2009-03-11 Thread Joel Reymont
Any suggestions on how to resolve this? ocamlfind installs into /usr/local/lib/site-lib and there's a site-lib/ camlp4 directory with META in it. Thanks, Joel --- ocamlfind ocamlc -package 'oUnit, extlib, camlp4' -linkpkg -g src/ easy_ast.cmo src/easy_code.cmo src/easy_lexer.cmo

Re: [Caml-list] How to compile project with sub directories (using OcamlMakefile)

2009-03-11 Thread Conglun Yao
Thanks, peng, it works. Conglun On Sun, Mar 8, 2009 at 2:50 PM, Peng Zang peng.z...@gmail.com wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Here is something similar from one of my projects.  Although each subproject is not in a subdirectory, it should be trivial to modify by

Re: Re : [Caml-list] Reference to undefined global `Camlp4_config'

2009-03-11 Thread Joel Reymont
On Mar 11, 2009, at 1:33 PM, Matthieu Wipliez wrote: I'm not familiar with ocamlfind, but for Camlp4 you need this: -I +camlp4 camlp4lib.cma I was under the impression that ocamlfind -packages takes care of adding the camlp4 bits. Does this solve the problem? Not really but thanks

Re: [Caml-list] Reference to undefined global `Camlp4_config'

2009-03-11 Thread Jérémie Dimino
Joel Reymont wrote: ocamlfind ocamlc -package 'oUnit, extlib, *camlp4*' -linkpkg -g src/ easy_ast.cmo src/easy_code.cmo src/easy_lexer.cmo src/easy_symtab.cmo src/token.cmo src/static1.cmo src/easy_parser.cmo src/test_tools.cmo src/parser_test.cmo src/test.cmo -o src/test.byte File

[Caml-list] ocaml resurgence?

2009-03-11 Thread Joel Reymont
Is it just me or there's a fresh uptake of OCaml among bright people? I used to have to wait a long time (hours?) to get my questions answered and now I get them answered in just a few minutes. And I'm not talking simple questions since I don't consider camlp4 anywhere simple. Woot! I

Re: [Caml-list] typing problem with sexplib and mutually recursive polymorphic types

2009-03-11 Thread Markus Mottl
On Wed, Mar 11, 2009 at 02:11, yoann padioleau pada...@wanadoo.fr wrote: Yes on this example, but what if I can't move it out because the types really need to be mutually recursive ? I'm afraid, I don't see any straightforward way of achieving this goal. If the above were allowed in a truly

Re: [Caml-list] Re: ocaml resurgence?

2009-03-11 Thread Gilles Pirio
Yes - I'd agree OCaml is getting more traction these days! Looking forward to it in the commercial field :) Also, I'm starting to see more openings in my field where FP is a requirements. See for instance for OCaml:

Re: [Caml-list] Re: ocaml resurgence?

2009-03-11 Thread Richard Jones
On Wed, Mar 11, 2009 at 02:17:20PM +, Sylvain Le Gall wrote: http://planet.ocamlcore.org Anyone who writes about OCaml, even irregularly, I'd urge you to get your blog syndicated on this planet. This page describes how: http://www.ocamlcore.org/planet/ Rich. -- Richard Jones Red Hat

Re: [Caml-list] C-r in readline from programmer-monk?

2009-03-11 Thread Kuba Ober
I'm using the readline for toplevel from programmer-monk for a while now: http://pmonk.net/svn/ocaml-misc/readline I can use the up-down arrows easily which is usually enough. Still when I try to do C-r for incremental backward search, it doesn't work. Anybody knows how to enable it?

Re: [Caml-list] typing problem with sexplib and mutually recursive polymorphic types

2009-03-11 Thread Till Varoquaux
This is a quick overview of my current understanding. Corrections by higher authorities are welcome: Optional type declarations in ocaml only enable to restrict given types (not to generalize them). Although it enables better error reporting it does not allow us to compile anything that would

[Caml-list] V.null in ocamlgraph

2009-03-11 Thread Alexy Khrabrov
In some folds over data when creating ocmalgraph's, I'd need an empty vertex value, something like V.null, to give to an edge-creating fold when I know it's not going to be used. Currently I have to look ahead into the data. Does it make sense to add a null value to the V module, or is

Re: [Caml-list] typing problem with sexplib and mutually recursive polymorphic types

2009-03-11 Thread Yoann Padioleau
Yitzhak Mandelbaum yitzh...@cs.princeton.edu writes: While I'm not sure it will help you in this case (because the code is generated), The code is generated, but I am ok with modifying it. I use typeconv/sexplib/binprot and camlp4 just as a way to produce a first draft and then I refine the

[Caml-list] camlp4: how do you write this rule?

2009-03-11 Thread Joel Reymont
I would like my expression rule to parse 1 + 2 points as Plus (1, Points 2). I currently have the following, with Points right-associative and at the bottom, but it doesn't work. Is this something that Camlp4 can handle? Thanks, Joel expr: [ ... | LEFTA [ e1 = expr; Or;

[Caml-list] camlp4: precedence, LEFTA, NONA, etc.

2009-03-11 Thread Joel Reymont
I'm trying to properly set up the precedence in my expression camlp4 rule. It's not working properly, though. (* wrong!!! has higher prec than and*) # parse_with_rule expr 1 2 and 3 4;; - : Easy_ast.expr = Cond (Int 1, GT, And (Int 2, Cond (Int 3, GT, Int 4))) (* right! mul is higher

Re: [Caml-list] camlp4: how do you write this rule?

2009-03-11 Thread Martin Jambon
Joel Reymont wrote: I would like my expression rule to parse 1 + 2 points as Plus (1, Points 2). I currently have the following, with Points right-associative and at the bottom, but it doesn't work. Is this something that Camlp4 can handle? Thanks, Joel expr: [ ... | LEFTA

[Caml-list] changing labels on ocamlgraph edges

2009-03-11 Thread Alexy Khrabrov
It looks like the only way to change a label on an edge e -- say increment it -- is to read off the old one with G.E.label, then remember the src and dst with G.E.src/dst, then G.remove_edge_e g e, create a new edge e' with G.V.create src (label+1) dst, and G.add_adge_e g e'. Is this