<s>
Idris	B-Language
is	O
a	O
purely-functional	B-Application
programming	O
language	O
with	O
dependent	O
types	O
,	O
optional	O
lazy	O
evaluation	O
,	O
and	O
features	O
such	O
as	O
a	O
totality	O
checker	O
.	O
</s>
<s>
Idris	B-Language
may	O
be	O
used	O
as	O
a	O
proof	O
assistant	O
,	O
but	O
it	O
is	O
designed	O
to	O
be	O
a	O
general-purpose	B-Language
programming	I-Language
language	I-Language
similar	O
to	O
Haskell	B-Language
.	O
</s>
<s>
The	O
Idris	B-Language
type	O
system	O
is	O
similar	O
to	O
Agda	B-Language
's	O
,	O
and	O
proofs	O
are	O
similar	O
to	O
Coq	B-Application
's	O
,	O
including	O
tactics	O
(	O
theorem	O
proving	O
functions/procedures	O
)	O
via	O
elaborator	O
reflection	O
.	O
</s>
<s>
Compared	O
to	O
Agda	B-Language
and	O
Coq	B-Application
,	O
Idris	B-Language
prioritizes	O
management	O
of	O
side	O
effects	O
and	O
support	O
for	O
embedded	O
domain-specific	O
languages	O
.	O
</s>
<s>
Idris	B-Language
compiles	O
to	O
C	B-Language
(	O
relying	O
on	O
a	O
custom	O
copying	O
garbage	B-General_Concept
collector	I-General_Concept
using	O
Cheney	B-General_Concept
's	I-General_Concept
algorithm	I-General_Concept
)	O
and	O
JavaScript	B-Language
(	O
both	O
browser	O
-	O
and	O
Node.js-based	O
)	O
.	O
</s>
<s>
There	O
are	O
third-party	O
code	O
generators	O
for	O
other	O
platforms	O
,	O
including	O
JVM	B-Language
,	O
CIL	O
,	O
and	O
LLVM	B-Application
.	O
</s>
<s>
Idris	B-Language
is	O
named	O
after	O
a	O
singing	O
dragon	O
from	O
the	O
1970s	O
UK	O
children	O
's	O
television	O
program	O
Ivor	O
the	O
Engine	O
.	O
</s>
<s>
Idris	B-Language
combines	O
a	O
number	O
of	O
features	O
from	O
relatively	O
mainstream	O
functional	B-Language
programming	I-Language
languages	I-Language
with	O
features	O
borrowed	O
from	O
proof	O
assistants	O
.	O
</s>
<s>
The	O
syntax	O
of	O
Idris	B-Language
shows	O
many	O
similarities	O
with	O
that	O
of	O
Haskell	B-Language
.	O
</s>
<s>
A	O
hello	O
world	O
program	O
in	O
Idris	B-Language
might	O
look	O
like	O
this	O
:	O
</s>
<s>
The	O
only	O
differences	O
between	O
this	O
program	O
and	O
its	O
Haskell	B-Language
equivalent	O
are	O
the	O
single	O
(	O
instead	O
of	O
double	O
)	O
colon	O
in	O
the	O
type	O
signature	O
of	O
the	O
main	O
function	O
,	O
and	O
the	O
omission	O
of	O
the	O
word	O
"	O
where	O
"	O
in	O
the	O
module	B-Library
declaration	O
.	O
</s>
<s>
Idris	B-Language
supports	O
inductively-defined	O
data	O
types	O
and	O
parametric	O
polymorphism	O
.	O
</s>
<s>
Such	O
types	O
can	O
be	O
defined	O
both	O
in	O
traditional	O
"	O
Haskell98	B-Language
"	O
-like	O
syntax	O
:	O
</s>
<s>
or	O
in	O
the	O
more	O
general	O
GADT-like	O
syntax	O
:	O
</s>
<s>
The	O
following	O
defines	O
a	O
type	O
of	O
lists	O
whose	O
lengths	O
are	O
known	O
before	O
the	O
program	O
runs	O
,	O
traditionally	O
called	O
vectors	B-Data_Structure
:	O
</s>
<s>
Since	O
the	O
precise	O
types	O
of	O
the	O
input	O
vectors	B-Data_Structure
depend	O
on	O
a	O
value	O
,	O
it	O
is	O
possible	O
to	O
be	O
certain	O
at	O
compile	B-Application
time	I-Application
that	O
the	O
resulting	O
vector	O
will	O
have	O
exactly	O
(	O
n	O
+	O
m	O
)	O
elements	O
of	O
type	O
a	O
.	O
</s>
<s>
The	O
word	O
"	O
total	O
"	O
invokes	O
the	O
totality	O
checker	O
which	O
will	O
report	O
an	O
error	O
if	O
the	O
function	O
does	B-Algorithm
n't	I-Algorithm
cover	I-Algorithm
all	I-Algorithm
possible	I-Algorithm
cases	I-Algorithm
or	O
cannot	O
be	O
(	O
automatically	O
)	O
proven	O
not	O
to	O
enter	O
an	O
infinite	B-Algorithm
loop	I-Algorithm
.	O
</s>
<s>
Another	O
common	O
example	O
is	O
pairwise	O
addition	O
of	O
two	O
vectors	B-Data_Structure
that	O
are	O
parameterized	O
over	O
their	O
length	O
:	O
</s>
<s>
Because	O
the	O
type	O
system	O
can	O
prove	O
that	O
the	O
vectors	B-Data_Structure
have	O
the	O
same	O
length	O
,	O
we	O
can	O
be	O
sure	O
at	O
compile	B-Application
time	I-Application
that	O
case	O
will	O
not	O
occur	O
and	O
there	O
is	O
no	O
need	O
to	O
include	O
that	O
case	O
in	O
the	O
function	O
’s	O
definition	O
.	O
</s>
<s>
Dependent	O
types	O
are	O
powerful	O
enough	O
to	O
encode	O
most	O
properties	O
of	O
programs	O
,	O
and	O
an	O
Idris	B-Language
program	O
can	O
prove	O
invariants	O
at	O
compile	B-Application
time	I-Application
.	O
</s>
<s>
This	O
makes	O
Idris	B-Language
into	O
a	O
proof	O
assistant	O
.	O
</s>
<s>
There	O
are	O
two	O
standard	O
ways	O
of	O
interacting	O
with	O
proof	O
assistants	O
:	O
by	O
writing	O
a	O
series	O
of	O
tactic	O
invocations	O
(	O
Coq	B-Application
style	O
)	O
,	O
or	O
by	O
interactively	O
elaborating	O
a	O
proof	O
term	O
(	O
Epigram/Agda	O
style	O
)	O
.	O
</s>
<s>
Idris	B-Language
supports	O
both	O
modes	O
of	O
interaction	O
,	O
although	O
the	O
set	O
of	O
available	O
tactics	O
is	O
not	O
yet	O
as	O
useful	O
as	O
that	O
of	O
Coq	B-Application
.	O
</s>
<s>
Because	O
Idris	B-Language
contains	O
a	O
proof	O
assistant	O
,	O
Idris	B-Language
programs	O
can	O
be	O
written	O
to	O
pass	O
proofs	O
around	O
.	O
</s>
<s>
Idris	B-Language
aims	O
to	O
avoid	O
this	O
pitfall	O
by	O
aggressively	O
erasing	O
unused	O
terms	O
.	O
</s>
<s>
By	O
default	O
,	O
Idris	B-Language
generates	O
native	O
code	O
through	O
C	B-Language
.	O
The	O
other	O
officially	O
supported	O
backend	O
generates	O
JavaScript	B-Language
.	O
</s>
<s>
Idris	B-Language
2	O
is	O
a	O
new	O
self-hosted	O
version	O
of	O
the	O
language	O
which	O
deeply	O
integrates	O
a	O
linear	O
type	O
system	O
,	O
based	O
on	O
quantitative	O
type	O
theory	O
.	O
</s>
<s>
It	O
currently	O
compiles	O
to	O
Scheme	B-Language
and	O
C	B-Language
.	O
</s>
