Is it possible to have interface constraints on a parameter to a type constructor of a dependent record in idris?
Say I have an interface Show : Type -> Type
. Now I need to place a constraint on the following dependent record:
record Source s where
constructor MkSource
initial : s
I need to place a constraint on the parameter s
so that it should always be a instance of Show
. How to achieve this?
Show
" do you mean there should exist a witnessss : Show s
? If yes, why not just add another field toSource
of typeShow s
? – CactusShow
interface in your question (ie using the keywordsinterface
andwhere
). – Philip Dorrell