camfort-1.2.0: CamFort - Cambridge Fortran infrastructure
Safe HaskellSafe-Inferred
LanguageHaskell2010

Camfort.Helpers.Syntax

Description

This module provides a number of helper functions for working with Fortran syntax that are useful between different analyses and transformations.

Synopsis

Variable renaming helpers

caml :: [Char] -> [Char] Source #

Comparison and ordering

data AnnotationFree t Source #

AnnotationFree is a data type that wraps other types and denotes terms which should be compared for equality modulo their annotations and source location information

Constructors

AnnotationFree 

Fields

Instances

Instances details
Show t => Show (AnnotationFree t) Source # 
Instance details

Defined in Camfort.Helpers.Syntax

Eq (AnnotationFree BaseType) Source # 
Instance details

Defined in Camfort.Helpers.Syntax

Eq a => Eq (AnnotationFree (Expression a)) Source # 
Instance details

Defined in Camfort.Helpers.Syntax

Eq (AnnotationFree ConstructType) Source # 
Instance details

Defined in Camfort.Helpers.Syntax

Eq (AnnotationFree SemType) Source # 
Instance details

Defined in Camfort.Helpers.Syntax

(Eq (AnnotationFree a), Eq (AnnotationFree b)) => Eq (AnnotationFree (a, b)) Source # 
Instance details

Defined in Camfort.Helpers.Syntax

Methods

(==) :: AnnotationFree (a, b) -> AnnotationFree (a, b) -> Bool #

(/=) :: AnnotationFree (a, b) -> AnnotationFree (a, b) -> Bool #

Eq (AnnotationFree a) => Eq (AnnotationFree [a]) Source # 
Instance details

Defined in Camfort.Helpers.Syntax

af :: t -> AnnotationFree t Source #

short-hand constructor for AnnotationFree

Accessor functions for extracting various pieces of information

extractVariable :: Expression a -> Maybe Name Source #

Extracts a string of the (root) variable name from an expression, e.g., extractVariable "v" = Just v extractVariable "v(i)" = Just v

SrcSpan Helpers

Orphan instances

Monoid Int Source #

Set a default monoid instances for Int

Instance details

Methods

mempty :: Int #

mappend :: Int -> Int -> Int #

mconcat :: [Int] -> Int #

Semigroup Int Source # 
Instance details

Methods

(<>) :: Int -> Int -> Int #

sconcat :: NonEmpty Int -> Int #

stimes :: Integral b => b -> Int -> Int #