Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Simon Spies
stdpp
Commits
2dc8dc84
Commit
2dc8dc84
authored
Jul 04, 2014
by
Robbert Krebbers
Browse files
Misc functions on streams.
parent
baaee9e0
Changes
1
Hide whitespace changes
Inline
Side-by-side
theories/streams.v
View file @
2dc8dc84
...
...
@@ -23,6 +23,12 @@ Fixpoint slookup {A} (i : nat) (s : stream A) : A :=
match
i
with
O
=>
shead
s
|
S
i
=>
stail
s
!.!
i
end
where
"s !.! i"
:
=
(
slookup
i
s
).
Global
Instance
stream_fmap
:
FMap
stream
:
=
λ
A
B
f
,
cofix
go
s
:
=
f
(
shead
s
)
:
.
:
go
(
stail
s
).
Fixpoint
stake
{
A
}
(
n
:
nat
)
(
s
:
stream
A
)
:
=
match
n
with
0
=>
[]
|
S
n
=>
shead
s
::
stake
n
(
stail
s
)
end
.
Section
stream_properties
.
Context
{
A
:
Type
}.
Implicit
Types
x
y
:
A
.
...
...
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