* An extended comparative study of language support for generic programming @ 2010-02-11 0:06 Jon Harrop 2010-02-10 23:00 ` [Caml-list] " Raoul Duke 0 siblings, 1 reply; 4+ messages in thread From: Jon Harrop @ 2010-02-11 0:06 UTC (permalink / raw) To: caml-list Anyone studied this paper by Garcia et al.: http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.110.122&rep=rep1&type=pdf -- Dr Jon Harrop, Flying Frog Consultancy Ltd. http://www.ffconsultancy.com/?e ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Caml-list] An extended comparative study of language support for generic programming 2010-02-11 0:06 An extended comparative study of language support for generic programming Jon Harrop @ 2010-02-10 23:00 ` Raoul Duke 2010-02-11 1:31 ` Jon Harrop 0 siblings, 1 reply; 4+ messages in thread From: Raoul Duke @ 2010-02-10 23:00 UTC (permalink / raw) To: caml-list > http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.110.122&rep=rep1&type=pdf :-) http://groups.google.com/group/comp.lang.functional/browse_thread/thread/d654fedd6efdf753/3ee82770d5e79402#3ee82770d5e79402 ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Caml-list] An extended comparative study of language support for generic programming 2010-02-10 23:00 ` [Caml-list] " Raoul Duke @ 2010-02-11 1:31 ` Jon Harrop 2010-02-11 2:10 ` Peng Zang 0 siblings, 1 reply; 4+ messages in thread From: Jon Harrop @ 2010-02-11 1:31 UTC (permalink / raw) To: caml-list On Wednesday 10 February 2010 23:00:44 Raoul Duke wrote: > > http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.110.122&rep=rep1 > >&type=pdf > > > :-) > > http://groups.google.com/group/comp.lang.functional/browse_thread/thread/d6 >54fedd6efdf753/3ee82770d5e79402#3ee82770d5e79402 See my response there: http://groups.google.com/group/comp.lang.functional/msg/2cb15a6281087b04 :-) I was wondering if anyone here was familiar with this work and/or had anything to say about their OCaml solutions and discussion? -- Dr Jon Harrop, Flying Frog Consultancy Ltd. http://www.ffconsultancy.com/?e ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Caml-list] An extended comparative study of language support for generic programming 2010-02-11 1:31 ` Jon Harrop @ 2010-02-11 2:10 ` Peng Zang 0 siblings, 0 replies; 4+ messages in thread From: Peng Zang @ 2010-02-11 2:10 UTC (permalink / raw) To: caml-list; +Cc: Jon Harrop -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Just read the relevant OCaml section, and I see two things that seem strange: 1) From my understanding, the paper appears to say that OCaml has cannot constrain a function parameter with more than one concept, which is untrue. Eg. # class type foo = object method foo : unit end;; # class type bar = object method bar : unit end;; # let f ((x:#foo):#bar) = x;; val f : (< bar : unit; foo : unit; .. > as 'a) -> 'a = <fun> 2) It also says that constraints specified on type parameters may not determine the actual type. They provide example: class type conceptA = object method fn1 : int end let algo (x : #conceptA) : int = x#fn2 + 1 And point out the type of parameter x is not just #conceptA, it also has method fn2. This is true. But although confusing to new users, is hardly limiting. You can use a sig [A] to ensure the parameter type is correct (that's what sigs do after all), or you can simple use the close type and then the open [B]. [A] include (struct let algo (x : #conceptA) : int = x#fn2 + 1 end:sig val algo : #conceptA -> int end);; [B] let algo (x : conceptA) : int = x#fn1 + 1;; let algo (x : #conceptA) : int = algo (x:>conceptA);; Peng On Wednesday 10 February 2010 08:31:00 pm Jon Harrop wrote: > On Wednesday 10 February 2010 23:00:44 Raoul Duke wrote: > > > http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.110.122&rep=re > > >p1 &type=pdf > > > > > :-) > > > > http://groups.google.com/group/comp.lang.functional/browse_thread/thread/ > >d6 54fedd6efdf753/3ee82770d5e79402#3ee82770d5e79402 > > See my response there: > > http://groups.google.com/group/comp.lang.functional/msg/2cb15a6281087b04 > > :-) > > I was wondering if anyone here was familiar with this work and/or had > anything to say about their OCaml solutions and discussion? -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.7 (GNU/Linux) iD8DBQFLc2cQfIRcEFL/JewRAtBaAJ4maHkhrk0oYyDGekgTPkugIb8v1gCbBwg0 QxCm3QBqUR1vrPDB1+aM9bA= =cQ8r -----END PGP SIGNATURE----- ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2010-02-11 2:10 UTC | newest] Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2010-02-11 0:06 An extended comparative study of language support for generic programming Jon Harrop 2010-02-10 23:00 ` [Caml-list] " Raoul Duke 2010-02-11 1:31 ` Jon Harrop 2010-02-11 2:10 ` Peng Zang
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).