Skip to content

Compiling with GHC #7

@mmirman

Description

@mmirman

Rather than writing our own compiler, we should attempt to use the GHC type checker.

This would involve writing a compiler to do a source analysis, and split it into multiple sources:

onServer :: b1 -> ... -> bN -> (b1 -> ... bN -> S a) -> C a

do nm <- askClient
b <- onServer $ do a <- getFromDB nm
return $ parse a
return $ show b

would get converted to

do nm <- askClient
b <- onServer nm $ (\nm -> do a <- getFromDB nm
return $ parse a)

where we figure out what scope nm was defined in automatically by type.

Functions like exprType from the GHC API will be useful.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions