<div dir="ltr"><div><div><div><div><div>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.<br><br></div><div>

e.g lifting 'baz' from function 'foo' below<br><br>--------------------------<br>foo a = baz<br>  where<br>    baz :: Int<br>    baz = xx 1 a<br><br>    xx :: (Num t) => t -> t -> t<br>    xx p1 p2 = p1 + p2<br>

--------------------------------------<br></div><div><br></div>becomes<br><br>---------------------------------------------<br>foo a = (baz xx a)<br>  where<br>    xx :: (Num t) => t -> t -> t<br>    xx p1 p2 = p1 + p2<br>

<br>-- baz:: (forall t. Num t => t -> t -> t) -> Int ->Int<br>baz :: Num a => (a -> t1 -> t) -> t1 -> t<br>baz xx a= xx 1 a<br>-----------------------------------------------<br><br></div>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.<br>

<br></div>So before diving in too deeply, I thought I would test the waters as to the feasibility of doing something like this. I was hoping that perhaps the effort at an external constraint solver might be making the interfacing slightly simpler.<br>

<br></div>Regards<br></div> Alan<br><div><div><div><br></div></div></div></div>