caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* FP & Software Engineering
@ 2006-03-29 23:01 Jonathan Bryant
  2006-03-29 23:38 ` [Caml-list] " skaller
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Jonathan Bryant @ 2006-03-29 23:01 UTC (permalink / raw)
  To: caml-list

Ok.  I have a question (or set of questions) that requires the expertise
of the list, so here it goes:

For my Software Engineering II class, which is very heavily based around
object oriented design patterns, I have implemented all 10 assignments
(so far) in OCaml using simply the functional aspects of the language
(no objects).  Each pattern has been used in a rather purist form.  For
example, strategy and iterator were simply higher order functions, while
things like command were implemented using closures/lexical scoping.
This makes for code that is faster, more efficient, and cleaner than my
fellow students' Java/C++ code.

I've been fighting my professors to let me use OCaml for over a year now
and this professor is, at least, the first one who's halfway letting me
use it.  Unfortunately, he is not completely convinced.  Being a OO &
ASP/.NET junkie and never having seriously used a functional language,
he is lost as to HOFs, functors, partial application, etc. and isn't
really convinced that they are useful/necessary (I also believe he
hasn't more than glanced at the code).  He is also demanding UML
diagrams of my code with these notated in it.

Has anybody ever come up with a way of doing these things (HOFs,
functors, partial application, module types, parametric polymorphism) in
UML or any kind of modeling language?  If not, how are these things
usually notated in academic settings (symbolicly, not verbally)?  Is
there anything I can make visually that qualifies?  Google did not
reveal a modeling language for FPLs, so I'm lost.

--Jonathan Bryant



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Caml-list] FP & Software Engineering
  2006-03-29 23:01 FP & Software Engineering Jonathan Bryant
@ 2006-03-29 23:38 ` skaller
  2006-03-30 14:42 ` Jean-Christophe Filliatre
       [not found] ` <Pine.LNX.4.63.0603311500560.4669@phonographe.labri.fr>
  2 siblings, 0 replies; 4+ messages in thread
From: skaller @ 2006-03-29 23:38 UTC (permalink / raw)
  To: jtbryant; +Cc: caml-list

On Wed, 2006-03-29 at 18:01 -0500, Jonathan Bryant wrote:

> I've been fighting my professors to let me use OCaml for over a year now
> and this professor is, at least, the first one who's halfway letting me
> use it.  Unfortunately, he is not completely convinced.  Being a OO &
> ASP/.NET junkie and never having seriously used a functional language,
> he is lost as to HOFs, functors, partial application, etc. and isn't
> really convinced that they are useful/necessary (I also believe he
> hasn't more than glanced at the code). 

Sounds like you should be the professor, and he the student :)

>  He is also demanding UML
> diagrams of my code with these notated in it.

> If not, how are these things
> usually notated in academic settings 

Category theory. It's full of pictures :)
But doesn't fit well with applicative languages
(CT is compositional).

Hmm..


	'a list ----- filter ----> 'a list

you can draw some pictures of functions and join
up the domains and codomains, and, instantiate
type variables:

	'a list
	   ||
	   ||
	   V
	int list

I guess you'll eventually get enough ink on paper to make
it look pretty. 


-- 
John Skaller <skaller at users dot sf dot net>
Felix, successor to C++: http://felix.sf.net


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Caml-list] FP & Software Engineering
  2006-03-29 23:01 FP & Software Engineering Jonathan Bryant
  2006-03-29 23:38 ` [Caml-list] " skaller
@ 2006-03-30 14:42 ` Jean-Christophe Filliatre
       [not found] ` <Pine.LNX.4.63.0603311500560.4669@phonographe.labri.fr>
  2 siblings, 0 replies; 4+ messages in thread
From: Jean-Christophe Filliatre @ 2006-03-30 14:42 UTC (permalink / raw)
  To: jtbryant; +Cc: caml-list


Jonathan Bryant writes:
 > Has anybody ever come up with a way of doing these things (HOFs,
 > functors, partial application, module types, parametric polymorphism) in
 > UML or any kind of modeling language? 

In Norman  Ramsey's nice  paper "ML Module  Mania" you'll find  such a
diagram for a complex combination of signatures, modules and functors:
see

  http://www.eecs.harvard.edu/nr/pubs/maniaws-abstract.html 

There  are similar  diagrams in  Philippe Narbel's  recent  book about
Ocaml, but unfortunately  this book is only printed  in French (if I'm
right).

Hope this helps,
-- 
Jean-Christophe Filliâtre (http://www.lri.fr/~filliatr)


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: FP & Software Engineering
       [not found] ` <Pine.LNX.4.63.0603311500560.4669@phonographe.labri.fr>
@ 2006-03-31 20:27   ` Jonathan Bryant
  0 siblings, 0 replies; 4+ messages in thread
From: Jonathan Bryant @ 2006-03-31 20:27 UTC (permalink / raw)
  To: Philippe Narbel; +Cc: caml-list

Wow.  I think I follow most of that, but ATM I do wish I spoke more than
about 2 words of French.  Some of the later examples I'm a little lost
on, but I've only given it a cursory glance so far.

While this is great for the modules, it doesn't seem as though there is
a way to indicate much other than the module/functor system (although it
is possible that this is due to my shortcomings in the French
language :).  Anything on the use of partial application, lexical
scoping, HOFs, etc. as design elements?

--Jonathan

On Fri, 2006-03-31 at 15:11 +0200, Philippe Narbel wrote:
> 
> > Ok.  I have a question (or set of questions) that requires the expertise
> > of the list, so here it goes:
> >
> > [...]
> 
> > Has anybody ever come up with a way of doing these things (HOFs,
> > functors, partial application, module types, parametric polymorphism) in
> > UML or any kind of modeling language?  If not, how are these things
> > usually notated in academic settings (symbolicly, not verbally)?  Is
> > there anything I can make visually that qualifies?  Google did not
> > reveal a modeling language for FPLs, so I'm lost.
> >
> 
> 
> hello,
> 
> I have been very interested in these questions for 
> some time now.  As a matter of fact, UML is not 
> very good at all to represent generic architectures...
> 
> Here in Bordeaux, I made my ML students use a special
> notation which is close to Petri nets. I introduce it in 
> my book about OCaml, but -- as Filiatre said --, it is only
> printed in french so far.
> 
> However, you can find a paper on the internet that 
> I wrote for the INRIA conference JFLA'2004 about this subject.
> It is also in french but the examples aren't, and you should
> be able to figure out how the representation works by
> looking at the figures:
> 
> http://jfla.inria.fr/2004/actes/PS/12-narbel.ps
> 
> of course, feel free to ask me any more questions.
> 
> Ph. Narbel
> 
> 
> 


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2006-03-31 20:28 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-03-29 23:01 FP & Software Engineering Jonathan Bryant
2006-03-29 23:38 ` [Caml-list] " skaller
2006-03-30 14:42 ` Jean-Christophe Filliatre
     [not found] ` <Pine.LNX.4.63.0603311500560.4669@phonographe.labri.fr>
2006-03-31 20:27   ` Jonathan Bryant

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).