问题
I have made a stream of (N x N) type. How can i access the individual element of the pair ??
genL : ℕ → Stream (ℕ × ℕ) → Stream (ℕ × ℕ)
genL k ((x , y) :: xs) = if ((y * k) lt x) then (x , y) :: (♯ genL k (♭ xs))
else genL k (♭ xs)
It says there is no constuctor , in stream. I have one solution in mind that i will create records of pair then it will works. Apart from that is there any other way to acccess the element.
回答1:
The constructor is _∷_
(type \::
to get ∷
), not _::_
.
Anyway your definition is not productive and doesn't convince the termination checker.
来源:https://stackoverflow.com/questions/29369643/accessing-element-from-stream-in-agda