-
-
Save evancz/48221fe7330a6887595f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
snippetFromTheCompiler = with errorAndIO | |
let importedVars <- mapM (canonicalizeValues env) (Map.toList interfaces) | |
allTypes = concat (ctors : importedVars) | |
vars = concatMap (fst . snd) allTypes | |
header = Map.map snd (Map.fromList allTypes) | |
environ = noneNoDocs . T.CLet [ T.Scheme vars [] (noneNoDocs T.CTrue) header ] | |
fvar <- liftIO $ T.var T.Flexible | |
c <- TcExpr.constrain env (program moduleBody) (T.varN fvar) | |
return (header, environ c) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
snippetFromTheCompiler = do | |
importedVars <- mapM (canonicalizeValues env) (Map.toList interfaces) | |
let allTypes = concat (ctors : importedVars) | |
vars = concatMap (fst . snd) allTypes | |
header = Map.map snd (Map.fromList allTypes) | |
environ = noneNoDocs . T.CLet [ T.Scheme vars [] (noneNoDocs T.CTrue) header ] | |
fvar <- liftIO $ T.var T.Flexible | |
c <- TcExpr.constrain env (program moduleBody) (T.varN fvar) | |
return (header, environ c) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment