git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
C++: fixes after 0.10 updates
commit47b38b07504df4345fb76cc63a37b1424d6dcd9a authorAndy Arvanitis <andyarvanitis@gmail.com> dateSun 2 Oct 2016, 18:08 (10 years ago) parent64e8cd9
3 files changed+12−3
pcc/Main.hs+5 pcc/TestMain.hs+2 src/Language/PureScript/CodeGen/Cpp.hs+5−3
pcc/Main.hs+5
@@ -158,6 +158,10 @@ sourceMaps = switch $
158158 long "source-maps"
159159 <> help "Generate source maps"
160160
161+dumpCoreFn :: Parser Bool
162+dumpCoreFn = switch $
163+ long "dump-corefn"
164+ <> help "Dump the (functional) core representation of the compiled code at output/*/corefn.json"
161165
162166options :: Parser P.Options
163167options = P.Options <$> noTco
@@ -167,6 +171,7 @@ options = P.Options <$> noTco
167171 <*> verboseErrors
168172 <*> (not <$> comments)
169173 <*> sourceMaps
174+ <*> dumpCoreFn
170175
171176pccMakeOptions :: Parser PCCMakeOptions
172177pccMakeOptions = PCCMakeOptions <$> many inputFile
pcc/TestMain.hs+2
@@ -105,6 +105,7 @@ packages =
105105 , ("purescript-console", "")
106106 , ("purescript-functions", "")
107107 , ("purescript-partial", "")
108+ , ("purescript-newtype", "")
108109 ]
109110
110111-------------------------------------------------------------------------------
@@ -124,4 +125,5 @@ skipped :: [String]
124125-------------------------------------------------------------------------------
125126skipped =
126127 [ "NumberLiterals.purs" -- unreliable float comparison, test manually
128+ , "FunWithFunDeps.purs" -- requires FFI
127129 ]
src/Language/PureScript/CodeGen/Cpp.hs+5−3
@@ -755,9 +755,11 @@ moduleToCpp env (Module _ mn imps _ foreigns decls) = do
755755 findClass :: Qualified (ProperName 'ClassName) -> Maybe ([String], [T.Constraint], [(String, T.Type)])
756756 -------------------------------------------------------------------------------------------------
757757 findClass name
758− | Just (params, fns, constraints) <- M.lookup name (E.typeClasses env),
759− fns' <- (\(i,t) -> (runIdent i, t)) <$> fns
760− = Just (fst <$> params, constraints, (sortBy (compare `on` normalizedName . fst) fns'))
758+ | Just tcd <- M.lookup name (E.typeClasses env),
759+ fns' <- (\(i,t) -> (runIdent i, t)) <$> E.typeClassMembers tcd
760+ = Just (fst <$> E.typeClassArguments tcd,
761+ E.typeClassSuperclasses tcd,
762+ (sortBy (compare `on` normalizedName . fst) fns'))
761763 findClass _ = Nothing
762764
763765 -------------------------------------------------------------------------------------------------