camfort-0.902: CamFort - Cambridge Fortran infrastructure

Safe HaskellNone
LanguageHaskell2010

Camfort.Helpers.Vec

Synopsis

Documentation

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 NatBox where Source #

Constructors

NatBox :: Natural n -> NatBox 

Instances

class IsNatural n where Source #

Minimal complete definition

fromNat

Methods

fromNat :: Proxy n -> Int Source #

Instances

IsNatural Z Source # 

Methods

fromNat :: Proxy Nat Z -> Int Source #

IsNatural n => IsNatural (S n) Source # 

Methods

fromNat :: Proxy Nat (S n) -> Int Source #

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 #

length :: Vec n a -> Int Source #

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

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

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

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

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

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

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 VecBox a where Source #

Constructors

VecBox :: Vec n a -> VecBox a 

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

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

applyListOp :: ([a] -> [a]) -> Vec n a -> Vec n a Source #

Apply length preserving list operation.

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

hasSize :: Vec m a -> Natural n -> Maybe (EqT m n) Source #

data VecList a where Source #

Constructors

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

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