on master help sign in
Merge branch 'release-candidate' into dev
d87cfc6Evan Czaplicki
changelog.txt+3
@@ -2,8 +2,11 @@
2Release 0.9.1
2Release 0.9.1
3=============
3=============
4
4
5+ * Allow custom precedence and associativity for user-defined infix ops
6+ * Realias types before printing
5 * Switch to Tango color scheme, adding a bunch of nice colors
7 * Switch to Tango color scheme, adding a bunch of nice colors
6 * add the greyscale function for easily producing greys
8 * add the greyscale function for easily producing greys
9+ * Check the type of main
7 * Fix miscellaneous bugs in type checker
10 * Fix miscellaneous bugs in type checker
8 * Switch name of Matrix2D to Transform2D
11 * Switch name of Matrix2D to Transform2D
9
12
compiler/Transform/Canonicalize.hs+10−1
@@ -56,10 +56,19 @@ metadataModule ifaces modul =
56 program' <- rename initialEnv (program modul)
56 program' <- rename initialEnv (program modul)
57 aliases' <- mapM (third renameType') (aliases modul)
57 aliases' <- mapM (third renameType') (aliases modul)
58 datatypes' <- mapM (third (mapM (second (mapM renameType')))) (datatypes modul)
58 datatypes' <- mapM (third (mapM (second (mapM renameType')))) (datatypes modul)
59+ exports' <- mapM (third renameType') (foreignExports modul)
60+ imports' <- mapM (twoAndFour (rename initialEnv) renameType') (foreignImports modul)
59− return $ modul { program = program', aliases = aliases', datatypes = datatypes' }
61+ return $ modul { program = program'
62+ , aliases = aliases'
63+ , datatypes = datatypes'
64+ , foreignExports = exports'
65+ , foreignImports = imports' }
60 where
66 where
61 second f (a,b) = (,) a `fmap` f b
67 second f (a,b) = (,) a `fmap` f b
62 third f (a,b,c) = (,,) a b `fmap` f c
68 third f (a,b,c) = (,,) a b `fmap` f c
69+ twoAndFour f g (a,b,c,d) = do b' <- f b
70+ d' <- g d
71+ return (a,b',c,d')
63 renameType' =
72 renameType' =
64 Either.either (\err -> Left [P.text err]) return . renameType (replace "type" initialEnv)
73 Either.either (\err -> Left [P.text err]) return . renameType (replace "type" initialEnv)
65
74