... | ... | @@ -79,11 +79,25 @@ and so on. (The variable `f` must have a proper function type.) |
|
|
{-# VECTORISE type T = ty #-}
|
|
|
```
|
|
|
|
|
|
**TODO**
|
|
|
|
|
|
- Maybe don't have a rhs, but make this pragma mean that `T` should be vectorised as if the module containing `T` would have been vectorised. (Post-hoc vectorisation of a data type.)
|
|
|
|
|
|
## The VECTORISE SCALAR pragma for type constructors
|
|
|
|
|
|
|
|
|
For a type constructor `T`, the pragma
|
|
|
|
|
|
```wiki
|
|
|
{-# VECTORISE SCALAR T #-}
|
|
|
```
|
|
|
|
|
|
|
|
|
The type constructor `T` must be in scope, but may be imported. |
|
|
indicates that the type is scalar; i.e., it has no embedded arrays. Note that the type cannot be parameterised (as we could not rule out that any of the type parameters at a usage site is an array type.)
|
|
|
|
|
|
|
|
|
The type constructor `T` must be in scope, but it may be imported.
|
|
|
|
|
|
**TODO**
|
|
|
|
|
|
- For type constructors identified with this pragma, can we generate an `instance` of the `Scalar` type class automatically (instead of relying on it being in the library)? |