[Haskell-cafe] Data Type Inheritance ala OO - Inheritence -- howto best in Haskell ?
kaffeepause73
kaffeepause73 at yahoo.de
Fri Jun 17 09:40:07 CEST 2011
Hi Evan,
that looks very interesting indeed - as still newby I try to understand:
- u create a class "Y" to tackle the "zero" problem for different kinds of y
vectors in a common way
- u create a "Signal" class for the Y- signal inheriting interfaces from y
and Storable.Storable
Then u nest X and Y in a V.Vector - array and give it the type synonym
SigVec.
In all of this X and Y are ur types (or type synonyms) and y is a help
variable.
Then u define the function at -- and that where my understanding fails ?
- this function takes X and sigVec and give u Y ? -- do u use it to applies
all functions on SigVec on Y ?
- don't u need to create instances somewhere in the process and wouldn't u
then have to write all the code during the instance declaration ?
Cheers Phil
P.S.: - some generic question:
- I read using composite datatype using the "data" keyword makes code rather
slow - is nesting better ? : e.g. "data Signal Double v.Vector" versus
"newtype (Double, v.Vector)
- which nesting structure is most efficient - touples, lists, V.vector, ...
- alternatively I'm thinking of an "external parallel list" to store
information about the signals
--
View this message in context: http://haskell.1045720.n5.nabble.com/Data-Type-Inheritance-ala-OO-Inheritence-howto-best-in-Haskell-tp4494800p4497962.html
Sent from the Haskell - Haskell-Cafe mailing list archive at Nabble.com.
More information about the Haskell-Cafe
mailing list