[Haskell-cafe] I miss OO
Erik de Castro Lopo
mle+hs at mega-nerd.com
Wed Nov 25 16:08:59 EST 2009
Michael Mossey wrote:
> I'm fairly new to Haskell, and starting to write some big projects.
> Previously I used OO exclusively, mostly Python. I really miss the
> "namespace" capabilities... a class can have a lot of generic method names
> which may be identical for several different classes because there is no
> ambiguity.
>
> In my musical application, many "objects" (or in Haskell, data) have a time
> associated with them. In Python I would have an accessor function called
> "time" in every class.
This is what Type Classes in Haskell are for. See:
http://www.haskell.org/tutorial/classes.html
Erik
--
----------------------------------------------------------------------
Erik de Castro Lopo
http://www.mega-nerd.com/
More information about the Haskell-Cafe
mailing list