idiom for different implementations of same idea

Dylan Thurston dpt@math.harvard.edu
Thu, 1 Aug 2002 18:32:27 -0400


--H+4ONPRPur6+Ovig
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Thu, Aug 01, 2002 at 02:34:00PM -0700, Hal Daume III wrote:
> ...
> Now, I want in my executable my user to be able to say "-model=3D0" and so
> on in the command line and for it to use the appropriate model.  Each of
> these models will go in a separate module.
>=20
> One way to do this would be to import all of the models qualified and then
> if they choose Model0, pass to the "go" function Model0.prepareData,
> Model0.initialize, etc.  This is fine, simple, good.  But it doesn't
> enforce at all the types of the functions.

I don't understand what you mean by this.  Surely the "go" function is
polymorphic over the types in the model, but requires matching types?

I don't think you can get Haskell to not "enforce at all the types of
the functions".  I must be missing something.

--Dylan

--H+4ONPRPur6+Ovig
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQE9Sbb7Veybfhaa3tcRAruyAJ9GXPI9AMglRJSVG2zODmB6NPiXlgCglL1l
sIFOxF1llio8C1DnnpaHP98=
=qHBK
-----END PGP SIGNATURE-----

--H+4ONPRPur6+Ovig--