camfort-0.904: CamFort - Cambridge Fortran infrastructure

Safe HaskellNone
LanguageHaskell2010

Camfort.Helpers.Vec

Contents

Synopsis

Datatypes

data EqT a b where Source #

Constructors

ReflEq :: EqT a a 

data ExistsEqT t n where Source #

Constructors

ExistsEqT :: EqT (t m) n -> ExistsEqT t n 

data Nat Source #

Constructors

Z 
S Nat 

data Natural n where Source #

Constructors

Zero :: Natural Z 
Succ :: Natural n -> Natural (S n) 

Instances

Show (Natural n) Source # 

Methods

showsPrec :: Int -> Natural n -> ShowS #

show :: Natural n -> String #

showList :: [Natural n] -> ShowS #

data Vec n a where Source #

Constructors

Nil :: Vec Z a 
Cons :: a -> Vec n a -> Vec (S n) a 

Instances

Functor (Vec n) Source # 

Methods

fmap :: (a -> b) -> Vec n a -> Vec n b #

(<$) :: a -> Vec n b -> Vec n a #

Foldable (Vec n) Source # 

Methods

fold :: Monoid m => Vec n m -> m #

foldMap :: Monoid m => (a -> m) -> Vec n a -> m #

foldr :: (a -> b -> b) -> b -> Vec n a -> b #

foldr' :: (a -> b -> b) -> b -> Vec n a -> b #

foldl :: (b -> a -> b) -> b -> Vec n a -> b #

foldl' :: (b -> a -> b) -> b -> Vec n a -> b #

foldr1 :: (a -> a -> a) -> Vec n a -> a #

foldl1 :: (a -> a -> a) -> Vec n a -> a #

toList :: Vec n a -> [a] #

null :: Vec n a -> Bool #

length :: Vec n a -> Int #

elem :: Eq a => a -> Vec n a -> Bool #

maximum :: Ord a => Vec n a -> a #

minimum :: Ord a => Vec n a -> a #

sum :: Num a => Vec n a -> a #

product :: Num a => Vec n a -> a #

Eq a => Eq (Vec n a) Source # 

Methods

(==) :: Vec n a -> Vec n a -> Bool #

(/=) :: Vec n a -> Vec n a -> Bool #

Ord a => Ord (Vec n a) Source # 

Methods

compare :: Vec n a -> Vec n a -> Ordering #

(<) :: Vec n a -> Vec n a -> Bool #

(<=) :: Vec n a -> Vec n a -> Bool #

(>) :: Vec n a -> Vec n a -> Bool #

(>=) :: Vec n a -> Vec n a -> Bool #

max :: Vec n a -> Vec n a -> Vec n a #

min :: Vec n a -> Vec n a -> Vec n a #

Show a => Show (Vec n a) Source # 

Methods

showsPrec :: Int -> Vec n a -> ShowS #

show :: Vec n a -> String #

showList :: [Vec n a] -> ShowS #

data VecBox a where Source #

Constructors

VecBox :: Vec n a -> VecBox a 

data VecList a where Source #

Constructors

VL :: [Vec n a] -> VecList a 

Vector Operations

(!!) :: Vec n a -> Int -> a Source #

findIndex :: (a -> Bool) -> Vec n a -> Maybe Int Source #

fromList :: [a] -> VecBox a Source #

fromLists :: forall a. [[a]] -> VecList a Source #

length :: Vec n a -> Int Source #

lengthN :: Vec n a -> Natural n Source #

proveEqSize :: Vec n a -> Vec m b -> Maybe (EqT m n) Source #

replace :: Int -> a -> Vec n a -> Vec n a Source #

toList :: Vec n a -> [a] Source #

zip :: Vec n a -> Vec n b -> Vec n (a, b) Source #

zipWith :: (a -> b -> c) -> Vec n a -> Vec n b -> Vec n c Source #