
30 Jul
2008
30 Jul
'08
3:28 p.m.
A data declaration _defines_ type constructors. You describe what types those constructors can accept, so this: data T = TString String | TInt Integer | TList [T] | TDict [(TString, T)] actually doesn't make any sense -- the list holds what? Holds tuples of `TString` and `T`. What type is `TString` ? It's not a type, it's a constructor! So you need to make it a type. Also, it is not clear to me why the `TDict` can not just map `String`s to `T`s -- if you get a `TString` in the course of parsing, you can unwrap it. -- _jsn