Safe Haskell | None |
---|---|
Language | Haskell2010 |
Reductions of primitives
Currently, it contains reductions for:
- CLaSH.Sized.Vector.map
- CLaSH.Sized.Vector.zipWith
- CLaSH.Sized.Vector.traverse#
- CLaSH.Sized.Vector.foldr
- CLaSH.Sized.Vector.fold
- CLaSH.Sized.Vector.dfold
- CLaSH.Sized.Vector.(++)
- CLaSH.Sized.Vector.head
- CLaSH.Sized.Vector.tail
- CLaSH.Sized.Vector.unconcatBitVector#
Partially handles:
- CLaSH.Sized.Vector.unconcat
- CLaSH.Sized.Vector.transpose
- reduceZipWith :: Int -> Type -> Type -> Type -> Term -> Term -> Term -> NormalizeSession Term
- reduceMap :: Int -> Type -> Type -> Term -> Term -> NormalizeSession Term
- reduceTraverse :: Int -> Type -> Type -> Type -> Term -> Term -> Term -> NormalizeSession Term
- mkTravVec :: TyConName -> DataCon -> DataCon -> Term -> Term -> Term -> Type -> Int -> [Term] -> Term
- reduceFoldr :: Int -> Type -> Type -> Term -> Term -> Term -> NormalizeSession Term
- reduceFold :: Int -> Type -> Term -> Term -> NormalizeSession Term
- reduceDFold :: Int -> Type -> Term -> Term -> Term -> NormalizeSession Term
- reduceHead :: Int -> Type -> Term -> NormalizeSession Term
- reduceTail :: Int -> Type -> Term -> NormalizeSession Term
- reduceAppend :: Int -> Int -> Type -> Term -> Term -> NormalizeSession Term
- reduceUnconcat :: Int -> Int -> Type -> Term -> NormalizeSession Term
- reduceTranspose :: Int -> Int -> Type -> Term -> NormalizeSession Term
Documentation
:: Int | Length of the vector(s) |
-> Type | Type of the lhs of the function |
-> Type | Type of the rhs of the function |
-> Type | Type of the result of the function |
-> Term | The zipWith'd functions |
-> Term | The 1st vector argument |
-> Term | The 2nd vector argument |
-> NormalizeSession Term |
Replace an application of the CLaSH.Sized.Vector.zipWith
primitive on
vectors of a known length n
, by the fully unrolled recursive "definition"
of CLaSH.Sized.Vector.zipWith
:: Int | Length of the vector |
-> Type | Argument type of the function |
-> Type | Result type of the function |
-> Term | The map'd function |
-> Term | The map'd over vector |
-> NormalizeSession Term |
Replace an application of the CLaSH.Sized.Vector.map
primitive on vectors
of a known length n
, by the fully unrolled recursive "definition" of
CLaSH.Sized.Vector.map
:: Int | Length of the vector |
-> Type | Element type of the argument vector |
-> Type | The type of the applicative |
-> Type | Element type of the result vector |
-> Term | The |
-> Term | The function to traverse with |
-> Term | The argument vector |
-> NormalizeSession Term |
Replace an application of the CLaSH.Sized.Vector.traverse#
primitive on
vectors of a known length n
, by the fully unrolled recursive "definition"
of CLaSH.Sized.Vector.traverse#
:: TyConName | Vec tcon |
-> DataCon | Nil con |
-> DataCon | Cons con |
-> Term |
|
-> Term |
|
-> Term |
|
-> Type |
|
-> Int | Length of the vector |
-> [Term] | Elements of the vector |
-> Term |
Create the traversable vector
e.g. for a length '2' input vector, we get
(:>) <$> x0 <*> ((:>) <$> x1 <*> pure Nil)
:: Int | Length of the vector |
-> Type | Element type of the argument vector |
-> Type | Type of the starting element |
-> Term | The function to fold with |
-> Term | The starting value |
-> Term | The argument vector |
-> NormalizeSession Term |
Replace an application of the CLaSH.Sized.Vector.foldr
primitive on
vectors of a known length n
, by the fully unrolled recursive "definition"
of CLaSH.Sized.Vector.foldr
:: Int | Length of the vector |
-> Type | Element type of the argument vector |
-> Term | The function to fold with |
-> Term | The argument vector |
-> NormalizeSession Term |
Replace an application of the CLaSH.Sized.Vector.fold
primitive on
vectors of a known length n
, by the fully unrolled recursive "definition"
of CLaSH.Sized.Vector.fold
:: Int | Length of the vector |
-> Type | Element type of the argument vector |
-> Term | Function to fold with |
-> Term | Starting value |
-> Term | The vector to fold |
-> NormalizeSession Term |
Replace an application of the CLaSH.Sized.Vector.dfold
primitive on
vectors of a known length n
, by the fully unrolled recursive "definition"
of CLaSH.Sized.Vector.dfold
:: Int | Length of the vector |
-> Type | Element type of the vector |
-> Term | The argument vector |
-> NormalizeSession Term |
Replace an application of the CLaSH.Sized.Vector.head
primitive on
vectors of a known length n
, by a projection of the first element of a
vector.
:: Int | Length of the vector |
-> Type | Element type of the vector |
-> Term | The argument vector |
-> NormalizeSession Term |
Replace an application of the CLaSH.Sized.Vector.tail
primitive on
vectors of a known length n
, by a projection of the tail of a
vector.
:: Int | Length of the LHS arg |
-> Int | Lenght of the RHS arg |
-> Type | Element type of the vectors |
-> Term | The LHS argument |
-> Term | The RHS argument |
-> NormalizeSession Term |
Replace an application of the CLaSH.Sized.Vector.(++)
primitive on
vectors of a known length n
, by the fully unrolled recursive "definition"
of CLaSH.Sized.Vector.(++)
:: Int | Length of the result vector |
-> Int | Length of the elements of the result vector |
-> Type | Element type |
-> Term | Argument vector |
-> NormalizeSession Term |
Replace an application of the CLaSH.Sized.Vector.unconcat
primitive on
vectors of a known length n
, by the fully unrolled recursive "definition"
of CLaSH.Sized.Vector.unconcat
:: Int | Length of the result vector |
-> Int | Length of the elements of the result vector |
-> Type | Element type |
-> Term | Argument vector |
-> NormalizeSession Term |
Replace an application of the CLaSH.Sized.Vector.transpose
primitive on
vectors of a known length n
, by the fully unrolled recursive "definition"
of CLaSH.Sized.Vector.transpose