[Haskell-cafe] Encapsulation in Haskell

Jared Updike jupdike at gmail.com
Thu Dec 22 15:58:52 EST 2005

> > So one of the big things in object oriented programming is
> > encapsulation, and I'm wondering how to do it properly in
> > Haskell.  How do you define new data types but minimize the
> > dependence of external packages on the exact nature of the
> > data definition?
> Use modules. Don't expose the constructors.

Instead, just expose functions that implement the functionality users
of your library will need:



jupdike at gmail.com
reverse ")-:"

More information about the Haskell-Cafe mailing list