Re: [Caml-list] Define parser and printer consistently

2010-12-08 Thread Ashish Agarwal
Maybe you will find Pickler Combinators useful: http://research.microsoft.com/en-us/um/people/akenn/fun/picklercombinators.pdf On Wed, Dec 8, 2010 at 11:47 PM, Dawid Toton d...@wp.pl wrote: I'm going to define a parser and a printer for a simple grammar. Is there a way to define both of them

Re: [Caml-list] HELP : with regular expression

2010-12-07 Thread Ashish Agarwal
I know you're asking for a solution with Str. Since I can't help with that, let me give you the Pcre solution instead. Hopefully my explanations will make up for the lack of examples to help you start using it. pmatch is the function you care about. Ignore most of the arguments. All you need to

Re: [Caml-list] Native toplevel? (was: OCamlJit 2.0)

2010-11-19 Thread Ashish Agarwal
On Fri, Nov 19, 2010 at 1:24 PM, Hezekiah M. Carty hca...@atmos.umd.eduwrote: ocamlscript is certainly a wonderful tool, for prototyping and otherwise. It unfortunately doesn't help specifically with the load a large file and do something with it case. Right. Also, I should mention that a

Re: [Caml-list] Native toplevel? (was: OCamlJit 2.0)

2010-11-18 Thread Ashish Agarwal
On Wed, Nov 17, 2010 at 3:44 AM, Alain Frisch al...@frisch.fr wrote: Does performance really matter that much for rapid prototyping/development? Rapid prototyping for me often involves a couple of lines of code that read in a very large file and do something with it. I have to keep compiling

Re: [Caml-list] Re: Unicode, update

2010-10-19 Thread Ashish Agarwal
Have you considered adding these to the Batteries project? It would be good to get general purpose functionality added directly there. Also that way you don't have to feel you've done a lot of things; a single useful function could be added. On Mon, Oct 18, 2010 at 9:59 PM, Paul Steckler

Re: [Caml-list] How can I set a type parameter of Map.Make(X) ?

2010-09-20 Thread Ashish Agarwal
module M = Map.Make(String) type t = int M.t Type t is the type of maps from string's to int's. Or alternatively write a function that assumes 'a is some specific type: # let f m = M.fold (fun _ x y - x + y) m 0;; val f : int M.t - int = fun On Mon, Sep 20, 2010 at 10:35 AM, Dumitru

Re: [Caml-list] How can I set a type parameter of Map.Make(X) ?

2010-09-20 Thread Ashish Agarwal
the associated type (**this** I knew how to do). I would like to write something like: include module type of Set.Make(String) with 'a= int Is this possible? Yours, Jacky Potop On 20/09/2010 16:57, Ashish Agarwal wrote: module M = Map.Make(String) type t = int M.t Type t is the type

Re: [Caml-list] How can I set a type parameter of Map.Make(X) ?

2010-09-20 Thread Ashish Agarwal
(* foo.ml *) module M = Map.Make (String) include M type value = string type map = string M.t Martin Yours, Jacky Potop On 20/09/2010 16:57, Ashish Agarwal wrote: module M = Map.Make(String) type t = int M.t Type t is the type of maps from string's to int's. Or alternatively

Re: [Caml-list] Create a constraint between variant type and data list

2010-09-03 Thread Ashish Agarwal
See the Enum section of deriving: http://code.google.com/p/deriving/wiki/Introduction I haven't used it myself so cannot comment on how well it works. On Fri, Sep 3, 2010 at 2:51 PM, Martin Jambon martin.jam...@ens-lyon.orgwrote: Sylvain Le Gall wrote: Hello all, I would like to somehow

Re: [Caml-list] Smart ways to implement worker threads

2010-07-15 Thread Ashish Agarwal
The link given to Reppy's book leads to either: a direct download option which does not work, or a sponsored option which goes to sites that seem unreliable and require us to register. Is the download available more easily elsewhere? I didn't get anywhere with google. Thanks. On Thu, Jul 15,

Re: [Caml-list] Private modules in packages

