accelerate-utility-1.0.0.1: Utility functions for the Accelerate framework

Safe HaskellNone
LanguageHaskell98

Data.Array.Accelerate.Utility.Shape

Description

An alternative Shape class that allows to add new "methods", but forbids to add new instances. You can provide new "methods" by calling switch with a newtype around your function type.

For the general concept, see: https://www.haskell.org/haskellwiki/Closed_world_instances

Documentation

class (Shape sh, Slice sh, Elt sh, Eq sh, Plain sh ~ sh, Lift Exp sh) => C sh where Source #

Minimal complete definition

switch

Methods

switch :: f Z -> (forall sh0. C sh0 => f (sh0 :. Int)) -> f sh Source #

Instances

C Z Source # 

Methods

switch :: f Z -> (forall sh0. C sh0 => f (sh0 :. Int)) -> f Z Source #

(C sh, (~) * i Int) => C ((:.) sh i) Source # 

Methods

switch :: f Z -> (forall sh0. C sh0 => f (sh0 :. Int)) -> f (sh :. i) Source #