git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
C++: fixes after 0.10 updates
47b38b0Andy Arvanitis
pcc/Main.hs+5
@@ -158,6 +158,10 @@ sourceMaps = switch $
158 long "source-maps"
158 long "source-maps"
159 <> help "Generate source maps"
159 <> help "Generate source maps"
160
160
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"
161
165
162options :: Parser P.Options
166options :: Parser P.Options
163options = P.Options <$> noTco
167options = P.Options <$> noTco
@@ -167,6 +171,7 @@ options = P.Options <$> noTco
167 <*> verboseErrors
171 <*> verboseErrors
168 <*> (not <$> comments)
172 <*> (not <$> comments)
169 <*> sourceMaps
173 <*> sourceMaps
174+ <*> dumpCoreFn
170
175
171pccMakeOptions :: Parser PCCMakeOptions
176pccMakeOptions :: Parser PCCMakeOptions
172pccMakeOptions = PCCMakeOptions <$> many inputFile
177pccMakeOptions = PCCMakeOptions <$> many inputFile
pcc/TestMain.hs+2
@@ -105,6 +105,7 @@ packages =
105 , ("purescript-console", "")
105 , ("purescript-console", "")
106 , ("purescript-functions", "")
106 , ("purescript-functions", "")
107 , ("purescript-partial", "")
107 , ("purescript-partial", "")
108+ , ("purescript-newtype", "")
108 ]
109 ]
109
110
110-------------------------------------------------------------------------------
111-------------------------------------------------------------------------------
@@ -124,4 +125,5 @@ skipped :: [String]
124-------------------------------------------------------------------------------
125-------------------------------------------------------------------------------
125skipped =
126skipped =
126 [ "NumberLiterals.purs" -- unreliable float comparison, test manually
127 [ "NumberLiterals.purs" -- unreliable float comparison, test manually
128+ , "FunWithFunDeps.purs" -- requires FFI
127 ]
129 ]
src/Language/PureScript/CodeGen/Cpp.hs+5−3
@@ -755,9 +755,11 @@ moduleToCpp env (Module _ mn imps _ foreigns decls) = do
755 findClass :: Qualified (ProperName 'ClassName) -> Maybe ([String], [T.Constraint], [(String, T.Type)])
755 findClass :: Qualified (ProperName 'ClassName) -> Maybe ([String], [T.Constraint], [(String, T.Type)])
756 -------------------------------------------------------------------------------------------------
756 -------------------------------------------------------------------------------------------------
757 findClass name
757 findClass name
758− | Just (params, fns, constraints) <- M.lookup name (E.typeClasses env),
758+ | Just tcd <- M.lookup name (E.typeClasses env),
759− fns' <- (\(i,t) -> (runIdent i, t)) <$> fns
759+ fns' <- (\(i,t) -> (runIdent i, t)) <$> E.typeClassMembers tcd
760+ = Just (fst <$> E.typeClassArguments tcd,
761+ E.typeClassSuperclasses tcd,
760− = Just (fst <$> params, constraints, (sortBy (compare `on` normalizedName . fst) fns'))
762+ (sortBy (compare `on` normalizedName . fst) fns'))
761 findClass _ = Nothing
763 findClass _ = Nothing
762
764
763 -------------------------------------------------------------------------------------------------
765 -------------------------------------------------------------------------------------------------