Confusion about types
|Reported by:||guest||Owned by:|
|Component:||Compiler (Type checker)||Version:||6.4.1|
|Type of failure:||Difficulty:||Unknown|
|Test Case:||Blocked By:|
In GHC 6.0.1 the following data type definition (for a binary search tree) seems to be invalid.
I know I've used this kind of thing before, so whats up. This is the entire file, by the
data BST a = Ord a => Leaf | Node a (BST a) (BST a)
Gives an error message :
All of the type variables in the constraint `Ord a' are already in scope
(at least one must be universally quantified here)
When checking the existential context of constructor `Leaf'
In the data type declaration for `BST'
I'm confused - where would I put a universal quantification? Does Leaf now need a type declaration and if so what would it be?