-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | An embedded language for accelerated array processing -- -- This library defines an embedded language for regular, -- multi-dimensional array computations with multiple backends to -- facilitate high-performance implementations. Currently, there are two -- backends: (1) an interpreter that serves as a reference implementation -- of the intended semantics of the language and (2) a CUDA backend -- generating code for CUDA-capable NVIDIA GPUs. -- -- To use the CUDA backend, you need to have CUDA version 3.x installed. -- The CUDA backend currently doesn't support Char and Bool -- arrays. -- -- An experimental OpenCL backend is available at -- https://github.com/HIPERFIT/accelerate-opencl and an -- experimental multicore CPU backend building on the Repa array library -- is available at https://github.com/blambo/accelerate-repa. -- -- Known bugs: https://github.com/AccelerateHS/accelerate/issues -- --
-- replicate (Z :.2 :.All :.3) arr ---- -- yields a three dimensional array, where arr is replicated -- twice across the first and three times across the third dimension. replicate :: (Slice slix, Elt e) => Exp slix -> Acc (Array (SliceShape slix) e) -> Acc (Array (FullShape slix) e) -- | Construct a new array by applying a function to each index. -- -- For example, the following will generate a one-dimensional array -- (Vector) of three floating point numbers: -- --
-- generate (index1 3) (\_ -> 1.2) ---- -- Or, equivalently: -- --
-- generate (constant (Z :. (3::Int))) (\_ -> 1.2) ---- -- Finally, the following will create an array equivalent to '[1..10]': -- --
-- generate (index1 10) $ \ ix -> -- let (Z :. i) = unlift ix -- in fromIntegral i --generate :: (Shape ix, Elt a) => Exp ix -> (Exp ix -> Exp a) -> Acc (Array ix a) -- | Change the shape of an array without altering its contents, where -- --
-- precondition: size ix == size ix' --reshape :: (Shape ix, Shape ix', Elt e) => Exp ix -> Acc (Array ix' e) -> Acc (Array ix e) -- | Index an array with a *generalised* array index (supplied as the -- second argument). The result is a new array (possibly a singleton) -- containing all dimensions in their entirety. slice :: (Slice slix, Elt e) => Acc (Array (FullShape slix) e) -> Exp slix -> Acc (Array (SliceShape slix) e) -- | Apply the given function element-wise to the given array. map :: (Shape ix, Elt a, Elt b) => (Exp a -> Exp b) -> Acc (Array ix a) -> Acc (Array ix b) -- | Apply the given binary function element-wise to the two arrays. The -- extent of the resulting array is the intersection of the extents of -- the two source arrays. zipWith :: (Shape ix, Elt a, Elt b, Elt c) => (Exp a -> Exp b -> Exp c) -> Acc (Array ix a) -> Acc (Array ix b) -> Acc (Array ix c) -- | Reduction of the innermost dimension of an array of arbitrary rank. -- The first argument needs to be an associative function to -- enable an efficient parallel implementation. fold :: (Shape ix, Elt a) => (Exp a -> Exp a -> Exp a) -> Exp a -> Acc (Array (ix :. Int) a) -> Acc (Array ix a) -- | Variant of fold that requires the reduced array to be non-empty -- and doesn't need an default value. fold1 :: (Shape ix, Elt a) => (Exp a -> Exp a -> Exp a) -> Acc (Array (ix :. Int) a) -> Acc (Array ix a) -- | Segmented reduction along the innermost dimension. Performs one -- individual reduction per segment of the source array. These reductions -- proceed in parallel. -- -- The source array must have at least rank 1. The Segments array -- determines the lengths of the logical sub-arrays, each of which is -- folded separately. foldSeg :: (Shape ix, Elt a, Elt i, IsIntegral i) => (Exp a -> Exp a -> Exp a) -> Exp a -> Acc (Array (ix :. Int) a) -> Acc (Segments i) -> Acc (Array (ix :. Int) a) -- | Variant of foldSeg that requires all segments of the -- reduced array to be non-empty and doesn't need a default value. -- -- The source array must have at least rank 1. The Segments array -- determines the lengths of the logical sub-arrays, each of which is -- folded separately. fold1Seg :: (Shape ix, Elt a, Elt i, IsIntegral i) => (Exp a -> Exp a -> Exp a) -> Acc (Array (ix :. Int) a) -> Acc (Segments i) -> Acc (Array (ix :. Int) a) -- | List-style left-to-right scan, but with the additional -- restriction that the first argument needs to be an associative -- function to enable an efficient parallel implementation. The initial -- value (second argument) may be arbitrary. scanl :: Elt a => (Exp a -> Exp a -> Exp a) -> Exp a -> Acc (Vector a) -> Acc (Vector a) -- | Variant of scanl, where the final result of the reduction is -- returned separately. Denotationally, we have -- --
-- scanl' f e arr = (crop 0 (len - 1) res, unit (res!len)) -- where -- len = shape arr -- res = scanl f e arr --scanl' :: Elt a => (Exp a -> Exp a -> Exp a) -> Exp a -> Acc (Vector a) -> (Acc (Vector a), Acc (Scalar a)) -- | List style left-to-right scan without an initial value (aka -- inclusive scan). Again, the first argument needs to be an -- associative function. Denotationally, we have -- --
-- scanl1 f e arr = crop 1 len res -- where -- len = shape arr -- res = scanl f e arr --scanl1 :: Elt a => (Exp a -> Exp a -> Exp a) -> Acc (Vector a) -> Acc (Vector a) -- | Right-to-left variant of scanl. scanr :: Elt a => (Exp a -> Exp a -> Exp a) -> Exp a -> Acc (Vector a) -> Acc (Vector a) -- | Right-to-left variant of scanl'. scanr' :: Elt a => (Exp a -> Exp a -> Exp a) -> Exp a -> Acc (Vector a) -> (Acc (Vector a), Acc (Scalar a)) -- | Right-to-left variant of scanl1. scanr1 :: Elt a => (Exp a -> Exp a -> Exp a) -> Acc (Vector a) -> Acc (Vector a) -- | Forward permutation specified by an index mapping. The result array is -- initialised with the given defaults and any further values that are -- permuted into the result array are added to the current value using -- the given combination function. -- -- The combination function must be associative. Elements that are -- mapped to the magic value ignore by the permutation function -- are being dropped. permute :: (Shape ix, Shape ix', Elt a) => (Exp a -> Exp a -> Exp a) -> Acc (Array ix' a) -> (Exp ix -> Exp ix') -> Acc (Array ix a) -> Acc (Array ix' a) -- | Backward permutation backpermute :: (Shape ix, Shape ix', Elt a) => Exp ix' -> (Exp ix' -> Exp ix) -> Acc (Array ix a) -> Acc (Array ix' a) -- | Map a stencil over an array. In contrast to map, the domain of -- a stencil function is an entire neighbourhood of each array -- element. Neighbourhoods are sub-arrays centred around a focal point. -- They are not necessarily rectangular, but they are symmetric in each -- dimension and have an extent of at least three in each dimensions — -- due to the symmetry requirement, the extent is necessarily odd. The -- focal point is the array position that is determined by the stencil. -- -- For those array positions where the neighbourhood extends past the -- boundaries of the source array, a boundary condition determines the -- contents of the out-of-bounds neighbourhood positions. stencil :: (Shape ix, Elt a, Elt b, Stencil ix a stencil) => (stencil -> Exp b) -> Boundary a -> Acc (Array ix a) -> Acc (Array ix b) -- | Map a binary stencil of an array. The extent of the resulting array is -- the intersection of the extents of the two source arrays. stencil2 :: (Shape ix, Elt a, Elt b, Elt c, Stencil ix a stencil1, Stencil ix b stencil2) => (stencil1 -> stencil2 -> Exp c) -> Boundary a -> Acc (Array ix a) -> Boundary b -> Acc (Array ix b) -> Acc (Array ix c) -- | Pipelining of two array computations. -- -- Denotationally, we have -- --
-- (acc1 >-> acc2) arrs = let tmp = acc1 arrs in acc2 tmp ---- -- Operationally, the array computations acc1 and acc2 -- will not share any sub-computations, neither between each other nor -- with the environment. This makes them truly independent stages that -- only communicate by way of the result of acc1 which is being -- fed as an argument to acc2. (>->) :: (Arrays a, Arrays b, Arrays c) => (Acc a -> Acc b) -> (Acc b -> Acc c) -> (Acc a -> Acc c) -- | An array-level if-then-else construct. cond :: Arrays a => Exp Bool -> Acc a -> Acc a -> Acc a -- | Infix version of cond. (?|) :: Arrays a => Exp Bool -> (Acc a, Acc a) -> Acc a class Lift c e where type family Plain e lift :: Lift c e => e -> c (Plain e) class Lift c e => Unlift c e unlift :: Unlift c e => c (Plain e) -> e -- | Lift a unary function into Exp. lift1 :: (Unlift Exp e1, Lift Exp e2) => (e1 -> e2) -> Exp (Plain e1) -> Exp (Plain e2) -- | Lift a binary function into Exp. lift2 :: (Unlift Exp e1, Unlift Exp e2, Lift Exp e3) => (e1 -> e2 -> e3) -> Exp (Plain e1) -> Exp (Plain e2) -> Exp (Plain e3) -- | Lift a unary function to a computation over rank-1 indices. ilift1 :: (Exp Int -> Exp Int) -> Exp (Z :. Int) -> Exp (Z :. Int) -- | Lift a binary function to a computation over rank-1 indices. ilift2 :: (Exp Int -> Exp Int -> Exp Int) -> Exp (Z :. Int) -> Exp (Z :. Int) -> Exp (Z :. Int) -- | Extract the first component of a pair. fst :: (Elt a, Elt b) => Exp (a, b) -> Exp a -- | Extract the second component of a pair. snd :: (Elt a, Elt b) => Exp (a, b) -> Exp b -- | Converts an uncurried function to a curried function. curry :: (Elt a, Elt b) => (Exp (a, b) -> Exp c) -> Exp a -> Exp b -> Exp c -- | Converts a curried function to a function on pairs. uncurry :: (Elt a, Elt b) => (Exp a -> Exp b -> Exp c) -> Exp (a, b) -> Exp c -- | The one index for a rank-0 array. index0 :: Exp Z -- | Turn an Int expression into a rank-1 indexing expression. index1 :: Exp Int -> Exp (Z :. Int) -- | Turn a rank-1 indexing expression into an Int expression. unindex1 :: Exp (Z :. Int) -> Exp Int -- | Creates a rank-2 index from two Exp Int`s index2 :: Exp Int -> Exp Int -> Exp DIM2 -- | Destructs a rank-2 index to an Exp tuple of two Int`s. unindex2 :: Exp DIM2 -> Exp (Int, Int) -- | Conditional expression. (?) :: Elt t => Exp Bool -> (Exp t, Exp t) -> Exp t -- | Expression form that extracts a scalar from an array. (!) :: (Shape ix, Elt e) => Acc (Array ix e) -> Exp ix -> Exp e -- | Extraction of the element in a singleton array. the :: Elt e => Acc (Scalar e) -> Exp e -- | Expression form that yields the shape of an array. shape :: (Shape ix, Elt e) => Acc (Array ix e) -> Exp ix -- | Expression form that yields the size of an array. size :: (Shape ix, Elt e) => Acc (Array ix e) -> Exp Int -- | The same as size but not operates directly on a shape without -- the array. shapeSize :: Shape ix => Exp ix -> Exp Int -- | Equality lifted into Accelerate expressions. (==*) :: (Elt t, IsScalar t) => Exp t -> Exp t -> Exp Bool -- | Inequality lifted into Accelerate expressions. (/=*) :: (Elt t, IsScalar t) => Exp t -> Exp t -> Exp Bool -- | Smaller-than lifted into Accelerate expressions. (<*) :: (Elt t, IsScalar t) => Exp t -> Exp t -> Exp Bool -- | Smaller-or-equal lifted into Accelerate expressions. (<=*) :: (Elt t, IsScalar t) => Exp t -> Exp t -> Exp Bool -- | Greater-than lifted into Accelerate expressions. (>*) :: (Elt t, IsScalar t) => Exp t -> Exp t -> Exp Bool -- | Greater-or-equal lifted into Accelerate expressions. (>=*) :: (Elt t, IsScalar t) => Exp t -> Exp t -> Exp Bool -- | Determine the maximum of two scalars. max :: (Elt t, IsScalar t) => Exp t -> Exp t -> Exp t -- | Determine the minimum of two scalars. min :: (Elt t, IsScalar t) => Exp t -> Exp t -> Exp t bit :: (Elt t, IsIntegral t) => Exp Int -> Exp t setBit :: (Elt t, IsIntegral t) => Exp t -> Exp Int -> Exp t clearBit :: (Elt t, IsIntegral t) => Exp t -> Exp Int -> Exp t complementBit :: (Elt t, IsIntegral t) => Exp t -> Exp Int -> Exp t testBit :: (Elt t, IsIntegral t) => Exp t -> Exp Int -> Exp Bool shift :: (Elt t, IsIntegral t) => Exp t -> Exp Int -> Exp t shiftL :: (Elt t, IsIntegral t) => Exp t -> Exp Int -> Exp t shiftR :: (Elt t, IsIntegral t) => Exp t -> Exp Int -> Exp t rotate :: (Elt t, IsIntegral t) => Exp t -> Exp Int -> Exp t rotateL :: (Elt t, IsIntegral t) => Exp t -> Exp Int -> Exp t rotateR :: (Elt t, IsIntegral t) => Exp t -> Exp Int -> Exp t -- | Conversions from the RealFrac class truncate :: (Elt a, Elt b, IsFloating a, IsIntegral b) => Exp a -> Exp b round :: (Elt a, Elt b, IsFloating a, IsIntegral b) => Exp a -> Exp b floor :: (Elt a, Elt b, IsFloating a, IsIntegral b) => Exp a -> Exp b ceiling :: (Elt a, Elt b, IsFloating a, IsIntegral b) => Exp a -> Exp b -- | Conjunction (&&*) :: Exp Bool -> Exp Bool -> Exp Bool -- | Disjunction (||*) :: Exp Bool -> Exp Bool -> Exp Bool -- | Negation not :: Exp Bool -> Exp Bool -- | Convert a Boolean value to an Int, where False turns -- into '0' and True into '1'. boolToInt :: Exp Bool -> Exp Int -- | General coercion from integral types fromIntegral :: (Elt a, Elt b, IsIntegral a, IsNum b) => Exp a -> Exp b -- | Magic value identifying elements that are ignored in a forward -- permutation ignore :: Shape ix => Exp ix -- | Combine the elements of two arrays pairwise. The shape of the result -- is the intersection of the two argument shapes. zip :: (Shape sh, Elt a, Elt b) => Acc (Array sh a) -> Acc (Array sh b) -> Acc (Array sh (a, b)) -- | Take three arrays and and return an array of triples, analogous to -- zip. zip3 :: (Shape sh, Elt a, Elt b, Elt c) => Acc (Array sh a) -> Acc (Array sh b) -> Acc (Array sh c) -> Acc (Array sh (a, b, c)) -- | Take three arrays and and return an array of quadruples, analogous to -- zip. zip4 :: (Shape sh, Elt a, Elt b, Elt c, Elt d) => Acc (Array sh a) -> Acc (Array sh b) -> Acc (Array sh c) -> Acc (Array sh d) -> Acc (Array sh (a, b, c, d)) -- | The converse of zip, but the shape of the two results is -- identical to the shape of the argument. unzip :: (Shape sh, Elt a, Elt b) => Acc (Array sh (a, b)) -> (Acc (Array sh a), Acc (Array sh b)) -- | Take an array of triples and return three arrays, analogous to unzip. unzip3 :: (Shape sh, Elt a, Elt b, Elt c) => Acc (Array sh (a, b, c)) -> (Acc (Array sh a), Acc (Array sh b), Acc (Array sh c)) -- | Take an array of quadruples and return four arrays, analogous to -- unzip. unzip4 :: (Shape sh, Elt a, Elt b, Elt c, Elt d) => Acc (Array sh (a, b, c, d)) -> (Acc (Array sh a), Acc (Array sh b), Acc (Array sh c), Acc (Array sh d)) -- | Reduction of an array of arbitrary rank to a single scalar value. The -- first argument needs to be an associative function to enable an -- efficient parallel implementation. foldAll :: (Shape sh, Elt a) => (Exp a -> Exp a -> Exp a) -> Exp a -> Acc (Array sh a) -> Acc (Scalar a) -- | Variant of foldAll that requires the reduced array to be -- non-empty and doesn't need an default value. fold1All :: (Shape sh, Elt a) => (Exp a -> Exp a -> Exp a) -> Acc (Array sh a) -> Acc (Scalar a) -- | Left-to-right prescan (aka exclusive scan). As for scan, the -- first argument must be an associative function. Denotationally, -- we have -- --
-- prescanl f e = Prelude.fst . scanl' f e --prescanl :: Elt a => (Exp a -> Exp a -> Exp a) -> Exp a -> Acc (Vector a) -> Acc (Vector a) -- | Left-to-right postscan, a variant of scanl1 with an initial -- value. Denotationally, we have -- --
-- postscanl f e = map (e `f`) . scanl1 f --postscanl :: Elt a => (Exp a -> Exp a -> Exp a) -> Exp a -> Acc (Vector a) -> Acc (Vector a) -- | Right-to-left prescan (aka exclusive scan). As for scan, the -- first argument must be an associative function. Denotationally, -- we have -- --
-- prescanr f e = Prelude.fst . scanr' f e --prescanr :: Elt a => (Exp a -> Exp a -> Exp a) -> Exp a -> Acc (Vector a) -> Acc (Vector a) -- | Right-to-left postscan, a variant of scanr1 with an initial -- value. Denotationally, we have -- --
-- postscanr f e = map (e `f`) . scanr1 f --postscanr :: Elt a => (Exp a -> Exp a -> Exp a) -> Exp a -> Acc (Vector a) -> Acc (Vector a) -- | Segmented version of scanl. scanlSeg :: (Elt a, Elt i, IsIntegral i) => (Exp a -> Exp a -> Exp a) -> Exp a -> Acc (Vector a) -> Acc (Segments i) -> Acc (Vector a) -- | Segmented version of scanl'. -- -- The first element of the resulting tuple is a vector of scanned -- values. The second element is a vector of segment scan totals and has -- the same size as the segment vector. scanl'Seg :: (Elt a, Elt i, IsIntegral i) => (Exp a -> Exp a -> Exp a) -> Exp a -> Acc (Vector a) -> Acc (Segments i) -> (Acc (Vector a), Acc (Vector a)) -- | Segmented version of scanl1. scanl1Seg :: (Elt a, Elt i, IsIntegral i) => (Exp a -> Exp a -> Exp a) -> Acc (Vector a) -> Acc (Segments i) -> Acc (Vector a) -- | Segmented version of prescanl. prescanlSeg :: (Elt a, Elt i, IsIntegral i) => (Exp a -> Exp a -> Exp a) -> Exp a -> Acc (Vector a) -> Acc (Segments i) -> Acc (Vector a) -- | Segmented version of postscanl. postscanlSeg :: (Elt a, Elt i, IsIntegral i) => (Exp a -> Exp a -> Exp a) -> Exp a -> Acc (Vector a) -> Acc (Segments i) -> Acc (Vector a) -- | Segmented version of scanr. scanrSeg :: (Elt a, Elt i, IsIntegral i) => (Exp a -> Exp a -> Exp a) -> Exp a -> Acc (Vector a) -> Acc (Segments i) -> Acc (Vector a) -- | Segmented version of scanr'. scanr'Seg :: (Elt a, Elt i, IsIntegral i) => (Exp a -> Exp a -> Exp a) -> Exp a -> Acc (Vector a) -> Acc (Segments i) -> (Acc (Vector a), Acc (Vector a)) -- | Segmented version of scanr1. scanr1Seg :: (Elt a, Elt i, IsIntegral i) => (Exp a -> Exp a -> Exp a) -> Acc (Vector a) -> Acc (Segments i) -> Acc (Vector a) -- | Segmented version of prescanr. prescanrSeg :: (Elt a, Elt i, IsIntegral i) => (Exp a -> Exp a -> Exp a) -> Exp a -> Acc (Vector a) -> Acc (Segments i) -> Acc (Vector a) -- | Segmented version of postscanr. postscanrSeg :: (Elt a, Elt i, IsIntegral i) => (Exp a -> Exp a -> Exp a) -> Exp a -> Acc (Vector a) -> Acc (Segments i) -> Acc (Vector a) -- | Flattens a given array of arbitrary dimension. flatten :: (Shape ix, Elt a) => Acc (Array ix a) -> Acc (Array DIM1 a) -- | Create an array where all elements are the same value. fill :: (Shape sh, Elt e) => Exp sh -> Exp e -> Acc (Array sh e) -- | Create an array of the given shape containing the values x, x+1, etc -- (in row-major order). enumFromN :: (Shape sh, Elt e, IsNum e) => Exp sh -> Exp e -> Acc (Array sh e) -- | Create an array of the given shape containing the values x, x+y, -- x+y+y, etc (in row-major order). enumFromStepN :: (Shape sh, Elt e, IsNum e) => Exp sh -> Exp e -> Exp e -> Acc (Array sh e) -- | Copy elements from source array to destination array according to a -- map. This is a backpermute operation where a map vector encodes -- the ouput to input index mapping. For example: -- -- input = [1, 9, 6, 4, 4, 2, 0, 1, 2] map = [1, 3, 7, 2, 5, 3] -- -- output = [9, 4, 1, 6, 2, 4] gather :: Elt e => Acc (Vector Int) -> Acc (Vector e) -> Acc (Vector e) -- | Conditionally copy elements from source array to destination array -- according to a map. This is a backpermute opereation where a -- map vector encdes the output to input index mapping. In -- addition, there is a mask vector, and an associated -- predication function, that specifies whether an element will be -- copied. If not copied, the output array assumes the default vector's -- value. For example: -- -- default = [6, 6, 6, 6, 6, 6] map = [1, 3, 7, 2, 5, 3] mask = [3, 4, 9, -- 2, 7, 5] pred = (> 4) input = [1, 9, 6, 4, 4, 2, 0, 1, 2] -- -- output = [6, 6, 1, 6, 2, 4] gatherIf :: (Elt e, Elt e') => Acc (Vector Int) -> Acc (Vector e) -> (Exp e -> Exp Bool) -> Acc (Vector e') -> Acc (Vector e') -> Acc (Vector e') -- | Copy elements from source array to destination array according to a -- map. This is a forward-permute operation where a map vector -- encodes an input to output index mapping. Output elements for indices -- that are not mapped assume the default vector's value. For example: -- -- default = [0, 0, 0, 0, 0, 0, 0, 0, 0] map = [1, 3, 7, 2, 5, 8] input = -- [1, 9, 6, 4, 4, 2, 5] -- -- output = [0, 1, 4, 9, 0, 4, 0, 6, 2] -- -- Note if the same index appears in the map more than once, the result -- is undefined. The map vector cannot be larger than the input vector. scatter :: Elt e => Acc (Vector Int) -> Acc (Vector e) -> Acc (Vector e) -> Acc (Vector e) -- | Conditionally copy elements from source array to destination array -- according to a map. This is a forward-permute operation where a -- map vector encodes an input to output index mapping. In -- addition, there is a mask vector, and an associated predicate -- function, that specifies whether an elements will be copied. If not -- copied, the output array assumes the default vector's value. For -- example: -- -- default = [0, 0, 0, 0, 0, 0, 0, 0, 0] map = [1, 3, 7, 2, 5, 8] mask = -- [3, 4, 9, 2, 7, 5] pred = (> 4) input = [1, 9, 6, 4, 4, 2] -- -- output = [0, 0, 0, 0, 0, 4, 0, 6, 2] -- -- Note if the same index appears in the map more than once, the result -- is undefined. The map and input vector must be of the same length. scatterIf :: (Elt e, Elt e') => Acc (Vector Int) -> Acc (Vector e) -> (Exp e -> Exp Bool) -> Acc (Vector e') -> Acc (Vector e') -> Acc (Vector e') -- | Yield all but the last element of the input vector. The vector may not -- be empty. init :: Elt e => Acc (Vector e) -> Acc (Vector e) -- | Yield all but the first element of the input vector. The vector may -- not be empty. tail :: Elt e => Acc (Vector e) -> Acc (Vector e) -- | Yield the first n elements of the input vector. The vector -- must contain no more than n elements. take :: Elt e => Exp Int -> Acc (Vector e) -> Acc (Vector e) -- | Yield all but the first n elements of the input vector. The -- vector must contain no more than n elements. drop :: Elt e => Exp Int -> Acc (Vector e) -> Acc (Vector e) -- | Yield a slit (slice) from the vector. The vector must contain at least -- i + n elements. slit :: Elt e => Exp Int -> Exp Int -> Acc (Vector e) -> Acc (Vector e) -- | Deprecated: Use Elt instead class Elt e => Elem e -- | Deprecated: Use Shape instead class Shape sh => Ix sh -- | Deprecated: Use Slice instead class Slice sh => SliceIx sh -- | Deprecated: Use lift instead tuple :: Lift Exp e => e -> Exp (Plain e) -- | Deprecated: Use unlift instead untuple :: Unlift Exp e => Exp (Plain e) -> e -- | Initialise the trace flag, which determines whether tracing -- messages should be emitted. initTrace :: Bool -> IO () instance Slice sh => SliceIx sh instance Shape sh => Ix sh instance Elt e => Elem e