A module defining the type and operations of free k-vector spaces over a basis b (for a field k)
- data Vect k b = V [(b, k)]
- zero :: Vect k b
- add :: (Ord b, Num k) => Vect k b -> Vect k b -> Vect k b
- (<+>) :: (Ord b, Num k) => Vect k b -> Vect k b -> Vect k b
- neg :: Num k => Vect k b -> Vect k b
- smultL :: Num k => k -> Vect k b -> Vect k b
- (*>) :: Num k => k -> Vect k b -> Vect k b
- smultR :: Num k => Vect k b -> k -> Vect k b
- (<*) :: Num k => Vect k b -> k -> Vect k b
- nf :: (Ord b, Num k) => Vect k b -> Vect k b
- linear :: (Ord b, Num k) => (a -> Vect k b) -> Vect k a -> Vect k b
- newtype EBasis = E Int
Documentation
Given a field type k (ie a Fractional instance), Vect k b is the type of the free k-vector space over the basis type b. Elements of Vect k b consist of k-linear combinations of elements of b.
V [(b, k)] |
(*>) :: Num k => k -> Vect k b -> Vect k bSource
Same as smultL. Mnemonic is multiply through (from the left)
(<*) :: Num k => Vect k b -> k -> Vect k bSource
Same as smultR. Mnemonic is multiply through (from the right)