Safe Haskell | None |
---|---|
Language | Haskell2010 |
Primitive Feldspar expressions
- type Length = Word32
- type Index = Word32
- data PrimTypeRep a where
- BoolT :: PrimTypeRep Bool
- Int8T :: PrimTypeRep Int8
- Int16T :: PrimTypeRep Int16
- Int32T :: PrimTypeRep Int32
- Int64T :: PrimTypeRep Int64
- Word8T :: PrimTypeRep Word8
- Word16T :: PrimTypeRep Word16
- Word32T :: PrimTypeRep Word32
- Word64T :: PrimTypeRep Word64
- FloatT :: PrimTypeRep Float
- DoubleT :: PrimTypeRep Double
- ComplexFloatT :: PrimTypeRep (Complex Float)
- ComplexDoubleT :: PrimTypeRep (Complex Double)
- data IntTypeRep a where
- data WordTypeRep a where
- data IntWordTypeRep a where
- IntType :: IntTypeRep a -> IntWordTypeRep a
- WordType :: WordTypeRep a -> IntWordTypeRep a
- data FloatingTypeRep a where
- data ComplexTypeRep a where
- data PrimTypeView a where
- PrimTypeBool :: PrimTypeView Bool
- PrimTypeIntWord :: IntWordTypeRep a -> PrimTypeView a
- PrimTypeFloating :: FloatingTypeRep a -> PrimTypeView a
- PrimTypeComplex :: ComplexTypeRep a -> PrimTypeView a
- viewPrimTypeRep :: PrimTypeRep a -> PrimTypeView a
- unviewPrimTypeRep :: PrimTypeView a -> PrimTypeRep a
- primTypeIntWidth :: PrimTypeRep a -> Maybe Int
- class (Eq a, Show a, Typeable a) => PrimType' a where
- primTypeOf :: PrimType' a => a -> PrimTypeRep a
- primTypeEq :: PrimTypeRep a -> PrimTypeRep b -> Maybe (Dict (a ~ b))
- witPrimType :: PrimTypeRep a -> Dict (PrimType' a)
- data Primitive sig where
- FreeVar :: PrimType' a => String -> Primitive (Full a)
- Lit :: (Eq a, Show a) => a -> Primitive (Full a)
- Add :: (Num a, PrimType' a) => Primitive (a :-> (a :-> Full a))
- Sub :: (Num a, PrimType' a) => Primitive (a :-> (a :-> Full a))
- Mul :: (Num a, PrimType' a) => Primitive (a :-> (a :-> Full a))
- Neg :: (Num a, PrimType' a) => Primitive (a :-> Full a)
- Abs :: (Num a, PrimType' a) => Primitive (a :-> Full a)
- Sign :: (Num a, PrimType' a) => Primitive (a :-> Full a)
- Quot :: (Integral a, PrimType' a) => Primitive (a :-> (a :-> Full a))
- Rem :: (Integral a, PrimType' a) => Primitive (a :-> (a :-> Full a))
- Div :: (Integral a, PrimType' a) => Primitive (a :-> (a :-> Full a))
- Mod :: (Integral a, PrimType' a) => Primitive (a :-> (a :-> Full a))
- FDiv :: (Fractional a, PrimType' a) => Primitive (a :-> (a :-> Full a))
- Pi :: (Floating a, PrimType' a) => Primitive (Full a)
- Exp :: (Floating a, PrimType' a) => Primitive (a :-> Full a)
- Log :: (Floating a, PrimType' a) => Primitive (a :-> Full a)
- Sqrt :: (Floating a, PrimType' a) => Primitive (a :-> Full a)
- Pow :: (Floating a, PrimType' a) => Primitive (a :-> (a :-> Full a))
- Sin :: (Floating a, PrimType' a) => Primitive (a :-> Full a)
- Cos :: (Floating a, PrimType' a) => Primitive (a :-> Full a)
- Tan :: (Floating a, PrimType' a) => Primitive (a :-> Full a)
- Asin :: (Floating a, PrimType' a) => Primitive (a :-> Full a)
- Acos :: (Floating a, PrimType' a) => Primitive (a :-> Full a)
- Atan :: (Floating a, PrimType' a) => Primitive (a :-> Full a)
- Sinh :: (Floating a, PrimType' a) => Primitive (a :-> Full a)
- Cosh :: (Floating a, PrimType' a) => Primitive (a :-> Full a)
- Tanh :: (Floating a, PrimType' a) => Primitive (a :-> Full a)
- Asinh :: (Floating a, PrimType' a) => Primitive (a :-> Full a)
- Acosh :: (Floating a, PrimType' a) => Primitive (a :-> Full a)
- Atanh :: (Floating a, PrimType' a) => Primitive (a :-> Full a)
- Complex :: (Num a, PrimType' a, PrimType' (Complex a)) => Primitive (a :-> (a :-> Full (Complex a)))
- Polar :: (Floating a, PrimType' a, PrimType' (Complex a)) => Primitive (a :-> (a :-> Full (Complex a)))
- Real :: (PrimType' a, PrimType' (Complex a)) => Primitive (Complex a :-> Full a)
- Imag :: (PrimType' a, PrimType' (Complex a)) => Primitive (Complex a :-> Full a)
- Magnitude :: (RealFloat a, PrimType' a, PrimType' (Complex a)) => Primitive (Complex a :-> Full a)
- Phase :: (RealFloat a, PrimType' a, PrimType' (Complex a)) => Primitive (Complex a :-> Full a)
- Conjugate :: (Num a, PrimType' (Complex a)) => Primitive (Complex a :-> Full (Complex a))
- I2N :: (Integral a, Num b, PrimType' a, PrimType' b) => Primitive (a :-> Full b)
- I2B :: (Integral a, PrimType' a) => Primitive (a :-> Full Bool)
- B2I :: (Integral a, PrimType' a) => Primitive (Bool :-> Full a)
- Round :: (RealFrac a, Num b, PrimType' a, PrimType' b) => Primitive (a :-> Full b)
- Not :: Primitive (Bool :-> Full Bool)
- And :: Primitive (Bool :-> (Bool :-> Full Bool))
- Or :: Primitive (Bool :-> (Bool :-> Full Bool))
- Eq :: (Eq a, PrimType' a) => Primitive (a :-> (a :-> Full Bool))
- NEq :: (Eq a, PrimType' a) => Primitive (a :-> (a :-> Full Bool))
- Lt :: (Ord a, PrimType' a) => Primitive (a :-> (a :-> Full Bool))
- Gt :: (Ord a, PrimType' a) => Primitive (a :-> (a :-> Full Bool))
- Le :: (Ord a, PrimType' a) => Primitive (a :-> (a :-> Full Bool))
- Ge :: (Ord a, PrimType' a) => Primitive (a :-> (a :-> Full Bool))
- BitAnd :: (Bits a, PrimType' a) => Primitive (a :-> (a :-> Full a))
- BitOr :: (Bits a, PrimType' a) => Primitive (a :-> (a :-> Full a))
- BitXor :: (Bits a, PrimType' a) => Primitive (a :-> (a :-> Full a))
- BitCompl :: (Bits a, PrimType' a) => Primitive (a :-> Full a)
- ShiftL :: (Bits a, PrimType' a, Integral b, PrimType' b) => Primitive (a :-> (b :-> Full a))
- ShiftR :: (Bits a, PrimType' a, Integral b, PrimType' b) => Primitive (a :-> (b :-> Full a))
- ArrIx :: PrimType' a => IArr Index a -> Primitive (Index :-> Full a)
- Cond :: Primitive (Bool :-> (a :-> (a :-> Full a)))
- type PrimDomain = Primitive :&: PrimTypeRep
- newtype Prim a = Prim {
- unPrim :: ASTF PrimDomain a
- evalPrim :: Prim a -> a
- sugarSymPrim :: (Signature sig, fi ~ SmartFun dom sig, sig ~ SmartSig fi, dom ~ SmartSym fi, dom ~ PrimDomain, SyntacticN f fi, sub :<: Primitive, PrimType' (DenResult sig)) => sub sig -> f
Types
data PrimTypeRep a where Source #
Representation of primitive supported types
BoolT :: PrimTypeRep Bool | |
Int8T :: PrimTypeRep Int8 | |
Int16T :: PrimTypeRep Int16 | |
Int32T :: PrimTypeRep Int32 | |
Int64T :: PrimTypeRep Int64 | |
Word8T :: PrimTypeRep Word8 | |
Word16T :: PrimTypeRep Word16 | |
Word32T :: PrimTypeRep Word32 | |
Word64T :: PrimTypeRep Word64 | |
FloatT :: PrimTypeRep Float | |
DoubleT :: PrimTypeRep Double | |
ComplexFloatT :: PrimTypeRep (Complex Float) | |
ComplexDoubleT :: PrimTypeRep (Complex Double) |
Show (PrimTypeRep a) Source # | |
data IntTypeRep a where Source #
Int8Type :: IntTypeRep Int8 | |
Int16Type :: IntTypeRep Int16 | |
Int32Type :: IntTypeRep Int32 | |
Int64Type :: IntTypeRep Int64 |
Show (IntTypeRep a) Source # | |
data WordTypeRep a where Source #
Word8Type :: WordTypeRep Word8 | |
Word16Type :: WordTypeRep Word16 | |
Word32Type :: WordTypeRep Word32 | |
Word64Type :: WordTypeRep Word64 |
Show (WordTypeRep a) Source # | |
data IntWordTypeRep a where Source #
IntType :: IntTypeRep a -> IntWordTypeRep a | |
WordType :: WordTypeRep a -> IntWordTypeRep a |
Show (IntWordTypeRep a) Source # | |
data FloatingTypeRep a where Source #
Show (FloatingTypeRep a) Source # | |
data ComplexTypeRep a where Source #
ComplexFloatType :: ComplexTypeRep (Complex Float) | |
ComplexDoubleType :: ComplexTypeRep (Complex Double) |
Show (ComplexTypeRep a) Source # | |
data PrimTypeView a where Source #
A different view of PrimTypeRep
that allows matching on similar types
PrimTypeBool :: PrimTypeView Bool | |
PrimTypeIntWord :: IntWordTypeRep a -> PrimTypeView a | |
PrimTypeFloating :: FloatingTypeRep a -> PrimTypeView a | |
PrimTypeComplex :: ComplexTypeRep a -> PrimTypeView a |
Show (PrimTypeView a) Source # | |
viewPrimTypeRep :: PrimTypeRep a -> PrimTypeView a Source #
unviewPrimTypeRep :: PrimTypeView a -> PrimTypeRep a Source #
primTypeIntWidth :: PrimTypeRep a -> Maybe Int Source #
class (Eq a, Show a, Typeable a) => PrimType' a where Source #
Primitive supported types
primTypeRep :: PrimTypeRep a Source #
Reify a primitive type
PrimType' Bool Source # | |
PrimType' Double Source # | |
PrimType' Float Source # | |
PrimType' Int8 Source # | |
PrimType' Int16 Source # | |
PrimType' Int32 Source # | |
PrimType' Int64 Source # | |
PrimType' Word8 Source # | |
PrimType' Word16 Source # | |
PrimType' Word32 Source # | |
PrimType' Word64 Source # | |
PrimType' (Complex Double) Source # | |
PrimType' (Complex Float) Source # | |
InterpBi (* -> Constraint, *) * (AssertCMD (* -> *) (* -> Constraint)) IO (Param1 (* -> Constraint) PrimType') # | |
Syntactic (Struct PrimType' Data a) # | |
type Internal (Struct PrimType' Data a) # | |
type Domain (Struct PrimType' Data a) # | |
primTypeOf :: PrimType' a => a -> PrimTypeRep a Source #
Convenience function; like primTypeRep
but with an extra argument to
constrain the type parameter. The extra argument is ignored.
primTypeEq :: PrimTypeRep a -> PrimTypeRep b -> Maybe (Dict (a ~ b)) Source #
Check whether two type representations are equal
witPrimType :: PrimTypeRep a -> Dict (PrimType' a) Source #
Reflect a PrimTypeRep
to a PrimType'
constraint
Expressions
data Primitive sig where Source #
Primitive operations
type PrimDomain = Primitive :&: PrimTypeRep Source #
Primitive expressions
Prim | |
|
sugarSymPrim :: (Signature sig, fi ~ SmartFun dom sig, sig ~ SmartSig fi, dom ~ SmartSym fi, dom ~ PrimDomain, SyntacticN f fi, sub :<: Primitive, PrimType' (DenResult sig)) => sub sig -> f Source #