camfort-1.0.1: CamFort - Cambridge Fortran infrastructure
Safe HaskellNone
LanguageHaskell2010

Language.Fortran.Model.Op.Core.Match

Synopsis

Documentation

data MatchNumType a where Source #

Constructors

MatchNumType :: Sing p -> Sing k -> NumericBasicType k -> Prim p k a -> MatchNumType (PrimS a) 

matchNumType :: D a -> Maybe (MatchNumType a) Source #

Checks if the given type is numeric, and if so returns a proof of that fact.

data MatchNumR a b where Source #

Constructors

MatchNumR :: NumericBasicType k1 -> NumericBasicType k2 -> Prim p1 k1 a -> Prim p2 k2 b -> Prim (PrecMax p1 p2) (BasicTypeMax k1 k2) c -> MatchNumR (PrimS a) (PrimS b) 

matchNumR :: D a -> D b -> Maybe (MatchNumR a b) Source #

Checks if it is possible to perform a binary numeric operation on arguments with the given respective types. If so, returns the type that would result plus some more information about the types.

primCeil :: Prim p1 k1 a -> Prim p2 k2 b -> Maybe (MakePrim (PrecMax p1 p2) (BasicTypeMax k1 k2)) Source #

data MatchCompareR a b where Source #

Constructors

MatchCompareR :: ComparableBasicTypes k1 k2 -> Prim p1 k1 a -> Prim p2 k2 b -> MatchCompareR (PrimS a) (PrimS b) 

matchCompareR :: D a -> D b -> Maybe (MatchCompareR a b) Source #

Checks if it is possible to perform a binary comparison (equality or relational) operation on arguments with the given respective types. If so, returns proof of that fact.

data MatchOpSpec ok args where Source #

Constructors

MatchOpSpec :: OpSpec ok args result -> D result -> MatchOpSpec ok args 

matchOpSpec :: Op (Length args) ok -> Rec D args -> Maybe (MatchOpSpec ok args) Source #

Checks if it is possible to apply the given operator to the given arguments, and if so returns a proof of that fact, packaged with information about the result of applying the operator.