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

Language.Fortran.Repr.Value.Scalar.Machine

Synopsis

Note on type coercion implementation

When you run a binary operation on two Fortran values, type coercion may take place depending on the types of the values. This complicates evaluation code, because now we have to export two sets of functions for operating on values: one for returning a kinded value (e.g. addition returns the same type), and one for non-kinded values (e.g. equality returns a boolean).

On the lowest level, e.g. for operating over INTEGER(x) and INTEGER(y), we resolve this by doing the coercion in an internal function which is polymorphic over the result type, and using that in both sets of functions. To operate kinded, we use the relevant type. To operate unkinded, we use Const r, which ignores the kind and just stores a value of type r.

data FScalarValue Source #

A Fortran scalar value.

Instances

Instances details
Out FScalarValue Source # 
Instance details

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

Data FScalarValue Source # 
Instance details

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

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> FScalarValue -> c FScalarValue #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c FScalarValue #

toConstr :: FScalarValue -> Constr #

dataTypeOf :: FScalarValue -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c FScalarValue) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c FScalarValue) #

gmapT :: (forall b. Data b => b -> b) -> FScalarValue -> FScalarValue #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> FScalarValue -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> FScalarValue -> r #

gmapQ :: (forall d. Data d => d -> u) -> FScalarValue -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> FScalarValue -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> FScalarValue -> m FScalarValue #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> FScalarValue -> m FScalarValue #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> FScalarValue -> m FScalarValue #

Generic FScalarValue Source # 
Instance details

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

Associated Types

type Rep FScalarValue :: Type -> Type #

Show FScalarValue Source # 
Instance details

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

Binary FScalarValue Source # 
Instance details

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

Eq FScalarValue Source # 
Instance details

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

type Rep FScalarValue Source # 
Instance details

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

fScalarValueType :: FScalarValue -> FScalarType Source #

Recover a Fortran scalar value's type.