fortran-src-0.12.0: Parsers and analyses for Fortran standards 66, 77, 90, 95 and 2003 (partial).
Safe HaskellSafe-Inferred
LanguageHaskell2010

Language.Fortran.Repr.Value.Array.Machine

Description

Fortran array representation primitives.

Fortran arrays are homogeneous: every element has the same type. That means a REAL(8) array must store only REAL(8)s, no REAL(4)s. We use some type algebra to obtain correct-by-construction types.

Also, Fortran arrays are multi-dimensional. Rather than storing a single natural number for a single dimension, or doing some recursive work for arrays of arrays (which don't exist in Fortran), we instead store a list of naturals, defining each dimension's extent.

Synopsis

Documentation

type family Size dims where ... Source #

Equations

Size (dim ': dims) = dim + Size dims 
Size '[] = 0 

data FVA (ft :: k -> Type) (fk :: k) (dims :: [NaturalK]) Source #

Constructors

FVA 

Fields

Instances

Instances details
Show (ft fk) => Show (FVA ft fk dims) Source # 
Instance details

Defined in Language.Fortran.Repr.Value.Array.Machine

Methods

showsPrec :: Int -> FVA ft fk dims -> ShowS #

show :: FVA ft fk dims -> String #

showList :: [FVA ft fk dims] -> ShowS #

mkFVA1 :: forall l ft fk. Vector l (ft fk) -> FVA ft fk '[l] Source #

fvaShape :: forall dims ft fk. KnownNats dims => FVA ft fk dims -> Shape Source #

mkSomeFVA :: (forall l. KnownNat l => Vector l a -> r) -> [a] -> r Source #

class KnownNats (ns :: [NaturalK]) where Source #

Reify a list of type-level Naturals.

Methods

natVals :: [Natural] Source #

Instances

Instances details
KnownNats ('[] :: [NaturalK]) Source # 
Instance details

Defined in Language.Fortran.Repr.Value.Array.Machine

Methods

natVals :: [Natural] Source #

(KnownNat n, KnownNats ns) => KnownNats (n ': ns) Source # 
Instance details

Defined in Language.Fortran.Repr.Value.Array.Machine

Methods

natVals :: [Natural] Source #

data SomeFVA k ft Source #

Wrapper for defining an array of a kind-tagged Fortran type.

Constructors

forall (fk :: k) (dims :: [NaturalK]).(KnownNats dims, SingKind k, SingI fk) => SomeFVA 

Fields

mkSomeFVA1 :: forall k ft (fk :: k). (SingKind k, SingI fk) => [ft fk] -> SomeFVA k ft Source #