Copyright | (c) George Ungureanu KTH/EECS/ESY 2019-2020 |
---|---|
License | BSD-style (see the file LICENSE) |
Maintainer | ugeorge@kth.se |
Stability | experimental |
Portability | portable |
Safe Haskell | Safe |
Language | Haskell2010 |
This library is is an un-official alternative to Vector
meant for simulations of large data which is likely to become too
cumbersome. Fast Vector
functions do not use atoms, but rather use Prelude
functions on a wrapped newtype
using a native Haskell type (in this case
lists). The API tries to copy the exported functions of
ForSyDe.Atom.Skel.Vector and its submodule so that switching betwen libraries
can be made seamlessly just by Vector
with FastVector
in the library import.
Useful links:
- ForSyDe.Atom contains general guidelines for using the API
- ForSyDe.Atom.Skel.Vector documents the API which this module is trying to replicate.
- ForSyDe.Atom.Skel.FastVector.Matrix contains a collection of patterns for
working with 2-dimensional
Vector
s. - ForSyDe.Atom.Skel.FastVector.Cube contains a collection of patterns for
working with 3-dimensional
Vector
s. - ForSyDe.Atom.Skel.FastVector.DSP contains a collection of patterns commonly used in signal processing designs.
- the naming convention rules on how to interpret the function names based on their number of inputs and outputs.
Synopsis
- newtype Vector a = Vector {
- fromVector :: [a]
- vector :: [a] -> Vector a
- farm11 :: Functor f => (a -> b) -> f a -> f b
- farm21 :: Applicative f => (a1 -> a2 -> b) -> f a1 -> f a2 -> f b
- farm31 :: Applicative f => (a1 -> a2 -> a3 -> b) -> f a1 -> f a2 -> f a3 -> f b
- farm41 :: Applicative f => (a1 -> a2 -> a3 -> a4 -> b) -> f a1 -> f a2 -> f a3 -> f a4 -> f b
- farm51 :: Applicative f => (a1 -> a2 -> a3 -> a4 -> a5 -> b) -> f a1 -> f a2 -> f a3 -> f a4 -> f a5 -> f b
- farm12 :: Functor f => (a -> (a1, b)) -> f a -> (f a1, f b)
- farm22 :: Applicative f => (a1 -> a2 -> (a3, b)) -> f a1 -> f a2 -> (f a3, f b)
- (<++>) :: Vector a -> Vector a -> Vector a
- reduce :: (t -> t -> t) -> Vector t -> t
- length :: Vector a -> Int
- drop :: Int -> Vector a -> Vector a
- take :: Int -> Vector a -> Vector a
- first :: Vector t -> t
- group :: Int -> Vector a -> Vector (Vector a)
- fanout :: a -> Vector a
- fanoutn :: Int -> a -> Vector a
- stencil :: Int -> Vector a -> Vector (Vector a)
- tails :: Vector a -> Vector (Vector a)
- concat :: Vector (Vector a) -> Vector a
- iterate :: Int -> (a -> a) -> a -> Vector a
- pipe :: Vector (a -> a) -> a -> a
- pipe1 :: (a -> t -> t) -> Vector a -> t -> t
- reverse :: Vector a -> Vector a
- recuri :: Vector (b -> b) -> b -> Vector b
- get :: Int -> Vector a -> Maybe a
- evens :: Vector a -> Vector a
- odds :: Vector a -> Vector a
Documentation
In this library Vector
is just a wrapper around a list.
Vector | |
|
Instances
Functor Vector Source # | |
Applicative Vector Source # | |
Foldable Vector Source # | |
Defined in ForSyDe.Atom.Skel.FastVector.Lib fold :: Monoid m => Vector m -> m # foldMap :: Monoid m => (a -> m) -> Vector a -> m # foldMap' :: Monoid m => (a -> m) -> Vector a -> m # foldr :: (a -> b -> b) -> b -> Vector a -> b # foldr' :: (a -> b -> b) -> b -> Vector a -> b # foldl :: (b -> a -> b) -> b -> Vector a -> b # foldl' :: (b -> a -> b) -> b -> Vector a -> b # foldr1 :: (a -> a -> a) -> Vector a -> a # foldl1 :: (a -> a -> a) -> Vector a -> a # elem :: Eq a => a -> Vector a -> Bool # maximum :: Ord a => Vector a -> a # minimum :: Ord a => Vector a -> a # | |
Eq a => Eq (Vector a) Source # | |
Show a => Show (Vector a) Source # | |
farm21 :: Applicative f => (a1 -> a2 -> b) -> f a1 -> f a2 -> f b Source #
farm31 :: Applicative f => (a1 -> a2 -> a3 -> b) -> f a1 -> f a2 -> f a3 -> f b Source #
farm41 :: Applicative f => (a1 -> a2 -> a3 -> a4 -> b) -> f a1 -> f a2 -> f a3 -> f a4 -> f b Source #
farm51 :: Applicative f => (a1 -> a2 -> a3 -> a4 -> a5 -> b) -> f a1 -> f a2 -> f a3 -> f a4 -> f a5 -> f b Source #
farm22 :: Applicative f => (a1 -> a2 -> (a3, b)) -> f a1 -> f a2 -> (f a3, f b) Source #