I have an interface that depends on another interface, with some dependent types, and I can't get the compiler to constrain a type in a related function
import Data.Vect
interface Distribution (0 event : Nat) (dist : Nat -> Nat -> Type) where
data Gaussian : Nat -> Nat -> Type where
Distribution e Gaussian where
interface Distribution targets marginal =>
Model (targets : Nat) (marginal : Nat -> Nat -> Type) model where
marginalise : model -> Vect s Double -> marginal targets s
foo : m -> Model 1 Gaussian m => Vect s Double -> Nat
foo model x = let marginal = marginalise model x in ?rhs
I get
While processing right hand side of foo. Can't find an implementation for Model ?targets ?marginal m.
foo model x = let marginal = marginalise model x in ?rhs
^^^^^^^^^^^^^^^^^^^
How could this be?
If I use marginalise {marginal=Gaussian} {targets=1} model x
it type checks, but I don't get why this isn't already determined by the type signature.
I don't think this qu I asked about the same area applies here