
On Wed, Oct 09, 2024 at 09:33:30AM +0200, Andreas Källberg wrote:
On 8 Oct 2024, at 00:14, Tom Ellis
wrote: data PossiblyRootedTree lengths labels where RootedTree :: AugmentedTree [NodeId] lengths labels UnrootedTree :: AugmentedTree () lengths labels Isn’t that invalid syntax? Wouldn’t you need either
data PossiblyRootedTree lengths labels where RootedTree :: AugmentedTree [NodeId] lengths labels -> PossiblyRootedTree lengths labels UnrootedTree :: AugmentedTree () lengths labels -> PossiblyRootedTree lengths labels
or simply (avoiding GADT syntax altogether):
data PossiblyRootedTree lengths labels = RootedTree (AugmentedTree [NodeId] lengths labels) | UnrootedTree (AugmentedTree () lengths labels)
Yes, you're right, thanks (and I'm not sure why I thought that required a GADT). Tom