diff options
author | Manuel M T Chakravarty <chak@cse.unsw.edu.au> | 2011-02-20 10:50:32 +0000 |
---|---|---|
committer | Manuel M T Chakravarty <chak@cse.unsw.edu.au> | 2011-02-20 10:50:32 +0000 |
commit | f2aaae9757e7532485c97f6c9a9ed5437542d1dd (patch) | |
tree | 9a0cdadb318534898bc0ea8ff5fec5931ef5620e /compiler/utils | |
parent | 19d8dcbdaac5dc10e551703b824e8237e7d5f0a1 (diff) | |
download | haskell-f2aaae9757e7532485c97f6c9a9ed5437542d1dd.tar.gz |
Added a VECTORISE pragma
- Added a pragma {-# VECTORISE var = exp #-} that prevents
the vectoriser from vectorising the definition of 'var'.
Instead it uses the binding '$v_var = exp' to vectorise
'var'. The vectoriser checks that the Core type of 'exp'
matches the vectorised Core type of 'var'. (It would be
quite complicated to perform that check in the type checker
as the vectorisation of a type needs the state of the VM
monad.)
- Added parts of a related VECTORISE SCALAR pragma
- Documented -ddump-vect
- Added -ddump-vt-trace
- Some clean up
Diffstat (limited to 'compiler/utils')
-rw-r--r-- | compiler/utils/Bag.lhs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/compiler/utils/Bag.lhs b/compiler/utils/Bag.lhs index bb0f10481a..097a112359 100644 --- a/compiler/utils/Bag.lhs +++ b/compiler/utils/Bag.lhs @@ -16,7 +16,7 @@ module Bag ( concatBag, foldBag, foldrBag, foldlBag, isEmptyBag, isSingletonBag, consBag, snocBag, anyBag, listToBag, bagToList, - foldlBagM, mapBagM, mapBagM_, + foldrBagM, foldlBagM, mapBagM, mapBagM_, flatMapBagM, flatMapBagPairM, mapAndUnzipBagM, mapAccumBagLM ) where @@ -171,6 +171,12 @@ foldlBag k z (UnitBag x) = k z x foldlBag k z (TwoBags b1 b2) = foldlBag k (foldlBag k z b1) b2 foldlBag k z (ListBag xs) = foldl k z xs +foldrBagM :: (Monad m) => (a -> b -> m b) -> b -> Bag a -> m b +foldrBagM _ z EmptyBag = return z +foldrBagM k z (UnitBag x) = k x z +foldrBagM k z (TwoBags b1 b2) = do { z' <- foldrBagM k z b2; foldrBagM k z' b1 } +foldrBagM k z (ListBag xs) = foldrM k z xs + foldlBagM :: (Monad m) => (b -> a -> m b) -> b -> Bag a -> m b foldlBagM _ z EmptyBag = return z foldlBagM k z (UnitBag x) = k z x |