2010-05-21 Thread Ashish Agarwal
write a script to generate the P.mli file Why do you need Bar.mli and Foo.mli at all? Just write the P.mli only. On Fri, May 21, 2010 at 5:51 AM, Hans Ole Rafaelsen hrafael...@gmail.comwrote: Thanks Michael and Julien, That did the trick. I manually inserted the content of the Bar.mli and

Re: [Caml-list] Inspect libary

2010-04-15 Thread Ashish Agarwal
Regarding LGPL 2.1 versus 3.0, I recently tried finding the linking exception for 3.0 but concluded that no one has written it yet (from postings to the OCaml list, beginners list, and contacting the FSF). So if you're going to include the linking exception, which most LGPL'd ocaml libraries do,

Re: [Caml-list] Ocaml-Pcre Documentation?

2010-04-08 Thread Ashish Agarwal
What do you need to know? Documentation for the underlying pcre library might be your best option. On Thu, Apr 8, 2010 at 3:06 PM, Oliver Bandel oli...@first.in-berlin.dewrote: Hello, where can I find the documenatation to pcre-ocaml? Some pages seem to be out dated. Where can I find

[Caml-list] LGPLv3 linking exception

2010-03-31 Thread Ashish Agarwal
From older posts, I get the impression that OCaml's lack of support for dynamic linking affects the choice of including a linking exception in libraries released under GPL or LGPL. Can someone summarize the issue? Is there an OCaml library using an LGPLv3 + linking exception license? I've not

Re: [Caml-list] [newbie] miscellaneous on installation and web site

2010-03-02 Thread Ashish Agarwal
Why? How to install GODI? GODI is a very nice package management system for OCaml, making it trivial to install both OCaml and most OCaml libraries that are in common use. It automatically downloads and installs libraries, and checks for dependencies. I would recommend using it, unless perhaps

Re: [Caml-list] Re: The need to specify 'rec' in a recursive function defintion

2010-02-16 Thread Ashish Agarwal
It may be worth recalling the OCaml koans at http://eigenclass.org/hiki/fp-ocaml-koans. The first one is: let rec One day, a disciple of another sect came to Xavier Leroy and said mockingly: The OCaml compiler seems very limited: why do you have to indicate when a function is recursive, cannot

Re: [Caml-list] camlp4

2010-02-07 Thread Ashish Agarwal
- the source folder tree is deep, and thus harder to grep I use find. $ find ./ -exec grep foo {} \; On Sun, Feb 7, 2010 at 12:19 PM, Martin DeMello martindeme...@gmail.comwrote: On Sat, Feb 6, 2010 at 5:44 PM, Tiphaine Turpin tiphaine.tur...@irisa.fr wrote: - the source folder tree is

Re: [Caml-list] Module abbreviation

2009-12-15 Thread Ashish Agarwal
If you only have a file ast.mli, you should not be able to write Ast.Sig because you do not have a module named Ast. Please double check your example. It cannot be working as you describe. On Tue, Dec 15, 2009 at 11:39 AM, Romain Bardou rom...@bardou.fr wrote: Hello, dear Caml-list, I have a

Re: [Caml-list] Module abbreviation

2009-12-15 Thread Ashish Agarwal
with modules so it works out. On Tue, Dec 15, 2009 at 6:28 PM, David Allsopp dra-n...@metastack.comwrote: Ashish Agarwal wrote: If you only have a file ast.mli, you should not be able to write Ast.Sig because you do not have a module named Ast. This isn't true - the include statement works

Re: [Caml-list] ocamlbuild documentation

2009-10-21 Thread Ashish Agarwal
Any ideas about where to host them? Why not at the first link given? It is a wiki. http://brion.inria.fr/gallium/index.php/Ocamlbuild Personally I think what's most needed is a description of the concepts, although examples of course would help too. On Wed, Oct 21, 2009 at 9:36 AM, Erick

Re: [Caml-list] Ocamldoc and multiple packages

