From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by walapai.inria.fr (8.13.6/8.13.6) with ESMTP id pA97U73T010647 for ; Wed, 9 Nov 2011 08:30:07 +0100 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ai8DAF0ruk4+yYwFkmdsb2JhbABDhH2VaY9BIgEBAQEHDQsHEieBcgEBBAEjGQFBCwsaAiYCAleIGwKmT5I2gTCGZ4EWBKYQ X-IronPort-AV: E=Sophos;i="4.69,482,1315173600"; d="scan'208";a="129352730" Received: from mx2.bouyguestel.com ([62.201.140.5]) by mail1-smtp-roc.national.inria.fr with ESMTP; 09 Nov 2011 08:30:04 +0100 Received: from PNMSSS226 ([10.123.138.22]) by pnmsss226z03fe0.bouyguestel.com (MTA Server) with ESMTP id <0LUD00MZEU635780@pnmsss226z03fe0.bouyguestel.com>; Wed, 09 Nov 2011 08:30:04 +0100 (CET) Date: Wed, 09 Nov 2011 08:29:58 +0100 From: Cedric Cellier In-reply-to: To: caml-list@inria.fr Reply-to: Cedric Cellier Message-id: <1320823798.6647.2.camel@Nokia-N900> Content-id: <1320823797.6647.1.camel@Nokia-N900> MIME-version: 1.0 X-Mailer: Modest 3.2 Content-type: text/plain; charset=utf-8 Content-transfer-encoding: 7bit References: Subject: Re: [Caml-list] Include question > And if you don't want to pollute your entire code with functor when > it's in fact for testing and not part of the logic of the application, Functor seams the way to go here. The use of this technique as envisaged here is hardly invading, and comes with many advantages : Functors help document/clarify the code by stating the relasionships between modules. Functors help build testable programs by encouraging small and well isolated modules. Functors help build testable programs by allowing to replace a module with the test version of the modules (the same with many more pre/post conditions added). And they come free from runtime cost most of the time, which is amazing. For some reasons though, despite functors being one of the greatest strength of the language, we do seam shy to use, recommand or brag about them. I wonder if this is due to the lack of proper documentation ?