Fix vectorisation of recursive types
[ghc-hetmet.git] / compiler / vectorise / Vectorise / Builtins / Base.hs
index 884224e..69ae84f 100644 (file)
@@ -61,9 +61,12 @@ data Builtins
         , parrayTyCon      :: TyCon                    -- ^ PArray
         , parrayDataCon    :: DataCon                  -- ^ PArray
         , pdataTyCon       :: TyCon                    -- ^ PData
+        , paClass          :: Class                     -- ^ PA
         , paTyCon          :: TyCon                    -- ^ PA
         , paDataCon        :: DataCon                  -- ^ PA
+        , paPRSel          :: Var                       -- ^ PA
         , preprTyCon       :: TyCon                    -- ^ PRepr
+        , prClass          :: Class                     -- ^ PR
         , prTyCon          :: TyCon                    -- ^ PR
         , prDataCon        :: DataCon                  -- ^ PR
         , replicatePDVar   :: Var                      -- ^ replicatePD
@@ -117,7 +120,15 @@ indexBuiltin
 
 indexBuiltin fn f i bi
   | inRange (bounds xs) i = xs ! i
-  | otherwise            = pprPanic fn (ppr i)
+  | otherwise            
+  = pprSorry "Vectorise.Builtins.indexBuiltin" 
+       (vcat   [ text ""
+               , text "DPH builtin function '" <> text fn <> text "' of size '" <> ppr i <> text "' is not yet implemented."
+               , text "This function does not appear in your source program, but it is needed"
+               , text "to compile your code in the backend. This is a known, current limitation"
+               , text "of DPH. If you want it to to work you should send mail to cvs-ghc@haskell.org"
+               , text "and ask what you can do to help (it might involve some GHC hacking)."])
+
   where        xs = f bi