| 1 |
------------------------------------------------------------------------ |
| 2 |
-- The Agda standard library |
| 3 |
-- |
| 4 |
-- Finite sets |
| 5 |
------------------------------------------------------------------------ |
| 6 |
|
| 7 |
{-# OPTIONS --cubical-compatible --safe #-} |
| 8 |
|
| 9 |
module Data.Fin where |
| 10 |
|
| 11 |
open import Relation.Nullary.Decidable.Core |
| 12 |
import Data.Nat.Properties as ℕ |
| 13 |
|
| 14 |
------------------------------------------------------------------------ |
| 15 |
-- Publicly re-export the contents of the base module |
| 16 |
|
| 17 |
open import Data.Fin.Base public |
| 18 |
|
| 19 |
------------------------------------------------------------------------ |
| 20 |
-- Publicly re-export queries |
| 21 |
|
| 22 |
open import Data.Fin.Properties public |
| 23 |
using (_≟_; _≤?_; _<?_) |
| 24 |
|
| 25 |
-- # m = "m". |
| 26 |
|
| 27 |
infix 10 #_ |
| 28 |
|
| 29 |
#_ : ∀ m {n} {m<n : True (m ℕ.<? n)} → Fin n |
| 30 |
#_ _ {m<n = m<n} = fromℕ< (toWitness m<n) |