Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Tej Chajed
stdpp
Commits
6ce40f46
Commit
6ce40f46
authored
Apr 29, 2016
by
Robbert Krebbers
Browse files
Heterogeneous lists.
parent
7e6955cd
Changes
1
Hide whitespace changes
Inline
Side-by-side
theories/hlist.v
0 → 100644
View file @
6ce40f46
From
stdpp
Require
Import
base
.
(* Not using [list Type] in order to avoid universe inconsistencies *)
Inductive
tlist
:
=
tnil
:
tlist
|
tcons
:
Type
→
tlist
→
tlist
.
Inductive
hlist
:
tlist
→
Type
:
=
|
hnil
:
hlist
tnil
|
hcons
{
A
As
}
:
A
→
hlist
As
→
hlist
(
tcons
A
As
).
Fixpoint
himpl
(
As
:
tlist
)
(
B
:
Type
)
:
Type
:
=
match
As
with
tnil
=>
B
|
tcons
A
As
=>
A
→
himpl
As
B
end
.
Definition
happly
{
As
B
}
(
f
:
himpl
As
B
)
(
xs
:
hlist
As
)
:
B
:
=
(
fix
go
As
xs
:
=
match
xs
in
hlist
As
return
himpl
As
B
→
B
with
|
hnil
=>
λ
f
,
f
|
hcons
A
As
x
xs
=>
λ
f
,
go
As
xs
(
f
x
)
end
)
_
xs
f
.
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment