[Haskell-cafe] Encapsulation in Haskell

Philippa Cowderoy flippa at flippac.org
Thu Dec 22 15:53:07 EST 2005

On Thu, 22 Dec 2005, Creighton Hogg wrote:

> Hi guys,
> 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.

flippa at flippac.org

The task of the academic is not to scale great 
intellectual mountains, but to flatten them.

More information about the Haskell-Cafe mailing list