1
0
forked from GitHub/gf-core

gfcc generation with HOAS: var fields appended to records

This commit is contained in:
aarne
2008-01-31 16:37:32 +00:00
parent 6bddc8df8a
commit db6e1de1ae
4 changed files with 27 additions and 7 deletions

View File

@@ -69,10 +69,18 @@ catSkeleton :: Type -> ([CId],CId)
catSkeleton ty = case ty of
DTyp hyps val _ -> ([valCat ty | Hyp _ ty <- hyps],val)
typeSkeleton :: Type -> ([(Int,CId)],CId)
typeSkeleton ty = case ty of
DTyp hyps val _ -> ([(contextLength ty, valCat ty) | Hyp _ ty <- hyps],val)
valCat :: Type -> CId
valCat ty = case ty of
DTyp _ val _ -> val
contextLength :: Type -> Int
contextLength ty = case ty of
DTyp hyps _ _ -> length hyps
cid :: String -> CId
cid = CId