Let us consider the following code snippet:
blah :: a -> b -> a
blah x y = ble x where
ble :: b -> b
ble x = x
This compiles fine under GHC, which essentially means that b
from the 3rd line is something different than b
from the first line.
My question is simple: is there a way to somehow relate in the type declaration of ble
to a type used in an outer context, i.e. the type declaration of blah
?
Obviously, this is just an example and not a real-world use-case for type declarations.
module Blarg where ...
:) – BifoliateTypeAbstractions
implemented this in GHC 9.10: It allows you to bind them explicitly as part of the equation:blah @a @b x y = ..
– Permeate