Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Gilles Coremans
ASTTool
Commits
587db730
Commit
587db730
authored
Apr 30, 2020
by
marton bognar
Browse files
New type shift helper function
parent
8b840421
Changes
1
Hide whitespace changes
Inline
Side-by-side
SystemF/SystemFBase.hs
View file @
587db730
...
...
@@ -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
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment