mirror of
https://github.com/GaloisInc/cryptol.git
synced 2024-12-16 20:03:27 +03:00
Allow a value parameter to be defined by another value parameter.
This commit is contained in:
parent
1cbbba7c32
commit
432638a77a
@ -119,17 +119,21 @@ checkTyParams func inst =
|
||||
|
||||
|
||||
|
||||
checkValParams :: Module {- ^ Parameterized module -} ->
|
||||
checkValParams :: Module {- ^ Parameterized module -} ->
|
||||
Map TParam Type {- ^ Type instantiations -} ->
|
||||
Module {- ^ Instantiation module -} ->
|
||||
Module {- ^ Instantiation module -} ->
|
||||
InferM (Map Name Expr)
|
||||
-- ^ Definitions for the parameters
|
||||
checkValParams func tMap inst =
|
||||
Map.fromList <$> mapM checkParam (Map.toList (mParamFuns func))
|
||||
where
|
||||
valMap = Map.fromList [ (nameIdent (dName d), (dName d, dSignature d))
|
||||
valMap = Map.fromList (defByParam ++ defByDef)
|
||||
|
||||
defByDef = [ (nameIdent (dName d), (dName d, dSignature d))
|
||||
| dg <- mDecls inst, d <- groupDecls dg ]
|
||||
|
||||
defByParam = [ (nameIdent x, (x, s)) | (x,s) <- Map.toList (mParamFuns inst) ]
|
||||
|
||||
su = listSubst [ (TVBound x, t) | (x,t) <- Map.toList tMap ]
|
||||
|
||||
checkParam (x,sP) =
|
||||
|
Loading…
Reference in New Issue
Block a user