Jacques Garrigue writes:
> type 'a base = {x : 'a; fn : 'a -> unit}
> type 'b base_op = {bop: 'a. 'a base -> 'b}
> type base_wrapper = {base: 'b. 'b base_op -> 'b}
>
> let l =
> let a = {x = 1; fn = print_int}
> and b = {x = 1.2; fn = print_float} in
> [{base = fun x -> x.bop a}; {base = fu
Here is a slightly more usable version, using helper functions to
avoid writing intermediate closures by hand.
type 'a base = {x : 'a; fn : 'a -> unit}
(* 4 next lines are boilerplate, could be auto-generated *)
type 'b base_op = {bop: 'a. 'a base -> 'b}
type base_wrapper = {base: 'b. 'b b
From: Goswin von Brederlow
> Small extra question concerning this. Can I get ocaml to recognise a
> type like this?
>
> type base = 'a. {
> x : 'a;
> fn : 'a -> unit;
> }
>
> List.iter
> (fun r -> r.fn r)
> [{x = 1; fn = (fun r -> print_int r.x); };
>{x = 1.2; fn = (fun r -> print_fl
Goswin von Brederlow writes:
> So what other ways are there of doing this? Records. Idealy I would
> like to do this:
>
> type base = { x : int }
> let make_base x = { x = x }
> let print_x r = print_int r.x
> type foo = { base with y : int }
> let make_foo x y = { x = x; y = y }
> let _ =
> pr
Peng Zang writes:
> On Tuesday 07 April 2009 03:41:32 am David MENTRE wrote:
>> Hello,
>>
>> On Tue, Apr 7, 2009 at 07:48, Goswin von Brederlow
> wrote:
>> > In the last 2 weeks I've been playing around with lots of different
>> > ways to do the same thing to get a feel for what style suites me
David MENTRE writes:
> Hello,
>
> On Tue, Apr 7, 2009 at 07:48, Goswin von Brederlow wrote:
>> In the last 2 weeks I've been playing around with lots of different
>> ways to do the same thing to get a feel for what style suites me
>> best. If you have improvements or alternative ways of doing th
Hello,
there is a petition against softwarepatents in europe.
Please sign the petition and spread the word!
http://www.stopsoftwarepatents.eu/
Ciao,
Oliver Bandel
___
Caml-list mailing list. Subscription management:
http://yquem.inria.fr/cg
Can anyone summarize the trade-offs between the Camomile and Netstring
(netconversion) unicode translation libraries? The netconversion
documentation (http://projects.camlcity.org/projects/dl/ocamlnet-2.2.9/doc/html-main/Netconversion.html
) mentions that Camomile implements text strings as in
DESMONS Bertrand wrote:
By the way, where can I see whether the file in question is a symbolic link?
"ls -l"?
or
"cmd /c dir"
With "cmd /c dir", you should see a file "liblapack.a.lnk" (in /lib).
Can you see it? Is there a file "liblapack.a" as well?
-- Alain
__
>Can you try passing "-ccopt -cygpath" to ocamlc?
Yes, but the error persists...
| a...@pc~/UMH/Master 2
| $ ocamlc -ccopt -cygpath -I "C:/Program Files/Objective
Caml/lib/site-lib/lacam
| l" bigarray.cma lacaml.cma -verbose d.ml
| + flexlink -chain mingw -exe -o "camlprog.exe" "-LC:/Program
Fi
DESMONS Bertrand wrote:
Hello,
Compiling a little program using Lacaml (in a cygwin shell) gives me the
error:
The library file seems to be a symbolic link. flexlink is a regular
Win32 application and does not know about this Cygwin-specific notion.
The good news is that it can use the exter
Hello,
Compiling a little program using Lacaml (in a cygwin shell) gives me the
error:
| a...@pc~/UMH/Master 2
| $ ocamlfind ocamlc -package lacaml -linkpkg d.ml
| ** Fatal error: Error while reading c:/cygwin/lib\liblapack.a:
Sys_error("Invali
| d argument")
| File "d.ml", line 1, characters 0-1
OPEN CALL FOR PAPERS
JFP Special Issue on Generic Programming
Deadline: 1 October 2009
http://www.comlab.ox.ac.uk/ralf.hinze/JFP/cfp.html
Scope
-
Generic programming is about making programs more adapt
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
On Tuesday 07 April 2009 03:41:32 am David MENTRE wrote:
> Hello,
>
> On Tue, Apr 7, 2009 at 07:48, Goswin von Brederlow
wrote:
> > In the last 2 weeks I've been playing around with lots of different
> > ways to do the same thing to get a feel for w
> I have a question related to this: Is there a reason for the absence of a
> ConcreteBidirectionalLabeled graph in the API?
Simply an historical reason: the module ConcreteBidirectional is an
external contribution (by Ted Kremenek), which was only recently added
to Ocamlgraph.
Anybody can cont
Hi,
I have a question related to this: Is there a reason for the absence of a
ConcreteBidirectionalLabeled graph in the API?
Thanks,
Matthieu
- Message d'origine
> De : Jean-Christophe Filliâtre
> À : Pietro Abate
> Cc : caml-list@yquem.inria.fr
> Envoyé le : Mardi, 7 Avril 2009, 9
Hello,
On Tue, Apr 7, 2009 at 07:48, Goswin von Brederlow wrote:
> In the last 2 weeks I've been playing around with lots of different
> ways to do the same thing to get a feel for what style suites me
> best. If you have improvements or alternative ways of doing the two
> things below let me kno
The ACM SIGSAM 2009 International
Workshop on Programming Languages for
Mechanized Mathematics Systems
PLMMS 2009
Munich, Germany; August 21, 2009
http://plmms09.cse.tamu.edu
Hi,
Sorry for the late answer...
> I've a small problem with ocamlgraph.
> I want to parse a dot graph into a ConcreteBidirectional.
>
> The problem is that the signature needed for Dot.Parse requires a function
> edge, but I've no mean to specify a label (since it is unlabelled !!)...
>
> The
19 matches
Mail list logo