on master help sign in
Make foreign calls lazily (or they get executed at the wrong time...)
598160cEdwin Brady
src/Idris/Compiler.hs+1−1
@@ -131,7 +131,7 @@ doForeign (_ : fgn : args)
131 do args' <- mapM epic args
131 do args' <- mapM epic args
132 -- wrap it in a prim__IO
132 -- wrap it in a prim__IO
133 -- return $ con_ 0 @@ impossible @@
133 -- return $ con_ 0 @@ impossible @@
134− return $ foreign_ rty fgnName (zip args' tys)
134+ return $ lazy_ $ foreign_ rty fgnName (zip args' tys)
135 | otherwise = fail "Badly formed foreign function call"
135 | otherwise = fail "Badly formed foreign function call"
136
136
137getFTypes :: TT Name -> [E.Type]
137getFTypes :: TT Name -> [E.Type]