Commit 587db730 authored by marton bognar's avatar marton bognar
Browse files

New type shift helper function

parent 8b840421
......@@ -29,7 +29,14 @@ generateHnatTypeVar n c = (STypeVar (generateHnatTypeVar (n - 1) c))
termshiftHelpplus d c (TmVar var) = if (var >= c) then (TmVar (plus var d)) else (TmVar var)
typeshiftHelpplus d c (TyVar var) = if (var >= c) then (TyVar (plus var d)) else (TyVar var)
-- typeshiftHelpplus d c (TyVar var) = if (var >= c) then (TyVar (plus d var)) else (TyVar var)
typeshiftHelpplus d c (TyVar var) = TyVar (go c var) where
go Z v = plus d v
go (STypeVar c) Z = Z
go (STermVar c) Z = Z
go (STypeVar c) (STypeVar v) = STypeVar (go c v)
go (STermVar c) (STermVar v) = STermVar (go c v)
termshiftplus d t = (termmap (termshiftHelpplus d) (typeshiftHelpplus d) (Z) t)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment