Primitive and helper functions supported by Feldspar
- noSizeProp :: a -> ()
- noSizeProp2 :: a -> b -> ()
- class (Eq a, Storable a) => Eq a where
- optEq :: (Storable a, Size a ~ Range b, Ord b, Num b) => Data a -> Data a -> Data Bool
- optNeq :: (Storable a, Size a ~ Range b, Ord b, Num b) => Data a -> Data a -> Data Bool
- class (Ord a, Eq a, Storable a) => Ord a where
- optLT :: (Storable a, Ord a, Size a ~ Range b, Ord b, Num b) => Data a -> Data a -> Data Bool
- optGT :: (Storable a, Ord a, Size a ~ Range b, Ord b, Num b) => Data a -> Data a -> Data Bool
- optLTE :: (Storable a, Ord a, Size a ~ Range b, Ord b, Num b) => Data a -> Data a -> Data Bool
- optGTE :: (Storable a, Ord a, Size a ~ Range b, Ord b, Num b) => Data a -> Data a -> Data Bool
- optMin :: (Ord a, Size a ~ Range b, Ord b, Num b) => Data a -> Data a -> Data a
- optMax :: (Ord a, Size a ~ Range b, Ord b, Num b) => Data a -> Data a -> Data a
- not :: Data Bool -> Data Bool
- (?) :: Computable a => Data Bool -> (a, a) -> a
- (&&) :: Data Bool -> Data Bool -> Data Bool
- (||) :: Data Bool -> Data Bool -> Data Bool
- (&&*) :: Computable a => (a -> Data Bool) -> (a -> Data Bool) -> a -> Data Bool
- (||*) :: Computable a => (a -> Data Bool) -> (a -> Data Bool) -> a -> Data Bool
- class (Numeric a, Integral a, Ord a, Storable a) => Integral a where
- optRem :: (Integral a, Size a ~ Range b, Ord b, Num b, Enum b) => Data a -> Data a -> Data a
- optMod :: (Integral a, Size a ~ Range b, Ord b, Num b, Enum b) => Data a -> Data a -> Data a
- optSignedExp :: (Integral a, Bits a, Storable a, Size a ~ Range b, Ord b, Num b) => Data a -> Data a -> Data a
- optExp :: (Integral a, Storable a) => Data a -> Data a -> Data a
- for :: Computable a => Data Int -> Data Int -> a -> (Data Int -> a -> a) -> a
- unfoldCore :: (Computable state, Storable a) => Data Length -> state -> (Data Int -> state -> (Data a, state)) -> (Data [a], state)
- class (Num a, Storable a) => Numeric a where
- absNum' :: (Numeric a, Num (Size a)) => Data a -> Data a
- optAbs :: (Numeric a, Size a ~ Range b, Num b, Ord b) => Data a -> Data a
- signumNum' :: (Numeric a, Num (Size a)) => Data a -> Data a
- optSignum :: (Numeric a, Size a ~ Range b, Num b, Ord b) => Data a -> Data a
- optAdd :: (Numeric a, Num (Size a)) => Data a -> Data a -> Data a
- optSub :: (Numeric a, Num (Size a)) => Data a -> Data a -> Data a
- optMul :: (Numeric a, Num (Size a)) => Data a -> Data a -> Data a
- class (Fractional a, Storable a) => Fractional' a where
- class (Bits a, Storable a) => Bits a where
- (.&.) :: Data a -> Data a -> Data a
- (.|.) :: Data a -> Data a -> Data a
- xor :: Data a -> Data a -> Data a
- (⊕) :: Data a -> Data a -> Data a
- complement :: Data a -> Data a
- bit :: Data Int -> Data a
- setBit :: Data a -> Data Int -> Data a
- clearBit :: Data a -> Data Int -> Data a
- complementBit :: Data a -> Data Int -> Data a
- testBit :: Data a -> Data Int -> Data Bool
- shiftL :: Data a -> Data Int -> Data a
- (<<) :: Data a -> Data Int -> Data a
- shiftR :: Data a -> Data Int -> Data a
- (>>) :: Data a -> Data Int -> Data a
- rotateL :: Data a -> Data Int -> Data a
- rotateR :: Data a -> Data Int -> Data a
- reverseBits :: Data a -> Data a
- bitScan :: Data a -> Data Int
- bitCount :: Data a -> Data Int
- bitSize :: Data a -> Data Int
- isSigned :: Data a -> Data Bool
- optAnd :: (Bits a, Storable a) => Data a -> Data a -> Data a
- optOr :: (Bits a, Storable a) => Data a -> Data a -> Data a
- optXor :: (Bits a, Bits a, Storable a) => Data a -> Data a -> Data a
- allOnes :: (Eq a, Bits a) => a -> Bool
- optZero :: (a -> Data Int -> a) -> a -> Data Int -> a
- scanLeft :: Bits b => b -> Int
- countBits :: Bits b => b -> Int
- revBits :: Bits b => b -> b
Misc.
noSizeProp :: a -> ()Source
noSizeProp2 :: a -> b -> ()Source
optLTE :: (Storable a, Ord a, Size a ~ Range b, Ord b, Num b) => Data a -> Data a -> Data BoolSource
optGTE :: (Storable a, Ord a, Size a ~ Range b, Ord b, Num b) => Data a -> Data a -> Data BoolSource
(?) :: Computable a => Data Bool -> (a, a) -> aSource
Selects the elements of the pair depending on the condition
(&&*) :: Computable a => (a -> Data Bool) -> (a -> Data Bool) -> a -> Data BoolSource
Lazy conjunction, second argument only run if necessary
(||*) :: Computable a => (a -> Data Bool) -> (a -> Data Bool) -> a -> Data BoolSource
Lazy disjunction, second argument only run if necessary
class (Numeric a, Integral a, Ord a, Storable a) => Integral a whereSource
optSignedExp :: (Integral a, Bits a, Storable a, Size a ~ Range b, Ord b, Num b) => Data a -> Data a -> Data aSource
Loops
for :: Computable a => Data Int -> Data Int -> a -> (Data Int -> a -> a) -> aSource
For-loop
:
for
start end init body
-
start
/end
are the start/end indexes. -
init
is the starting state. -
body
computes the next state given the current loop index (ranging over[start .. end]
) and the current state.
unfoldCore :: (Computable state, Storable a) => Data Length -> state -> (Data Int -> state -> (Data a, state)) -> (Data [a], state)Source
A sequential "unfolding" of an vector
:
unfoldCore
l init step
-
l
is the length of the resulting vector. -
init
is the initial state. -
step
is a function computing a new element and the next state from the current index and current state. The index is the position of the new element in the output vector.
class (Fractional a, Storable a) => Fractional' a whereSource
Bit manipulation
class (Bits a, Storable a) => Bits a whereSource
The following class provides functions for bit level manipulation
(.&.) :: Data a -> Data a -> Data aSource
(.|.) :: Data a -> Data a -> Data aSource
xor :: Data a -> Data a -> Data aSource
(⊕) :: Data a -> Data a -> Data aSource
complement :: Data a -> Data aSource
bit :: Data Int -> Data aSource
setBit :: Data a -> Data Int -> Data aSource
clearBit :: Data a -> Data Int -> Data aSource
complementBit :: Data a -> Data Int -> Data aSource
testBit :: Data a -> Data Int -> Data BoolSource
shiftL :: Data a -> Data Int -> Data aSource
(<<) :: Data a -> Data Int -> Data aSource
shiftR :: Data a -> Data Int -> Data aSource
(>>) :: Data a -> Data Int -> Data aSource
rotateL :: Data a -> Data Int -> Data aSource
rotateR :: Data a -> Data Int -> Data aSource
reverseBits :: Data a -> Data aSource
bitScan :: Data a -> Data IntSource
Returns the number of leading zeroes for unsigned types. For signed types it returns the number of unnecessary sign bits
bitCount :: Data a -> Data IntSource