Safe Haskell | None |
---|---|
Language | Haskell2010 |
- module Prelude.EDSL
- module Control.Monad
- data Data a
- class (Syntactic a, Domain a ~ FeldDomain, Type (Internal a)) => Syntax a
- data Comp a
- module Data.Int
- module Data.Word
- data Complex a :: * -> * = ~a :+ ~a
- class (Eq a, Show a, Typeable a) => PrimType' a
- class (PrimType' a, Type a) => PrimType a
- class (Eq a, Show a, Typeable a, Inhabited a) => Type a
- type Length = Word32
- type Index = Word32
- data Ref a
- type DRef a = Ref (Data a)
- data Arr a
- type DArr a = Arr (Data a)
- data IArr a
- type DIArr a = IArr (Data a)
- class Inhabited a
- class Syntactic a where
- type family Domain a :: * -> *
- type family Internal a :: *
- eval :: (Syntactic a, Domain a ~ FeldDomain) => a -> Internal a
- showAST :: (Syntactic a, Domain a ~ FeldDomain) => a -> String
- drawAST :: (Syntactic a, Domain a ~ FeldDomain) => a -> IO ()
- module Feldspar.Frontend
- class Eq a => Bits a
- class Bits b => FiniteBits b
- class (Real a, Enum a) => Integral a where
- class Eq a => Ord a
- class (RealFrac a, Floating a) => RealFloat a
- class (Real a, Fractional a) => RealFrac a
- data Border i :: * -> *
- type IxRange i = (i, Int, Border i)
- data AssertionLabel
Documentation
module Prelude.EDSL
module Control.Monad
Types
Syntax
class (Syntactic a, Domain a ~ FeldDomain, Type (Internal a)) => Syntax a Source #
Specialization of the Syntactic
class for the Feldspar domain
Monad for computational effects: mutable data structures and control flow
Monad Comp Source # | |
Functor Comp Source # | |
Applicative Comp Source # | |
MonadComp Comp Source # | |
MonadRun Comp Source # | |
Syntax a => Storable (Push Comp a) Source # | |
newStoreRep :: MonadComp m => proxy (Push Comp a) -> StoreSize (Push Comp a) -> m (StoreRep (Push Comp a)) Source # initStoreRep :: MonadComp m => Push Comp a -> m (StoreRep (Push Comp a)) Source # readStoreRep :: MonadComp m => StoreRep (Push Comp a) -> m (Push Comp a) Source # unsafeFreezeStoreRep :: MonadComp m => StoreRep (Push Comp a) -> m (Push Comp a) Source # writeStoreRep :: MonadComp m => StoreRep (Push Comp a) -> Push Comp a -> m () Source # | |
type StoreRep (Push Comp a) Source # | |
type StoreSize (Push Comp a) Source # | |
Object-language types
module Data.Int
module Data.Word
Complex numbers are an algebraic type.
For a complex number z
,
is a number with the magnitude of abs
zz
,
but oriented in the positive real direction, whereas
has the phase of signum
zz
, but unit magnitude.
The Foldable
and Traversable
instances traverse the real part first.
~a :+ ~a infix 6 | forms a complex number from its real and imaginary rectangular components. |
class (Eq a, Show a, Typeable a) => PrimType' a Source #
Primitive supported types
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) # | |
class (Eq a, Show a, Typeable a, Inhabited a) => Type a Source #
Supported types
Type Bool Source # | |
Type Double Source # | |
Type Float Source # | |
Type Int8 Source # | |
Type Int16 Source # | |
Type Int32 Source # | |
Type Int64 Source # | |
Type Word8 Source # | |
Type Word16 Source # | |
Type Word32 Source # | |
Type Word64 Source # | |
Type (Complex Double) Source # | |
Type (Complex Float) Source # | |
(Type a, Type b) => Type (a, b) Source # | |
Mutable variable
Mutable array
Immutable array
Inhabited types
type family Domain a :: * -> * #
type Domain () # | |
type Domain (Prim a) # | |
type Domain (Data a) # | |
type Domain (Option a) # | |
type Domain (Validated a) # | |
type Domain (a -> b) # | |
type Domain (a, b) # | |
type Domain (ASTF sym a) | |
type Domain (ASTFull sym a) | |
type Domain (a, b, c) # | |
type Domain (Struct PrimType' Data a) # | |
type Domain (a, b, c, d) # | |
type Domain (a, b, c, d, e) # | |
type Domain (a, b, c, d, e, f) # | |
type Domain (a, b, c, d, e, f, g) # | |
type Domain (a, b, c, d, e, f, g, h) # | |
type Domain (a, b, c, d, e, f, g, h, i) # | |
type Domain (a, b, c, d, e, f, g, h, i, j) # | |
type Domain (a, b, c, d, e, f, g, h, i, j, k) # | |
type Domain (a, b, c, d, e, f, g, h, i, j, k, l) # | |
type Domain (a, b, c, d, e, f, g, h, i, j, k, l, m) # | |
type Domain (a, b, c, d, e, f, g, h, i, j, k, l, m, n) # | |
type Domain (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) # | |
type Internal () # | |
type Internal (Prim a) # | |
type Internal (Data a) # | |
type Internal (Option a) # | |
type Internal (Validated a) # | |
type Internal (a -> b) # | |
type Internal (a, b) # | |
type Internal (ASTF sym a) | |
type Internal (ASTFull sym a) | |
type Internal (a, b, c) # | |
type Internal (Struct PrimType' Data a) # | |
type Internal (a, b, c, d) # | |
type Internal (a, b, c, d, e) # | |
type Internal (a, b, c, d, e, f) # | |
type Internal (a, b, c, d, e, f, g) # | |
type Internal (a, b, c, d, e, f, g, h) # | |
type Internal (a, b, c, d, e, f, g, h, i) # | |
type Internal (a, b, c, d, e, f, g, h, i, j) # | |
type Internal (a, b, c, d, e, f, g, h, i, j, k) # | |
type Internal (a, b, c, d, e, f, g, h, i, j, k, l) # | |
type Internal (a, b, c, d, e, f, g, h, i, j, k, l, m) # | |
type Internal (a, b, c, d, e, f, g, h, i, j, k, l, m, n) # | |
type Internal (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) # | |
Front end
eval :: (Syntactic a, Domain a ~ FeldDomain) => a -> Internal a Source #
Evaluate a closed expression
showAST :: (Syntactic a, Domain a ~ FeldDomain) => a -> String Source #
Show the syntax tree using Unicode art
Only user assertions will be included.
drawAST :: (Syntactic a, Domain a ~ FeldDomain) => a -> IO () Source #
Draw the syntax tree on the terminal using Unicode art
Only user assertions will be included.
module Feldspar.Frontend
The Bits
class defines bitwise operations over integral types.
- Bits are numbered from 0 with bit 0 being the least significant bit.
(.&.), (.|.), xor, complement, (shift | shiftL, shiftR), (rotate | rotateL, rotateR), bitSize, bitSizeMaybe, isSigned, testBit, bit, popCount
class Bits b => FiniteBits b #
The FiniteBits
class denotes types with a finite, fixed number of bits.
Since: 4.7.0.0
class (Real a, Enum a) => Integral a where #
Integral numbers, supporting integer division.
The Ord
class is used for totally ordered datatypes.
Instances of Ord
can be derived for any user-defined
datatype whose constituent types are in Ord
. The declared order
of the constructors in the data declaration determines the ordering
in derived Ord
instances. The Ordering
datatype allows a single
comparison to determine the precise ordering of two objects.
Minimal complete definition: either compare
or <=
.
Using compare
can be more efficient for complex types.
class (RealFrac a, Floating a) => RealFloat a #
Efficient, machine-independent access to the components of a floating-point number.
floatRadix, floatDigits, floatRange, decodeFloat, encodeFloat, isNaN, isInfinite, isDenormalized, isNegativeZero, isIEEE
class (Real a, Fractional a) => RealFrac a #
Extracting components of fractions.
RealFrac CFloat | |
RealFrac CDouble | |
RealFrac NominalDiffTime | |
properFraction :: Integral b => NominalDiffTime -> (b, NominalDiffTime) # truncate :: Integral b => NominalDiffTime -> b # round :: Integral b => NominalDiffTime -> b # ceiling :: Integral b => NominalDiffTime -> b # floor :: Integral b => NominalDiffTime -> b # | |
RealFrac DiffTime | |
() :=> (RealFrac Double) | |
() :=> (RealFrac Float) | |
Integral a => RealFrac (Ratio a) | |
RealFrac a => RealFrac (Identity a) | |
(Integral a) :=> (RealFrac (Ratio a)) | |
Class (Real a, Fractional a) (RealFrac a) | |
Class (RealFrac a, Floating a) (RealFloat a) | |
RealFrac a => RealFrac (Const k a b) | |
Functor Border | |
Foldable Border | |
fold :: Monoid m => Border m -> m # foldMap :: Monoid m => (a -> m) -> Border a -> m # foldr :: (a -> b -> b) -> b -> Border a -> b # foldr' :: (a -> b -> b) -> b -> Border a -> b # foldl :: (b -> a -> b) -> b -> Border a -> b # foldl' :: (b -> a -> b) -> b -> Border a -> b # foldr1 :: (a -> a -> a) -> Border a -> a # foldl1 :: (a -> a -> a) -> Border a -> a # elem :: Eq a => a -> Border a -> Bool # maximum :: Ord a => Border a -> a # minimum :: Ord a => Border a -> a # | |
Traversable Border | |
Eq i => Eq (Border i) | |
Num i => Num (Border i) |
|
Show i => Show (Border i) | |
type IxRange i = (i, Int, Border i) #
Index range
(lo,step,hi)
lo
gives the start index; step
gives the step length; hi
gives the stop
index which may be inclusive or exclusive.
data AssertionLabel Source #
Assertion labels
InternalAssertion | Internal assertion to guarantee meaningful results |
LibraryAssertion String | Assertion related to a specific library |
UserAssertion String | Assertion in user code. The default label for user assertions is
|
Eq AssertionLabel Source # | |
(==) :: AssertionLabel -> AssertionLabel -> Bool # (/=) :: AssertionLabel -> AssertionLabel -> Bool # | |
Show AssertionLabel Source # | |
showsPrec :: Int -> AssertionLabel -> ShowS # show :: AssertionLabel -> String # showList :: [AssertionLabel] -> ShowS # |