summaryrefslogtreecommitdiff
path: root/compiler/vectorise/Vectorise/Monad.hs
diff options
context:
space:
mode:
authorSimon Marlow <marlowsd@gmail.com>2011-09-16 13:40:53 +0100
committerSimon Marlow <marlowsd@gmail.com>2011-09-21 09:52:59 +0100
commit3db757241ce7fb99c096c30481aefa86bb9855a1 (patch)
tree003ea696a39cf558b975cc4d4b0e7bd88c0867ad /compiler/vectorise/Vectorise/Monad.hs
parent9de6f19e5de702967a9411b01c06734d3b67eea8 (diff)
downloadhaskell-3db757241ce7fb99c096c30481aefa86bb9855a1.tar.gz
Add support for all top-level declarations to GHCi
This is work mostly done by Daniel Winograd-Cort during his internship at MSR Cambridge, with some further refactoring by me. This commit adds support to GHCi for most top-level declarations that can be used in Haskell source files. Class, data, newtype, type, instance are all supported, as are Type Family-related declarations. The current set of declarations are shown by :show bindings. As with variable bindings, entities bound by newer declarations shadow earlier ones. Tests are in testsuite/tests/ghci/scripts/ghci039--ghci054. Documentation to follow.
Diffstat (limited to 'compiler/vectorise/Vectorise/Monad.hs')
-rw-r--r--compiler/vectorise/Vectorise/Monad.hs8
1 files changed, 6 insertions, 2 deletions
diff --git a/compiler/vectorise/Vectorise/Monad.hs b/compiler/vectorise/Vectorise/Monad.hs
index 9a61c6d013..0c9766e33e 100644
--- a/compiler/vectorise/Vectorise/Monad.hs
+++ b/compiler/vectorise/Vectorise/Monad.hs
@@ -55,7 +55,11 @@ initV :: HscEnv
-> VM a
-> IO (Maybe (VectInfo, a))
initV hsc_env guts info thing_inside
- = do { (_, Just res) <- initDs hsc_env (mg_module guts) (mg_rdr_env guts) (mg_types guts) go
+ = do {
+ let type_env = typeEnvFromEntities [] (mg_tcs guts) (mg_clss guts) (mg_fam_insts guts)
+ -- XXX should we try to get the Ids here?
+ ; (_, Just res) <- initDs hsc_env (mg_module guts)
+ (mg_rdr_env guts) type_env go
; dumpIfVtTrace "Incoming VectInfo" (ppr info)
; case res of
@@ -110,7 +114,7 @@ initV hsc_env guts info thing_inside
}
} }
- new_info genv = modVectInfo genv (mg_types guts) (mg_vect_decls guts) info
+ new_info genv = modVectInfo genv (mg_tcs guts) (mg_vect_decls guts) info
selectBackendErr = sLit "To use -fvectorise select a DPH backend with -fdph-par or -fdph-seq"