Architecture of HTE v.Haskell 2010

When it comes to typecheckers, the expectations are high. We expect them to be defect free and function exactly as expected. Earlier, I argued that it cannot easily be achieved without translations to a more solid and accepted setting. For the very same purpose, to make the typechecker as solid as possible I developed a version (v.Haskell 2010) based on the standard and accepted methods.

Firstly, the core part of the typechecker is nearly identical to the one (THIH) developed (and extended) by Mark P. Jones. The desugaring system is carefully coded to follow translations defined in Haskell 2010 language report. Kind inference is done by the typechecker itself; it employs the demotion schemes described earlier. Finally, the layered architecture of the project keeps each part separated.

The system is composed of the following components:

  • HSE – Parser
    :: (User input – Haskell 2010 :: String) -> AST
  • Desugaring System
    :: AST -> Desugared AST
  • ToTHIH
    :: Desugared AST -> Surface THIH Syntax (implicitly kinded)
  •  Kind Inference
    :: Surface THIH Syntax  -> Original THIH Syntax (explictly kinded)

    1. Demotion
      :: Types of Surface THIH Syntax -> THIH Expressions
    2. Typeinference (THIH)
      :: THIH Expressions (implicitly typed) -> Inferred Types
    3. Promotion
      ::  Inferred Types -> Inferred Kinds
    4. Syntax Conversion
      :: (Surface THIH Syntax, Kinds) ->  Original THIH Syntax
  • Loading
    :: Module Headers / Top-level declarations -> Environment
  • THIH
    :: Original THIH Syntax -> Environment -> THIH Assumptions
  • FromTHIH
    :: THIH Assumptions -> Pretty Assumptions

About Shayan

Researcher/Programmer at Chalmers University of Technology
This entry was posted in Articles. Bookmark the permalink.

3 Responses to Architecture of HTE v.Haskell 2010

  1. Mathnerd314 says:

    Is the code available yet?

  2. Yes, soon I will put a snapshot (08/20) of it for public access. And thanks for your interest.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s