Added simple instances of the Typed class for actuals and formals
This commit is contained in:
parent
ecb4758b64
commit
7bbfab34a0
|
@ -73,6 +73,13 @@ abbrevModeOfName n
|
||||||
instance Typed A.Name where
|
instance Typed A.Name where
|
||||||
astTypeOf = typeOfName
|
astTypeOf = typeOfName
|
||||||
|
|
||||||
|
instance Typed A.Formal where
|
||||||
|
astTypeOf (A.Formal _ t _) = return t
|
||||||
|
|
||||||
|
instance Typed A.Actual where
|
||||||
|
astTypeOf (A.ActualVariable v) = astTypeOf v
|
||||||
|
astTypeOf (A.ActualExpression e) = astTypeOf e
|
||||||
|
|
||||||
-- | Gets the 'A.Type' for a given 'A.Name' by looking at its definition in the 'CompState'. Dies with an error if the name is unknown.
|
-- | Gets the 'A.Type' for a given 'A.Name' by looking at its definition in the 'CompState'. Dies with an error if the name is unknown.
|
||||||
typeOfName :: (CSMR m, Die m) => A.Name -> m A.Type
|
typeOfName :: (CSMR m, Die m) => A.Name -> m A.Type
|
||||||
typeOfName n
|
typeOfName n
|
||||||
|
|
Loading…
Reference in New Issue
Block a user