
31 Jul
2008
31 Jul
'08
6:36 a.m.
Rafael Gustavo da Cunha Pereira Pinto schrieb:
I was thinking:
data TPrimitive= TString String | TInt Integer data TComplex = TList [TPrimitive] | TDict [(String,TPrimitive)] data T = TPrimitive | TComplex
Would that work?
This is not what Markus wants for two reasons: (1) T is just an enumeration here, maybe you meant data T = TPrimitive TPrimitive | TComplex TComplex instead. (2) Lists and dictionaries are allowed to contain complex values, but lists are not allowed to contain values of different "types". Tillmann