-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[rational] towards proving useful things
- Loading branch information
1 parent
3650866
commit 8bb7bc3
Showing
3 changed files
with
269 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{-# OPTIONS --safe --cubical-compatible #-} | ||
module Data.Vec.Util where | ||
|
||
open import Data.Vec | ||
open import Data.Nat | ||
|
||
private variable | ||
X : Set | ||
|
||
repeat : ∀ {n} → (k : ℕ) → Vec X n → Vec X (k * n) | ||
repeat zero xs = [] | ||
repeat (suc k) xs = xs ++ repeat k xs | ||
|
||
head-nz : ∀ {n} {{_ : NonZero n}} → Vec X n → X | ||
head-nz (x ∷ xs) = x |
Oops, something went wrong.