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

Language.Fortran.Util.FirstParameter

Description

A convenience class for retrieving the first field of any constructor in a datatype.

The primary usage for this class is generic derivation:

data D a = D a () String deriving Generic instance FirstParameter (D a) a

Note that _the deriver does not check you are requesting a valid/safe instance._ Invalid instances propagate the error to runtime. Fixing this requires a lot more type-level work. (The generic-lens library has a general solution, but it's slow and memory-consuming.)

Documentation

class FirstParameter a e | a -> e where Source #

Minimal complete definition

Nothing

Methods

getFirstParameter :: a -> e Source #

default getFirstParameter :: (Generic a, GFirstParameter (Rep a) e) => a -> e Source #

setFirstParameter :: e -> a -> a Source #

default setFirstParameter :: (Generic a, GFirstParameter (Rep a) e) => e -> a -> a Source #

Instances

Instances details
FirstParameter Token SrcSpan Source # 
Instance details

Defined in Language.Fortran.Parser.Fixed.Lexer

FirstParameter Token SrcSpan Source # 
Instance details

Defined in Language.Fortran.Parser.Free.Lexer

FirstParameter (AllocOpt a) a Source # 
Instance details

Defined in Language.Fortran.AST

FirstParameter (Argument a) a Source # 
Instance details

Defined in Language.Fortran.AST

FirstParameter (Attribute a) a Source # 
Instance details

Defined in Language.Fortran.AST

FirstParameter (Block a) a Source # 
Instance details

Defined in Language.Fortran.AST

FirstParameter (CommonGroup a) a Source # 
Instance details

Defined in Language.Fortran.AST

FirstParameter (ControlPair a) a Source # 
Instance details

Defined in Language.Fortran.AST

FirstParameter (DataGroup a) a Source # 
Instance details

Defined in Language.Fortran.AST

FirstParameter (Declarator a) a Source # 
Instance details

Defined in Language.Fortran.AST

FirstParameter (DimensionDeclarator a) a Source # 
Instance details

Defined in Language.Fortran.AST

FirstParameter (DoSpecification a) a Source # 
Instance details

Defined in Language.Fortran.AST

FirstParameter (Expression a) a Source # 
Instance details

Defined in Language.Fortran.AST

FirstParameter (FlushSpec a) a Source # 
Instance details

Defined in Language.Fortran.AST

FirstParameter (ForallHeader a) a Source # 
Instance details

Defined in Language.Fortran.AST

FirstParameter (ForallHeaderPart a) a Source # 
Instance details

Defined in Language.Fortran.AST

FirstParameter (FormatItem a) a Source # 
Instance details

Defined in Language.Fortran.AST

FirstParameter (ImpElement a) a Source # 
Instance details

Defined in Language.Fortran.AST

FirstParameter (ImpList a) a Source # 
Instance details

Defined in Language.Fortran.AST

FirstParameter (Index a) a Source # 
Instance details

Defined in Language.Fortran.AST

FirstParameter (Namelist a) a Source # 
Instance details

Defined in Language.Fortran.AST

FirstParameter (Prefix a) a Source # 
Instance details

Defined in Language.Fortran.AST

FirstParameter (ProcDecl a) a Source # 
Instance details

Defined in Language.Fortran.AST

FirstParameter (ProcInterface a) a Source # 
Instance details

Defined in Language.Fortran.AST

FirstParameter (ProgramUnit a) a Source # 
Instance details

Defined in Language.Fortran.AST

FirstParameter (Selector a) a Source # 
Instance details

Defined in Language.Fortran.AST

FirstParameter (Statement a) a Source # 
Instance details

Defined in Language.Fortran.AST

FirstParameter (StructureItem a) a Source # 
Instance details

Defined in Language.Fortran.AST

FirstParameter (Suffix a) a Source # 
Instance details

Defined in Language.Fortran.AST

FirstParameter (TypeSpec a) a Source # 
Instance details

Defined in Language.Fortran.AST

FirstParameter (UnionMap a) a Source # 
Instance details

Defined in Language.Fortran.AST

FirstParameter (Use a) a Source # 
Instance details

Defined in Language.Fortran.AST

Methods

getFirstParameter :: Use a -> a Source #

setFirstParameter :: a -> Use a -> Use a Source #

FirstParameter (KindParam a) a Source # 
Instance details

Defined in Language.Fortran.AST.Literal

FirstParameter (ComplexLit a) a Source # 
Instance details

Defined in Language.Fortran.AST.Literal.Complex

FirstParameter (ComplexPart a) a Source # 
Instance details

Defined in Language.Fortran.AST.Literal.Complex

FirstParameter (LValue a) a Source # 
Instance details

Defined in Language.Fortran.LValue

FirstParameter (AList t a) a Source # 
Instance details

Defined in Language.Fortran.AST.AList

Methods

getFirstParameter :: AList t a -> a Source #

setFirstParameter :: a -> AList t a -> AList t a Source #

FirstParameter (ATuple t1 t2 a) a Source # 
Instance details

Defined in Language.Fortran.AST.AList

Methods

getFirstParameter :: ATuple t1 t2 a -> a Source #

setFirstParameter :: a -> ATuple t1 t2 a -> ATuple t1 t2 a Source #

class GFirstParameter f e where Source #

Methods

getFirstParameter' :: f a -> e Source #

setFirstParameter' :: e -> f a -> f a Source #

Instances

Instances details
GFirstParameter (U1 :: k -> Type) String Source # 
Instance details

Defined in Language.Fortran.Util.FirstParameter

Methods

getFirstParameter' :: forall (a :: k0). U1 a -> String Source #

setFirstParameter' :: forall (a :: k0). String -> U1 a -> U1 a Source #

(GFirstParameter a e, GFirstParameter b e) => GFirstParameter (a :*: b :: k -> Type) e Source # 
Instance details

Defined in Language.Fortran.Util.FirstParameter

Methods

getFirstParameter' :: forall (a0 :: k0). (a :*: b) a0 -> e Source #

setFirstParameter' :: forall (a0 :: k0). e -> (a :*: b) a0 -> (a :*: b) a0 Source #

(GFirstParameter a e, GFirstParameter b e) => GFirstParameter (a :+: b :: k -> Type) e Source # 
Instance details

Defined in Language.Fortran.Util.FirstParameter

Methods

getFirstParameter' :: forall (a0 :: k0). (a :+: b) a0 -> e Source #

setFirstParameter' :: forall (a0 :: k0). e -> (a :+: b) a0 -> (a :+: b) a0 Source #

GFirstParameter (K1 i a :: k -> Type) e Source # 
Instance details

Defined in Language.Fortran.Util.FirstParameter

Methods

getFirstParameter' :: forall (a0 :: k0). K1 i a a0 -> e Source #

setFirstParameter' :: forall (a0 :: k0). e -> K1 i a a0 -> K1 i a a0 Source #

GFirstParameter (K1 i e :: k -> Type) e Source # 
Instance details

Defined in Language.Fortran.Util.FirstParameter

Methods

getFirstParameter' :: forall (a :: k0). K1 i e a -> e Source #

setFirstParameter' :: forall (a :: k0). e -> K1 i e a -> K1 i e a Source #

GFirstParameter a e => GFirstParameter (M1 i c a :: k -> Type) e Source # 
Instance details

Defined in Language.Fortran.Util.FirstParameter

Methods

getFirstParameter' :: forall (a0 :: k0). M1 i c a a0 -> e Source #

setFirstParameter' :: forall (a0 :: k0). e -> M1 i c a a0 -> M1 i c a a0 Source #