- value' :: Type a => Size a -> a -> Data a
- value :: Type a => a -> Data a
- unit :: Data ()
- true :: Data Bool
- false :: Data Bool
- array :: Type a => Size a -> a -> Data a
- cap :: Type a => Size a -> Data a -> Data a
- function :: (Syntactic a, Type b) => Bool -> String -> (Info a -> Size b) -> (Internal a -> b) -> a -> Data b
- function1 :: (Type a, Type b) => String -> (Size a -> Size b) -> (a -> b) -> Data a -> Data b
- function2 :: (Type a, Type b, Type c) => String -> (Size a -> Size b -> Size c) -> (a -> b -> c) -> Data a -> Data b -> Data c
- condition :: Syntactic a => Data Bool -> a -> a -> a
- (?) :: Syntactic a => Data Bool -> (a, a) -> a
- ifThenElse :: Syntactic a => Data Bool -> a -> a -> a
- viewGetIx :: Typeable a => Data Index -> Data a -> Maybe (Data [a])
- parallel'' :: Type a => Bool -> Data Length -> (Data Index -> Data a) -> Data [a] -> Data [a]
- parallel' :: Type a => Data Length -> (Data Index -> Data a) -> Data [a] -> Data [a]
- parallel :: Type a => Data Length -> (Data Index -> Data a) -> Data [a]
- forLoop :: Syntactic st => Data Length -> st -> (Data Index -> st -> st) -> st
- sequential :: (Type a, Syntactic st) => Data Length -> st -> (Data Index -> st -> (Data a, st)) -> (st -> Data [a]) -> Data [a]
- noinline :: (Syntactic a, Syntactic b) => String -> (a -> b) -> a -> b
- noinline2 :: (Syntactic a, Syntactic b, Syntactic c) => String -> (a -> b -> c) -> a -> b -> c
- setLength :: Type a => Data Length -> Data [a] -> Data [a]

# Documentation

array :: Type a => Size a -> a -> Data aSource

Like `value`

but with an extra `Size`

argument that can be used to increase
the size beyond the given data.

Example 1:

array (10 :> 20 :> universal) [] :: Data [[DefaultInt]]

gives an uninitialized 10x20 array of `DefaultInt`

elements.

Example 2:

array (10 :> 20 :> universal) [[1,2,3]] :: Data [[DefaultInt]]

gives a 10x20 array whose first row is initialized to `[1,2,3]`

.

function :: (Syntactic a, Type b) => Bool -> String -> (Info a -> Size b) -> (Internal a -> b) -> a -> Data bSource

function2 :: (Type a, Type b, Type c) => String -> (Size a -> Size b -> Size c) -> (a -> b -> c) -> Data a -> Data b -> Data cSource

Identical to `condition`

. Provided for backwards-compatibility, but will be
removed in the future.

parallel'' :: Type a => Bool -> Data Length -> (Data Index -> Data a) -> Data [a] -> Data [a]Source

Parallel array with continuation

parallel' :: Type a => Data Length -> (Data Index -> Data a) -> Data [a] -> Data [a]Source

Parallel array with continuation

:: Type a | |

=> Data Length | Length of resulting array (outermost level) |

-> (Data Index -> Data a) | Function that maps each index in the range |

-> Data [a] |

Parallel array

Since there are no dependencies between the elements, the compiler is free to compute the elements in any order, or even in parallel.

:: Syntactic st | |

=> Data Length | Number of iterations |

-> st | Initial state |

-> (Data Index -> st -> st) | Loop body (current index and state to next state) |

-> st | Final state |

For loop

noinline :: (Syntactic a, Syntactic b) => String -> (a -> b) -> a -> bSource

Prevent a function from being inlined