2009-09-11 Thread Ashish Agarwal
I don't know the answer but you might try using ocamlbuild's mlpack and odocl features, and see how it does it. On Fri, Sep 11, 2009 at 11:47 AM, Alexey Rodriguez mrche...@gmail.comwrote: Dear list, I am trying to build ocamldoc documentation for an ocaml project that contains multiple

Re: [Caml-list] Documentation to start

2009-09-04 Thread Ashish Agarwal
I would recommend Jason Hickey's excellent book [1]. You can also look at the OCaml manual [2], but in my opinion this is better as reference. The easiest way to install OCaml depends on the OS you are using, but GODI [3] is a good choice for most systems. [1]

Re: [Caml-list] Why don't you use batteries?

2009-09-03 Thread Ashish Agarwal
I have been planning to start using Batteries for several months, but here are some reasons I have not yet: - It did not compile under godi, but I haven't tried in a while. - The migration will require changes across our code base. It's hard to set aside the time for such an undertaking. - Core

Re: [Caml-list] Why don't you use batteries?

2009-09-03 Thread Ashish Agarwal
Great! I did not know this book was going to employ Batteries. That is a great step towards making Batteries the standard library. On Thu, Sep 3, 2009 at 2:24 PM, Alp Mestan a...@mestan.fr wrote: On Thu, Sep 3, 2009 at 5:00 PM, Ashish Agarwal agarwal1...@gmail.comwrote: - Core language

Re: [Caml-list] ignoring toplevel phrases?

2009-06-26 Thread Ashish Agarwal
Just curious, why do you want this? On Fri, Jun 26, 2009 at 12:22 AM, Roland Zumkeller roland.zumkel...@gmail.com wrote: Hi, Is it possible to modify the toplevel's behavior such that it silently ignores any re-definitions of already bound identifiers (without recompiling)? I would like to

Re: [Caml-list] Extending existing modules

2009-06-03 Thread Ashish Agarwal
A related request is that mli files result in named module types, which has been previously discussed: http://groups.google.com/group/fa.caml/browse_frm/thread/6485036bc24f262f/af3cd471a808c8d9?lnk=gstq=agarwal#af3cd471a808c8d9 On Wed, Jun 3, 2009 at 1:04 PM, Sébastien Hinderer

Re: [Caml-list] Extending modules and signatures

2009-04-17 Thread Ashish Agarwal
This is a commonly requested feature. One issue is that a file a.ml creates a module A. However, a file a.mli does not create a module type A. I'm not sure why this is the case. Does anyone know if there is a specific reason? On Fri, Apr 17, 2009 at 4:51 PM, Peter Hawkins

Re: [Caml-list] Strings

2009-04-03 Thread Ashish Agarwal
I found immutable strings to be a PITAin what way? On Fri, Apr 3, 2009 at 7:56 AM, Jon Harrop j...@ffconsultancy.com wrote: I read that batteries included provides first-class rope-based strings and I was just reading up on some horror stories about immutable strings on StackOverflow.

Re: [Caml-list] building 64bit ocaml from cvs on mac osx leopard

2009-03-05 Thread Ashish Agarwal
I just did a fresh install and it is working fine for me when I use the normal method. The ocamlbuild method seems to compile fine, but make install gives some error. I checked ocamlbuild's log file and the last line says Compilation successful, but when I do make install it says cp: ocamlc: No

Re: [Caml-list] ocamlbuild + ocamldoc + external library problems

2008-12-23 Thread Ashish Agarwal
Thank you. That does it. However, it seems not analogous to code compilation, for which what I did was add ocaml_lib ~extern:true ~dir:~/mylibs mylib2; to myocamlbuild.ml and then use the _tags file to specify which files require mylib2. I wonder why the call to ocamldoc cannot use the same

Re: [Caml-list] More Caml

2008-12-23 Thread Ashish Agarwal
a lot more effort into numerics and string processing and a lot less effort into symbolics Is there any fundamental reason these two goals must be at odds? Why can't a compiler be good at numeric and symbolic computation? On Tue, Dec 23, 2008 at 4:59 AM, Jon Harrop j...@ffconsultancy.com wrote:

