[Haskell-cafe] Base classes can be _ELIMINATED_ with interfaces

Shelby Moore shelby at coolpage.com
Thu Nov 5 07:10:06 EST 2009


> Shelby Moore wrote:
>> In Haskel, subtyping is done with Module...
>
> data is analogous to a public class members.  Use Module to make some
> implementation private:
>
> http://www.cs.auckland.ac.nz/references/haskell/haskell-intro-html/modules.html#sect9.2
>
> Thus use type classes (interfaces) when consuming the public Module
> interfaces in functions (i.e. only consume the exported Module interfaces
> in the sense they implement a type class, never directly consume the
> Module name space).

A strong argument against hiding internal functionality of an ADT (against
using Module), and favoring fully composable functional programming (i.e
Haskell without Module) for GUIs:

http://lambda-the-ultimate.org/node/3668#comment-51993  (concise and sweet)


More information about the Haskell-Cafe mailing list