[Haskell-cafe] Working with the code For "Typing Haskell In Haskell"

Patrick LeBoutillier patrick.leboutillier at gmail.com
Tue Oct 18 17:37:15 CEST 2011

Hi all,

I'm working with the code that accompanies this paper
(http://web.cecs.pdx.edu/~mpj/thih/) and I'm trying to use it
but I can't figure out how to get started. I have the following code
but it is not giving me the expected result:

import TypingHaskellInHaskell

mapt = "map" :>: Forall [Star, Star]
            ([] :=>
             ((TGen 0 `fn` TGen 1) `fn` TAp tList (TGen 0) `fn` TAp
tList (TGen 1)))

idt = "id" :>: Forall [Star]
            ([] :=>
             (TGen 0 `fn` TGen 0))

exprt = Ap (Const mapt) (Const idt)

test = runTI $ tiExpr initialEnv [] exprt

When I execute the test function above in ghci I get:

([],TVar (Tyvar "v3" Star)).

I was expecting someting like below for the type part:

TAp tList (TGen 0) `fn` TAp tList (TGen 0)

What I want is the library to compute for me the type of "map id".
What is the proper way to achieve this? Has anybody on the list worked
with this code before?

Thanks as lot,

Patrick LeBoutillier
Rosemère, Québec, Canada

More information about the Haskell-Cafe mailing list