quickspec
quickspec copied to clipboard
Higher Kinded type arguments
I have a use case where my data types receive higher kinded types, for example:
type R2 a b = (Representable a, Representable b)
newtype LinRel k a b = LR
{ unLR :: (Num k, R2 a b) => a k -> b k
}
And I have a set of operations over this data type.
I tried using quickspec but found that I cannot add an operation that works over this data type because A, B, etc. types are not of the right kind. I could monomorphize but there are operations that need to be polymorphic like compose :: R b => LinRel k a b -> LinRel k b c -> LinRel k a c.
Is there a way to workaround this limitation?