Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
alphaLib
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Operations
Operations
Incidents
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
POTTIER Francois
alphaLib
Commits
4e010cca
Commit
4e010cca
authored
Feb 02, 2017
by
POTTIER Francois
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Comments.
parent
0e17d991
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
3 deletions
+31
-3
src/BindingForms.ml
src/BindingForms.ml
+31
-3
No files found.
src/BindingForms.ml
View file @
4e010cca
...
...
@@ -26,9 +26,9 @@ type ('bn, 'term) abs =
(* We need one class per variety of visitor, which is a bit painful. *)
(* The method [visit_abs
traction
] is polymorphic in the type of terms. This is
important, as it means that one can use several instances of [abs
traction]
in a
single type definition and still be able to construct well-typed
(* The method [visit_abs] is polymorphic in the type of terms. This is
important, as it means that one can use several instances of [abs
] in a
single type definition and still be able to construct well-typed
visitors. *)
(* The virtual methods [extend] and [restrict] are not polymorphic in the
...
...
@@ -38,6 +38,10 @@ type ('bn, 'term) abs =
(* Because [iter] and [iter2] are special cases of [reduce] and [reduce2],
respectively, we define them that way, so as to save effort. *)
(* -------------------------------------------------------------------------- *)
(* [map] *)
class
virtual
[
'
self
]
map
=
object
(
self
:
'
self
)
method
private
visit_'bn
:
void
->
void
->
void
...
...
@@ -55,6 +59,10 @@ class virtual ['self] map = object (self : 'self)
end
(* -------------------------------------------------------------------------- *)
(* [endo] *)
class
virtual
[
'
self
]
endo
=
object
(
self
:
'
self
)
method
private
visit_'bn
:
void
->
void
->
void
...
...
@@ -76,6 +84,10 @@ class virtual ['self] endo = object (self : 'self)
end
(* -------------------------------------------------------------------------- *)
(* [reduce] *)
class
virtual
[
'
self
]
reduce
=
object
(
self
:
'
self
)
method
private
visit_'bn
:
void
->
void
->
void
...
...
@@ -95,6 +107,10 @@ class virtual ['self] reduce = object (self : 'self)
end
(* -------------------------------------------------------------------------- *)
(* [iter] *)
class
virtual
[
'
self
]
iter
=
object
(
_
:
'
self
)
inherit
[
'
self
]
reduce
...
...
@@ -103,6 +119,10 @@ class virtual ['self] iter = object (_ : 'self)
end
(* -------------------------------------------------------------------------- *)
(* [map2] *)
class
virtual
[
'
self
]
map2
=
object
(
self
:
'
self
)
method
private
visit_'bn
:
void
->
void
->
void
->
void
...
...
@@ -120,6 +140,10 @@ class virtual ['self] map2 = object (self : 'self)
end
(* -------------------------------------------------------------------------- *)
(* [reduce2] *)
class
virtual
[
'
self
]
reduce2
=
object
(
self
:
'
self
)
method
private
visit_'bn
:
void
->
void
->
void
->
void
...
...
@@ -139,6 +163,10 @@ class virtual ['self] reduce2 = object (self : 'self)
end
(* -------------------------------------------------------------------------- *)
(* [iter2] *)
class
virtual
[
'
self
]
iter2
=
object
(
_
:
'
self
)
inherit
[
'
self
]
reduce2
...
...
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