HaRe and incremental type checking / type inference

Richard Eisenberg eir at cis.upenn.edu
Sun Jul 13 20:21:22 UTC 2014


Hello Alan,

It's not clear what you're asking for here. What's keeping you from "accessing the full power of the GHC type system"?

Richard

On Jul 9, 2014, at 4:35 PM, AlanKim Zimmerman <alan.zimm at gmail.com> wrote:

> 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.
> 
> 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.
> 
> Regards
>  Alan
> 
> _______________________________________________
> ghc-devs mailing list
> ghc-devs at haskell.org
> http://www.haskell.org/mailman/listinfo/ghc-devs



More information about the ghc-devs mailing list