linear-1.3.1: Linear Algebra

Portability non-portable experimental Edward Kmett Trustworthy

Linear.V1

Description

1-D Vectors

Synopsis

• newtype V1 a = V1 a
• class R1 t where
• _x :: Functor f => (a -> f a) -> t a -> f (t a)

# Documentation

newtype V1 a Source

A 1-dimensional vector

````>>> ````pure 1 :: V1 Int
```V1 1
```
````>>> ````V1 2 + V1 3
```V1 5
```
````>>> ````V1 2 * V1 3
```V1 6
```
````>>> ````sum (V1 2)
```2
```

Constructors

 V1 a

Instances

 Monad V1 Functor V1 Typeable1 V1 Applicative V1 Foldable V1 Traversable V1 Distributive V1 Traversable1 V1 Foldable1 V1 Apply V1 Bind V1 Additive V1 Metric V1 Core V1 R1 V1 Affine V1 Eq a => Eq (V1 a) Fractional a => Fractional (V1 a) Data a => Data (V1 a) Num a => Num (V1 a) Ord a => Ord (V1 a) Read a => Read (V1 a) Show a => Show (V1 a) Ix a => Ix (V1 a) Storable a => Storable (V1 a) Epsilon a => Epsilon (V1 a)

class R1 t whereSource

A space that has at least 1 basis vector `_x`.

Methods

_x :: Functor f => (a -> f a) -> t a -> f (t a)Source

````>>> ````V1 2 ^._x
```2
```
````>>> ````V1 2 & _x .~ 3
```V1 3
```
``` `_x` :: Lens' (t a) a
```

Instances

 R1 Identity R1 V1 R1 V2 R1 V3 R1 V4 R1 f => R1 (Point f)