
17 Nov
2009
17 Nov
'09
1:11 a.m.
2009/11/15 Matthew Wong
If I want to express the following idea (the following won't compiler):
data TypeCon a = ValConA a | ValConB [ValConA a] | ValConC [ValConB a]
In this definition, you are confusing constructors with types. You can't have a list of `ValConB a` -- the type is actually `TypeCon a`.
The alternative is use 3 different type constructors,
data TypeConA a = ValConA a data TypeConB a = ValConB a data TypeConC a = ValConC a
This is more promising. I'd need to see the typeclass you're trying to define to say more. -- Jason Dusek