Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
Which syntax to teach ?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2007-10-30 (16:30)
From: Chung-chieh Shan <ccshan@p...>
Subject: Re: Which syntax to teach ?
Adrien <> wrote in article <> in gmane.comp.lang.caml.inria:
> > 7. They easily understand how the standard library is used (but not the
> > functors), the open statement, the fact that a program may be in several
> > .ml files. The .mli files are a bit more mysterious. Functors are _very_
> > mysterious.

Any tips on how (and perhaps how not) to teach functors?  I'm using a
Haskell equivalent of functors (namely constructor classes) in an AI
class (!) and they seem to be mysterious.  It didn't seem to work to
explain the Java/C# code that I would like to write (but can't, because
these languages have no interface _on_ generics (as opposed to generic

> I just don't get the importance of functors.

I use them to provide multiple interpretations of the same abstract
construction (each interpretation is a module and each abstract
construction is a functor from interpretation modules to result
modules).  Here is a description of a simple example:

Edit this signature at
One can show you aren't immediately killed by tidal forces once crossing
over the event horizon of Black Hole. Mathematically, your space coordinates
become time-like and vice versa. This causes a shift in your light
cone and your world line can never intersect with someone on the outside.