https://github.com/bobbbay/dinwiddy
Dependently typed N-dimensional array type signatures for Idris (2).
https://github.com/bobbbay/dinwiddy
dependent-types ndarray
Last synced: 6 months ago
JSON representation
Dependently typed N-dimensional array type signatures for Idris (2).
- Host: GitHub
- URL: https://github.com/bobbbay/dinwiddy
- Owner: bobbbay
- Created: 2021-11-21T23:55:26.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2022-05-05T14:16:38.000Z (over 3 years ago)
- Last Synced: 2025-01-23T11:45:13.927Z (12 months ago)
- Topics: dependent-types, ndarray
- Language: Idris
- Homepage:
- Size: 18.6 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.org
- Contributing: CONTRIBUTING.org
Awesome Lists containing this project
README
#+TITLE: Dinwiddy
N-dimensional arrays in Idris 2, featuring:
* Nat-indexable n-dimensional array type synonyms
* Matrices and matrix algebra helper functions
** Usage
At a very basic level, the API for an N-dimensional array in Dinwiddy is the following:
#+begin_src idris
Array : (dimension : Nat) -> (sizes : Vect dimension Nat) -> (type : Type)
#+end_src
For example, the following type declaration =x=:
#+begin_src idris
x : Array 2 [2, 3] Bool
#+end_src
Will create an array that looks like this:
#+begin_src
###
###
#+end_src
Full of booleans. It's value could be, for example:
#+begin_src idris
x = [[ True, True, True ],
[ False, False, True ]]
#+end_src
Check out `examples` and `tests` for more information.