Let’s say I have a couple of functions like this:
f :: forall t. Foo (t -> Bar Integer) => t -> Integer
g :: forall t. Foo (t -> Bar ()) => t -> Integer
and their definitions use TypeApplications and ScopedTypeVariables to declare the Foo
instance to use, since it’s ambiguous. I cannot write a type synonym Fubar
…
type Fubar i = forall t. Foo (t -> Bar i) => t -> Integer
…since this will no longer bind t
in the type declarations.
Can I somehow extract or bubble up the t
variable? Could a type synonym have an additional output channel that can be bound?