Skip to content
GitLab
Menu
Why GitLab
Pricing
Contact Sales
Explore
Why GitLab
Pricing
Contact Sales
Explore
Sign in
Get free trial
Primary navigation
Search or go to…
Project
T
Typer
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Requirements
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Privacy statement
Keyboard shortcuts
?
What's new
6
Snippets
Groups
Projects
Show more breadcrumbs
Stefan
Typer
Commits
1de1c2fd
Commit
1de1c2fd
authored
6 years ago
by
Stefan
Browse files
Options
Downloads
Patches
Plain Diff
-
parent
c66d283d
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
paper.tex
+14
-4
14 additions, 4 deletions
paper.tex
with
14 additions
and
4 deletions
paper.tex
+
14
−
4
View file @
1de1c2fd
...
...
@@ -9,7 +9,7 @@
\DeclareUnicodeCharacter
{
2261
}{
\ensuremath
{
\equiv
}}
\DeclareUnicodeCharacter
{
21DB
}{
\ensuremath
{
\Rrightarrow
}}
\DeclareUnicodeCharacter
{
2980
}{
\ensuremath
{
|||
}}
\DeclareUnicodeCharacter
{
2980
}{
\ensuremath
{
\Vvert
}}
\DeclareUnicodeCharacter
{
2081
}{
\ensuremath
{_
1
}}
\DeclareUnicodeCharacter
{
2082
}{
\ensuremath
{_
2
}}
\DeclareUnicodeCharacter
{
3A9
}{
\ensuremath
{
\Omega
}}
...
...
@@ -174,13 +174,13 @@ where \id{hd} and \id{tl} are field names. We could have written just
Functions and data constructors are curried. You can define the
traditional
\id
{
map
}
function as follows:
\begin{verbatim}
map : (a : Type)
≡>
(b : Type)
≡>
map : (a : Type)
⇛
(b : Type)
⇛
(a -> b) -> List a -> List b;
map f xs = case xs
| nil => nil
| cons x xs => cons (f x) (map f xs);
\end{verbatim}
The type declaration is optional. The triple arrow
$
\equiv
>
$
is used
The type declaration is optional. The triple arrow
$
⇛
$
is used
for functions whose argument is
\emph
{
implicit
}
, which is actually called
\emph
{
erasable
}
in Typer.
%% It is the dependent function type, used to give a name to the function
...
...
@@ -228,6 +228,8 @@ They're defined simply as values with a dedicated type \id{Macro}:
where
\id
{
macro
}
is the constructor of the
\id
{
Macro
}
type and
\id
{
ifthen
}
is the function which performs the expansion. Ignoring the types, this is
very similar to how it is done in Emacs Lisp.
%% FIXME: Maybe discuss the fact that we receive a *List* of Sexp rather
%% than a single Sexp as argument?
The
\id
{
ifthen
}
function
could be defined as follows:
\begin{verbatim}
...
...
@@ -282,6 +284,7 @@ analysis in one step, Typer further subdivides the syntactic analysis phase
into two steps. The first step does a rudimentary analysis that only
extracts a generic tree structure, called S-expression. The shape of
S-expressions could be described with the datatype shown in
%% FIXME: Discuss the absence of a "nil" element.
Figure~
\ref
{
fig:Typer-Sexp
}
.
Note how, at this stage, the representation of the code has no notion of
...
...
@@ -655,6 +658,10 @@ anything left to generalize); if the free meta-variable is used in
a non-erasable way, we signal an error since generalizing it with an
erasable abstraction would lead to invalid code.
%% FIXME: Discuss decidability/termination
%% FIXME: Is it an actual strict superset of HM (I think so, except for
%% the case of recursion where we currently require a type annotation).
There are two further places where generalization happens: when a
$
\lambda
$
abstraction is elaborated in a context that expects an erasable function, we
wrap it into an additional erasable
$
\lambda
$
; and when elaborating a
\emph
{
type
...
...
@@ -721,6 +728,7 @@ calculus are the following:
}
\end{array}
\end{displaymath}
%% FIXME: Explain what these S/A/R mean!
But the typing rule we use is slightly different for erasable functions:
\begin{displaymath}
\Infer
{
\Jtyper
{
\tau
_
1
}
s
\\
...
...
@@ -1228,14 +1236,16 @@ making it more flexible at the same time.
While it has not been officially released yet, its code can be found at
\url
{
https://gitlab.com/monnier/typer
}
.
\newenvironment
{
acks
}{
\subsection*
{
Acknowledgments
}}{}
\newcommand
\grantsponsor
[3]
{
#2 (#1)
}
\newcommand
\grantnum
[2]
{
#2
}
\
subsection*
{
Acknowledgment
s
}
\
begin{ack
s}
This work was supported by the
\grantsponsor
{
NSERC
}{
Natural Sciences and
Engineering Research Council of Canada
}{
http://nserc-crsng.gc.ca/
}
grant
N
$^
o
$
~
\grantnum
{
NSERC
}{
298311/2012
}
. Any opinions, findings, and
conclusions or recommendations expressed in this material are those of the
author and do not necessarily reflect the views of the NSERC.
\end{acks}
\bibliographystyle
{
alpha
}
%% \bibliography{typer_theory}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment