I am trying to write a record in Idris but that has a generic parameter which needs to be constrained by an interface. For normal union types I can write:
data BSTree : (a : Type) -> Type where
Empty : Ord a => BSTree a
Node : Ord a => BSTree a -> a -> BSTree a
but I am trying to figure out the syntax for doing the same thing, just with a record. I tried something like:
record Point a where
constructor MkPoint : Eq a => a -> a -> Point a
x : a
y : a
but it does not compile.
Is there a way to do this in Idris?
TIA