fixed-vector-1.1.0.0: Generic vectors with statically known size.

Safe HaskellNone
LanguageHaskell98

Data.Vector.Fixed.Generic

Contents

Description

More generic version of function from Data.Vector.Fixed module. They do not require that all vector have same type, only same length. All such functions have suffix G.

Synopsis

Mapping

mapG :: (Vector v a, Vector w b, Dim v ~ Dim w) => (a -> b) -> v a -> w b Source #

Map over vector

imapG :: (Vector v a, Vector w b, Dim v ~ Dim w) => (Int -> a -> b) -> v a -> w b Source #

Apply function to every element of the vector and its index.

mapMG :: (Vector v a, Vector w b, Dim w ~ Dim v, Monad m) => (a -> m b) -> v a -> m (w b) Source #

Monadic map over vector.

imapMG :: (Vector v a, Vector w b, Dim w ~ Dim v, Monad m) => (Int -> a -> m b) -> v a -> m (w b) Source #

Monadic map over vector.

Zips

zipWithG :: (Vector v a, Vector w b, Vector u c, Dim v ~ Dim u, Dim v ~ Dim w) => (a -> b -> c) -> v a -> w b -> u c Source #

Zip two vector together using function.

izipWithG :: (Vector v a, Vector w b, Vector u c, Dim v ~ Dim u, Dim v ~ Dim w) => (Int -> a -> b -> c) -> v a -> w b -> u c Source #

Zip two vector together using function which takes element index as well.

zipWithMG :: (Vector v a, Vector w b, Vector u c, Dim v ~ Dim u, Dim v ~ Dim w, Monad m) => (a -> b -> m c) -> v a -> w b -> m (u c) Source #

Zip two vector together using monadic function.

izipWithMG :: (Vector v a, Vector w b, Vector u c, Dim v ~ Dim u, Dim v ~ Dim w, Monad m) => (Int -> a -> b -> m c) -> v a -> w b -> m (u c) Source #

Zip two vector together using monadic function which takes element index as well..