
Richard Eisenberg
On Jun 28, 2015, at 7:11 PM, Kosyrev Serge <_deepfire@feelingofgreen.ru> wrote:
Sadly, even this doesn't fly, because:
The first argument of a tuple should have kind '*', but 'a' has kind 'CatName'.
..which doesn't really change even if I replace the tuple with a product type within the CatEntry itself.
Basically GHC refuses to constrain the kind of constructor argument types beyond the granularity provided by '*'.
And so I wonder if this is one restriction among those that you aim to remove.. : -)
No -- this restriction leads to the best definition for tuples, in my opinion. Instead, you probably want a promoted tuple: put a ' before the open-parenthesis, and see if that works for you.
data CatEntry where CatEntry ∷ Category a ⇒ '(a, CatX a) → CatEntry
yields:
Expected a type, but ‘'(a, CatX a)’ has kind ‘(,) CatName *’ In the type ‘'(a, CatX a)’
whereas:
data CatEntry where CatEntry ∷ Category a ⇒ a → CatX a → CatEntry
yields:
Expected a type, but ‘a’ has kind ‘CatName’ In the type ‘a’
-- respectfully, Косырев Серёга