------------------------------------------------------------------------
-- The Agda standard library
--
-- Finite sets defined using the reflexive-transitive closure, Star
------------------------------------------------------------------------

{-# OPTIONS --with-K --safe #-}

module Data.Star.Fin where

open import Data.Star.Nat as  using ()
open import Data.Star.Pointer using (Any; this; that)
open import Data.Unit.Base using (; tt)

-- Finite sets are undecorated pointers into natural numbers.

Fin :   Set
Fin = Any  _  )  _  )

-- "Constructors".

zero :  {n}  Fin (ℕ.suc n)
zero = this tt

suc :  {n}  Fin n  Fin (ℕ.suc n)
suc = that tt