Add listToVect to util
This commit is contained in:
parent
5aa490acae
commit
0fc8fa7e18
1 changed files with 8 additions and 0 deletions
|
@ -192,6 +192,14 @@ Lazily generate all the permutations of a Vect
|
||||||
maxBy f (x :: xs) = Foldable.maxBy f x xs
|
maxBy f (x :: xs) = Foldable.maxBy f x xs
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Convert a list to a vect as a sigma type
|
||||||
|
|
||||||
|
```idris
|
||||||
|
export
|
||||||
|
listToVect : List a -> (n : Nat ** Vect n a)
|
||||||
|
listToVect xs = (length xs ** fromList xs)
|
||||||
|
```
|
||||||
|
|
||||||
## Fin
|
## Fin
|
||||||
|
|
||||||
```idris hide
|
```idris hide
|
||||||
|
|
Loading…
Add table
Reference in a new issue