I have hit a problem in HaRe when lifting a declaration from e.g. a where clause of a function to the top level, where there is a type signature of any complexity.
e.g lifting 'baz' from function 'foo' below
--------------------------
foo a = baz
where
baz :: Int
baz = xx 1 a
xx :: (Num t) => t -> t -> t
xx p1 p2 = p1 + p2
--------------------------------------
becomes
---------------------------------------------
foo a = (baz xx a)
where
xx :: (Num t) => t -> t -> t
xx p1 p2 = p1 + p2
-- baz:: (forall t. Num t => t -> t -> t) -> Int ->Int
baz :: Num a => (a -> t1 -> t) -> t1 -> t
baz xx a= xx 1 a
-----------------------------------------------
For a very small subset this can be calculated easily, but for full generality it would be great to access the full power of the GHC type system.