[Caml-list] ocamlbuild + ocamldoc + external library problems

2008-12-22 Thread Ashish Agarwal
How can I get ocamlbuild to include paths to external libraries when building documentation? Ocamlbuild gives me errors when building documentation, when my interface files contain references to an external library. I have set up my plugin and _tags file to correctly compile the code, but cannot

Re: [Caml-list] About namespaces

2008-11-22 Thread Ashish Agarwal
Among other things, this means that if I write an extension MyList to List and someone else writes and extension HisList to List, there is no automated way to merge these, I need to write yet another module LatestList to be able to use both extensions at the same time. Merging these with the

Re: [Caml-list] open Module (not?) considered harmful

2008-11-20 Thread Ashish Agarwal
Consider open Array;; open List;; I doubt anyone is recommending this. The module design dictates, to some extent, whether the module should be opened. Array and List clearly should not since they have commonly used function names. However, the proposed Data.Containers certainly should be

Re: [Caml-list] problem installing janestreet core through godi

2008-10-22 Thread Ashish Agarwal
, characters 21-46: Unbound type constructor Type_class.writer On Wed, Oct 22, 2008 at 4:16 AM, Mark Shinwell [EMAIL PROTECTED]wrote: On Tue, Oct 21, 2008 at 04:22:09PM -0400, Markus Mottl wrote: 2008/10/21 Ashish Agarwal [EMAIL PROTECTED]: I am having trouble installing JaneStreet's Core library

Fwd: [Caml-list] problem installing janestreet core through godi

2008-10-22 Thread Ashish Agarwal
I only had cpp-4.0 and tried your suggestion with that; bin-prot compiles completely. On Wed, Oct 22, 2008 at 1:57 PM, Nobuyuki TOMIZAWA [EMAIL PROTECTED] wrote: Hi, list, Thank you for the replies. In type_class.ml and type_class.mli, I replaced (*pp cpp $ARCH_FLAGS *) with (*pp gcc -E

[Caml-list] problem installing janestreet core through godi

2008-10-21 Thread Ashish Agarwal
I am having trouble installing JaneStreet's Core library through godi. On Mac OS X, it fails while installing the prerequisite bin-prot: ... ocamlfind ocamlc -package type-conv -c -pp cpp $ARCH_FLAGS -I +camlp4 type_class.mli File type_class.mli, line 93, characters 15-16: Syntax error ...

Re: [Caml-list] Dynamic loading on Mac OS X

2008-10-16 Thread Ashish Agarwal
See this post on beginner's list: http://tech.groups.yahoo.com/group/ocaml_beginners/message/6905 On Wed, Oct 15, 2008 at 4:14 PM, Harrison, John R [EMAIL PROTECTED] wrote: This discussion of dynamic loading in 3.11 reminded me of a more basic question I meant to ask, but never did. On

Re: [Caml-list] Default module type?

2008-09-25 Thread Ashish Agarwal
That is correct. You have to define a module type within an ml file, and then include that. See the following thread on the beginner's list. http://tech.groups.yahoo.com/group/ocaml_beginners/message/8992 However, I never did find out why. Why does the compiler not create a module type MySig from

Re: [Caml-list] Another question about modules

2008-07-15 Thread Ashish Agarwal
Firstly, you have a circular dependency. How are you compiling? That should be the first error you get. On Tue, Jul 15, 2008 at 6:51 PM, Andre Nathan [EMAIL PROTECTED] wrote: I think this is similar to this simpler problem: a.ml: type t = { id: int } let f x = print_int x.id; B.f x

Re: [Caml-list] Re: call ocaml from R

2008-07-03 Thread Ashish Agarwal
There was some discussion about this on the main list, but there was no clear answer. http://groups.google.com/group/fa.caml/browse_thread/thread/46ad55d2102c1898/b92a26b04ce70c5d?lnk=gstq=R#b92a26b04ce70c5d On Thu, Jul 3, 2008 at 11:21 AM, Peng Zhang [EMAIL PROTECTED] wrote: Is it at all