Is there a way to use DefaultSignatures extension with associated type families.
Here is an example why I need it.
class Foo p where
type Back p :: *
type Forward p :: *
customFunc :: p -> IO ()
newtype Bar a = Bar (Forward a)
data Bat = Bat
type family ForwardBar a :: *
type instance ForwardBar Bat = Int
instance Foo (Bar Bat) where
type Back (Bar Bat) = Bat
type Forward (Bar Bat) = ForwardBar Bat
customFunc _ = print "I am different customFunc and this is Bat Bat"
Now I want whenever p ~ Bar x then type Back (Bar x) = x and type ForwardBar (Bar x) = Forward x. I want to auto derive this whenever I am defining instance for some Bar x. However, definition of customFunc is different. Is this possible?
Also is it possible to add default signatures to functions of a class in another file (or package). I am using some class which I want to add default signatures but I dont want to modify the class definition itself.